zhangyuewww 2 years ago
parent
commit
03c357e658

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java

@@ -701,6 +701,11 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
      */
     @TableField(exist = false)
     private String expenseRecord;
+    /**
+     * 退库有无运输任务标识(1有)
+     */
+    @TableField(exist = false)
+    private String tranTaskFlag;
 
 
     @Override

+ 68 - 64
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -3129,6 +3129,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
 
     @Override
     public ContractManagementInfo getInContract(String contractNo, String compId) {
+        //采购入库
         ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
                 .eq("comp_id", compId)
                 .eq("delete_flag", "0")
@@ -3139,45 +3140,45 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         if (contractManagementInfo != null) {
             ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>()
                     .eq("contract_id", contractManagementInfo.getId()));
-            TranTaskInfo tranTaskInfo =tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
-                    .eq("comp_id",compId)
-                    .eq("contract_no", contractManagementInfo.getContractNo()));
-            if (tranTaskInfo!=null) {
-                //查合同下的车牌号,入库只能查到未提交的
-                List<TranCarInfo> tranCarInfoList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                        .eq("info_id", tranTaskInfo.getId())
-                        .eq("fleet_flag", "0").eq("tran_type", "4").eq("three_tran_type", "汽运").ne("submit", "2")
-                        .last("ORDER BY CONVERT ( car_no USING gbk ) ASC"));
-                if (!org.springframework.util.CollectionUtils.isEmpty(tranCarInfoList)) {
-                    contractManagementInfo.setTranCarInfoList(tranCarInfoList);
-                }
-                //查合同下的车队,入库只能查到未提交的
-                List<TranCarInfo> tranCarInfoList1 = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                        .eq("info_id", tranTaskInfo.getId())
-                        .eq("fleet_flag", "1").eq("tran_type", "4").eq("three_tran_type", "汽运")
-                        .last("ORDER BY CONVERT ( fleet_name USING gbk ) ASC"));
-                if (!org.springframework.util.CollectionUtils.isEmpty(tranCarInfoList1)) {
-                    contractManagementInfo.setTranCarInfoList1(tranCarInfoList1);
-                }
-            }
+//            TranTaskInfo tranTaskInfo =tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
+//                    .eq("comp_id",compId)
+//                    .eq("contract_no", contractManagementInfo.getContractNo()));
+//            if (tranTaskInfo!=null) {
+//                //查合同下的车牌号,入库只能查到未提交的
+//                List<TranCarInfo> tranCarInfoList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
+//                        .eq("info_id", tranTaskInfo.getId())
+//                        .eq("fleet_flag", "0").eq("tran_type", "4").eq("three_tran_type", "汽运").ne("submit", "2")
+//                        .last("ORDER BY CONVERT ( car_no USING gbk ) ASC"));
+//                if (!org.springframework.util.CollectionUtils.isEmpty(tranCarInfoList)) {
+//                    contractManagementInfo.setTranCarInfoList(tranCarInfoList);
+//                }
+//                //查合同下的车队,入库只能查到未提交的
+//                List<TranCarInfo> tranCarInfoList1 = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
+//                        .eq("info_id", tranTaskInfo.getId())
+//                        .eq("fleet_flag", "1").eq("tran_type", "4").eq("three_tran_type", "汽运")
+//                        .last("ORDER BY CONVERT ( fleet_name USING gbk ) ASC"));
+//                if (!org.springframework.util.CollectionUtils.isEmpty(tranCarInfoList1)) {
+//                    contractManagementInfo.setTranCarInfoList1(tranCarInfoList1);
+//                }
+//            }
             //查船名
-            Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
-            shipListWrapper.eq("contract_no", contractManagementInfo.getContractNo())
-                    .eq("delete_flag", "0");
-            shipListWrapper.andNew().eq("tran_type", "3").or()
-                    .eq("three_tran_type", "散船");
-            List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
-            if (!org.springframework.util.CollectionUtils.isEmpty(shipInfoList)) {
-                contractManagementInfo.setShipInfoList(shipInfoList);
-            }
-            //查火运流向
-            List<TranCarInfo> fireList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                    .eq("contract_no", contractManagementInfo.getContractNo())
-                    .eq("tran_type", "2")
-                    .eq("delete_flag", "0"));
-            if (!org.springframework.util.CollectionUtils.isEmpty(fireList)) {
-                contractManagementInfo.setFireDirectionList(fireList);
-            }
+//            Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
+//            shipListWrapper.eq("contract_no", contractManagementInfo.getContractNo())
+//                    .eq("delete_flag", "0");
+//            shipListWrapper.andNew().eq("tran_type", "3").or()
+//                    .eq("three_tran_type", "散船");
+//            List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
+//            if (!org.springframework.util.CollectionUtils.isEmpty(shipInfoList)) {
+//                contractManagementInfo.setShipInfoList(shipInfoList);
+//            }
+//            //查火运流向
+//            List<TranCarInfo> fireList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
+//                    .eq("contract_no", contractManagementInfo.getContractNo())
+//                    .eq("tran_type", "2")
+//                    .eq("delete_flag", "0"));
+//            if (!org.springframework.util.CollectionUtils.isEmpty(fireList)) {
+//                contractManagementInfo.setFireDirectionList(fireList);
+//            }
             contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
             contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
             contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
