فهرست منبع

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

ccjgmwz 3 سال پیش
والد
کامیت
f840570a3f
15فایلهای تغییر یافته به همراه330 افزوده شده و 46 حذف شده
  1. 9 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/InOutWarehouseTaskController.java
  2. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TranProcessInfoController.java
  3. 8 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CustomerInfo.java
  4. 4 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/InOutWarehouseTask.java
  5. 6 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IInOutWarehouseTaskService.java
  6. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ITranProcessInfoService.java
  7. 16 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java
  8. 7 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CostManagementInfoServiceImpl.java
  9. 15 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/InOutWarehouseTaskServiceImpl.java
  10. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/QualityInspectionManagementServiceImpl.java
  11. 236 21
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranCarInfoServiceImpl.java
  12. 16 12
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java
  13. 2 2
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml
  14. 4 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CustomerInfoMapper.xml
  15. 4 4
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml

+ 9 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/InOutWarehouseTaskController.java

@@ -135,6 +135,15 @@ public class InOutWarehouseTaskController {
     public Page<InOutWarehouseTask> selectWarehouseTask(InOutWarehouseTask inOutWarehouseTask) {
         return inOutWarehouseTaskService.selectWarehouseTask(inOutWarehouseTask);
     }
+    /**
+     * 出入库任务列表
+     * @param flag
+     * @return
+     */
+    @GetMapping("/selectInOutWarehouseNo")
+    public List<InOutWarehouseTask> selectInOutWarehouseNo(String flag) {
+        return inOutWarehouseTaskService.selectInOutWarehouseNo(flag);
+    }
 
 }
 

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TranProcessInfoController.java

