Explorar el Código

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

ccj hace 1 año
padre
commit
737548ac58

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

@@ -325,6 +325,7 @@ public class TranTaskInfoServiceImpl extends ServiceImpl<TranTaskInfoMapper, Tra
                 .eq(WarehouseBaseInfo.QueryFiles.WAREHOUSE_TYPE,warehouseType)
                 .orderBy(WarehouseBaseInfo.QueryFiles.UPDATE_DATE, false));
         if (!CollectionUtils.isEmpty(warehouseBaseInfoList)) {
+            List<WarehouseBaseInfo> warehouseBaseInfoList1=new ArrayList<>();
             for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
                 //临时库带出品级
                 if ("2".equals(warehouseBaseInfo.getWarehouseType())){
@@ -332,20 +333,27 @@ public class TranTaskInfoServiceImpl extends ServiceImpl<TranTaskInfoMapper, Tra
                     .eq("comp_id",compId)
                     .eq("contract_no",warehouseBaseInfo.getWarehouseName()));
                     if (contractManagementInfo!=null){
+                        //只能查到执行中的合同
+                        if (!"执行中".equals(contractManagementInfo.getStatus())){
+                            warehouseBaseInfoList1.add(warehouseBaseInfo);
+                            continue;
+                        }
                         //货物信息
                         ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>().eq(ContractGoodsInfo.QueryFiles.CONTRACT_ID, contractManagementInfo.getId()));
                         warehouseBaseInfo.setGrade(contractGoodsInfo.getGrade());
                         warehouseBaseInfo.setGoodsName(contractGoodsInfo.getGoodsName());
                     }
                 }
-                // 以库位为维度查询
-                List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
-                        .eq("base_id", warehouseBaseInfo.getId()));
-                if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
-                    warehouseBaseInfo.setPositionInfos(warehousePositionInfos);
+                else {
+                    // 以库位为维度查询
+                    List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
+                            .eq("base_id", warehouseBaseInfo.getId()));
+                    if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
+                        warehouseBaseInfo.setPositionInfos(warehousePositionInfos);
+                    }
                 }
             }
-
+            warehouseBaseInfoList.removeAll(warehouseBaseInfoList1);
         }
         return warehouseBaseInfoList;
     }

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

@@ -1524,8 +1524,9 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
                                     tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
                                     tranSettlementReport.setId(IdGenerator.generateUUID());
+                                    tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
                                     if ("汽运".equals(warehouseInOutInfo.getOutType())) {
-                                        tranSettlementReport.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
+                                        tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
                                         tranSettlementReport.setTranType("汽运");
                                         tranSettlementReport.setTranTypeKey("1");
                                         tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
@@ -1731,6 +1732,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                     tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
                                     tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
+                                    TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                    if (tranProcessInfo!=null){
+                                        tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                    }
                                 }
                                 //运输单价不为空
                                 if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
@@ -1761,6 +1766,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                     if (tranTaskInfo1!=null){
                                         tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                        TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                        if (tranProcessInfo!=null){
+                                            tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                        }
                                     }
                                 }
                                 tranSettlementReport.setTranTypeKey("2");
@@ -1776,6 +1785,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                     if (tranTaskInfo1!=null){
                                         tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                        TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                        if (tranProcessInfo!=null){
+                                            tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                        }
                                     }
                                 }
                             }
@@ -2168,7 +2181,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         if (contractManagementInfo1 == null) {
                             throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
                         }
-                        warehouseInOutInfo.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
                         Wrapper wrapper = new EntityWrapper<TranCarInfo>()
                                 .eq("contract_no", warehouseInOutInfo.getContractNo())
                                 .eq("car_no", warehouseInOutInfo.getCarNo())
@@ -2274,7 +2286,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         tranSettlementReport.setId(IdGenerator.generateUUID());
                         tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
                         if ("汽运".equals(warehouseInOutInfo.getOutType())) {
-                            tranSettlementReport.setGrainPrice(warehouseInOutInfo.getGrainPrice());
                             tranSettlementReport.setTranType("汽运");
                             tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                             tranSettlementReport.setServiceCharge(20d);
@@ -2284,6 +2295,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                 tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
                                 tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
+                                TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                if (tranProcessInfo!=null){
+                                    tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                }
                             }
                             //运输单价不为空
                             if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
@@ -2314,6 +2329,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                 if (tranTaskInfo1!=null){
                                     tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                    TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                    if (tranProcessInfo!=null){
+                                        tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                    }
                                 }
                             }
                             tranSettlementReport.setTranTypeKey("2");
@@ -2329,6 +2348,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                 if (tranTaskInfo1!=null){
                                     tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                    TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                    if (tranProcessInfo!=null){
+                                        tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                    }
                                 }
                             }
                         }
@@ -3749,6 +3772,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                                 tranSettlementReport.setAmountNotPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
                                                 tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
                                                 tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
+                                                tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
                                             }
                                             tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
                                             tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
@@ -3829,6 +3853,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                                 tranSettlementReport.setAmountNotPayable(Float.valueOf(tranProcessInfo.getTranPrice()) * tranSettlementReport.getSettlementWeight());
                                                 tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
                                                 tranSettlementReport.setSettlementPrice(Double.valueOf(String.valueOf(tranProcessInfo.getTranPrice())));
