zhangyuewww 2 年之前
父节点
当前提交
6760193dc8

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

@@ -119,6 +119,10 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      * 结算重量(吨)
      */
     private Float settlementWeight;
+    /**
+     * 发货地
+     */
+    private String startAddress;
     /**
      * 扣款(元)
      */

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

@@ -139,6 +139,7 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
         pageView.put("pageSize", tranSettlementReport.getPageSize());
         pageView.put("currentPage", tranSettlementReport.getCurrentPage());
         pageView.put("tranTypeKey", tranSettlementReport.getTranTypeKey());
+        pageView.put("startAddress", tranSettlementReport.getStartAddress());
         pageView.put("taskNo", tranSettlementReport.getTaskNo());
         pageView.put("processNo", tranSettlementReport.getProcessNo());
         pageView.put("carId", tranSettlementReport.getCarId());

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

@@ -1023,8 +1023,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 ContractManagementInfo contractManagementInfo1=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
                         .eq("contract_no",inOutWarehouseTask.getWarehouseName())
                         .eq("comp_id",inOutWarehouseTask.getCompId()));
-                if (contractManagementInfo1!=null) {
+                if (contractManagementInfo1!=null&&"定价采购".equals(contractManagementInfo1.getPriceType())) {
                     contractManagementInfo.setContractPrice(Float.valueOf(String.valueOf(contractManagementInfo1.getUnitContractPrice())));
+                    contractManagementInfo.setPriceType(contractManagementInfo1.getPriceType());
+                }
+                else if(contractManagementInfo1!=null&&"随行就市".equals(contractManagementInfo1.getPriceType())){
+                    contractManagementInfo.setPriceType(contractManagementInfo1.getPriceType());
                 }
                 contractManagementInfo.setGrade(inOutWarehouseTask.getGrade());
                 contractManagementInfo.setSendWarehouse(inOutWarehouseTask.getSendWarehouse());

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

@@ -4051,6 +4051,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                                     }
                                     tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
                                     tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
+                                    tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
                                     tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                                     //运输单价不为空
                                     if (tranProcessInfo.getTranPrice()!=null){
@@ -4190,60 +4191,61 @@ 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.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);
+                                //生成汽运报表
+                                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());
+                                    }
+                                }
+                                // 退回的单子 再启用
                                 else {
 
-                                    // 设置状态 已提交审核
-                                    tranSettlementReport.setWorkflowId(workflow.getId());
                                     tranSettlementReportService.updateById(tranSettlementReport);
-                                    workflowService.startInstance(workflow.getId(), tranSettlementReport.getId());
+                                    workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
                                 }
                             }
-                            // 退回的单子 再启用
-                            else {
-
-                                tranSettlementReportService.updateById(tranSettlementReport);
-                                workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
-                            }
                         }
                     }
                     if (warehouseInOutInfo.getWeighingManagement() != null) {
@@ -4747,6 +4749,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             }
                             tranSettlementReport.setContractNo(warehouseInOutInfo.getContractNo());
                             tranSettlementReport.setCarNo(warehouseInOutInfo.getCarNo());
+                            tranSettlementReport.setStartAddress(warehouseInOutInfo.getWarehouseName());
                             tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
                             //运输单价不为空
                             if (warehouseInOutInfo.getFreight()!=null){

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

@@ -29,6 +29,9 @@
         <if test="processNo != null and processNo != ''">
             AND process_no = #{processNo}
         </if>
+        <if test="startAddress != null and startAddress != ''">
+            AND start_address = #{startAddress}
+        </if>
         <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
             AND contract_no = #{contractNo}
         </if>
@@ -72,6 +75,7 @@
         unloading_weight as unloadingWeight,
         loading_img as loadingImg,
         unloading_img as unloadingImg,
+        start_address as startAddress,
         loss_weight as lossWeight,
         manual_flag as ManualFlag,
         transport_price as transportPrice,
@@ -111,6 +115,9 @@
         <if test="processNo != null and processNo != ''">
             AND process_no = #{processNo}
         </if>
+        <if test="startAddress != null and startAddress != ''">
+            AND start_address = #{startAddress}
+        </if>
         <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
             AND contract_no = #{contractNo}
         </if>