@@ -70,7 +70,7 @@ public class TranProcessInfoController {
      */
     @PostMapping("/api/editReceivingStatus")
     public String editReceivingStatus(@RequestBody TranProcessInfo tranProcessInfo){
-        return tranProcessInfoService.editReceivingStatus(tranProcessInfo.getId());
+        return tranProcessInfoService.editReceivingStatus(tranProcessInfo);
     }
 
 

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

@@ -71,6 +71,14 @@ public class CustomerInfo extends BaseModel<CustomerInfo> {
      * 收款人身份证号码
      */
     private String payeeNumberCard;
+    /**
+     * 保证金(元)
+     */
+    private Float securityDeposit;
+    /**
+     * 预付金(元)
+     */
+    private Float advancePayment;
     /**
      * 身份证号码
      */

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

@@ -207,6 +207,10 @@ public class InOutWarehouseTask extends BaseModel<InOutWarehouseTask> {
      * 移库入库仓库名称
      */
     private String moveWarehouseName;
+    /**
+     * 预估运费(元/吨)
+     */
+    private Float estimatedFreight;
 
 
     /**

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IInOutWarehouseTaskService.java

@@ -91,4 +91,10 @@ public interface IInOutWarehouseTaskService extends IService<InOutWarehouseTask>
      * @return
      */
     Page<InOutWarehouseTask> selectWarehouseTask(InOutWarehouseTask inOutWarehouseTask);
+    /**
+     * 查出入库任务编号
+     * @param flag
+     * @return
+     */
+    List<InOutWarehouseTask> selectInOutWarehouseNo(String flag);
 }

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

@@ -57,7 +57,7 @@ public interface ITranProcessInfoService extends IService<TranProcessInfo> {
      * @param id
      * @return
      */
-    String editReceivingStatus(String id);
+    String editReceivingStatus(TranProcessInfo tranProcessInfo);
     /**
      * 删除运输阶段
      *

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

@@ -68,6 +68,8 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
     @Autowired
     private ITranCarInfoService tranCarInfoService;
     @Autowired
+    private ITranProcessInfoService tranProcessInfoService;
+    @Autowired
     private INewWorkflowService workflowService;
     @Autowired
     private IPriceConfirmationSheetService priceConfirmationSheetService;
@@ -585,7 +587,20 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                             returnWeight = returnWeight + warehouseInOutInfo.getNetWeight();
                         }
                     }
-                    contractManagementInfo1.setCompletedQuantity(outWeight - loss - returnWeight);
+                    //自运的销售合同
+                    if ("1".equals(contractManagementInfo1.getDeliverType())){
+                        //已完货的粮款结算阶段
+                        TranProcessInfo tranProcessInfo=tranProcessInfoService.selectOne(new EntityWrapper<TranProcessInfo>()
+                                .eq("end_flag","1")
+                                .eq("receiving_status_flag","1"));
+                        if (tranProcessInfo!=null){
+                            //完成量等于完货净重
+                            contractManagementInfo1.setCompletedQuantity(tranProcessInfo.getWeight());
+                        }
+                    }
+                    else {
+                        contractManagementInfo1.setCompletedQuantity(outWeight - loss - returnWeight);
+                    }
                 }
             }
         }

+ 7 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CostManagementInfoServiceImpl.java

@@ -66,12 +66,16 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
     @Transactional(rollbackFor = Exception.class)
     public String editCostManagementInfo(CostManagementInfo costManagementInfo) {
         boolean one = this.updateById(costManagementInfo);
+        CostManagementInfo costManagementInfo1=this.selectById(costManagementInfo.getId());
         WeightedDetails weightedDetails=new WeightedDetails();
         //新增主键id
         weightedDetails.setId(IdGenerator.generateUUID());
-        weightedDetails.setCostAfter(costManagementInfo.getCost());
-        weightedDetails.setGoodsName(costManagementInfo.getGoodsName());
-        weightedDetails.setGoodsNameKey(costManagementInfo.getGoodsNameKey());
+        weightedDetails.setCompId(costManagementInfo1.getCompId());
+        weightedDetails.setWarehouseName(costManagementInfo1.getWarehouseName());
+        weightedDetails.setWarehouseId(costManagementInfo1.getWarehouseId());
+        weightedDetails.setCostAfter(costManagementInfo1.getCost());
+        weightedDetails.setGoodsName(costManagementInfo1.getGoodsName());
+        weightedDetails.setGoodsNameKey(costManagementInfo1.getGoodsNameKey());
         weightedDetailsService.insert(weightedDetails);
         if (one) {
             return "OK";

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

@@ -471,4 +471,19 @@ public class InOutWarehouseTaskServiceImpl extends ServiceImpl<InOutWarehouseTas
         page.setSize(inOutWarehouseTask.getPageSize());
         return page;
     }
+
+    /**
+     * 查出入库任务编号
+     * @param flag
+     * @return
+     */
+    @Override
+    public List<InOutWarehouseTask> selectInOutWarehouseNo(String flag) {
+        //执行中的编号
+        List<InOutWarehouseTask> inOutWarehouseTaskList=this.selectList(new EntityWrapper<InOutWarehouseTask>()
+                .eq("comp_id",AuthSecurityUtils.getCurrentUserInfo().getCompId())
+                .eq("task_status_key","5")
+        .orderBy("update_date",false));
+        return inOutWarehouseTaskList;
+    }
 }

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

@@ -167,7 +167,7 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
         //查潮粮单价已审核的数据
         List<PurchasePrice> purchasePriceList=purchasePriceService.selectList(new EntityWrapper<PurchasePrice>()
         .eq("warehouse_id",warehouseId)
-        .eq("status_flag","3"));
+        .eq("status","已通过"));
         return purchasePriceList;
     }
 

+ 236 - 21
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranCarInfoServiceImpl.java

@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
 import com.winsea.svc.base.base.entity.CommonStaff;
 import com.winsea.svc.base.base.service.ICommonStaffService;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
+import com.winsea.svc.base.workflow.entity.Workflow;
 import com.winsea.svc.notice.entity.NoticeTaskInfo;
 import com.winsea.svc.notice.entity.base.BaseNotice;
 import com.winsea.svc.notice.service.INoticeService;