@@ -3187,6 +3188,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                 contractManagementInfo.setContractPrice(contractManagementInfo.getPointPrice() != null ? contractManagementInfo.getPointPrice() : Float.valueOf(String.valueOf(contractManagementInfo.getUnitContractPrice())));
             }
         } else {
+            //销售合同退库
             contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
                     .eq("status_flag", "1")
@@ -3198,45 +3200,45 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                         .eq("contract_id", contractManagementInfo.getId()));
                 TranTaskInfo tranTaskInfo =tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
                         .eq("comp_id",compId)
+                        .eq("task_type","退库")
                         .eq("contract_no", contractManagementInfo.getContractNo()));
                 if (tranTaskInfo!=null) {
-                    //查合同下的车牌号,入库只能查到未提交的
+                    contractManagementInfo.setTranTaskFlag("1");
+                    //查合同下的车牌号,退库
                     List<TranCarInfo> tranCarInfoList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                            .eq("info_id", tranTaskInfo.getId()).eq("fleet_flag", "0").eq("tran_type", "1").ne("submit", "2")
+                            .eq("info_id", tranTaskInfo.getId()).eq("fleet_flag", "0").eq("tran_type", "1").eq("submit", "0")
                             .last("ORDER BY CONVERT ( car_no USING gbk ) ASC"));
                     if (!org.springframework.util.CollectionUtils.isEmpty(tranCarInfoList)) {
                         contractManagementInfo.setTranCarInfoList(tranCarInfoList);
                     }
-                    List<TranCarInfo> tranCarInfoList1 = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                            .eq("info_id", tranTaskInfo.getId()).eq("fleet_flag", "1").eq("tran_type", "1")
-                            .last("ORDER BY CONVERT ( fleet_name USING gbk ) ASC"));
-                    if (!org.springframework.util.CollectionUtils.isEmpty(tranCarInfoList1)) {
-                        contractManagementInfo.setTranCarInfoList1(tranCarInfoList1);
-                    }
-                }
-                //查船名
-                Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
-                shipListWrapper.eq("contract_no", contractManagementInfo.getContractNo())
-                        .eq("delete_flag", "0");
-                shipListWrapper.andNew().eq("tran_type", "3").or()
-                        .eq("three_tran_type", "散船");
-                List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
-                if (!org.springframework.util.CollectionUtils.isEmpty(shipInfoList)) {
-                    contractManagementInfo.setShipInfoList(shipInfoList);
-                }
-                //查火运流向
-                List<TranCarInfo> fireList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
-                        .eq("contract_no", contractManagementInfo.getContractNo())
-                        .eq("tran_type", "2")
-                        .eq("delete_flag", "0"));
-                if (!org.springframework.util.CollectionUtils.isEmpty(fireList)) {
-                    contractManagementInfo.setFireDirectionList(fireList);
                 }
+                else{
+                    contractManagementInfo.setTranTaskFlag("0");
+                }
+//                //查船名
+//                Wrapper<TranCarInfo> shipListWrapper = new EntityWrapper<>();
+//                shipListWrapper.eq("contract_no", contractManagementInfo.getContractNo())
+//                        .eq("delete_flag", "0");
+//                shipListWrapper.andNew().eq("tran_type", "3").or()
+//                        .eq("three_tran_type", "散船");
+//                List<TranCarInfo> shipInfoList = tranCarInfoService.selectList(shipListWrapper);
+//                if (!org.springframework.util.CollectionUtils.isEmpty(shipInfoList)) {
+//                    contractManagementInfo.setShipInfoList(shipInfoList);
+//                }
+//                //查火运流向
+//                List<TranCarInfo> fireList = tranCarInfoService.selectList(new EntityWrapper<TranCarInfo>()
+//                        .eq("contract_no", contractManagementInfo.getContractNo())
+//                        .eq("tran_type", "2")
+//                        .eq("delete_flag", "0"));
+//                if (!org.springframework.util.CollectionUtils.isEmpty(fireList)) {
+//                    contractManagementInfo.setFireDirectionList(fireList);
+//                }
                 contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
                 contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
                 contractManagementInfo.setGrade(contractGoodsInfo.getGrade());
                 contractManagementInfo.setInOutType("退库");
             } else {
+                //收购合同
                 contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
                         .eq("comp_id", compId)
                         .eq("contract_type", "3")
@@ -3249,6 +3251,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                     contractManagementInfo.setGoodsName(contractGoodsInfo.getGoodsName());
                     contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
                 } else {
+                    //移库入库
                     InOutWarehouseTask inOutWarehouseTask = inOutWarehouseTaskService.selectOne(new EntityWrapper<InOutWarehouseTask>()
                             .eq("comp_id", compId)
                             .eq("delete_flag", "0")
@@ -3261,6 +3264,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                         BeanUtils.copyProperties(inOutWarehouseTask, contractManagementInfo1);
                         TranTaskInfo tranTaskInfo =tranTaskInfoService.selectOne(new EntityWrapper<TranTaskInfo>()
                                 .eq("comp_id",compId)
+                                .eq("task_type","移库")
                                 .eq("contract_no", inOutWarehouseTask.getMoveTaskNo()));
                         if (tranTaskInfo!=null) {
                             //查移库任务编号下的车牌号,入库只能查到已出库的