Преглед на файлове

销售列表增加账户类型

周箭河 преди 5 години
родител
ревизия
a13a57c0b4

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/SysPaymentConfigService.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
+import com.ym.mec.biz.dal.enums.AccountType;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.common.service.BaseService;
 
@@ -37,5 +38,5 @@ public interface SysPaymentConfigService extends BaseService<Integer, SysPayment
      * @param merNos
      * @return
      */
-    Boolean checkOutAccount(PaymentChannelEnum payType,String merNos);
+    AccountType checkAccountType(PaymentChannelEnum payType, String merNos);
 }

+ 5 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java

@@ -7,10 +7,7 @@ import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.SellOrderDao;
 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.GoodsType;
-import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
-import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
-import com.ym.mec.biz.dal.enums.SellTypeEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
@@ -31,6 +28,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
     private StudentPaymentOrderDao studentPaymentOrderDao;
     @Autowired
     private MusicGroupDao musicGroupDao;
+    @Autowired
+    private SysPaymentConfigService sysPaymentConfigService;
 
     @Override
     public BaseDAO<Integer, SellOrder> getDAO() {
@@ -138,6 +137,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
 
         int i = 1;
         BigDecimal detailRouteBalance = BigDecimal.ZERO;
+        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(studentPaymentOrder.getPaymentChannel()), studentPaymentOrder.getMerNos());
         for (StudentPaymentOrderDetail orderDetail : orderDetails) {
 
             BigDecimal detailBalance = orderDetail.getPrice().compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO :
@@ -192,6 +192,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
                 sellOrder.setUserId(studentPaymentOrder.getUserId());
                 sellOrder.setPaymentChannel(studentPaymentOrder.getPaymentChannel());
                 sellOrder.setMerNo(studentPaymentOrder.getMerNos());
+                sellOrder.setAccountType(accountType);
                 sellOrder.setSellTime(studentPaymentOrder.getCreateTime());
                 sellOrder.setCreateIme(new Date());
                 sellOrder.setUpdateTime(new Date());

+ 7 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysPaymentConfigServiceImpl.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.SysPaymentConfigDao;
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
+import com.ym.mec.biz.dal.enums.AccountType;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.common.dal.BaseDAO;
@@ -38,13 +39,13 @@ public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPay
     }
 
     @Override
-    public Boolean checkOutAccount(PaymentChannelEnum payType, String merNos) {
-        if ((!payType.equals(PaymentChannelEnum.ADAPAY) && !payType.equals(PaymentChannelEnum.YQPAY)) || StringUtils.isBlank(merNos)) {
-            return false;
+    public AccountType checkAccountType(PaymentChannelEnum payType, String merNos) {
+        if (payType == null || (!payType.equals(PaymentChannelEnum.ADAPAY) && !payType.equals(PaymentChannelEnum.YQPAY)) || StringUtils.isBlank(merNos)) {
+            return AccountType.INTERNAL;
         }
         List<SysPaymentConfig> accounts = sysPaymentConfigDao.getOutAccounts(payType);
         String[] merNoArr = merNos.split(",");
-        boolean hasOutAccount = false;
+        AccountType accountType = AccountType.INTERNAL;
         NODE1:
         for (String merNo : merNoArr) {
             for (SysPaymentConfig account : accounts) {
@@ -55,11 +56,11 @@ public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPay
                     accountNo = account.getYqMerNo();
                 }
                 if (accountNo.equals(merNo)) {
-                    hasOutAccount = true;
+                    accountType = AccountType.EXTERNAL;
                     break NODE1;
                 }
             }
         }
-        return hasOutAccount;
+        return accountType;
     }
 }