@@ -23,6 +24,7 @@ import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import java.util.List;
 
@@ -54,6 +56,16 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
     @Autowired
     private ISalesDeliveryReportService salesDeliveryReportService;
     @Autowired
+    private ITranSettlementReportService tranSettlementReportService;
+    @Autowired
+    private IDriverPayeeInfoService driverPayeeInfoService;
+    @Autowired
+    private ITranProcessInfoService tranProcessInfoService;
+    @Autowired
+    private ITranTaskInfoService tranTaskInfoService;
+    @Autowired
+    private INewWorkflowService workflowService;
+    @Autowired
     private GeTuiUtils geTuiUtils;
     @Autowired
     private INoticeService noticeService;
@@ -211,35 +223,238 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
      */
     @Override
     public String feedbackTranCar(TranCarInfo tranCarInfo) {
-        //新增
-        if (StringUtils.isEmpty(tranCarInfo.getId())) {
-            tranCarInfo.setId(IdGenerator.generateUUID());
-            //保存
-            if ("0".equals(tranCarInfo.getFlag())){
-                tranCarInfo.setStatusFlag(StatusEnum.NOT_LOADED.getFlag());
-                tranCarInfo.setStatus(StatusEnum.NOT_LOADED.getName());
+        //提交
+        if ("1".equals(tranCarInfo.getFlag())){
+            //卸车反馈时状态改为已送达
+            if (tranCarInfo.getUnloadNetWeight() > 0) {
+                tranCarInfo.setStatusFlag(StatusEnum.DELIVERED.getFlag());
+                tranCarInfo.setStatus(StatusEnum.DELIVERED.getName());
             }
-            //提交
+            //装车反馈
             else {
                 tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
                 tranCarInfo.setStatus(StatusEnum.LOADED.getName());
-            }
-            this.insert(tranCarInfo);
-        }
-        else {
-            if ("1".equals(tranCarInfo.getFlag())){
-                //卸车反馈时状态改为已送达
-                if (tranCarInfo.getUnloadNetWeight() > 0) {
-                    tranCarInfo.setStatusFlag(StatusEnum.DELIVERED.getFlag());
-                    tranCarInfo.setStatus(StatusEnum.DELIVERED.getName());
+                TranProcessInfo tranProcessInfo=tranProcessInfoService.selectById(tranCarInfo.getProcessId());
+                TranTaskInfo tranTaskInfo=tranTaskInfoService.selectById(tranCarInfo.getInfoId());
+                //汽运类型
+                if (tranCarInfo.getTranType().equals(NumberConstant.CONSTANT1)) {
+                    List<TranSettlementReport> tranSettlementReportList = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                            .eq("car_id", tranCarInfo.getId()));
+                    if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
+                        if (tranCarInfo.getUnloadNetWeight() > 0) {
+                            for (TranSettlementReport tranSettlementReport : tranSettlementReportList) {
+                                tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                                tranSettlementReport.setUnloadingWeight(tranCarInfo.getUnloadNetWeight());
+                                tranSettlementReport.setUnloadingImg(tranCarInfo.getUnloadPoundImg());
+                                //损耗
+                                tranSettlementReport.setLossWeight(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight());
+                                //结算重量
+                                if ("0".equals(tranSettlementReport.getManualFlag())) {
+                                    //卸车不为空时,结算重量=装卸取小
+                                    tranSettlementReport.setSettlementWeight(tranCarInfo.getLoadNetWeight() > tranCarInfo.getUnloadNetWeight() ? tranCarInfo.getUnloadNetWeight() : tranCarInfo.getLoadNetWeight());
+                                }
+                                //扣款
+                                if (tranSettlementReport.getLossWeight() <= (tranCarInfo.getLoadNetWeight() / 1000)) {
+                                    tranSettlementReport.setDeductionAmount("0");
+                                    //应付=单价x结算重量-扣款
+                                    tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
+                                } else {
+                                    tranSettlementReport.setDeductionAmount(String.format("%.2f", (Float.valueOf(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight()) - (tranCarInfo.getLoadNetWeight() / 1000)) * Float.valueOf(tranCarInfo.getTranPrice())));
+                                    //应付=单价x结算重量-扣款
+                                    tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight() - Float.valueOf(tranSettlementReport.getDeductionAmount()));
+                                }
+                                tranSettlementReportService.updateById(tranSettlementReport);
+                            }
+                        }
+                    } else {
+                        //生成汽运报表
+                        TranSettlementReport tranSettlementReport = new TranSettlementReport();
+                        tranSettlementReport.setCompId(tranTaskInfo.getCompId());
+                        tranSettlementReport.setCarId(tranCarInfo.getId());
+                        tranSettlementReport.setId(IdGenerator.generateUUID());
+                        tranSettlementReport.setTranType("汽运");
+                        tranSettlementReport.setTranTypeKey("1");
+                        tranSettlementReport.setContractNo(tranTaskInfo.getContractNo());
+                        tranSettlementReport.setProcessNo(tranProcessInfo.getProcessNo());
+                        tranSettlementReport.setName(tranCarInfo.getDriver());
+                        tranSettlementReport.setPhone(tranCarInfo.getDriverPhone());
+                        tranSettlementReport.setCarNo(tranCarInfo.getCarNo());
+                        //查询账户信息
+                        List<DriverViewInfo> driverViewInfoList = driverViewInfoService.selectList(new EntityWrapper<DriverViewInfo>()
+                                .eq("driver_name", tranCarInfo.getDriver())
+                                .eq("delete_flag", "0"));
+                        if (!CollectionUtils.isEmpty(driverViewInfoList)) {
+                            for (DriverViewInfo driverViewInfo : driverViewInfoList) {
+                                List<DriverPayeeInfo> driverPayeeInfoList = driverPayeeInfoService.selectList(new EntityWrapper<DriverPayeeInfo>()
+                                        .eq("driver_id", driverViewInfo.getId())
+                                        .eq("delete_flag", "0"));
+                                if (!CollectionUtils.isEmpty(driverPayeeInfoList)) {
+                                    //本次收款账户
+                                    tranSettlementReport.setCardNo(driverPayeeInfoList.get(0).getBankCard());
+                                }
+                            }
+                        }
+                        tranSettlementReport.setSettlementWeight(tranCarInfo.getLoadNetWeight());
+                        //应付
+                        tranSettlementReport.setAmountIngPayable(tranProcessInfo.getTranPrice() * tranSettlementReport.getSettlementWeight());
+                        //未付
+                        tranSettlementReport.setAmountNotPayable(tranProcessInfo.getTranPrice() * tranSettlementReport.getSettlementWeight());
+                        tranSettlementReport.setTranCarNo(tranCarInfo.getTranCarNo());
+                        tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
+                        tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                        tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
+                        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 {
+
+                            tranSettlementReportService.updateById(tranSettlementReport);
+                            workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
+                        }
+                    }
                 }
-                else {
-                    tranCarInfo.setStatusFlag(StatusEnum.LOADED.getFlag());
-                    tranCarInfo.setStatus(StatusEnum.LOADED.getName());
+                //火运类型
+                else if (tranCarInfo.getTranType().equals(NumberConstant.CONSTANT2)) {
+                    List<TranSettlementReport> tranSettlementReportList = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                            .eq("car_id", tranCarInfo.getId()));
+                    if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
+                        if (tranCarInfo.getUnloadNetWeight() > 0) {
+                            for (TranSettlementReport tranSettlementReport : tranSettlementReportList) {
+                                tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                                tranSettlementReport.setUnloadingWeight(tranCarInfo.getUnloadNetWeight());
+                                tranSettlementReport.setUnloadingImg(tranCarInfo.getUnloadPoundImg());
+                                //损耗
+                                tranSettlementReport.setLossWeight(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight());
+                                tranSettlementReportService.updateById(tranSettlementReport);
+                            }
+                        }
+                    } else {
+                        //生成火运报表
+                        TranSettlementReport tranSettlementReport = new TranSettlementReport();
+                        tranSettlementReport.setCompId(tranTaskInfo.getCompId());
+                        tranSettlementReport.setCarId(tranCarInfo.getId());
+                        tranSettlementReport.setId(IdGenerator.generateUUID());
+                        tranSettlementReport.setTranType("火运");
+                        tranSettlementReport.setTranTypeKey("2");
+                        tranSettlementReport.setContractNo(tranTaskInfo.getContractNo());
+                        tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
+                        tranSettlementReport.setProcessNo(tranProcessInfo.getProcessNo());
+                        tranSettlementReport.setBoxNo(tranCarInfo.getBoxNo());
+                        tranSettlementReport.setSettlementWeight(tranCarInfo.getLoadNetWeight());
+                        tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
+                        tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                        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 {
+
+                            tranSettlementReportService.updateById(tranSettlementReport);
+                            workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
+                        }
+                    }
+                }
+                //船运类型
+                else if (tranCarInfo.getTranType().equals(NumberConstant.CONSTANT3)) {
+                    List<TranSettlementReport> tranSettlementReportList = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                            .eq("car_id", tranCarInfo.getId()));
+                    if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
+                        if (tranCarInfo.getUnloadNetWeight() > 0) {
+                            for (TranSettlementReport tranSettlementReport : tranSettlementReportList) {
+                                tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                                tranSettlementReport.setUnloadingWeight(tranCarInfo.getUnloadNetWeight());
+                                tranSettlementReport.setUnloadingImg(tranCarInfo.getUnloadPoundImg());
+                                //损耗
+                                tranSettlementReport.setLossWeight(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight());
+                                tranSettlementReportService.updateById(tranSettlementReport);
+                            }
+                        }
+                    } else {
+                        //生成船运报表
+                        TranSettlementReport tranSettlementReport = new TranSettlementReport();
+                        tranSettlementReport.setCompId(tranTaskInfo.getCompId());
+                        tranSettlementReport.setCarId(tranCarInfo.getId());
+                        tranSettlementReport.setId(IdGenerator.generateUUID());
+                        tranSettlementReport.setTranType("船运");
+                        tranSettlementReport.setTranTypeKey("3");
+                        tranSettlementReport.setTaskNo(tranTaskInfo.getTaskNo());
+                        tranSettlementReport.setProcessNo(tranProcessInfo.getProcessNo());
+                        if ("集装箱".equals(tranCarInfo.getShipType())){
+                            tranSettlementReport.setBoxNo(tranCarInfo.getCaseNo());
+                        }
+                        else{
+                            tranSettlementReport.setBoxNo(tranCarInfo.getBinNumber());
+                        }
+                        tranSettlementReport.setShipType(tranCarInfo.getShipType());
+                        tranSettlementReport.setContractNo(tranTaskInfo.getContractNo());
+                        tranSettlementReport.setSettlementWeight(tranCarInfo.getLoadNetWeight());
+                        tranSettlementReport.setTranCarNo(tranCarInfo.getTranCarNo());
+                        tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
+                        tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                        tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
+                        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 {
+
+                            tranSettlementReportService.updateById(tranSettlementReport);
+                            workflowService.activateInstance(tranSettlementReport.getWorkflowId(), tranSettlementReport.getId());
+                        }
+                    }
                 }
             }
