소스 검색

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

ccj 2 년 전
부모
커밋
77d66348e5
25개의 변경된 파일808개의 추가작업 그리고 660개의 파일을 삭제
  1. 0 136
      src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ShortFillingInfo.java
  2. 0 16
      src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/ShortFillingInfoMapper.java
  3. 0 16
      src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IShortFillingInfoService.java
  4. 0 20
      src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ShortFillingInfoServiceImpl.java
  5. 1 1
      winsea-haixin-platform-backend/src/main/resources/application.yml
  6. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java
  7. 4 4
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BatchReviewInfoController.java
  8. 9 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TranSettlementReportController.java
  9. 68 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/BatchReviewInfo.java
  10. 4 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TranSettlementReport.java
  11. 10 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehousingOrder.java
  12. 8 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/ExportVView.java
  13. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/BatchReviewInfoMapper.java
  14. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IBatchReviewInfoService.java
  15. 2 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ITranSettlementReportService.java
  16. 20 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/BatchReviewInfoServiceImpl.java
  17. 372 289
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranProcessInfoServiceImpl.java
  18. 19 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranSettlementReportServiceImpl.java
  19. 128 106
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java
  20. 54 53
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java
  21. 11 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java
  22. 55 14
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranSettlementReportListener.java
  23. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/BatchReviewInfoMapper.xml
  24. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml
  25. 4 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousingOrderMapper.xml

+ 0 - 136
src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ShortFillingInfo.java

