فهرست منبع

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

ccjgmwz 3 سال پیش
والد
کامیت
a959665989

+ 15 - 13
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FreightReceivingDispatchingServiceImpl.java

@@ -118,14 +118,14 @@ public class FreightReceivingDispatchingServiceImpl extends ServiceImpl<FreightR
         freightReceivingDispatching.setStatus("发货");
         freightReceivingDispatching.setBatch(batch);
         this.insert(freightReceivingDispatching);
-        freightReceivingDispatching.setId(IdGenerator.generateUUID());
-        freightReceivingDispatching.setStatusFlag("2");
-        freightReceivingDispatching.setStatus("收货");
-//        IdentityAuthenticationInfo identityAuthenticationInfo=iIdentityAuthenticationInfoService.selectOne(new EntityWrapper<>()
-//        .eq("cover","0")
-//        .eq(""))
-        freightReceivingDispatching.setBatch(batch);
-        this.insert(freightReceivingDispatching);
+//        freightReceivingDispatching.setId(IdGenerator.generateUUID());
+//        freightReceivingDispatching.setStatusFlag("2");
+//        freightReceivingDispatching.setStatus("收货");
+////        IdentityAuthenticationInfo identityAuthenticationInfo=iIdentityAuthenticationInfoService.selectOne(new EntityWrapper<>()
+////        .eq("cover","0")
+////        .eq(""))
+//        freightReceivingDispatching.setBatch(batch);
+//        this.insert(freightReceivingDispatching);
         return freightReceivingDispatching.getId();
     }
 
@@ -152,11 +152,13 @@ public class FreightReceivingDispatchingServiceImpl extends ServiceImpl<FreightR
             freightReceivingDispatchingCar.setGoodsIngPayable(freightReceivingDispatchingCar.getReciveNetWeight()*freightReceivingDispatchingList.get(0).getGoodsPrice());
             freightReceivingDispatchingCar.setFreightIngPayable(freightReceivingDispatchingCar.getReciveNetWeight()*freightReceivingDispatchingList.get(0).getFreightUnitPrice());
         }
-//        FreightReceivingDispatching freightReceivingDispatching = this.selectById(freightReceivingDispatchingCar.getInfoId());
-//        if (freightReceivingDispatching != null) {
-//            freightReceivingDispatching.setSignedFor(String.valueOf(Float.valueOf(freightReceivingDispatching.getSignedFor()) + 1));
-//            this.updateById(freightReceivingDispatching);
-//        }
+        FreightReceivingDispatching freightReceivingDispatching = this.selectOne(new EntityWrapper<FreightReceivingDispatching>()
+                .eq("batch",freightReceivingDispatchingCar.getBatch())
+                .eq("delete_flag","0"));
+        if (freightReceivingDispatching != null) {
+            freightReceivingDispatching.setSignedFor(String.valueOf(Float.valueOf(freightReceivingDispatching.getSignedFor()) + 1));
+            this.updateById(freightReceivingDispatching);
+        }
         freightReceivingDispatchingCarService.insert(freightReceivingDispatchingCar);
         return freightReceivingDispatchingCar.getId();
     }

+ 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("已结算");
                 }
             }
         }

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

@@ -169,10 +169,20 @@ public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceip
                 purchaseReceiptReport1.setNetWeight(purchaseReceiptReport1.getNetWeight() - purchaseReceiptReport.getCarryOverWeight());
                 this.updateById(purchaseReceiptReport1);
                 PurchaseReceiptReport receiptReport = purchaseReceiptReport.getPurchaseReceiptReport();
+                //结转到其他合同
+                if (purchaseReceiptReport.getPurchaseReceiptReport().getId()!=null){
+                    //更新原数据
+                    receiptReport.setCarryForward("入" + purchaseReceiptReport.getCarryOverWeight() + "+" + purchaseReceiptReport1.getContractNo());
+                    this.updateById(receiptReport);
+                }
+                //结转到本合同
+                else{
+                    receiptReport.setContractNo(purchaseReceiptReport.getContractNo());
+                }
                 receiptReport.setId(IdGenerator.generateUUID());
+                receiptReport.setCompId(purchaseReceiptReport1.getCompId());
                 //净重为结转重量
                 receiptReport.setNetWeight(purchaseReceiptReport.getCarryOverWeight());
-                receiptReport.setCarryForward("入" + purchaseReceiptReport.getCarryOverWeight() + "+" + purchaseReceiptReport1.getContractNo());
                 this.insert(receiptReport);
             }
         } else {
@@ -330,18 +340,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("已结算");
                 }
             }
         }

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/FreightReceivingDispatchingMapper.xml

@@ -50,6 +50,7 @@
         shipper as driverPhone,
         goods_name as goodsName,
         freight_payer as freightPayer,
+        shipper_phone as shipperPhone,
         receiving_address as receivingAddress,
         account_number as accountNumber,
         goods_price as goodsPrice,