会员余额增减接口修改

This commit is contained in:
张松
2025-02-18 14:33:49 +08:00
parent 25854ad51e
commit 21f339a2d8
3 changed files with 9 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ public class ShopUserMoneyEditDTO {
@DecimalMax("9999")
private BigDecimal money;
private String bizEnum;
private ShopUserFlowBizEnum bizEnum;
/**
* 备注
*/

View File

@@ -23,7 +23,13 @@ public enum ShopUserFlowBizEnum {
// 充值退款
RECHARGE_REFUND("rechargeRefund"),
// 管理员手动增减余额
ADMIN_IN("adminIn");
ADMIN_IN("adminIn"),
//管理员退款充值
ADMIN_REFUND("adminRefund"),
//adminOut
ADMIN_OUT("adminOut"),
//adminInOut
ADMIN_IN_OUT("adminInOut"),;
private final String code;
ShopUserFlowBizEnum(String code) {

View File

@@ -96,7 +96,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(shopUserEditDTO.getBizEnum());
userFlow.setBizCode(shopUserEditDTO.getBizEnum().getCode());
userFlow.setType(shopUserEditDTO.getType() == 0 ? "-" : "+");
userFlow.setRemark(shopUserEditDTO.getRemark());
userFlow.setRelationId(shopUserEditDTO.getRelationId());