zhangyuewww 2 years ago
parent
commit
43b53baf3e

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

@@ -4145,6 +4145,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     }
                                     tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
                                     tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
+                                    tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
                                     tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
                                     tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                                     //运输单价不为空
@@ -4438,11 +4439,11 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         tranCarInfo.setContractNo(warehouseInOutInfo.getContractNo());
                         tranCarInfo.setStatus(StatusEnum.LOADED.getName());
                         tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
-                        if ("1".equals(tranCarInfo.getSubmit())) {
-                            throw new YException(YExceptionEnum.CARNO_SUBMITTED_ERROR);
-                        } else {
-                            tranCarInfo.setSubmit("1");
-                        }
+//                        if ("1".equals(tranCarInfo.getSubmit())) {
+//                            throw new YException(YExceptionEnum.CARNO_SUBMITTED_ERROR);
+//                        } else {
+//                            tranCarInfo.setSubmit("1");
+//                        }
                         tranCarInfoService.updateById(tranCarInfo);
                     }
                     //判断是否有货
@@ -4648,11 +4649,11 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             tranCarInfo.setContractNo(warehouseInOutInfo.getContractNo());
                             tranCarInfo.setStatus(StatusEnum.LOADED.getName());
                             tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
-                            if ("1".equals(tranCarInfo.getSubmit())) {
-                                throw new YException(YExceptionEnum.CARNO_SUBMITTED_ERROR);
-                            } else {
-                                tranCarInfo.setSubmit("1");
-                            }
+//                            if ("1".equals(tranCarInfo.getSubmit())) {
+//                                throw new YException(YExceptionEnum.CARNO_SUBMITTED_ERROR);
+//                            } else {
+//                                tranCarInfo.setSubmit("1");
+//                            }
                             tranCarInfoService.updateById(tranCarInfo);
                         }
                     }
@@ -4750,11 +4751,11 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             }
                             tranCarInfo.setStatus(StatusEnum.LOADED.getName());
                             tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
-                            if ("1".equals(tranCarInfo.getSubmit())) {
-                                throw new YException(YExceptionEnum.CARNO_SUBMITTED_ERROR);
-                            } else {
-                                tranCarInfo.setSubmit("1");
-                            }
+//                            if ("1".equals(tranCarInfo.getSubmit())) {
+//                                throw new YException(YExceptionEnum.CARNO_SUBMITTED_ERROR);
+//                            } else {
+//                                tranCarInfo.setSubmit("1");
+//                            }
                             tranCarInfoService.updateById(tranCarInfo);
                         }
                     }
@@ -4841,61 +4842,62 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             warehouseInOutInfo.setTranCarNo(tranCarNo);
                             warehouseInOutInfoService.updateById(warehouseInOutInfo);
                             tranCarInfoService.insert(tranCarInfo);
-                            //生成汽运报表
-                            TranSettlementReport tranSettlementReport = new TranSettlementReport();
-                            tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
-                            tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
-                            tranSettlementReport.setId(IdGenerator.generateUUID());
-                            if ("汽运".equals(warehouseInOutInfo.getOutType())) {
-                                tranSettlementReport.setTranType("汽运");
-                                tranSettlementReport.setTranTypeKey("1");
-                            } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
-                                tranSettlementReport.setTranType("火运");
-                                tranSettlementReport.setTranTypeKey("2");
-                            } else {
-                                tranSettlementReport.setTranType("船运");
-                                tranSettlementReport.setTranTypeKey("3");
-                            }
-                            tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
-                            tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
-                            tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
-                            tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                            //运输单价不为空
-                            if (warehouseInOutInfo.getFreight()!=null){
-                                //应付
-                                tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                //未付
-                                tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                                tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
-                            }
-                            tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
-                            tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                            tranSettlementReportService.insert(tranSettlementReport);
-                            boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
-                            // 不是退回的单子
-                            if (isStartWorkflow) {
-                                Workflow workflow = workflowService
-                                        .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
-                                // 没配置审核流程,直接结束并处理信息
-                                if (workflow == null) {
-                                    throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
-                                }
-                                // 开启审核流
-                                else {
-
-                                    // 设置状态 已提交审核
-                                    tranSettlementReport.setWorkflowId(workflow.getId());
-                                    tranSettlementReportService.updateById(tranSettlementReport);
-                                    workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
-                                }
+                        }
+                        //生成汽运报表
+                        TranSettlementReport tranSettlementReport = new TranSettlementReport();
+                        tranSettlementReport.setCompId(warehouseBaseInfo.getCompId());
+                        tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
+                        tranSettlementReport.setId(IdGenerator.generateUUID());
+                        if ("汽运".equals(warehouseInOutInfo.getOutType())) {
+                            tranSettlementReport.setTranType("汽运");
+                            tranSettlementReport.setTranTypeKey("1");
+                        } else if ("火运".equals(warehouseInOutInfo.getOutType())) {
+                            tranSettlementReport.setTranType("火运");
+                            tranSettlementReport.setTranTypeKey("2");
+                        } else {
+                            tranSettlementReport.setTranType("船运");
+                            tranSettlementReport.setTranTypeKey("3");
+                        }
+                        tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
+                        tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
+                        tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
+                        tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
+                        tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                        //运输单价不为空
+                        if (warehouseInOutInfo.getFreight()!=null){
+                            //应付
+                            tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+                            //未付
+                            tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+                            tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
+                        }
+                        tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
+                        tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+                        tranSettlementReportService.insert(tranSettlementReport);
+                        boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(tranSettlementReport.getWorkflowId());
+                        // 不是退回的单子
+                        if (isStartWorkflow) {
+                            Workflow workflow = workflowService
+                                    .findLatestWorkflowByBusinessCodeByApp(tranSettlementReport.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
+                            // 没配置审核流程,直接结束并处理信息
+                            if (workflow == null) {
+                                throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
                             }
-                            // 退回的单子 再启用
+                            // 开启审核流
                             else {
 
+                                // 设置状态 已提交审核
+                                tranSettlementReport.setWorkflowId(workflow.getId());
                                 tranSettlementReportService.updateById(tranSettlementReport);
-                                workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
+                                workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
                             }
                         }
+                        // 退回的单子 再启用
+                        else {
+
+                            tranSettlementReportService.updateById(tranSettlementReport);
+                            workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
+                        }
                     }
                     if (warehouseBaseInfo != null) {
                         //出库时打入成本

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

@@ -90,6 +90,7 @@
         status,
         status_flag as statusFlag,
         approve_status as approveStatus,
+        create_date as createDate,
         workflow_id as workflowId
         FROM tran_settlement_report
         WHERE