zhangyuewww 3 年之前
父节点
当前提交
82d5aa8552

+ 11 - 7
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchaseClosingReportServiceImpl.java

@@ -313,19 +313,23 @@ public class PurchaseClosingReportServiceImpl extends ServiceImpl<PurchaseClosin
                 .eq("delete_flag", "0")
                 .orderBy("update_date", false));
         for(ContractManagementInfo contractManagementInfo: contractManagementInfoList){
+            Float money=0.0f;
+            Float collectMoney=0.0f;
             //查采购平仓报表
             List<PurchaseClosingReport> purchaseClosingReportList = this.selectList(new EntityWrapper<PurchaseClosingReport>()
                     .eq("contract_no", contractManagementInfo.getContractNo())
                     .eq("delete_flag", "0"));
             if (!CollectionUtils.isEmpty(purchaseClosingReportList)){
                 for (PurchaseClosingReport purchaseClosingReport:purchaseClosingReportList){
-                    //有未付金额
-                    if (purchaseClosingReport.getAmountNotPayable() > 0) {
-                        contractManagementInfo.setReportStatus("待结算");
-                    }
-                    else {
-                        contractManagementInfo.setReportStatus("已结算");
-                    }
+                    money=money+purchaseClosingReport.getAmountNotPayable();
+                    collectMoney=collectMoney+purchaseClosingReport.getCollectionNotPayable();
+                }
+                //有未付/未收金额
+                if (money > 0||collectMoney>0) {
+                    contractManagementInfo.setReportStatus("待结算");
+                }
+                else {
+                    contractManagementInfo.setReportStatus("已结算");
                 }
             }
         }

+ 9 - 6
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchaseReceiptReportServiceImpl.java

@@ -330,18 +330,21 @@ public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceip
                 .eq("delete_flag", "0")
                 .orderBy("update_date", false));
         for (ContractManagementInfo contractManagementInfo : contractManagementInfoList) {
+            Float money=0.0f;
             //查采购出库报表
             List<PurchaseReceiptReport> purchaseReceiptReportList = this.selectList(new EntityWrapper<PurchaseReceiptReport>()
                     .eq("contract_no", contractManagementInfo.getContractNo())
                     .eq("delete_flag", "0"));
             if (!CollectionUtils.isEmpty(purchaseReceiptReportList)) {
                 for (PurchaseReceiptReport purchaseReceiptReport : purchaseReceiptReportList) {
-                    //有未付金额
-                    if (purchaseReceiptReport.getAmountNotPayable() > 0) {
-                        contractManagementInfo.setReportStatus("待结算");
-                    } else {
-                        contractManagementInfo.setReportStatus("已结算");
-                    }
+                    money=money+purchaseReceiptReport.getAmountNotPayable();
+                }
+                //有未付金额
+                if (money>0){
+                    contractManagementInfo.setReportStatus("待结算");
+                }
+                else {
+                    contractManagementInfo.setReportStatus("已结算");
                 }
             }
         }

+ 11 - 7
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SalesClosingReportServiceImpl.java

@@ -310,19 +310,23 @@ public class SalesClosingReportServiceImpl extends ServiceImpl<SalesClosingRepor
                 .eq("delete_flag", "0")
                 .orderBy("update_date", false));
         for(ContractManagementInfo contractManagementInfo: contractManagementInfoList){
+            Float money=0.0f;
+            Float collectMoney=0.0f;
             //查销售平仓报表
             List<SalesClosingReport> salesClosingReportList = this.selectList(new EntityWrapper<SalesClosingReport>()
                     .eq("contract_no", contractManagementInfo.getContractNo())
                     .eq("delete_flag", "0"));
             if (!CollectionUtils.isEmpty(salesClosingReportList)){
                 for (SalesClosingReport salesClosingReport:salesClosingReportList){
-                    //有未付金额
-                    if (salesClosingReport.getAmountNotPayable() > 0) {
-                        contractManagementInfo.setReportStatus("待结算");
-                    }
-                    else {
-                        contractManagementInfo.setReportStatus("已结算");
-                    }
+                    money=money+salesClosingReport.getAmountNotPayable();
+                    collectMoney=collectMoney+salesClosingReport.getCollectionNotPayable();
+                }
+                //有未付/未收金额
+                if (money > 0||collectMoney>0) {
+                    contractManagementInfo.setReportStatus("待结算");
+                }
+                else {
+                    contractManagementInfo.setReportStatus("已结算");
                 }
             }
         }

+ 9 - 7
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SalesDeliveryReportServiceImpl.java

@@ -287,19 +287,21 @@ public class SalesDeliveryReportServiceImpl extends ServiceImpl<SalesDeliveryRep
                 .eq("delete_flag", "0")
                 .orderBy("update_date", false));
         for(ContractManagementInfo contractManagementInfo: contractManagementInfoList){
+            Float money=0.0f;
             //查销售出库报表
             List<SalesDeliveryReport> salesDeliveryReportList = this.selectList(new EntityWrapper<SalesDeliveryReport>()
                     .eq("contract_no", contractManagementInfo.getContractNo())
                     .eq("delete_flag", "0"));
             if (!CollectionUtils.isEmpty(salesDeliveryReportList)){
                 for (SalesDeliveryReport salesDeliveryReport:salesDeliveryReportList){
-                    //有未付金额
-                    if (salesDeliveryReport.getCollectionNotPayable() > 0) {
-                        contractManagementInfo.setReportStatus("待结算");
-                    }
-                    else {
-                        contractManagementInfo.setReportStatus("已结算");
-                    }
+                    money=money+salesDeliveryReport.getCollectionNotPayable();
+                }
+                //有未收金额
+                if (money > 0) {
+                    contractManagementInfo.setReportStatus("待结算");
+                }
+                else {
+                    contractManagementInfo.setReportStatus("已结算");
                 }
             }
         }