Explorar el Código

提现操作日志

lc hace 5 días
padre
commit
dcc573010d

+ 27 - 15
cif-service/src/main/java/com/txz/cif/service/impl/WithdrawRecordServiceImpl.java

@@ -32,8 +32,10 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 
 
 /**
@@ -105,6 +107,7 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
                 if (ObjectUtil.isEmpty(paymentChannel)) {
                     throw new ServiceException(LocalUtil.get("withdrawal.channel.does.not.exist"));
                 }
+                List<BizLog> bizLogList = new ArrayList<>();
                 switch (paymentChannel.getChannelName()) {
                     case "TFPAY":
 //                        Map<String, Object> payMentChannelMap = TFPayUtil.convertObjectToMap(paymentChannel);
@@ -125,21 +128,16 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
                                         .payBankcode(w.getBank().toLowerCase())
                                         .build()
                                 , paymentChannel.getSecretKey());
-                        try {
-                            // 新增日志
-                            bizLogService.save(BizLog.builder()
-                                    .bizType(2)
-                                    .bizNo(w.getOrderNo())
-                                    .thirdOrderNo(thirdOrderNo)
-                                    .type(5)
-                                    .receiveMessage(bizLog.getReceiveMessage())
-                                    .sendMessage(bizLog.getSendMessage())
-                                    .createTime(now)
-                                    .createUser(userName)
-                                    .memo(review).build());
-                        } catch (Exception e) {
-                            log.error("新增提现提交订单日志失败", e);
-                        }
+                      bizLogList.add(BizLog.builder()
+                        .bizType(2)
+                        .bizNo(w.getOrderNo())
+                        .thirdOrderNo(thirdOrderNo)
+                        .type(7)
+                        .receiveMessage(bizLog.getReceiveMessage())
+                        .sendMessage(bizLog.getSendMessage())
+                        .createTime(now)
+                        .createUser(userName)
+                        .memo("提现申请调用第三方").build());
                         JSONObject resultJson;
                         try {
                             resultJson = JSONUtil.parseObj(bizLog.getReceiveMessage());
@@ -155,6 +153,20 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
                     default:
                         throw new ServiceException(LocalUtil.get("this.channel.is.not.supported.temporarily"));
                 }
+              try {
+                // 新增日志
+                bizLogList.add(BizLog.builder()
+                  .bizType(2)
+                  .bizNo(w.getOrderNo())
+                  .thirdOrderNo(thirdOrderNo)
+                  .type(5)
+                  .createTime(now)
+                  .createUser(userName)
+                  .memo(review).build());
+                bizLogService.save(bizLogList);
+              } catch (Exception e) {
+                log.error("新增提现提交订单日志失败", e);
+              }
                 this.update(WithdrawRecord.builder().id(w.getId()).channel(paymentChannel.getChannelName()).review(review).status(status).updateUser(userName).thirdOrderNo(thirdOrderNo).build());
             } finally {
                 lockTemplate.releaseLock(lockInfo);