فهرست منبع

修改查询往来账款

xuefy 3 سال پیش
والد
کامیت
d1f118b31b

+ 8 - 6
sc-service/src/main/java/com/huyi/service/credit/controller/OwnCreditController.java

@@ -353,8 +353,6 @@ public class OwnCreditController extends BaseController {
             List<String> payIdList = CommonUtil.getIdFromList(relList,"zfbrBillId");
             Map p = new HashMap();
             p.put("payIdList",CommonUtil.listToStr4InSql(payIdList));
-            ///加标识,不走sql条件:AND (f.zfi_status IN ('03', '99') OR f.zfi_id IS NULL)
-            p.put("flag","flag");
             IPage<Map> payList = ownCreditService.getAccountsPay(p,request);
             map.put("payList",payList);
         }
@@ -1112,7 +1110,7 @@ public class OwnCreditController extends BaseController {
         SysUser use = userInfo.getSysUser();
         Map<String,String> map = new HashMap<>();
         //查询非失效,非删除的融信
-        /*LambdaQueryWrapper<ZcFinanceInf> financeInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<ZcFinanceInf> financeInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
         List<String> stateList = new ArrayList<>();
         //以下状态关联了账款不可再查询出来
         stateList.add("00");
@@ -1121,6 +1119,8 @@ public class OwnCreditController extends BaseController {
         stateList.add("04");
         stateList.add("05");
         stateList.add("06");
+        stateList.add("07");
+        stateList.add("08");
         financeInfLambdaQueryWrapper.in(ZcFinanceInf::getZfiStatus,stateList).or().isNull(ZcFinanceInf::getZfiStatus);
         List<ZcFinanceInf>   financeInfsList = financeInfService.findZcFinanceInfs(financeInfLambdaQueryWrapper);
         if(financeInfsList.size() > 0){
@@ -1134,7 +1134,7 @@ public class OwnCreditController extends BaseController {
                 List<String> billIdList = CommonUtil.getIdFromList(relList,"zfbrBillId");
                 map.put("billIdList",CommonUtil.listToStr4InSql(billIdList));
             }
-        }*/
+        }
 
 
         //获取公司编号
@@ -1172,7 +1172,7 @@ public class OwnCreditController extends BaseController {
         String companyId = use.getCompanyId();
         Map<String,String> map = new HashMap<>();
         //查询非失效,非删除的融信
-        /*LambdaQueryWrapper<ZcFinanceInf> financeInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<ZcFinanceInf> financeInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
         List<String> stateList = new ArrayList<>();
         //以下状态关联了账款不可再查询出来
         stateList.add("00");
@@ -1181,6 +1181,8 @@ public class OwnCreditController extends BaseController {
         stateList.add("04");
         stateList.add("05");
         stateList.add("06");
+        stateList.add("07");
+        stateList.add("08");
         financeInfLambdaQueryWrapper.in(ZcFinanceInf::getZfiStatus,stateList).or().isNull(ZcFinanceInf::getZfiStatus);
         List<ZcFinanceInf>   financeInfsList = financeInfService.findZcFinanceInfs(financeInfLambdaQueryWrapper);
         if(financeInfsList.size() > 0){
@@ -1194,7 +1196,7 @@ public class OwnCreditController extends BaseController {
                 List<String> billIdList = CommonUtil.getIdFromList(relList,"zfbrBillId");
                 map.put("billIdList",CommonUtil.listToStr4InSql(billIdList));
             }
-        }*/
+        }
         //接收方
         if(!CommonUtil.isEmpty(zfiSupplierId)){
             //应收企业

+ 4 - 20
sc-service/src/main/resources/mapper/credit/OwnCreditMapper.xml

@@ -228,14 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 ON y.scy_id = b.zbi_payer_id
             LEFT JOIN  sys_company s
                 ON s.scy_id = b.zbi_payee_id
-            LEFT JOIN zc_finance_bill_rel rel
-                ON rel.zfbr_bill_id = b.zbi_id
-            LEFT JOIN zc_finance_inf f
-                ON rel.zfbr_finance_id = f.zfi_id
             WHERE 1=1
-            <if test="paramMap.flag == null  or paramMap.flag == ''">
-                AND (f.zfi_status IN ('03', '99') OR f.zfi_id IS NULL)
-            </if>
 --             b.zbi_status = '00'
             <if test="paramMap.zbiPayerId != null  and paramMap.zbiPayerId != ''">
                 AND b.zbi_payer_id = #{paramMap.zbiPayerId}
@@ -252,10 +245,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paramMap.payIdList != null  and paramMap.payIdList != ''">
                 and b.zbi_id  IN (${paramMap.payIdList})
             </if>
-            <!--<if test="paramMap.billIdList != null  and paramMap.billIdList != ''">
+            <if test="paramMap.billIdList != null  and paramMap.billIdList != ''">
                 and b.zbi_id  NOT IN (${paramMap.billIdList})
-            </if>-->
-            GROUP BY b.zbi_id
+            </if>
             ORDER BY b.create_time DESC
 
     </select>
@@ -278,14 +270,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ON y.scy_id = b.zbi_payer_id
             LEFT JOIN  sys_company s
             ON s.scy_id = b.zbi_payee_id
-            LEFT JOIN zc_finance_bill_rel rel
-            ON rel.zfbr_bill_id = b.zbi_id
-            LEFT JOIN zc_finance_inf f
-            ON rel.zfbr_finance_id = f.zfi_id
             WHERE 1=1
-            <if test="paramMap.flag == null  or paramMap.flag == ''">
-                AND (f.zfi_status IN ('03', '99') OR f.zfi_id IS NULL)
-            </if>
 --             b.zbi_status = '00'
             <if test="paramMap.zbiPayeeId != null  and paramMap.zbiPayeeId != ''">
                 AND b.zbi_payee_id = #{paramMap.zbiPayeeId}
@@ -302,10 +287,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paramMap.payIdList != null  and paramMap.payIdList != ''">
                 and b.zbi_id  IN (${paramMap.payIdList})
             </if>
-            <!--<if test="paramMap.billIdList != null  and paramMap.billIdList != ''">
+            <if test="paramMap.billIdList != null  and paramMap.billIdList != ''">
                 and b.zbi_id  NOT IN (${paramMap.billIdList})
-            </if>-->
-            GROUP BY b.zbi_id
+            </if>
             ORDER BY b.create_time DESC
 
     </select>