@@ -1,136 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.entity;
-
-import java.util.Date;
-import com.baomidou.mybatisplus.activerecord.Model;
-import BaseModel;
-import java.io.Serializable;
-
-import com.baomidou.mybatisplus.annotations.Version;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * <p>
- * 记录短途加油信息
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
-public class ShortFillingInfo extends BaseModel<ShortFillingInfo> {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键id
-     */
-    private String id;
-    /**
-     * 公司id
-     */
-    private String compId;
-    /**
-     * 用户id
-     */
-    private String commonId;
-    /**
-     * 加油id
-     */
-    private String fillingId;
-    /**
-     * 车牌号
-     */
-    private String carNo;
-    /**
-     * 仓库名称
-     */
-    private String warehouseName;
-    /**
-     * 发货库
-     */
-    private String sendWarehouse;
-    /**
-     * 收货库
-     */
-    private String receiveWarehouse;
-    /**
-     * 始发地省
-     */
-    private String originProvince;
-    /**
-     * 始发地市
-     */
-    private String originCity;
-    /**
-     * 始发地区
-     */
-    private String originArea;
-    /**
-     * 始发地经度
-     */
-    private String originLongitude;
-    /**
-     * 始发地纬度
-     */
-    private String originLatitude;
-    /**
-     * 终到地省
-     */
-    private String destinationProvince;
-    /**
-     * 终到地市
-     */
-    private String destinationCity;
-    /**
-     * 终到地区
-     */
-    private String destinationArea;
-    /**
-     * 终到地经度
-     */
-    private String destinationLongitude;
-    /**
-     * 终到地纬度
-     */
-    private String destinationLatitude;
-    /**
-     * 请款日期
-     */
-    private Date amountDeadline;
-    /**
-     * 里程(公里)
-     */
-    private Double mileage;
-    /**
-     * 请款金额(元)
-     */
-    private Double amountRequested;
-    /**
-     * 行程状态(1已开始3已结束5已报销)
-     */
-    private String travelStatus;
-    /**
-     * 行程状态标识
-     */
-    private String travelStatusFlag;
-    /**
-     * 审核状态
-     */
-    private String approveStatus;
-    /**
-     * 工作流ID
-     */
-    private String workflowId;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 16
src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/ShortFillingInfoMapper.java

@@ -1,16 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.mapper;
-
-import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
-
-/**
- * <p>
- * 记录短途加油信息 Mapper 接口
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-public interface ShortFillingInfoMapper extends BaseMapper<ShortFillingInfo> {
-
-}

+ 0 - 16
src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IShortFillingInfoService.java

@@ -1,16 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.service;
-
-import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
-import com.baomidou.mybatisplus.service.IService;
-
-/**
- * <p>
- * 记录短途加油信息 服务类
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-public interface IShortFillingInfoService extends IService<ShortFillingInfo> {
-
-}

+ 0 - 20
src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ShortFillingInfoServiceImpl.java

@@ -1,20 +0,0 @@
-package com.yh.saas.plugin.yiliangyiyun.service.impl;
-
-import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
-import com.yh.saas.plugin.yiliangyiyun.mapper.ShortFillingInfoMapper;
-import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 记录短途加油信息 服务实现类
- * </p>
- *
- * @author Gdc
- * @since 2022-07-07
- */
-@Service
-public class ShortFillingInfoServiceImpl extends ServiceImpl<ShortFillingInfoMapper, ShortFillingInfo> implements IShortFillingInfoService {
-
-}

+ 1 - 1
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -12,7 +12,7 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
   profiles:
-    active: prod
+    active: local
   resources:
     static-locations: file:///winsea/static/
   thymeleaf:

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

@@ -53,7 +53,7 @@ public class GeneratorCodeByTables {
     }
 
     public static void main(String[] args) throws IOException {
-        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","short_filling_info");
+        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","batch_review_info");
     }
 
     /**

+ 4 - 4
src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/ShortFillingInfoController.java → winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BatchReviewInfoController.java

@@ -7,15 +7,15 @@ import org.springframework.web.bind.annotation.RestController;
 
 /**
  * <p>
- * 记录短途加油信息 前端控制器
+ * 批次审核信息 前端控制器
  * </p>
  *
  * @author Gdc
- * @since 2022-07-07
+ * @since 2022-09-03
  */
 @RestController
-@RequestMapping("/shortFillingInfo")
-public class ShortFillingInfoController {
+@RequestMapping("/batchReviewInfo")
+public class BatchReviewInfoController {
 
 }
 

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

@@ -23,6 +23,15 @@ import java.util.List;
 public class TranSettlementReportController {
     @Autowired
     private ITranSettlementReportService tranSettlementReportService;
+    /**
+     * 审核数据
+     * @param tranSettlementReport
+     * @return
+     */
+    @GetMapping("/getTranSettlementReport")
+    public List<TranSettlementReport> getTranSettlementReport(TranSettlementReport tranSettlementReport){
+        return tranSettlementReportService.getTranSettlementReport(tranSettlementReport);
+    }
     /**
      * 汽运结算统计报表
      * @param tranSettlementReport

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

@@ -0,0 +1,68 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 批次审核信息
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("batch_review_info")
+public class BatchReviewInfo extends BaseModel<BatchReviewInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 状态标识
+     */
+    private String statusFlag;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 状态英文
+     */
+    private String statusEn;
+    /**
+     * 审核状态
+     */
+    private String approveStatus;
+    /**
+     * 审核流id
+     */
+    private String workflowId;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

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

@@ -177,6 +177,10 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      * 银行卡号
      */
     private String cardNo;
+    /**
+     * 批次id
+     */
+    private String batchId;
     /**
      * 通过1驳回2
      */

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

@@ -166,6 +166,16 @@ public class WarehousingOrder extends BaseModel<WarehousingOrder> {
      * 请款
      */
     private Double requestFunds;
+    /**
+     * 请款人
+     */
+    private String requestPerson;
+    /**
+     * 请款日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date requestDate;
     /**
      * 客户
      */

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

@@ -271,5 +271,13 @@ public class ExportVView {
      * 运费
      */
     private Float freight;
+    /**
+     * 出入库任务编号
+     */
+    private String inOutTaskNo;
+    /**
+     * 备注
+     */
+    private String remark;
 
 }

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/BatchReviewInfoMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 批次审核信息 Mapper 接口
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+public interface BatchReviewInfoMapper extends BaseMapper<BatchReviewInfo> {
+
+}

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

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 批次审核信息 服务类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+public interface IBatchReviewInfoService extends IService<BatchReviewInfo> {
+
+}

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

@@ -16,6 +16,8 @@ import java.util.List;
  * @since 2021-08-27
  */
 public interface ITranSettlementReportService extends IService<TranSettlementReport> {
+
+    List<TranSettlementReport> getTranSettlementReport(TranSettlementReport tranSettlementReport);
     /**
      * 汽运结算统计报表
      *

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

@@ -0,0 +1,20 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
+import com.yh.saas.plugin.yiliangyiyun.mapper.BatchReviewInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IBatchReviewInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 批次审核信息 服务实现类
+ * </p>
+ *
+ * @author Gdc
+ * @since 2022-09-03
+ */
+@Service
+public class BatchReviewInfoServiceImpl extends ServiceImpl<BatchReviewInfoMapper, BatchReviewInfo> implements IBatchReviewInfoService {
+
+}

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

@@ -75,6 +75,8 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
     private ICommonStaffRoleService commonStaffRoleService;
+    @Autowired
+    private IBatchReviewInfoService batchReviewInfoService;
     /**
      * 汽运调度分页列表查询
      *
@@ -205,6 +207,9 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
     public String insertTranCar(TranProcessInfo tranProcessInfo) {
         this.updateById(tranProcessInfo);
         List<TranCarInfo> tranCarInfoList = tranProcessInfo.getTranCarInfoList();
+        BatchReviewInfo batchReviewInfo = new BatchReviewInfo();
+        batchReviewInfo.setId(IdGenerator.generateUUID());
+        String flagBatch = "0";
         if (!CollectionUtils.isEmpty(tranCarInfoList)) {
             for (TranCarInfo tranCarInfo : tranCarInfoList) {
                 if (tranCarInfo.getLoadNetWeight() == null) {
@@ -254,34 +259,34 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                         tranCarInfo.setContractNo(tranTaskInfo.getContractNo());
                         //汽运类型
                         if (tranCarInfo.getTranType().equals(NumberConstant.CONSTANT1)) {
-                            List<TranSettlementReport> tranSettlementReportList = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                            TranSettlementReport tranSettlementReport1 = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
                                     .eq("car_id", tranCarInfo.getId()));
-                            if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
-                                if (tranCarInfo.getUnloadNetWeight() > 0&&tranProcessInfo.getFlag()!=null) {
-                                    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);
-                                    }
-                                }
+                            if (tranSettlementReport1!=null) {
+//                                if (tranCarInfo.getLoadNetWeight() > 0&&tranProcessInfo.getFlag()!=null) {
+//                                    for (TranSettlementReport tranSettlementReport : tranSettlementReportList) {
+                                        tranSettlementReport1.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(tranSettlementReport1);
+//                                    }
+//                                }
                             } else {
                                 //生成汽运报表
                                 TranSettlementReport tranSettlementReport = new TranSettlementReport();
@@ -319,48 +324,36 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                 tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
                                 tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
                                 tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
+                                tranSettlementReport.setBatchId(batchReviewInfo.getId());
                                 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());
-                                }
+                                flagBatch = "1";
+//                                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 if (tranCarInfo.getTranType().equals(NumberConstant.CONSTANT2)) {
-                            List<TranSettlementReport> tranSettlementReportList = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                            TranSettlementReport tranSettlementReport1 = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
                                     .eq("car_id", tranCarInfo.getId()));
-                            if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
-                                if (tranCarInfo.getUnloadNetWeight() > 0&&tranProcessInfo.getFlag()!=null) {
-                                    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);
-                                    }
-                                }
+                            if (tranSettlementReport1!=null) {
+                                tranSettlementReport1.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                                tranSettlementReportService.updateById(tranSettlementReport1);
                             } else {
                                 //生成火运报表
                                 TranSettlementReport tranSettlementReport = new TranSettlementReport();
@@ -374,55 +367,24 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                 tranSettlementReport.setProcessNo(tranProcessInfo.getProcessNo());
                                 tranSettlementReport.setBoxNo(tranCarInfo.getBoxNo());
                                 tranSettlementReport.setSettlementWeight(tranCarInfo.getLoadNetWeight());
-                                TranProcessInfo tranProcessInfo1=this.selectById(tranProcessInfo.getId());
+                                TranProcessInfo tranProcessInfo1 = this.selectById(tranProcessInfo.getId());
                                 //应付
                                 tranSettlementReport.setAmountIngPayable(tranProcessInfo1.getTranPrice());
                                 //未付
                                 tranSettlementReport.setAmountNotPayable(tranProcessInfo1.getTranPrice());
                                 tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
                                 tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                                tranSettlementReport.setBatchId(batchReviewInfo.getId());
                                 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());
-                                }
+                                flagBatch = "1";
                             }
-                        }
+                         }
                         //船运类型
                         else if (tranCarInfo.getTranType().equals(NumberConstant.CONSTANT3)) {
-                            List<TranSettlementReport> tranSettlementReportList = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                            TranSettlementReport tranSettlementReport1 = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
                                     .eq("car_id", tranCarInfo.getId()));
-                            if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
-                                if (tranCarInfo.getUnloadNetWeight() > 0&&tranProcessInfo.getFlag()!=null) {
-                                    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);
-                                    }
-                                }
+                            if (tranSettlementReport1!=null) {
+                                tranSettlementReport1.setLoadingImg(tranCarInfo.getLoadPoundImg());
                             } else {
                                 //生成船运报表
                                 TranSettlementReport tranSettlementReport = new TranSettlementReport();
@@ -451,31 +413,9 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                                 tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
                                 tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
                                 tranSettlementReport.setTransportPrice(tranProcessInfo.getTranPrice());
+                                tranSettlementReport.setBatchId(batchReviewInfo.getId());
                                 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());
-                                }
+                                flagBatch = "1";
                             }
                         }
                     }
@@ -483,188 +423,297 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                     else if (tranCarInfo.getUnloadNetWeight() > 0) {
                         tranCarInfo.setStatusFlag(StatusEnum.DELIVERED.getFlag());
                         tranCarInfo.setStatus(StatusEnum.DELIVERED.getName());
-                        TranProcessInfo tranProcessInfo1 = this.selectById(tranProcessInfo.getId());
-                        //粮款结算阶段
-//                        if ("1".equals(tranProcessInfo1.getEndFlag())) {
-                            CommonStaff commonStaff = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
-                            //自运的销售合同
-                            ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
-                                    .eq("contract_no", tranProcessInfo1.getContractNo())
-                                    .eq("deliver_type", "1")
+                        //卸车反馈时更新报表卸车数据
+                        TranSettlementReport tranSettlementReport1 = tranSettlementReportService.selectOne(new EntityWrapper<TranSettlementReport>()
+                                    .eq("car_id", tranCarInfo.getId()));
+                        if (tranSettlementReport1!=null) {
+                            if (tranCarInfo.getUnloadNetWeight() > 0&&tranProcessInfo.getFlag()!=null) {
+                                tranSettlementReport1.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                                tranSettlementReport1.setUnloadingWeight(tranCarInfo.getUnloadNetWeight());
+                                tranSettlementReport1.setUnloadingImg(tranCarInfo.getUnloadPoundImg());
+                                //损耗
+                                tranSettlementReport1.setLossWeight(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight());
+                                //汽运类型
+                                if (tranCarInfo.getTranType().equals(NumberConstant.CONSTANT1)) {
+                                    //结算重量
+                                    if ("0".equals(tranSettlementReport1.getManualFlag())) {
+                                        //卸车不为空时,结算重量=装卸取小
+                                        tranSettlementReport1.setSettlementWeight(tranCarInfo.getLoadNetWeight() > tranCarInfo.getUnloadNetWeight() ? tranCarInfo.getUnloadNetWeight() : tranCarInfo.getLoadNetWeight());
+                                    }
+                                    //扣款
+                                    if (tranSettlementReport1.getLossWeight() <= (tranCarInfo.getLoadNetWeight() / 1000)) {
+                                        tranSettlementReport1.setDeductionAmount("0");
+                                        //应付=单价x结算重量-扣款
+                                        tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight());
+                                    } else {
+                                        tranSettlementReport1.setDeductionAmount(String.format("%.2f", (Float.valueOf(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight()) - (tranCarInfo.getLoadNetWeight() / 1000)) * Float.valueOf(tranCarInfo.getTranPrice())));
+                                        //应付=单价x结算重量-扣款
+                                        tranSettlementReport1.setAmountIngPayable(tranSettlementReport1.getTransportPrice() * tranSettlementReport1.getSettlementWeight() - Float.valueOf(tranSettlementReport1.getDeductionAmount()));
+                                    }
+                                }
+                                tranSettlementReportService.updateById(tranSettlementReport1);
+                                }
+                            }
+                        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 (contractManagementInfo != null) {
-                                if ("汽运".equals(tranProcessInfo1.getTranType())) {
-                                    StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
-                                            .eq("process_id", tranProcessInfo1.getId())
-                                            .eq("tran_car_no", tranCarInfo.getTranCarNo()));
-                                    if (stockSaleReceiptReport != null) {
-                                        //现货销售出库报表
-                                        stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
-                                        stockSaleReceiptReport.setFeedbackDate(new Date());
-                                        stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                        //按收货重量结算时
-                                        if("2".equals(contractManagementInfo.getSettlementWeightMethod())){
-                                            stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                            //定价销售
-                                            if(contractManagementInfo.getUnitContractPrice()!=null) {
-                                                stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
-                                                stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
-                                                        (contractManagementInfo.getUnitContractPrice()));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
-                                            //随行就市
-                                            else {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                            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.setTranCarNo(tranCarInfo.getTranCarNo());
+                            tranSettlementReport.setLoadingWeight(tranCarInfo.getLoadNetWeight());
+                            tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                            tranSettlementReport.setTransportPrice(Float.valueOf(tranCarInfo.getTranPrice()));
+                            tranSettlementReport.setLoadingImg(tranCarInfo.getLoadPoundImg());
+                            tranSettlementReport.setUnloadingWeight(tranCarInfo.getUnloadNetWeight());
+                            tranSettlementReport.setUnloadingImg(tranCarInfo.getUnloadPoundImg());
+                            //损耗
+                            tranSettlementReport.setLossWeight(tranCarInfo.getLoadNetWeight() - tranCarInfo.getUnloadNetWeight());
+                            //扣款
+                            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()));
+                            }
+                            //未付
+                            tranSettlementReport.setAmountNotPayable(tranSettlementReport.getAmountIngPayable());
+                            tranSettlementReport.setBatchId(batchReviewInfo.getId());
+                            tranSettlementReportService.insert(tranSettlementReport);
+                            flagBatch="1";
+//                            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());
+//                            }
+                        }
+                    }
+                    TranProcessInfo tranProcessInfo1 = this.selectById(tranProcessInfo.getId());
+                    //粮款结算阶段
+//                  if ("1".equals(tranProcessInfo1.getEndFlag())) {
+                    CommonStaff commonStaff = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
+                    //自运的销售合同
+                    ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                            .eq("contract_no", tranProcessInfo1.getContractNo())
+                            .eq("deliver_type", "1")
+                            .eq("delete_flag", "0"));
+                    if (contractManagementInfo != null) {
+                            if ("汽运".equals(tranProcessInfo1.getTranType())) {
+                                StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
+                                        .eq("process_id", tranProcessInfo1.getId())
+                                        .eq("tran_car_no", tranCarInfo.getTranCarNo()));
+                                if (stockSaleReceiptReport != null) {
+                                    //现货销售出库报表
+                                    stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
+                                    stockSaleReceiptReport.setFeedbackDate(new Date());
+                                    stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                    //按收货重量结算时
+                                    if("2".equals(contractManagementInfo.getSettlementWeightMethod())&&tranCarInfo.getUnloadNetWeight() > 0){
+                                        stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                        //定价销售
+                                        if(contractManagementInfo.getUnitContractPrice()!=null) {
+                                            stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
+                                            stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
+                                                    (contractManagementInfo.getUnitContractPrice()));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        //按出库重量结算时
-                                        else{
-                                            //随行就市
-                                            if(contractManagementInfo.getUnitContractPrice()==null) {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
-                                                        (tranCarInfo.getContractPrice()))));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                                        //随行就市
+                                        else {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                     }
+                                    //按出库重量结算时
+                                    else if("1".equals(contractManagementInfo.getSettlementWeightMethod())){
+                                        //随行就市
+                                        if(contractManagementInfo.getUnitContractPrice()==null) {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
+                                                    (tranCarInfo.getContractPrice()))));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
+                                        }
+                                    }
+                                    stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                 }
-                                else if ("火运".equals(tranProcessInfo1.getTranType())) {
-                                    StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
-                                            .eq("process_id", tranProcessInfo1.getId())
-                                            .eq("car_no", tranCarInfo.getCarNo())
-                                            .eq("box_no", tranCarInfo.getBoxNo()));
-                                    if (stockSaleReceiptReport != null) {
-                                        //现货销售出库报表
-                                        stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
-                                        stockSaleReceiptReport.setFeedbackDate(new Date());
-                                        stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                        //按收货重量结算时
-                                        if("1".equals(contractManagementInfo.getSettlementWeightMethod())){
-                                            stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                            //定价销售
-                                            if(contractManagementInfo.getUnitContractPrice()!=null) {
-                                                stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
-                                                stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
-                                                        (contractManagementInfo.getUnitContractPrice()));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
-                                            //随行就市
-                                            else {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                            }
+                            else if ("火运".equals(tranProcessInfo1.getTranType())) {
+                                StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
+                                        .eq("process_id", tranProcessInfo1.getId())
+                                        .eq("car_no", tranCarInfo.getCarNo())
+                                        .eq("box_no", tranCarInfo.getBoxNo()));
+                                if (stockSaleReceiptReport != null) {
+                                    //现货销售出库报表
+                                    stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
+                                    stockSaleReceiptReport.setFeedbackDate(new Date());
+                                    stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                    //按收货重量结算时
+                                    if("1".equals(contractManagementInfo.getSettlementWeightMethod())){
+                                        stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                        //定价销售
+                                        if(contractManagementInfo.getUnitContractPrice()!=null) {
+                                            stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
+                                            stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
+                                                    (contractManagementInfo.getUnitContractPrice()));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
+                                        }
+                                        //随行就市
+                                        else {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        //按出库重量结算时
-                                        else{
-                                            //随行就市
-                                            if(contractManagementInfo.getUnitContractPrice()==null) {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
-                                                        (tranCarInfo.getContractPrice()))));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                                    }
+                                    //按出库重量结算时
+                                    else{
+                                        //随行就市
+                                        if(contractManagementInfo.getUnitContractPrice()==null) {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
+                                                    (tranCarInfo.getContractPrice()))));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                     }
+                                    stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                 }
-                                else if (tranCarInfo.getShipType() != null && "散船".equals(tranCarInfo.getShipType())) {
-                                    StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
-                                            .eq("process_id", tranProcessInfo1.getId())
-                                            .eq("ship_no", tranCarInfo.getShipNo())
-                                            .eq("ship_name", tranCarInfo.getShipName()));
-                                    if (stockSaleReceiptReport != null) {
-                                        //现货销售出库报表
-                                        stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
-                                        stockSaleReceiptReport.setFeedbackDate(new Date());
-                                        stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                        //按收货重量结算时
-                                        if("1".equals(contractManagementInfo.getSettlementWeightMethod())){
-                                            stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                            //定价销售
-                                            if(contractManagementInfo.getUnitContractPrice()!=null) {
-                                                stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
-                                                stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
-                                                        (contractManagementInfo.getUnitContractPrice()));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
-                                            //随行就市
-                                            else {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                            }
+                            else if (tranCarInfo.getShipType() != null && "散船".equals(tranCarInfo.getShipType())) {
+                                StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
+                                        .eq("process_id", tranProcessInfo1.getId())
+                                        .eq("ship_no", tranCarInfo.getShipNo())
+                                        .eq("ship_name", tranCarInfo.getShipName()));
+                                if (stockSaleReceiptReport != null) {
+                                    //现货销售出库报表
+                                    stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
+                                    stockSaleReceiptReport.setFeedbackDate(new Date());
+                                    stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                    //按收货重量结算时
+                                    if("1".equals(contractManagementInfo.getSettlementWeightMethod())){
+                                        stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                        //定价销售
+                                        if(contractManagementInfo.getUnitContractPrice()!=null) {
+                                            stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
+                                            stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
+                                                    (contractManagementInfo.getUnitContractPrice()));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        //按出库重量结算时
-                                        else{
-                                            //随行就市
-                                            if(contractManagementInfo.getUnitContractPrice()==null) {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
-                                                        (tranCarInfo.getContractPrice()))));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                                        //随行就市
+                                        else {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
+                                        }
+                                    }
+                                    //按出库重量结算时
+                                    else{
+                                        //随行就市
+                                        if(contractManagementInfo.getUnitContractPrice()==null) {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
+                                                    (tranCarInfo.getContractPrice()))));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                     }
+                                    stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                 }
-                                else if (tranCarInfo.getShipType() != null && "集装箱".equals(tranCarInfo.getShipType())) {
-                                    StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
-                                            .eq("process_id", tranProcessInfo1.getId())
-                                            .eq("title_no", tranCarInfo.getTitleNo())
-                                            .eq("case_no", tranCarInfo.getCaseNo()));
-                                    if (stockSaleReceiptReport != null) {
-                                        //现货销售出库报表
-                                        stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
-                                        stockSaleReceiptReport.setFeedbackDate(new Date());
-                                        stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                        //按收货重量结算时
-                                        if("1".equals(contractManagementInfo.getSettlementWeightMethod())){
-                                            stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
-                                            //定价销售
-                                            if(contractManagementInfo.getUnitContractPrice()!=null) {
-                                                stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
-                                                stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
-                                                        (contractManagementInfo.getUnitContractPrice()));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
-                                            //随行就市
-                                            else {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                            }
+                            else if (tranCarInfo.getShipType() != null && "集装箱".equals(tranCarInfo.getShipType())) {
+                                StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
+                                        .eq("process_id", tranProcessInfo1.getId())
+                                        .eq("title_no", tranCarInfo.getTitleNo())
+                                        .eq("case_no", tranCarInfo.getCaseNo()));
+                                if (stockSaleReceiptReport != null) {
+                                    //现货销售出库报表
+                                    stockSaleReceiptReport.setFeedbackPerson(commonStaff.getStaffName());
+                                    stockSaleReceiptReport.setFeedbackDate(new Date());
+                                    stockSaleReceiptReport.setFeedbackWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                    //按收货重量结算时
+                                    if("1".equals(contractManagementInfo.getSettlementWeightMethod())){
+                                        stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight())));
+                                        //定价销售
+                                        if(contractManagementInfo.getUnitContractPrice()!=null) {
+                                            stockSaleReceiptReport.setSettlementPrice(contractManagementInfo.getUnitContractPrice());
+                                            stockSaleReceiptReport.setAmountIngReceivable(tranCarInfo.getUnloadNetWeight()*
+                                                    (contractManagementInfo.getUnitContractPrice()));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
+                                        }
+                                        //随行就市
+                                        else {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(tranCarInfo.getUnloadNetWeight() *tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        //按出库重量结算时
-                                        else{
-                                            //随行就市
-                                            if(contractManagementInfo.getUnitContractPrice()==null) {
-                                                stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
-                                                stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
-                                                        (tranCarInfo.getContractPrice()))));
-                                                stockSaleReceiptReport.setAmountEdReceivable(0.00);
-                                                stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
-                                            }
+                                    }
+                                    //按出库重量结算时
+                                    else{
+                                        //随行就市
+                                        if(contractManagementInfo.getUnitContractPrice()==null) {
+                                            stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(tranCarInfo.getContractPrice())));
+                                            stockSaleReceiptReport.setAmountIngReceivable(Double.valueOf(String.valueOf(stockSaleReceiptReport.getSettlementWeight()*
+                                                    (tranCarInfo.getContractPrice()))));
+                                            stockSaleReceiptReport.setAmountEdReceivable(0.00);
+                                            stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
                                         }
-                                        stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                     }
+                                    stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
                                 }
                             }
+                        }
                     }
                     //船运集装箱
                     if (tranCarInfoList.get(0).getTranType().equals(NumberConstant.CONSTANT3)&&"集装箱".equals(tranCarInfoList.get(0).getShipType())) {
@@ -682,6 +731,40 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                     }
                     tranCarInfoService.updateById(tranCarInfo);
                 }
+            // 批次开启审核流
+            if("1".equals(flagBatch)){
+                batchReviewInfoService.insert(batchReviewInfo);
+                boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(batchReviewInfo.getWorkflowId());
+                // 不是退回的单子
+                if (isStartWorkflow) {
+                    Workflow workflow = workflowService
+                            .findLatestWorkflowByBusinessCodeByApp(batchReviewInfo.getCompId(), "TRANSPORTATION-SETTLEMENT-REPORT");
+                    // 没配置审核流程,直接结束并处理信息
+                    if (workflow == null) {
+                        throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
+                    }
+                    // 开启审核流
+                    else {
+
+                        // 设置状态 已提交审核
+                        batchReviewInfo.setWorkflowId(workflow.getId());
+                        batchReviewInfoService.updateById(batchReviewInfo);
+                        workflowService.startInstance(workflow.getId(), batchReviewInfo.getId());
+                    }
+                }
+                //  更新详细状态
+                batchReviewInfo = batchReviewInfoService.selectById(batchReviewInfo.getId());
+                List<TranSettlementReport> tranSettlementReports = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                        .eq("batch_id",batchReviewInfo.getId()));
+                if(!CollectionUtils.isEmpty(tranSettlementReports)){
+                    for(int i=0;i<tranSettlementReports.size();i++){
+                        TranSettlementReport settlementReport = tranSettlementReports.get(i);
+                        settlementReport.setWorkflowId(batchReviewInfo.getWorkflowId());
+                        settlementReport.setStatus(batchReviewInfo.getStatus());
+                        settlementReport.setApproveStatus(batchReviewInfo.getApproveStatus());
+                    }
+                    tranSettlementReportService.insertBatch(tranSettlementReports);
+                }
             }
         }
         return tranProcessInfo.getId();

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

@@ -59,6 +59,22 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
     @Autowired
     private IInOutWarehouseTaskService inOutWarehouseTaskService;
 
+
+
+    /**
+     * 审核数据
+     *
+     * @param tranSettlementReport
+     * @return
+     */
+    @Override
+    public List<TranSettlementReport> getTranSettlementReport(TranSettlementReport tranSettlementReport) {
+
+        List<TranSettlementReport> tranSettlementReports = this.selectList(new EntityWrapper<TranSettlementReport>()
+        .eq("batch_id",tranSettlementReport.getBatchId()));
+        return tranSettlementReports;
+    }
+
     /**
      * 汽运结算统计列表
      *
@@ -121,8 +137,9 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
                 }
                 String taskId = "";
                 // 只有待审核状态才有taskId
-                if (StringUtils.isNotBlank(tranSettlementReport1.getWorkflowId())) {
-                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tranSettlementReport1.getWorkflowId()), tranSettlementReport1.getId());
+                if (StringUtils.isNotBlank(tranSettlementReport1.getWorkflowId())&&StringUtils.isNotBlank(tranSettlementReport1.getBatchId())) {
+
+                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tranSettlementReport1.getWorkflowId()), tranSettlementReport1.getBatchId());
                     taskId = jsonObject.getString("taskId");
                     tranSettlementReport1.setTaskId(taskId);
                 }

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

@@ -3886,10 +3886,10 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(8, 12 * 256 + 184);
         sheet.setColumnWidth(9, 12 * 256 + 184);
         sheet.setColumnWidth(10, 12 * 256 + 184);
-        sheet.setColumnWidth(11, "客户".getBytes().length * 6 * 256);
-        sheet.setColumnWidth(12, "货名".getBytes().length * 3 * 256);
+        sheet.setColumnWidth(11, 12 * 256 + 184);
+        sheet.setColumnWidth(12, "客户".getBytes().length * 6 * 256);
         sheet.setColumnWidth(13, 12 * 256 + 184);
-        sheet.setColumnWidth(14, 12 * 256 + 184);
+        sheet.setColumnWidth(14, "货名".getBytes().length * 3 * 256);
         sheet.setColumnWidth(15, 12 * 256 + 184);
         sheet.setColumnWidth(16, 12 * 256 + 184);
         sheet.setColumnWidth(17, 12 * 256 + 184);
@@ -3909,9 +3909,9 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(31, 12 * 256 + 184);
         sheet.setColumnWidth(32, 12 * 256 + 184);
         sheet.setColumnWidth(33, 12 * 256 + 184);
-        sheet.setColumnWidth(34, "反馈日期".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(34, 12 * 256 + 184);
         sheet.setColumnWidth(35, 12 * 256 + 184);
-        sheet.setColumnWidth(36, 12 * 256 + 184);
+        sheet.setColumnWidth(36, "反馈日期".getBytes().length * 2 * 256);
         sheet.setColumnWidth(37, 12 * 256 + 184);
         sheet.setColumnWidth(38, 12 * 256 + 184);
         sheet.setColumnWidth(39, 12 * 256 + 184);
@@ -3919,10 +3919,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(41, 12 * 256 + 184);
         sheet.setColumnWidth(42, 12 * 256 + 184);
         sheet.setColumnWidth(43, 12 * 256 + 184);
-        sheet.setColumnWidth(44, "收款日期".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(44, 12 * 256 + 184);
         sheet.setColumnWidth(45, 12 * 256 + 184);
-        sheet.setColumnWidth(46, 12 * 256 + 184);
-        sheet.setColumnWidth(47, 1 * 256 + 184);
+        sheet.setColumnWidth(46, "收款日期".getBytes().length * 2 * 256);
+        sheet.setColumnWidth(47, 12 * 256 + 184);
+        sheet.setColumnWidth(48, 12 * 256 + 184);
+        sheet.setColumnWidth(49, 1 * 256 + 184);
 
         // 创建单元格对象
         HSSFCell cell = null;
@@ -4036,6 +4038,10 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellStyle(styleTitle);
         cell = row0.createCell(46);
         cell.setCellStyle(styleTitle);
+        cell = row0.createCell(47);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(48);
+        cell.setCellStyle(styleTitle);
         rownum++;
 
         Map<String, Object> pageView = new HashMap<>();
@@ -4105,39 +4111,39 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             cell = rowp.createCell(9);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(10);
+            cell.setCellStyle(styleDetail);
+            cell = rowp.createCell(11);
             cell.setCellValue(netWeightPriceTotal / dataList.size());
             cell.setCellStyle(contextstyle1);
-            cell = rowp.createCell(11);
-            cell.setCellStyle(styleDetail);
             cell = rowp.createCell(12);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(13);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(14);
             cell.setCellStyle(styleDetail);
-            //水分平均值
             cell = rowp.createCell(15);
+            cell.setCellStyle(styleDetail);
+            cell = rowp.createCell(16);
+            cell.setCellStyle(styleDetail);
+            //水分平均值
+            cell = rowp.createCell(17);
             cell.setCellStyle(contextstyle1);
             cell.setCellValue(waterContentTotal / netWeightTmp);
-            cell = rowp.createCell(16);
+            cell = rowp.createCell(18);
             cell.setCellValue(impurityTotal / netWeightTmp);
             cell.setCellStyle(contextstyle1);
-            cell = rowp.createCell(17);
+            cell = rowp.createCell(19);
             cell.setCellValue(mildewGrainTotal / netWeightTmp);
             cell.setCellStyle(contextstyle1);
-            cell = rowp.createCell(18);
+            cell = rowp.createCell(20);
             cell.setCellValue(imperfectGrainTotal / netWeightTmp);
             cell.setCellStyle(contextstyle1);
-            cell = rowp.createCell(19);
+            cell = rowp.createCell(21);
             cell.setCellValue(bulkDensityTotal / netWeightTmp);
             cell.setCellStyle(contextstyle1);
-            cell = rowp.createCell(20);
+            cell = rowp.createCell(22);
             cell.setCellValue(jiaorenliTotal / netWeightTmp);
             cell.setCellStyle(contextstyle1);
-            cell = rowp.createCell(21);
-            cell.setCellStyle(styleDetail);
-            cell = rowp.createCell(22);
-            cell.setCellStyle(styleDetail);
             cell = rowp.createCell(23);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(24);
@@ -4151,20 +4157,20 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             cell = rowp.createCell(28);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(29);
-            cell.setCellValue(dataList.size());
-            cell.setCellStyle(styleDetail1);
+            cell.setCellStyle(styleDetail);
             cell = rowp.createCell(30);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(31);
-            cell.setCellStyle(styleDetail);
-            //纯重合计
+            cell.setCellValue(dataList.size());
+            cell.setCellStyle(styleDetail1);
             cell = rowp.createCell(32);
-            cell.setCellValue(netWeightTotal);
-            cell.setCellStyle(contextstyle1);
+            cell.setCellStyle(styleDetail);
             cell = rowp.createCell(33);
             cell.setCellStyle(styleDetail);
+            //纯重合计
             cell = rowp.createCell(34);
-            cell.setCellStyle(styleDetail);
+            cell.setCellValue(netWeightTotal);
+            cell.setCellStyle(contextstyle1);
             cell = rowp.createCell(35);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(36);
@@ -4178,18 +4184,22 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             cell = rowp.createCell(40);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(41);
-            cell.setCellValue(amountIngPayableTotal);
-            cell.setCellStyle(contextstyle1);
+            cell.setCellStyle(styleDetail);
             cell = rowp.createCell(42);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(43);
-            cell.setCellStyle(styleDetail);
+            cell.setCellValue(amountIngPayableTotal);
+            cell.setCellStyle(contextstyle1);
             cell = rowp.createCell(44);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(45);
             cell.setCellStyle(styleDetail);
             cell = rowp.createCell(46);
             cell.setCellStyle(styleDetail);
+            cell = rowp.createCell(47);
+            cell.setCellStyle(styleDetail);
+            cell = rowp.createCell(48);
+            cell.setCellStyle(styleDetail);
             rownum++;
         }
 
@@ -4218,120 +4228,126 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellValue("合同编号");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(8);
-        cell.setCellValue("合同结算状态");
+        cell.setCellValue("出库任务编号");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(9);
-        cell.setCellValue("合同重量(吨)");
+        cell.setCellValue("合同结算状态");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(10);
-        cell.setCellValue("合同单价(元/吨)");
+        cell.setCellValue("合同重量(吨)");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(11);
-        cell.setCellValue("客户");
+        cell.setCellValue("合同单价(元/吨)");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(12);
-        cell.setCellValue("货名");
+        cell.setCellValue("客户");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(13);
-        cell.setCellValue("类型");
+        cell.setCellValue("备注");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(14);
-        cell.setCellValue("等级");
+        cell.setCellValue("货名");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(15);
-        cell.setCellValue("水分");
+        cell.setCellValue("类型");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(16);
-        cell.setCellValue("杂质");
+        cell.setCellValue("等级");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(17);
-        cell.setCellValue("霉变粒");
+        cell.setCellValue("水分");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(18);
-        cell.setCellValue("不完善粒");
+        cell.setCellValue("杂质");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(19);
-        cell.setCellValue("容重");
+        cell.setCellValue("霉变粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(20);
-        cell.setCellValue("热损伤");
+        cell.setCellValue("不完善粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(21);
-        cell.setCellValue("车厢号");
+        cell.setCellValue("容重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(22);
-        cell.setCellValue("箱号1");
+        cell.setCellValue("热损伤");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(23);
-        cell.setCellValue("箱号2");
+        cell.setCellValue("车厢号");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(24);
-        cell.setCellValue("号1");
+        cell.setCellValue("号1");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(25);
+        cell.setCellValue("箱号2");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(26);
+        cell.setCellValue("封号1");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(27);
         cell.setCellValue("封号2");
         cell.setCellStyle(contextstyle);
-        cell = row1.createCell(26);
+        cell = row1.createCell(28);
         cell.setCellValue("船名");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(27);
+        cell = row1.createCell(29);
         cell.setCellValue("航次");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(28);
+        cell = row1.createCell(30);
         cell.setCellValue("车牌号");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(29);
+        cell = row1.createCell(31);
         cell.setCellValue("车数");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(30);
+        cell = row1.createCell(32);
         cell.setCellValue("毛重(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(31);
+        cell = row1.createCell(33);
         cell.setCellValue("皮重(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(32);
+        cell = row1.createCell(34);
         cell.setCellValue("出库净重(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(33);
+        cell = row1.createCell(35);
         cell.setCellValue("反馈重量(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(34);
+        cell = row1.createCell(36);
         cell.setCellValue("反馈日期");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(35);
+        cell = row1.createCell(37);
         cell.setCellValue("结算重量(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(36);
+        cell = row1.createCell(38);
         cell.setCellValue("结算单价(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(37);
+        cell = row1.createCell(39);
         cell.setCellValue("汽运运费(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(38);
+        cell = row1.createCell(40);
         cell.setCellValue("火运运费(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(39);
+        cell = row1.createCell(41);
         cell.setCellValue("船运运费(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(40);
+        cell = row1.createCell(42);
         cell.setCellValue("运费");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(41);
+        cell = row1.createCell(43);
         cell.setCellValue("应收金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(42);
+        cell = row1.createCell(44);
         cell.setCellValue("已收金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(43);
+        cell = row1.createCell(45);
         cell.setCellValue("未收金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(44);
+        cell = row1.createCell(46);
         cell.setCellValue("收款日期");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(45);
+        cell = row1.createCell(47);
         cell.setCellValue("已开票金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(46);
+        cell = row1.createCell(48);
         cell.setCellValue("状态");
         cell.setCellStyle(styleDetail);
         rownum++;
@@ -4369,138 +4385,144 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 }
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(8);
-                cell.setCellValue(editString(exportVView.getContractStatus()));
+                cell.setCellValue(editString(exportVView.getInOutTaskNo()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(9);
-                cell.setCellValue(editFloat(exportVView.getWeight()));
+                cell.setCellValue(editString(exportVView.getContractStatus()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(10);
-                cell.setCellValue(editFloat(exportVView.getUnitContractPrice()));
+                cell.setCellValue(editFloat(exportVView.getWeight()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(11);
-                cell.setCellValue(editString(exportVView.getCustomerName()));
+                cell.setCellValue(editFloat(exportVView.getUnitContractPrice()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(12);
-                cell.setCellValue(editString(exportVView.getGoodsName()));
+                cell.setCellValue(editString(exportVView.getCustomerName()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(13);
-                cell.setCellValue(editString(exportVView.getType()));
+                cell.setCellValue(editString(exportVView.getRemark()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(14);
-                cell.setCellValue(editString(exportVView.getGrade()));
+                cell.setCellValue(editString(exportVView.getGoodsName()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(15);
+                cell.setCellValue(editString(exportVView.getType()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(16);
+                cell.setCellValue(editString(exportVView.getGrade()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(17);
                 if (!StringUtils.isEmpty(exportVView.getWaterContent())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getWaterContent()));
                 }
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(16);
+                cell = rowx.createCell(18);
                 if (!StringUtils.isEmpty(exportVView.getImpurity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImpurity()));
                 }
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(17);
+                cell = rowx.createCell(19);
                 if (!StringUtils.isEmpty(exportVView.getMildewGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getMildewGrain()));
                 }
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(18);
+                cell = rowx.createCell(20);
                 if (!StringUtils.isEmpty(exportVView.getImperfectGrain())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getImperfectGrain()));
                 }
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(19);
+                cell = rowx.createCell(21);
                 if (!StringUtils.isEmpty(exportVView.getBulkDensity())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getBulkDensity()));
                 }
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(20);
+                cell = rowx.createCell(22);
                 if (!StringUtils.isEmpty(exportVView.getJiaorenli())) {
                     cell.setCellValue(Double.parseDouble(exportVView.getJiaorenli()));
                 }
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(21);
+                cell = rowx.createCell(23);
                 cell.setCellValue(editString(exportVView.getWingNumber()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(22);
+                cell = rowx.createCell(24);
                 cell.setCellValue(editString(exportVView.getBoxNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(23);
+                cell = rowx.createCell(25);
                 cell.setCellValue(editString(exportVView.getBoxNoOther()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(24);
+                cell = rowx.createCell(26);
                 cell.setCellValue(editString(exportVView.getTitleNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(25);
+                cell = rowx.createCell(27);
                 cell.setCellValue(editString(exportVView.getTitleNoOther()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(26);
+                cell = rowx.createCell(28);
                 cell.setCellValue(editString(exportVView.getShipNumber()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(27);
+                cell = rowx.createCell(29);
                 cell.setCellValue(editString(exportVView.getShipName()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(28);
+                cell = rowx.createCell(30);
                 cell.setCellValue(editString(exportVView.getCarNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(29);
+                cell = rowx.createCell(31);
                 cell.setCellValue("1");
                 cell.setCellStyle(styleDetail);
                 HSSFDataFormat df = wb.createDataFormat(); // 此处设置数据格式
                 contextstyle.setDataFormat(df.getBuiltinFormat("#,##0.00"));//保留两位小数点
                 HSSFDataFormat df1 = wb.createDataFormat(); // 此处设置数据格式
                 contextstyle1.setDataFormat(df1.getBuiltinFormat("#,##0.00"));//保留两位小数点
-                cell = rowx.createCell(30);
+                cell = rowx.createCell(32);
                 cell.setCellValue(editDouble(exportVView.getGrossWeight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(31);
+                cell = rowx.createCell(33);
                 cell.setCellValue(editDouble(exportVView.getTare()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(32);
+                cell = rowx.createCell(34);
                 cell.setCellValue(Double.parseDouble(exportVView.getNetWeight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(33);
+                cell = rowx.createCell(35);
                 cell.setCellValue(editFloat(exportVView.getFeedbackWeight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(34);
+                cell = rowx.createCell(36);
                 String date1 = addDateOneDay(exportVView.getFeedbackDate() != null ? exportVView.getFeedbackDate() : new Date());
                 cell.setCellValue(date1);
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(35);
+                cell = rowx.createCell(37);
                 cell.setCellValue(editFloat(exportVView.getSettlementWeight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(36);
+                cell = rowx.createCell(38);
                 cell.setCellValue(editFloat(exportVView.getSettlementPrice()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(37);
+                cell = rowx.createCell(39);
                 cell.setCellValue(editFloat(exportVView.getCarFreight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(38);
+                cell = rowx.createCell(40);
                 cell.setCellValue(editFloat(exportVView.getTrainFreight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(39);
+                cell = rowx.createCell(41);
                 cell.setCellValue(editFloat(exportVView.getShipFreight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(40);
+                cell = rowx.createCell(42);
                 cell.setCellValue(editFloat(exportVView.getShipFreight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(41);
+                cell = rowx.createCell(43);
                 cell.setCellValue(editDouble(exportVView.getAmountIngReceivable()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(42);
+                cell = rowx.createCell(44);
                 cell.setCellValue(editDouble(exportVView.getAmountEdReceivable()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(43);
+                cell = rowx.createCell(45);
                 cell.setCellValue(editDouble(exportVView.getAmountNotReceivable()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(44);
+                cell = rowx.createCell(46);
                 String date2 = addDateOneDay(exportVView.getCollectionDate() != null ? exportVView.getCollectionDate() : new Date());
                 cell.setCellValue(date2);
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(45);
+                cell = rowx.createCell(47);
                 cell.setCellValue(editFloat(exportVView.getMoney()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(46);
+                cell = rowx.createCell(48);
                 cell.setCellValue(editString(exportVView.getStatus()));
                 cell.setCellStyle(styleDetail);
 

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

@@ -3000,7 +3000,8 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         }
                     }
                 }
-            } else {
+            }
+            else {
                 //常用库入库
                 if ("2".equals(warehouseInOutInfo.getInOutFlag()) && "1".equals(warehouseBaseInfo.getWarehouseType())) {
                     //常用库采购入库类型
@@ -3848,58 +3849,58 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                         weighingManagementService.updateById(weighingManagement);
                     }
                     //运费大于0生成运费结算报表数据
-                    if (warehouseInOutInfo.getFreight() != null && warehouseInOutInfo.getFreight() > 0) {
-                        //生成汽运报表
-                        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())));
-                        //应付
-                        tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                        //未付
-                        tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
-                        tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
-                        tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
-                        tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
-                        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());
-                        }
-                    }
+//                    if (warehouseInOutInfo.getFreight() != null && warehouseInOutInfo.getFreight() > 0) {
+//                        //生成汽运报表
+//                        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())));
+//                        //应付
+//                        tranSettlementReport.setAmountIngPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+//                        //未付
+//                        tranSettlementReport.setAmountNotPayable(Float.valueOf(warehouseInOutInfo.getFreight()) * tranSettlementReport.getSettlementWeight());
+//                        tranSettlementReport.setLoadingWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
+//                        tranSettlementReport.setLoadingImg(warehouseInOutInfo.getAddressUrl());
+//                        tranSettlementReport.setTransportPrice(Float.valueOf(warehouseInOutInfo.getFreight()));
+//                        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());
+//                        }
+//                    }
                     TranCarInfo tranCarInfo = tranCarInfoService.selectById(warehouseInOutInfo.getCarId());
                     if (tranCarInfo != null) {
                         //将发货数据同步到派车表

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

@@ -282,11 +282,12 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                 warehousingOrder.setIdentifyId(warehousingOrder1.getIdentifyId());
                 warehousingOrder.setWarehouseName(warehousingOrder1.getWarehouseName());
                 warehousingOrder.setGoodsSource(warehousingOrder1.getGoodsSource());
+                warehousingOrder.setCustomer(warehousingOrder1.getGoodsSource());
                 warehousingOrder.setCompId(warehousingOrder1.getCompId());
                 warehousingOrder.setGoodsName(warehousingOrder1.getGoodsName());
                 warehousingOrder.setAvgCost(warehousingOrder1.getAvgCost());
                 warehousingOrder.setInType("收购入库");
-                double weight = paymentManagementList.stream().mapToDouble(PaymentManagement::getNetWeight).sum();
+                double weight = (paymentManagementList.stream().mapToDouble(PaymentManagement::getNetWeight).sum())/1000;
                 warehousingOrder.setInWarehouseWeight(Float.valueOf(String.valueOf(weight)));
                 warehousingOrder.setSurplusWeight(Float.valueOf(String.valueOf(weight)));
                 double money = paymentManagementList.stream().mapToDouble(PaymentManagement::getAmountIngPayable).sum();
@@ -609,6 +610,8 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                             for (WarehousingOrder warehousingOrder2 : warehousingOrderList) {
                                 warehousingOrder2.setStatusFlag(StatusEnum.PENDING_PAYMENT.getFlag());
                                 warehousingOrder2.setStatus(StatusEnum.PENDING_PAYMENT.getName());
+                                warehousingOrder2.setRequestPerson(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffName());
+                                warehousingOrder2.setRequestDate(new Date());
                                 warehousingOrder2.setWorkflowId(workflowId);
                                 warehousingOrder2.setBatchId(batchId);
                                 this.updateById(warehousingOrder2);
@@ -623,6 +626,8 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                         for (WarehousingOrder warehousingOrder2 : warehousingOrderList) {
                             warehousingOrder2.setStatusFlag(StatusEnum.PENDING_PAYMENT.getFlag());
                             warehousingOrder2.setStatus(StatusEnum.PENDING_PAYMENT.getName());
+                            warehousingOrder2.setRequestPerson(AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffName());
+                            warehousingOrder2.setRequestDate(new Date());
 //                            warehousingOrder2.setWorkflowId(workflowId);
                             warehousingOrder2.setBatchId(batchId);
                             this.updateById(warehousingOrder2);
@@ -926,6 +931,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("businessKeys", businessKeys);
         pageView.put("batchId", warehousingOrder.getBatchId());
+        pageView.put("appFlag", "1");
         // 查询入库单总数
         List<WarehousingOrder> dataList = baseMapper.getListByCondition(pageView);
 
@@ -1200,6 +1206,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("businessKeys", businessKeys);
         pageView.put("batchId", warehousingOrder.getBatchId());
+        pageView.put("appFlag", "1");
         // 查询入库单总数
         List<WarehousingOrder> dataList = baseMapper.getListByCondition(pageView);
 
@@ -1220,6 +1227,9 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
         if (dataList.size()>0) {
             warehousingOrder1.setWarehouseName(dataList.get(0).getWarehouseName());
             warehousingOrder1.setIssuingTime(dataList.get(0).getIssuingTime());
+            warehousingOrder1.setRequestPerson(dataList.get(0).getRequestPerson());
+            warehousingOrder1.setRequestDate(dataList.get(0).getRequestDate());
+            warehousingOrder1.setWarehousingOrderList(dataList);
             String taskId = "";
             // 只有待审核状态才有taskId
             if (StringUtils.isNotBlank(dataList.get(0).getWorkflowId())) {

+ 55 - 14
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/workflow/TranSettlementReportListener.java

@@ -1,13 +1,19 @@
 package com.yh.saas.plugin.yiliangyiyun.workflow;
 
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.yh.saas.common.support.workflow.AbstractWorkflowTaskListener;
 import com.yh.saas.common.support.workflow.annotation.WorkflowTaskListener;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
+import com.yh.saas.plugin.yiliangyiyun.entity.BatchReviewInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.PurchaseReceiptReport;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
+import com.yh.saas.plugin.yiliangyiyun.service.IBatchReviewInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
 import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
 
 @WorkflowTaskListener(name = "统计报表", group = "运输结算统计")
 public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
@@ -16,34 +22,69 @@ public class TranSettlementReportListener extends AbstractWorkflowTaskListener {
 
     @Autowired
     private ITranSettlementReportService tranSettlementReportService;
+    @Autowired
+    private IBatchReviewInfoService batchReviewInfoService;
 
     @Override
     public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
-        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
-        if (tranSettlementReport == null) {
+//        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
+        BatchReviewInfo batchReviewInfo = batchReviewInfoService.selectById(businessKey);
+        if (batchReviewInfo == null) {
             return;
         }
         if (processIsEnd) {
-            tranSettlementReport.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
-            tranSettlementReport.setStatus(StatusEnum.ORDER_PASSED.getName());
-            tranSettlementReport.setWorkflowId(null);
-            tranSettlementReport.setApproveStatus(null);
+            batchReviewInfo.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
+            batchReviewInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
+            batchReviewInfo.setWorkflowId(null);
+            batchReviewInfo.setApproveStatus(null);
         } else {
-            tranSettlementReport.setApproveStatus(status);
+            batchReviewInfo.setApproveStatus(status);
+        }
+        batchReviewInfoService.updateAllColumnById(batchReviewInfo);
+
+        //  更新详细状态
+//        batchReviewInfo = batchReviewInfoService.selectById(batchReviewInfo.getId());
+        List<TranSettlementReport> tranSettlementReports = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                .eq("batch_id",batchReviewInfo.getId()));
+        if(!CollectionUtils.isEmpty(tranSettlementReports)){
+            for(int i=0;i<tranSettlementReports.size();i++){
+                TranSettlementReport settlementReport = tranSettlementReports.get(i);
+                settlementReport.setWorkflowId(batchReviewInfo.getWorkflowId());
+                settlementReport.setStatus(batchReviewInfo.getStatus());
+                settlementReport.setApproveStatus(batchReviewInfo.getApproveStatus());
+
+            }
+            tranSettlementReportService.insertBatch(tranSettlementReports);
+
         }
-        tranSettlementReportService.updateAllColumnById(tranSettlementReport);
     }
 
     @Override
     public void handleRejectApplicationRepulsed(String workflowId, String businessKey, boolean needReapply) {
-        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
-        if (tranSettlementReport == null) {
+//        TranSettlementReport tranSettlementReport = tranSettlementReportService.selectById(businessKey);
+        BatchReviewInfo batchReviewInfo = batchReviewInfoService.selectById(businessKey);
+        if (batchReviewInfo == null) {
             return;
         }
-        tranSettlementReport.setStatusFlag(StatusEnum.TASK_RETURN.getFlag());
-        tranSettlementReport.setStatus(StatusEnum.TASK_RETURN.getName());
-        tranSettlementReport.setApproveStatus(null);
-        tranSettlementReportService.updateAllColumnById(tranSettlementReport);
+        batchReviewInfo.setStatusFlag(StatusEnum.TASK_RETURN.getFlag());
+        batchReviewInfo.setStatus(StatusEnum.TASK_RETURN.getName());
+        batchReviewInfo.setApproveStatus(null);
+        batchReviewInfoService.updateAllColumnById(batchReviewInfo);
+        //  更新详细状态
+//        batchReviewInfo = batchReviewInfoService.selectById(batchReviewInfo.getId());
+        List<TranSettlementReport> tranSettlementReports = tranSettlementReportService.selectList(new EntityWrapper<TranSettlementReport>()
+                .eq("batch_id",batchReviewInfo.getId()));
+        if(!CollectionUtils.isEmpty(tranSettlementReports)){
+            for(int i=0;i<tranSettlementReports.size();i++){
+                TranSettlementReport settlementReport = tranSettlementReports.get(i);
+                settlementReport.setWorkflowId(batchReviewInfo.getWorkflowId());
+                settlementReport.setStatus(batchReviewInfo.getStatus());
+                settlementReport.setApproveStatus(batchReviewInfo.getApproveStatus());
+
+            }
+            tranSettlementReportService.insertBatch(tranSettlementReports);
+
+        }
 
     }
 

+ 1 - 1
src/main/resources/mapper/ShortFillingInfoMapper.xml → winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/BatchReviewInfoMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.ShortFillingInfoMapper">
+<mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.BatchReviewInfoMapper">
 
 </mapper>

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -332,6 +332,8 @@
 --         w.warehouse_name as contractNo,
         case when m.contract_type = '1' then m.contract_no else '' end as contractNo,
         '' as customerName,
+        '' as remark,
+        w.in_out_task_no as inOutTaskNo,
         w.goods_name as goodsName,
         case when w.goods_name = '玉米(潮粮)' then '潮粮' else '干粮' end as type,
         w.grade as grade,
@@ -403,6 +405,8 @@
         cm.cost as costPrice,
         case when m.contract_type = '1' then m.contract_no else '' end as contractNo,
         m.buyer as customerName,
+        wm.customer as remark,
+        w.in_out_task_no as inOutTaskNo,
         g.goods_name as goodsName,
         case when g.goods_name = '玉米(潮粮)' then '潮粮' else '干粮' end as type,
         g.grade as grade,
@@ -445,6 +449,7 @@
         t.receive_warehouse as receiveWarehouse
         FROM stock_sale_receipt_report s
         left join warehouse_in_out_info w on w.id = s.warehouse_record_id and w.delete_flag = 0
+        left join weighing_management wm on wm.warehouse_in_out_id = w.id and wm.delete_flag = 0
         left join tran_process_info p on p.id = s.process_id and p.delete_flag = 0
         left join tran_task_info t on t.id = p.info_id and t.delete_flag = 0
         left join tran_car_info i on i.process_id = p.id and i.delete_flag = 0 and i.tran_car_no = s.tran_car_no and

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

@@ -58,6 +58,8 @@
         w.warehouse_name as warehouseName,
         wbi.warehouse_type as warehouseType,
         w.request_funds as requestFunds,
+        w.request_person as requestPerson,
+        w.request_date as requestDate,
         w.in_warehouse_weight as inWarehouseWeight,
         w.customer,
         w.remark,
@@ -104,7 +106,9 @@
             </foreach>
             )
         </if>
+        <if test="appFlag == null">
         group BY w.base_id,DATE_FORMAT(w.issuing_time,"%Y%m%d")
+        </if>
         ORDER BY w.update_date DESC
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}