zhangyuewww 2 vuotta sitten
vanhempi
commit
e165dcdaeb

+ 21 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/QualityInspectionManagementServiceImpl.java

@@ -634,6 +634,27 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
             }
             //中天昊元不能超过500吨
             if ("2710b21efc1e4393930c5dc800010dc4".equals(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId())){
+                if(qualityInspectionManagement1.getContractNo() != null){
+                    ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                            .eq("comp_id","2710b21efc1e4393930c5dc800010dc4")
+                            .eq("contract_no",qualityInspectionManagement1.getContractNo()));
+                    List<PaymentManagement> paymentManagementList = paymentManagementService.selectList(new EntityWrapper<PaymentManagement>()
+                            .eq("customer_number_card", qualityInspectionManagement1.getCustomerNumberCard())
+                            .eq("comp_id", AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId())
+                            .ge("create_date", year));
+                    if (!CollectionUtils.isEmpty(paymentManagementList)) {
+                        for (PaymentManagement paymentManagement1 : paymentManagementList) {
+                            ContractManagementInfo contractManagementInfo1=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                                    .eq("comp_id",paymentManagement1.getCompId())
+                                    .eq("contract_no",paymentManagement1.getContractNo()));
+                            if (contractManagementInfo1!=null){
+                                if (!contractManagementInfo1.getBuyer().equals(contractManagementInfo.getBuyer())) {
+                                    throw new RuntimeException("客户" + qualityInspectionManagement1.getCustomerName() + "已在别的公司送粮");
+                                }
+                            }
+                        }
+                    }
+                }
                 if(qualityInspectionManagement1.getGoodsName() != null){
                     if (qualityInspectionManagement1.getGoodsName().contains("玉米")) {
                         qualityInspectionManagement1.setGoodsName("玉米");