zhangyuewww 2 years ago
parent
commit
a2b498e8ec

+ 24 - 24
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -4890,6 +4890,30 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                 }
                 //常用库出库
                 else if ("1".equals(warehouseInOutInfo.getInOutFlag()) && "1".equals(warehouseBaseInfo.getWarehouseType())) {
+                    if (warehouseInOutInfo.getWeighingManagement() != null) {
+                        //毛重检斤
+                        //状态改为已称毛重
+                        WeighingManagement weighingManagement = warehouseInOutInfo.getWeighingManagement();
+                        weighingManagement.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
+                        weighingManagement.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
+                        weighingManagement.setGrossDate(new Date());
+                        weighingManagement.setSecretaryWeigher(commonStaff.getStaffName());
+                        //质检信息
+                        QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
+                                .eq("relation_id", weighingManagement.getRelationId())
+                                .eq("comp_id", commonStaff.getCompId()));
+                        if (qualityInspectionManagement != null) {
+                            qualityInspectionManagement.setCarNumber(warehouseInOutInfo.getCarNo());
+                            //状态改为已称毛重
+//                      qualityInspectionManagement.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
+//                      qualityInspectionManagement.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
+                            qualityInspectionManagementService.updateById(qualityInspectionManagement);
+                        }
+                        if (weighingManagement.getGrossWeight() == null || weighingManagement.getGrossWeight() == 0) {
+                            throw new YException(YExceptionEnum.GROSSWEIGHT_NULL);
+                        }
+                        weighingManagementService.updateById(weighingManagement);
+                    }
                     //常用库销售出库类型
                     if ("1".equals(warehouseInOutInfo.getInOutTypeKey())) {
                         //查出库任务关联的货源
@@ -5475,30 +5499,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
 //                                }
                         }
                     }
-                    if (warehouseInOutInfo.getWeighingManagement() != null) {
-                        //毛重检斤
-                        //状态改为已称毛重
-                        WeighingManagement weighingManagement = warehouseInOutInfo.getWeighingManagement();
-                        weighingManagement.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
-                        weighingManagement.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
-                        weighingManagement.setGrossDate(new Date());
-                        weighingManagement.setSecretaryWeigher(commonStaff.getStaffName());
-                        //质检信息
-                        QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
-                                .eq("relation_id", weighingManagement.getRelationId())
-                                .eq("comp_id", commonStaff.getCompId()));
-                        if (qualityInspectionManagement != null) {
-                            qualityInspectionManagement.setCarNumber(warehouseInOutInfo.getCarNo());
-                            //状态改为已称毛重
-//                      qualityInspectionManagement.setStatus(StatusEnum.WEIGHED_GROSS_WEIGHT.getName());
-//                      qualityInspectionManagement.setStatusFlag(StatusEnum.WEIGHED_GROSS_WEIGHT.getFlag());
-                            qualityInspectionManagementService.updateById(qualityInspectionManagement);
-                        }
-                        if (weighingManagement.getGrossWeight() == null || weighingManagement.getGrossWeight() == 0) {
-                            throw new YException(YExceptionEnum.GROSSWEIGHT_NULL);
-                        }
-                        weighingManagementService.updateById(weighingManagement);
-                    }
                     //运费大于0生成运费结算报表数据
 //                    if (warehouseInOutInfo.getFreight() != null && warehouseInOutInfo.getFreight() > 0) {
 //                        //生成汽运报表

+ 10 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java

@@ -1027,6 +1027,15 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
         if (weighingManagement1 != null){
             weighingManagement1.setInOutTaskNo(weighingManagement.getInOutTaskNo());
             weighingManagement1.setContractNo(weighingManagement.getContractNo());
+            ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                    .eq("comp_id",weighingManagement1.getCompId())
+                    .eq("contract_no",weighingManagement1.getContractNo()));
+            if (contractManagementInfo!=null){
+                weighingManagement1.setContractPrice(Float.valueOf(String.valueOf(contractManagementInfo.getUnitContractPrice())));
+                if ("销售出库".equals(weighingManagement1.getInOutType())){
+                    weighingManagement1.setCustomer(contractManagementInfo.getBuyer());
+                }
+            }
             InOutWarehouseTask inOutWarehouseTask=inOutWarehouseTaskService.selectOne(new EntityWrapper<InOutWarehouseTask>()
                     .eq("in_out_task_no",weighingManagement.getInOutTaskNo())
                     .eq("comp_id",weighingManagement1.getCompId()));
@@ -1084,7 +1093,7 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                         warehouseInOutInfo.setTaskNo(tranTaskInfo.getTaskNo());
                         tranCarInfo.setInfoId(tranTaskInfo.getId());
                         ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
-                                .eq("contract_no", warehouseInOutInfo.getContractNo()).eq("delete_flag", "0"));
+                                .eq("contract_no", warehouseInOutInfo.getContractNo()).eq("comp_id",weighingManagement1.getCompId()).eq("delete_flag", "0"));
                         if (contractManagementInfo1 != null) {
                             tranCarInfo.setCost(contractManagementInfo1.getUnitContractPrice());
                         } else {