Преглед изворни кода

运营端 提现记录 字段扩展

xucaiqin пре 2 година
родитељ
комит
e065d08c78

+ 1 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/wallet/CashItem.java

@@ -20,6 +20,7 @@ public class CashItem implements Serializable {
     @JSONField(name = "order_no")
     private String orderNo;
     private String uid;
+    private String uidName;
     private Integer status;
     @JSONField(name = "status_label")
     private String statusLabel;

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/res/FundVo.java

@@ -70,7 +70,7 @@ public class FundVo implements Serializable {
     private LocalDateTime createTime;
 
     /**
-     * 更新时间 todo-xcq 自我维护
+     * 更新时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime updateTime;

+ 61 - 9
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java

@@ -7,10 +7,7 @@ import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageRes;
-import com.sckw.core.utils.CollectionUtils;
-import com.sckw.core.utils.IdWorker;
-import com.sckw.core.utils.OrderUtils;
-import com.sckw.core.utils.StringTimeUtil;
+import com.sckw.core.utils.*;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.manage.api.RemoteManageService;
@@ -21,13 +18,11 @@ import com.sckw.payment.api.model.dto.common.R;
 import com.sckw.payment.dao.KwpWalletRefundMapper;
 import com.sckw.payment.dao.KwpWalletTransferMapper;
 import com.sckw.payment.job.AsyncPool;
+import com.sckw.payment.model.KwpWallet;
 import com.sckw.payment.model.KwpWalletRefund;
 import com.sckw.payment.model.KwpWalletRelation;
 import com.sckw.payment.model.KwpWalletTransfer;
-import com.sckw.payment.model.constant.PrePayEnum;
-import com.sckw.payment.model.constant.RefundEnum;
-import com.sckw.payment.model.constant.TransferEnum;
-import com.sckw.payment.model.constant.WalletChannelEnum;
+import com.sckw.payment.model.constant.*;
 import com.sckw.payment.model.dto.WalletInfoDto;
 import com.sckw.payment.model.dto.WalletRelationDto;
 import com.sckw.payment.model.dto.common.BusinessNo;
@@ -41,7 +36,6 @@ import com.sckw.payment.model.vo.req.page.MoneyPage;
 import com.sckw.payment.model.vo.req.page.PrePayPage;
 import com.sckw.payment.model.vo.req.page.RefundPage;
 import com.sckw.payment.model.vo.res.*;
-import com.sckw.core.utils.DateTimeUtil;
 import com.sckw.redis.config.RedisLockUtil;
 import com.sckw.redis.constant.RedisLockKey;
 import com.sckw.system.api.RemoteSystemService;
@@ -83,6 +77,7 @@ public class WalletService {
     private final KwpWalletTransferMapper kwpWalletTransferMapper;
     private final RedisLockUtil redisLockUtil;
     private final KwpWalletRefundSubService kwpWalletRefundSubService;
+    private final KwpWalletService kwpWalletService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
     @DubboReference(version = "1.0.0", group = "design", check = false)
@@ -252,6 +247,19 @@ public class WalletService {
         fundVo.setTransferMoney(df.format(bigDecimal));
     }
 
+    /**
+     * 相关操作
+     *
+     * @param fundVo
+     */
+    private void action(FundVo fundVo) {
+        KwpWallet kwpWallet = kwpWalletService.queryOne(fundVo.getUid(), fundVo.getFilter(), fundVo.getChannel());
+        if (Objects.nonNull(kwpWallet)) {
+            fundVo.setAction(kwpWallet.getAction());
+            fundVo.setUpdateTime(kwpWallet.getActionTime());
+        }
+    }
+
     /**
      * 按钱包渠道进行统计钱包清单数量
      *
@@ -479,6 +487,7 @@ public class WalletService {
             fundVo.setTotalMoney(dfMoney(re.getTotalMoney()));
             refundMoney2(fundVo);
             transferMoney(fundVo);
+            action(fundVo);
             vo.add(fundVo);
         }
         DecimalFormat df = new DecimalFormat("0.00");
@@ -560,6 +569,7 @@ public class WalletService {
             fundVo.setTotalMoney(dfMoney(re.getTotalMoney()));
             refundMoney2(fundVo);
             transferMoney(fundVo);
+            action(fundVo);
             vo.add(fundVo);
         }
         DecimalFormat df = new DecimalFormat("0.00");
@@ -599,6 +609,16 @@ public class WalletService {
         if (!payIndexR.getStatus()) {
             throw new BusinessException(StringUtils.isBlank(payIndexR.getMsg()) ? "充值失败" : payIndexR.getMsg());
         }
+        KwpWallet kwpWallet = new KwpWallet();
+        kwpWallet.setUid(uid);
+        kwpWallet.setFilter(filter);
+        kwpWallet.setChannel(channelEnum.getChannel());
+        kwpWallet.setAction(WalletActionEnum.CHARGING.getDesc());
+        kwpWallet.setActionTime(LocalDateTime.now());
+        kwpWallet.setRemark("");
+        kwpWallet.setOrderNo(Objects.nonNull(payIndexR.getData()) ? payIndexR.getData().getOrderNo() : "");
+        kwpWallet.setStatus(WalletActionEnum.CHARGING.getStatus());
+        kwpWalletService.saveOrUpdate(kwpWallet);
         return payIndexR.getData();
     }
 
@@ -625,6 +645,16 @@ public class WalletService {
         if (!payIndexR.getStatus()) {
             throw new BusinessException(StringUtils.isBlank(payIndexR.getMsg()) ? "充值失败" : payIndexR.getMsg());
         }
+        KwpWallet kwpWallet = new KwpWallet();
+        kwpWallet.setUid(uid);
+        kwpWallet.setFilter(filter);
+        kwpWallet.setChannel(channelEnum.getChannel());
+        kwpWallet.setAction(WalletActionEnum.CHARGING.getDesc());
+        kwpWallet.setActionTime(LocalDateTime.now());
+        kwpWallet.setRemark("");
+        kwpWallet.setOrderNo(Objects.nonNull(payIndexR.getData()) ? payIndexR.getData().getOrderNo() : "");
+        kwpWallet.setStatus(WalletActionEnum.CHARGING.getStatus());
+        kwpWalletService.saveOrUpdate(kwpWallet);
         return payIndexR.getData();
     }
 
@@ -646,6 +676,16 @@ public class WalletService {
         if (!payIndexR.getStatus()) {
             throw new BusinessException(StringUtils.isNotBlank(payIndexR.getMsg()) ? payIndexR.getMsg() : "申请提现异常");
         }
+        KwpWallet kwpWallet = new KwpWallet();
+        kwpWallet.setUid(cashWalletReq.getUid());
+        kwpWallet.setFilter(cashWalletReq.getFilter());
+        kwpWallet.setChannel(byChannel.getChannel());
+        kwpWallet.setAction(WalletActionEnum.CASHING.getDesc());
+        kwpWallet.setActionTime(LocalDateTime.now());
+        kwpWallet.setRemark("");
+        kwpWallet.setOrderNo(Objects.nonNull(payIndexR.getData()) ? payIndexR.getData().getOrderNo() : "");
+        kwpWallet.setStatus(WalletActionEnum.CASHING.getStatus());
+        kwpWalletService.saveOrUpdate(kwpWallet);
         return payIndexR.getData();
     }
 
@@ -721,6 +761,17 @@ public class WalletService {
                 //转帐中
                 walletTransfer.setStatus(TransferEnum.TRANSFERRING.getStatus());
                 kwpWalletTransferMapper.insert(walletTransfer);
+
+                KwpWallet kwpWallet = new KwpWallet();
+                kwpWallet.setUid(transferReq.getUid());
+                kwpWallet.setFilter(transferReq.getFilter());
+                kwpWallet.setChannel(channelEnum.getChannel());
+                kwpWallet.setAction(WalletActionEnum.TRANSFERRING.getDesc());
+                kwpWallet.setActionTime(LocalDateTime.now());
+                kwpWallet.setRemark("");
+                kwpWallet.setOrderNo(Objects.nonNull(businessNoR1.getData()) ? businessNoR1.getData().getBusinessNo() : "");
+                kwpWallet.setStatus(WalletActionEnum.TRANSFERRING.getStatus());
+                kwpWalletService.saveOrUpdate(kwpWallet);
                 return businessNoR1.getData();
             } finally {
                 redisLockUtil.unlock(key);
@@ -815,6 +866,7 @@ public class WalletService {
             LocalDateTime parse2 = LocalDateTime.parse(c2.getCreateTime(), df);
             return parse.compareTo(parse2);
         });
+        res.forEach(a -> a.setUidName(getFirmName(a.getUid())));
         //组装数据
         return new MorePageRes<>(cashPageReq.getPage(), cashPageReq.getPageSize(), res, String.valueOf(sum / 100.0D));
     }