Browse Source

融信查询往来账款修改

ch 3 years ago
parent
commit
dbd18cded9

+ 22 - 3
sc-service/src/main/java/com/huyi/service/credit/controller/OwnCreditController.java

@@ -1114,6 +1114,7 @@ public class OwnCreditController extends BaseController {
     public AjaxResult getAccountsPay(@RequestParam(required=false) String zbiName,
                                      @RequestParam(required=false) String receiveName,
                                      @RequestParam(required=false) String zbiPayeeId,
+                                     @RequestParam(required=false) String zfiId,
                                      QueryRequest request) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
         //获取当前企业的编号
         LoginUser userInfo = tokenService.getLoginUser();
@@ -1131,8 +1132,8 @@ public class OwnCreditController extends BaseController {
         stateList.add("06");
         stateList.add("07");
         stateList.add("08");
-        financeInfLambdaQueryWrapper.in(ZcFinanceInf::getZfiStatus,stateList).or().isNull(ZcFinanceInf::getZfiStatus);
-        List<ZcFinanceInf>   financeInfsList = financeInfService.findZcFinanceInfs(financeInfLambdaQueryWrapper);
+        financeInfLambdaQueryWrapper.and(i->i.in(ZcFinanceInf::getZfiStatus,stateList).or().isNull(ZcFinanceInf::getZfiStatus)).and(j->j.ne(ZcFinanceInf::getZfiId,zfiId));
+        List<ZcFinanceInf> financeInfsList = financeInfService.findZcFinanceInfs(financeInfLambdaQueryWrapper);
         if(financeInfsList.size() > 0){
             //提取融信编号
             List<String> financeIdList = CommonUtil.getIdFromList(financeInfsList,"zfiId");
@@ -1141,6 +1142,13 @@ public class OwnCreditController extends BaseController {
             lambdaQueryWrapper.in(ZcFinanceBillRel::getZfbrFinanceId,financeIdList);
             List<ZcFinanceBillRel>  relList =  financeBillRelService.findZcFinanceBillRels(lambdaQueryWrapper);
             if(relList.size() > 0){
+//                //查询当前融信已关联的账款
+//                if(CommonUtil.isNotEmpty(zfiId)){
+//                    LambdaQueryWrapper<ZcFinanceBillRel> wrapper = new LambdaQueryWrapper<>();
+//                    wrapper.eq(ZcFinanceBillRel::getZfbrFinanceId,zfiId);
+//                    List<ZcFinanceBillRel> billList = financeBillRelService.findZcFinanceBillRels(wrapper);
+//                    relList.addAll(billList);
+//                }
                 List<String> billIdList = CommonUtil.getIdFromList(relList,"zfbrBillId");
                 map.put("billIdList",CommonUtil.listToStr4InSql(billIdList));
             }
@@ -1174,6 +1182,7 @@ public class OwnCreditController extends BaseController {
                                             @RequestParam(required=false) String payName,
                                             @RequestParam(required=false) String payId,
                                             @RequestParam(required=false) String zfiSupplierId,
+                                            @RequestParam(required=false) String zfiId,
                                             QueryRequest request) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
         //获取当前企业的编号
         LoginUser userInfo = tokenService.getLoginUser();
@@ -1193,7 +1202,7 @@ public class OwnCreditController extends BaseController {
         stateList.add("06");
         stateList.add("07");
         stateList.add("08");
-        financeInfLambdaQueryWrapper.in(ZcFinanceInf::getZfiStatus,stateList).or().isNull(ZcFinanceInf::getZfiStatus);
+        financeInfLambdaQueryWrapper.and(i->i.in(ZcFinanceInf::getZfiStatus,stateList).or().isNull(ZcFinanceInf::getZfiStatus)).and(j->j.ne(ZcFinanceInf::getZfiId,zfiId));
         List<ZcFinanceInf>   financeInfsList = financeInfService.findZcFinanceInfs(financeInfLambdaQueryWrapper);
         if(financeInfsList.size() > 0){
             //提取融信编号
@@ -1221,6 +1230,16 @@ public class OwnCreditController extends BaseController {
         map.put("payName",payName);
         //应付企业编号
         map.put("payId",payId);
+//        //查询当前融信已关联的账款
+//        if(CommonUtil.isNotEmpty(zfiId)){
+//            LambdaQueryWrapper<ZcFinanceBillRel> wrapper = new LambdaQueryWrapper<>();
+//            wrapper.eq(ZcFinanceBillRel::getZfbrFinanceId,zfiId);
+//            List<ZcFinanceBillRel> billList = financeBillRelService.findZcFinanceBillRels(wrapper);
+//            if(billList.size()>0){
+//                List<String> stringList = CommonUtil.getIdFromList(billList,"zfbrBillId");
+//                map.put("stringList",CommonUtil.listToStr4InSql(stringList));
+//            }
+//        }
         IPage<Map> collectionList = ownCreditService.getAccountsCollection(map,request);
         return AjaxResult.success(collectionList);
     }