zhangyuewww hace 3 años
padre
commit
fc064f4550

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

@@ -46,6 +46,10 @@ public class TranPriceApprove extends BaseModel<TranPriceApprove> {
      * 审核人
      */
     private String reviewer;
+    /**
+     * 类型(1运价2结算重量)
+     */
+    private String recordType;
     /**
      * 审核结果
      */
@@ -54,6 +58,14 @@ public class TranPriceApprove extends BaseModel<TranPriceApprove> {
      * 运输单价(元/吨)
      */
     private Float tranPrice;
+    /**
+     * 修改前
+     */
+    private Float beforeModification;
+    /**
+     * 修改后
+     */
+    private Float afterModification;
 
 
     @Override

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

@@ -55,6 +55,10 @@ public class TranProcessInfo extends BaseModel<TranProcessInfo> {
      * 审核中的运输价格
      */
     private Float tranPriceIng;
+    /**
+     * 实际运费
+     */
+    private Float actualFreight;
     /**
      * 运输价格状态
      */

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

@@ -218,13 +218,21 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      */
     @TableField(exist = false)
     private Float money;
+    /**
+     * 修改人
+     */
+    @TableField(exist = false)
+    private String reviewer;
 
-    //改价记录
+    //账户记录
     @TableField(exist = false)
     private List<DriverPayeeInfo> driverPayeeInfoList;
 
     @TableField(exist = false)
     private List<TranSettlementReport> tranSettlementReportList;
+    //记录
+    @TableField(exist = false)
+    private List<TranPriceApprove> tranPriceApproveList;
 
 
     @Override

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

@@ -146,7 +146,7 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
                 .eq(TranCarInfo.QueryFiles.PROCESS_ID, id).eq(TranCarInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0).orderBy("tran_car_no"));
         //查看审核记录
         List<TranPriceApprove> tranPriceApproveList = tranPriceApproveService.selectList(new EntityWrapper<TranPriceApprove>()
-                .eq(TranPriceApprove.QueryFiles.PROCESS_ID, id).eq(TranPriceApprove.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
+                .eq(TranPriceApprove.QueryFiles.PROCESS_ID, id).eq("record_type", "1").eq(TranPriceApprove.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("id", id);
         // 查询派车总数包括已删除的
@@ -558,20 +558,23 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
             }
 
         }
-
         //决策人审核
-        else {
+        else if ("2".equals(tranProcessInfo.getFlag())) {
             tranProcessInfo.setTranPrice(tranProcessInfo.getTranPriceIng());
             tranProcessInfo.setTranPriceIng(0.0f);
             tranProcessInfo.setPriceStatus("已通过");
-            //生成审核记录
-            TranPriceApprove tranPriceApprove = new TranPriceApprove();
-            tranPriceApprove.setProcessId(tranProcessInfo.getId());
-            tranPriceApprove.setId(IdGenerator.generateUUID());
-            tranPriceApprove.setReviewer(tranProcessInfo.getReviewer());
-            tranPriceApprove.setResult("通过");
-            tranPriceApprove.setTranPrice(tranProcessInfo.getTranPrice());
-            tranPriceApproveService.insert(tranPriceApprove);
+            //汽运生成审核记录
+            if(tranProcessInfo.getTranTypeKey()!=null&&"1".equals(tranProcessInfo.getTranTypeKey())) {
+                //生成审核记录
+                TranPriceApprove tranPriceApprove = new TranPriceApprove();
+                tranPriceApprove.setProcessId(tranProcessInfo.getId());
+                tranPriceApprove.setId(IdGenerator.generateUUID());
+                tranPriceApprove.setReviewer(tranProcessInfo.getReviewer());
+                tranPriceApprove.setResult("通过");
+                tranPriceApprove.setRecordType("1");
+                tranPriceApprove.setTranPrice(tranProcessInfo.getTranPrice());
+                tranPriceApproveService.insert(tranPriceApprove);
+            }
             // 先删除任务
             noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "TRAN-TASK-APPROVE",
                     tranProcessInfo.getId(), null);

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

@@ -9,6 +9,8 @@ import com.winsea.svc.base.base.entity.CommonRoleResource;
 import com.winsea.svc.base.base.service.ICommonRoleResourceService;
 import com.winsea.svc.base.security.entity.User;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
+import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.TranSettlementReportMapper;
@@ -47,6 +49,8 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
     private IDriverViewInfoService driverViewInfoService;
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
+    @Autowired
+    private ITranPriceApproveService tranPriceApproveService;
 
     /**
      * 汽运结算统计列表
@@ -88,6 +92,13 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
         List<TranSettlementReport> dataList = baseMapper.getListByCondition(pageView);
         if (!CollectionUtils.isEmpty(dataList)) {
             for (TranSettlementReport tranSettlementReport1 : dataList) {
+                //查看修改结算重量记录
+                List<TranPriceApprove> tranPriceApproveList = tranPriceApproveService.selectList(new EntityWrapper<TranPriceApprove>()
+                        .eq(TranPriceApprove.QueryFiles.PROCESS_ID, tranSettlementReport1.getId())
+                        .eq("record_type", "2").eq(TranPriceApprove.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
+                if (!CollectionUtils.isEmpty(tranPriceApproveList)) {
+                    tranSettlementReport1.setTranPriceApproveList(tranPriceApproveList);
+                }
                 //查询账户信息
                 List<DriverViewInfo> driverViewInfoList = driverViewInfoService.selectList(new EntityWrapper<DriverViewInfo>()
                         .eq("driver_name", tranSettlementReport1.getName())
@@ -140,6 +151,16 @@ public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementR
         if (tranSettlementReport1 != null) {
             //0 修改结算重量
             if (tranSettlementReport.getFlag() == 0) {
+                //生成记录
+                TranPriceApprove tranPriceApprove = new TranPriceApprove();
+                tranPriceApprove.setProcessId(tranSettlementReport1.getId());
+                tranPriceApprove.setId(IdGenerator.generateUUID());
+                tranPriceApprove.setReviewer(tranSettlementReport.getReviewer());
+                tranPriceApprove.setBeforeModification(tranSettlementReport1.getSettlementWeight());
+                tranPriceApprove.setAfterModification(tranSettlementReport.getSettlementWeight());
+                tranPriceApprove.setTranPrice(tranSettlementReport1.getTransportPrice());
+                tranPriceApprove.setRecordType("2");
+                tranPriceApproveService.insert(tranPriceApprove);
                 tranSettlementReport1.setSettlementWeight(tranSettlementReport.getSettlementWeight());
                 tranSettlementReport1.setManualFlag("1");
                 //应付=单价x结算重量-扣款