会员充值 前置

This commit is contained in:
2025-02-17 18:25:12 +08:00
parent 50f19eafbf
commit 9b19329e69
14 changed files with 250 additions and 29 deletions

View File

@@ -4,6 +4,7 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.czg.account.entity.ShopUserFlow;
import com.czg.account.service.ShopUserFlowService;
import com.czg.service.account.mapper.ShopUserFlowMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;
/**
@@ -12,7 +13,7 @@ import org.springframework.stereotype.Service;
* @author zs
* @since 2025-02-13
*/
@Service
@DubboService
public class ShopUserFlowServiceImpl extends ServiceImpl<ShopUserFlowMapper, ShopUserFlow> implements ShopUserFlowService{
}

View File

@@ -22,6 +22,7 @@ import com.czg.utils.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;
import java.math.RoundingMode;
@@ -32,7 +33,7 @@ import java.math.RoundingMode;
* @author Administrator
* @since 2025-02-08
*/
@Service
@DubboService
public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> implements ShopUserService {
@Resource
private ShopUserFlowService shopUserFlowService;
@@ -82,7 +83,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
userFlow.setShopId(userInfo.getShopId());
userFlow.setAmount(shopUserEditDTO.getMoney());
userFlow.setBalance(shopUserEditDTO.getType() == 0 ? userInfo.getAmount().subtract(shopUserEditDTO.getMoney()) : userInfo.getAmount().add(shopUserEditDTO.getMoney()));
userFlow.setBizCode(ShopUserFlowBizEnum.ADMIN_IN.getCode());
userFlow.setBizCode(shopUserEditDTO.getBizEnum().getCode());
userFlow.setType(shopUserEditDTO.getType() == 0 ? "-" : "+");
userFlow.setRemark(shopUserEditDTO.getRemark());
return shopUserFlowService.save(userFlow);