Browse Source

查询核心开立增加接收方id条件,新增时判断应收企业是否与接收方一致

xuefy 3 years ago
parent
commit
a448f85c36

+ 17 - 0
sc-service/src/main/java/com/huyi/service/credit/controller/OwnCreditController.java

@@ -373,6 +373,13 @@ public class OwnCreditController extends BaseController {
             //接收企业
             String zfiSupplierId = CommonUtil.objToString(map.get("zfiSupplierId"));
             inf.setZfiSupplierId(zfiSupplierId);
+            if(ticketList.size() > 0){
+                //获取应收企业编号
+                String  zbiPayeeId = ticketList.get(0).get("zbiPayeeId");
+                if(!zfiSupplierId.equals(zbiPayeeId)){
+                    throw new Exception("请选择应收企业为接收方的应付账款");
+                }
+            }
             //选择
             if(ticketList.size() > 1){
                 //获取第一个应收企业
@@ -696,6 +703,13 @@ public class OwnCreditController extends BaseController {
             //核心企业授信额度
             String zfiCoreQuotaId = CommonUtil.objToString(map.get("zfiCoreQuotaId"));
             inf.setZfiCoreQuotaId(zfiCoreQuotaId);
+            if(ticketList.size() > 0){
+                //获取应收企业编号
+                String  zbiPayeeId = ticketList.get(0).get("zbiPayeeId");
+                if(!zfiSupplierId.equals(zbiPayeeId)){
+                    throw new Exception("请选择应收企业为接收方的应付账款");
+                }
+            }
             //选择
             if(ticketList.size() > 1){
                 //获取第一个应收企业
@@ -824,6 +838,7 @@ public class OwnCreditController extends BaseController {
     @GetMapping("/getAccountsPay")
     public AjaxResult getAccountsPay(@RequestParam(required=false) String zbiName,
                                      @RequestParam(required=false) String receiveName,
+                                     @RequestParam(required=false) String zbiPayeeId,
                                      QueryRequest request) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
         //获取当前企业的编号
         LoginUser userInfo = tokenService.getLoginUser();
@@ -858,6 +873,8 @@ public class OwnCreditController extends BaseController {
         map.put("zbiName",zbiName);
         //应收企业
         map.put("receiveName",receiveName);
+        //应收企业编号
+        map.put("zbiPayeeId",zbiPayeeId);
         IPage<Map> payList = ownCreditService.getAccountsPay(map,request);
         return AjaxResult.success(payList);
     }

+ 8 - 2
sc-service/src/main/resources/mapper/credit/OwnCreditMapper.xml

@@ -218,7 +218,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     b.zbi_amount                                    'zbiAmount',
                     b.zbi_service                                   'zbiService',
                     y.scy_name                                      'payName',
-                    s.scy_name                                      'receiveName'
+                    s.scy_name                                      'receiveName',
+                    b.zbi_payer_id                                  'zbiPayerId',
+                    b.zbi_payee_id                                  'zbiPayeeId'
 
             FROM   zc_bill_inf b
             LEFT JOIN  sys_company y
@@ -229,6 +231,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paramMap.zbiPayerId != null  and paramMap.zbiPayerId != ''">
                 AND b.zbi_payer_id = #{paramMap.zbiPayerId}
             </if>
+            <if test="paramMap.zbiPayeeId != null  and paramMap.zbiPayeeId != ''">
+                AND b.zbi_payee_id = #{paramMap.zbiPayeeId}
+            </if>
             <if test="paramMap.zbiName != null  and paramMap.zbiName != ''">
                 and b.zbi_name like concat('%', #{paramMap.zbiName}, '%')
             </if>
@@ -255,7 +260,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     b.zbi_service                                   'zbiService',
                     y.scy_name                                      'payName',
                     s.scy_name                                      'receiveName',
-                    b.zbi_payer_id                                  'zbiPayerId'
+                    b.zbi_payer_id                                  'zbiPayerId',
+                    b.zbi_payee_id                                  'zbiPayeeId'
 
             FROM   zc_bill_inf b
             LEFT JOIN  sys_company y