+                                                tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
                                             }
                                             tranSettlementReport.setUnloadingImg(warehouseInOutInfo.getAddressUrl());
                                             tranSettlementReport.setUnloadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
@@ -4519,10 +4544,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
                                     tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
                                     tranSettlementReport.setId(IdGenerator.generateUUID());
+                                    tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
                                     if ("汽运".equals(warehouseInOutInfo.getOutType())) {
                                         tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
                                         tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
-                                        tranSettlementReport.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
                                         tranSettlementReport.setTranType("汽运");
                                         tranSettlementReport.setTranTypeKey("1");
                                         tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
@@ -4749,6 +4774,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                     tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
                                     tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
+                                    TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                    if (tranProcessInfo!=null){
+                                        tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                    }
                                 }
                                 //运输单价不为空
                                 if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
@@ -4779,6 +4808,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                     if (tranTaskInfo1!=null){
                                         tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                        TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                        if (tranProcessInfo!=null){
+                                            tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                        }
                                     }
                                 }
                                 tranSettlementReport.setTranTypeKey("2");
@@ -4794,6 +4827,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                     if (tranTaskInfo1!=null){
                                         tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                        TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                        if (tranProcessInfo!=null){
+                                            tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                        }
                                     }
                                 }
                             }
@@ -5219,7 +5256,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         if (contractManagementInfo1 == null) {
                             throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
                         }
-                        warehouseInOutInfo.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
                         Wrapper wrapper = new EntityWrapper<TranCarInfo>()
                                 .eq("contract_no", warehouseInOutInfo.getContractNo())
                                 .eq("car_no", warehouseInOutInfo.getCarNo())
@@ -5366,7 +5402,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
                         tranSettlementReport.setId(IdGenerator.generateUUID());
                         if ("汽运".equals(warehouseInOutInfo.getOutType())) {
-                            tranSettlementReport.setGrainPrice(warehouseInOutInfo.getGrainPrice());
                             tranSettlementReport.setTranType("汽运");
                             tranSettlementReport.setTranTypeKey("1");
                             tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
@@ -5376,6 +5411,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                 tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
                                 tranSettlementReport.setStartAddress(tranTaskInfo.getSendWarehouse());
+                                TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                if (tranProcessInfo!=null){
+                                    tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                }
                             }
                             //运输单价不为空
                             if (tranCarInfo!=null&&tranCarInfo.getTranPrice()!=null){
@@ -5406,6 +5445,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                 if (tranTaskInfo1!=null){
                                     tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                    TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                    if (tranProcessInfo!=null){
+                                        tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                    }
                                 }
                             }
                             tranSettlementReport.setTranTypeKey("2");
@@ -5421,6 +5464,10 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                 TranTaskInfo tranTaskInfo1=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
                                 if (tranTaskInfo1!=null){
                                     tranSettlementReport.setTaskNo(tranTaskInfo1.getTaskNo());
+                                    TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                                    if (tranProcessInfo!=null){
+                                        tranSettlementReport.setGrainPrice(tranProcessInfo.getGoodsValue());
+                                    }
                                 }
                             }
                         }

+ 4 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranProessListener.java

@@ -21,8 +21,6 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
 
     private static final long serialVersionUID = 4103656734835351132L;
     @Autowired
-    private CommonUserMapper commonUserMapper;
-    @Autowired
     private ITranProcessInfoService tranProcessInfoService;
     @Autowired
     private ITranPriceApproveService tranPriceApproveService;
@@ -52,6 +50,8 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
                 tranProcessInfo.setTranPriceIng(0.0f);
                 tranProcessInfo.setTranPriceCar(0.0f);
             }
+            tranProcessInfo.setGoodsValue(tranProcessInfo.getGoodsValueIng());
+            tranProcessInfo.setGoodsValueIng(0d);
             //汽运生成审核记录
             if(tranProcessInfo.getTranTypeKey()!=null&&"1".equals(tranProcessInfo.getTranTypeKey())) {
                 //生成审核记录
@@ -96,8 +96,8 @@ public class TranProessListener extends AbstractWorkflowTaskListener {
         if (tranProcessInfo == null) {
             return;
         }
-        tranProcessInfo.setPriceStatus(StatusEnum.GRAIN_ADOPT.getName());
-        tranProcessInfo.setPriceStatusCar(StatusEnum.GRAIN_ADOPT.getName());
+        tranProcessInfo.setPriceStatus(StatusEnum.GRAIN_REJECT.getName());
+        tranProcessInfo.setPriceStatusCar(StatusEnum.GRAIN_REJECT.getName());
         tranProcessInfo.setApproveStatus(null);
         tranProcessInfoService.updateAllColumnById(tranProcessInfo);
         StatusRecord statusRecord = new StatusRecord();

+ 2 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/TranSettlementReportMapper.xml

@@ -8,7 +8,7 @@
         FROM tran_settlement_report
         WHERE
         delete_flag = '0'
-        AND create_date > '2022-11-01'
+        AND create_date > '2023-01-01'
         AND comp_id = #{compId}
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
@@ -133,7 +133,7 @@
         WHERE
         delete_flag = '0'
         AND comp_id = #{compId}
-        AND create_date > '2022-11-01'
+        AND create_date > '2023-01-01'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
                 AND status='待请款'  and approve_status is not null