Переглянути джерело

支付账户添加服务商字段,查询账户通过服务商id定位

ZhangWenQiang 5 роки тому
батько
коміт
34f392b6f2

+ 2 - 0
happy-boot-module-payment/src/main/java/org/jeecg/modules/hlgpayaccount/entity/HlgPayAccount.java

@@ -99,4 +99,6 @@ public class HlgPayAccount implements Serializable {
 	/**删除状态(0-正常,1-已删除)*/
 	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
 	private java.lang.String delFlag;
+	/**所属服务商*/
+	private Integer subcontractorId;
 }

+ 4 - 0
happy-boot-module-payment/src/main/java/org/jeecg/modules/hlgpayaccount/mapper/xml/HlgPayAccountMapper.xml

@@ -4,6 +4,7 @@
 
     <sql id="hwPayAccoutColumns">
 		a.id AS "id",
+		a.subcontractor_id AS "subcontractorId",
 		a.eaccod AS "eaccod",
 		a.eccnam AS "eccnam",
 		a.actcod AS "actcod",
@@ -70,6 +71,7 @@
 
     <insert id="saveAccout" keyProperty="id" useGeneratedKeys="true" parameterType="org.jeecg.modules.hlgpayaccount.entity.HlgPayAccount">
 		INSERT INTO hlg_pay_account(
+			subcontractor_id,
 			eaccod,
 			eccnam,
 			actcod,
@@ -94,6 +96,7 @@
 			update_by,
 			del_flag
 		) VALUES (
+			#{hlgPayAccount.subcontractorId},
 			#{hlgPayAccount.eaccod},
 			#{hlgPayAccount.eccnam},
 			#{hlgPayAccount.actcod},
@@ -122,6 +125,7 @@
 
     <update id="update">
 		UPDATE hlg_pay_account SET
+			subcontractor_id = #{hlgPayAccount.subcontractorId},
 			eaccod = #{hlgPayAccount.eaccod},
 			eccnam = #{hlgPayAccount.eccnam},
 			actcod = #{hlgPayAccount.actcod},

+ 2 - 3
happy-boot-module-payment/src/main/java/org/jeecg/modules/hlgpayaccount/service/IHlgPayAccountService.java

@@ -9,12 +9,11 @@ import java.util.List;
 /**
  * @Description: hlg_pay_account
  * @Author: jeecg-boot
- * @Date:   2020-03-02
+ * @Date: 2020-03-02
  * @Version: V1.0
  */
 public interface IHlgPayAccountService extends IService<HlgPayAccount> {
 
-    HlgPayAccount saveAccout(JSONObject jsonObject);
+    HlgPayAccount saveAccout(JSONObject jsonObject, Integer subcontractorId);
 
-    List<HlgPayAccount> findAccountList();
 }

+ 3 - 6
happy-boot-module-payment/src/main/java/org/jeecg/modules/hlgpayaccount/service/impl/HlgPayAccountServiceImpl.java

@@ -18,7 +18,7 @@ import java.util.List;
 /**
  * @Description: hlg_pay_account
  * @Author: jeecg-boot
- * @Date:   2020-03-02
+ * @Date: 2020-03-02
  * @Version: V1.0
  */
 @Service
@@ -26,7 +26,7 @@ public class HlgPayAccountServiceImpl extends ServiceImpl<HlgPayAccountMapper, H
 
     @Override
     @Transactional
-    public HlgPayAccount saveAccout(JSONObject jsonObject) {
+    public HlgPayAccount saveAccout(JSONObject jsonObject, Integer subcontractorId) {
         HlgPayAccount hlgPayAccount = new HlgPayAccount();
         hlgPayAccount.setEacnbr(jsonObject.getString("eacnbr"));
         //查询当前账号是否存在
@@ -34,6 +34,7 @@ public class HlgPayAccountServiceImpl extends ServiceImpl<HlgPayAccountMapper, H
         if (hwPayAccoutList.size() > 0) {
             hlgPayAccount = hwPayAccoutList.get(0);
         } else {
+            hlgPayAccount.setSubcontractorId(subcontractorId);
             hlgPayAccount.setEaccod(jsonObject.getString("eaccod"));
             hlgPayAccount.setEccnam(jsonObject.getString("eccnam"));
             hlgPayAccount.setActcod(jsonObject.getString("actcod"));
@@ -67,8 +68,4 @@ public class HlgPayAccountServiceImpl extends ServiceImpl<HlgPayAccountMapper, H
         return hlgPayAccount;
     }
 
-    @Override
-    public List<HlgPayAccount> findAccountList() {
-        return baseMapper.findAccountList();
-    }
 }

+ 9 - 3
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/util/PayCommon.java

@@ -2,8 +2,10 @@ package org.jeecg.modules.util;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.jeecg.common.utils.PayConst;
 import org.jeecg.common.utils.PayRequest;
+import org.jeecg.modules.hlgaccount.entity.HlgAccount;
 import org.jeecg.modules.hlgpayaccount.entity.HlgPayAccount;
 import org.jeecg.modules.hlgpayaccount.entity.HlgPayRecord;
 import org.jeecg.modules.hlgpayaccount.service.IHlgPayAccountService;
@@ -63,7 +65,7 @@ public class PayCommon {
                 JSONObject jsonObject2 = jsonArray.getJSONObject(i);
                 System.out.println("户口号========" + jsonObject2.get("eacnbr"));
                 System.out.println("账号========" + jsonObject2.get("actnbr"));
-                HlgPayAccount hlgPayAccount = iHlgPayAccountService.saveAccout(jsonObject2);
+                HlgPayAccount hlgPayAccount = iHlgPayAccountService.saveAccout(jsonObject2, hlgSubcontractor.getId());
                 hlgPayAccountList.add(hlgPayAccount);
             }
             System.out.println("head========" + jsonObjectHead.getString("resultcode"));
@@ -85,7 +87,9 @@ public class PayCommon {
         String funcode = PayConst.DCAGPCNV;
         String eacnbr = "";
         //获取支付账户信息
-        List<HlgPayAccount> hlgPayAccoutList = iHlgPayAccountService.findAccountList();
+        QueryWrapper<HlgPayAccount> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("subcontractor_id",hlgSubcontractor.getId());
+        List<HlgPayAccount> hlgPayAccoutList = iHlgPayAccountService.list(queryWrapper);
         if (hlgPayAccoutList != null && hlgPayAccoutList.size() > 0) {
             eacnbr = hlgPayAccoutList.get(0).getEacnbr();
         } else {
@@ -134,7 +138,9 @@ public class PayCommon {
         String funcode = PayConst.DCAGPOPR;
         String eacnbr = "";
         //获取支付账户信息
-        List<HlgPayAccount> hlgPayAccoutList = iHlgPayAccountService.findAccountList();
+        QueryWrapper<HlgPayAccount> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("subcontractor_id",hlgSubcontractor.getId());
+        List<HlgPayAccount> hlgPayAccoutList = iHlgPayAccountService.list(queryWrapper);
         if (hlgPayAccoutList != null && hlgPayAccoutList.size() > 0) {
             eacnbr = hlgPayAccoutList.get(0).getEacnbr();
         } else {