-            this.updateById(tranCarInfo);
         }
+        this.updateById(tranCarInfo);
         return tranCarInfo.getId();
     }
 

+ 16 - 12
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java

@@ -487,27 +487,31 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
     /**
      * 更改收货反馈状态
      *
-     * @param id
+     * @param tranProcessInfo
      * @return
      */
     @Override
-    public String editReceivingStatus(String id) {
+    public String editReceivingStatus(TranProcessInfo tranProcessInfo) {
         //查询反馈信息
-        TranProcessInfo tranProcessInfo = this.selectById(id);
-        if (tranProcessInfo != null) {
-            if (StatusEnum.FEEDBACK_DO.getFlag().equals(tranProcessInfo.getReceivingStatusFlag())) {
-                tranProcessInfo.setReceivingStatusFlag(StatusEnum.FEEDBACK_COMPLETED.getFlag());
-                tranProcessInfo.setReceivingStatus(StatusEnum.FEEDBACK_COMPLETED.getName());
+        TranProcessInfo tranProcessInfo1 = this.selectById(tranProcessInfo.getId());
+        if (tranProcessInfo1 != null) {
+            if (StatusEnum.FEEDBACK_DO.getFlag().equals(tranProcessInfo1.getReceivingStatusFlag())) {
+                //打入完货净重
+                if (tranProcessInfo.getWeight()!=null){
+                    tranProcessInfo1.setWeight(tranProcessInfo.getWeight());
+                }
+                tranProcessInfo1.setReceivingStatusFlag(StatusEnum.FEEDBACK_COMPLETED.getFlag());
+                tranProcessInfo1.setReceivingStatus(StatusEnum.FEEDBACK_COMPLETED.getName());
             } else {
-                tranProcessInfo.setReceivingStatusFlag(StatusEnum.FEEDBACK_DO.getFlag());
-                tranProcessInfo.setReceivingStatus(StatusEnum.FEEDBACK_DO.getName());
+                tranProcessInfo1.setReceivingStatusFlag(StatusEnum.FEEDBACK_DO.getFlag());
+                tranProcessInfo1.setReceivingStatus(StatusEnum.FEEDBACK_DO.getName());
             }
-            this.updateById(tranProcessInfo);
+            this.updateById(tranProcessInfo1);
             // 插入操作历史
             String staffName = this.billOperateHisService.getStaffAndName();
             // 插入操作历史
-            this.billOperateHisService.saveBillOperateHis(tranProcessInfo.getId(), NumberConstant.CONSTANT_FEEDBACK, staffName, null,
-                    tranProcessInfo.getProcessStatus(), null, "");
+            this.billOperateHisService.saveBillOperateHis(tranProcessInfo1.getId(), NumberConstant.CONSTANT_FEEDBACK, staffName, null,
+                    tranProcessInfo1.getProcessStatus(), null, "");
             return "OK";
         }
         return "NG";

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

@@ -14,7 +14,7 @@
         and m.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
-                AND m.status_flag != '3'
+                AND (m.status_flag != '3' or approve_status='待决策人审核')
             </if>
             <if test="searchType == 2">
                 AND m.status_flag = '3'
@@ -77,7 +77,7 @@
         and m.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
-                AND m.status_flag != '3'
+                AND (m.status_flag != '3' or approve_status='待决策人审核')
             </if>
             <if test="searchType == 2">
                 AND m.status_flag = '3'

+ 4 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CustomerInfoMapper.xml

@@ -23,7 +23,11 @@
         comp_id as compId,
         comp_name as compName,
         customer_name as customerName,
+        customer_type as customerType,
         customer_type_flag as customerTypeFlag,
+        advance_payment as advancePayment,
+        security_deposit as securityDeposit,
+        payee_name as payeeName,
         comp_address as compAddress,
         customer_phone as customerPhone,
         pay_taxes_card as payTaxesCard,

+ 4 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml

@@ -26,8 +26,8 @@
                 AND amount_ed_payable=amount_ing_payable
             </if>
             <if test="searchType == 7">
-                AND status='已通过'
-                or status='部分付款'
+                AND (status='已通过'
+                or status='部分付款')
             </if>
         </if>
         <if test="warehouseName != null and warehouseName != ''">
@@ -127,8 +127,8 @@
                 AND amount_ed_payable=amount_ing_payable
             </if>
             <if test="searchType == 7">
-                AND status='已通过'
-                or status='部分付款'
+                AND (status='已通过'
+                or status='部分付款')
             </if>
         </if>
         <if test="managementType != null and managementType != ''">