Sfoglia il codice sorgente

永发1.增加修改打印人,打印日期接口及调试
2.COC保存利润计算逻辑修改
3.费用申请主表结构创建
4.增加箱租金条款批量保存,删除接口及调试
5.ow计算租金逻辑修改

纪新园 10 mesi fa
parent
commit
0d592ae72e
14 ha cambiato i file con 723 aggiunte e 185 eliminazioni
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/dto/ExpenseApplicationDTO.java
  2. 144 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/ExpenseApplication.java
  3. 15 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/TradingBox.java
  4. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/vo/ExpenseApplicationVO.java
  5. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/FeeCenter.java
  6. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/ExpenseApplicationController.java
  7. 13 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RentTermController.java
  8. 10 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java
  9. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/ExpenseApplicationMapper.java
  10. 34 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/ExpenseApplicationMapper.xml
  11. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/IExpenseApplicationService.java
  12. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java
  13. 148 175
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/RouteCostServiceImpl.java
  14. 33 10
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/dto/ExpenseApplicationDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.dto;
+
+import org.springblade.los.box.entity.ExpenseApplication;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 费用申请表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-05-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ExpenseApplicationDTO extends ExpenseApplication {
+	private static final long serialVersionUID = 1L;
+
+}

+ 144 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/ExpenseApplication.java

@@ -0,0 +1,144 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 费用申请表实体类
+ *
+ * @author BladeX
+ * @since 2025-05-07
+ */
+@Data
+@TableName("logistics_expense_application")
+@ApiModel(value = "ExpenseApplication对象", description = "费用申请表")
+public class ExpenseApplication implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 来源类型
+	 */
+	@ApiModelProperty(value = "来源类型")
+	private String srcType;
+	/**
+	 * 业务日期
+	 */
+	@ApiModelProperty(value = "业务日期")
+	private Date srcBusDate;
+	/**
+	 * 来源id
+	 */
+	@ApiModelProperty(value = "来源id")
+	private Long srcId;
+	/**
+	 * 来源系统号
+	 */
+	@ApiModelProperty(value = "来源系统号")
+	private String srcNo;
+	/**
+	 * 来源提单号
+	 */
+	@ApiModelProperty(value = "来源提单号")
+	private String srcMblno;
+	/**
+	 * 来源放箱号
+	 */
+	@ApiModelProperty(value = "来源放箱号")
+	private String srcContainerNumber;
+	/**
+	 * 来源合同号
+	 */
+	@ApiModelProperty(value = "来源合同号")
+	private String srcContractNo;
+	/**
+	 * 审核状态
+	 */
+	@ApiModelProperty(value = "审核状态")
+	private String status;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+
+}

+ 15 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/TradingBox.java

@@ -541,6 +541,21 @@ public class TradingBox implements Serializable {
 	 */
 	@ApiModelProperty(value = "收付")
 	private String dc;
+	/**
+	 * 打印人
+	 */
+	@ApiModelProperty(value = "打印人")
+	private String printingPersonId;
+	/**
+	 * 打印人
+	 */
+	@ApiModelProperty(value = "打印人")
+	private String printingPersonName;
+	/**
+	 * 打印时间
+	 */
+	@ApiModelProperty(value = "打印时间")
+	private String printingPersonDate;
 
 	/**
 	 * 临时数据

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/vo/ExpenseApplicationVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.vo;
+
+import org.springblade.los.box.entity.ExpenseApplication;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 费用申请表视图实体类
+ *
+ * @author BladeX
+ * @since 2025-05-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ExpenseApplicationVO对象", description = "费用申请表")
+public class ExpenseApplicationVO extends ExpenseApplication {
+	private static final long serialVersionUID = 1L;
+
+}

+ 6 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/FeeCenter.java

@@ -993,5 +993,11 @@ public class FeeCenter implements Serializable {
 	@ApiModelProperty(value = "扣款时间")
 	private Date deductionTime;
 
+	/**
+	 * 放箱号
+	 */
+	@ApiModelProperty(value = "放箱号")
+	private String containerNumber;
+
 }
 

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/ExpenseApplicationController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.box.entity.ExpenseApplication;
+import org.springblade.los.box.vo.ExpenseApplicationVO;
+import org.springblade.los.box.service.IExpenseApplicationService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 费用申请表 控制器
+ *
+ * @author BladeX
+ * @since 2025-05-07
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/expenseapplication")
+@Api(value = "费用申请表", tags = "费用申请表接口")
+public class ExpenseApplicationController extends BladeController {
+
+	private final IExpenseApplicationService expenseApplicationService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入expenseApplication")
+	public R<ExpenseApplication> detail(ExpenseApplication expenseApplication) {
+		ExpenseApplication detail = expenseApplicationService.getOne(Condition.getQueryWrapper(expenseApplication));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 费用申请表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入expenseApplication")
+	public R<IPage<ExpenseApplication>> list(ExpenseApplication expenseApplication, Query query) {
+		IPage<ExpenseApplication> pages = expenseApplicationService.page(Condition.getPage(query), Condition.getQueryWrapper(expenseApplication));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 费用申请表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入expenseApplication")
+	public R<IPage<ExpenseApplicationVO>> page(ExpenseApplicationVO expenseApplication, Query query) {
+		IPage<ExpenseApplicationVO> pages = expenseApplicationService.selectExpenseApplicationPage(Condition.getPage(query), expenseApplication);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 费用申请表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入expenseApplication")
+	public R save(@Valid @RequestBody ExpenseApplication expenseApplication) {
+		return R.status(expenseApplicationService.save(expenseApplication));
+	}
+
+	/**
+	 * 修改 费用申请表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入expenseApplication")
+	public R update(@Valid @RequestBody ExpenseApplication expenseApplication) {
+		return R.status(expenseApplicationService.updateById(expenseApplication));
+	}
+
+	/**
+	 * 新增或修改 费用申请表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入expenseApplication")
+	public R submit(@Valid @RequestBody ExpenseApplication expenseApplication) {
+		return R.status(expenseApplicationService.saveOrUpdate(expenseApplication));
+	}
+
+	
+	/**
+	 * 删除 费用申请表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(expenseApplicationService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 13 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/RentTermController.java

@@ -34,6 +34,8 @@ import org.springblade.los.box.vo.RentTermVO;
 import org.springblade.los.box.service.IRentTermService;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.List;
+
 /**
  * 箱租金条款 控制器
  *
@@ -80,6 +82,17 @@ public class RentTermController extends BladeController {
 		return R.status(rentTermService.saveOrUpdate(rentTerm));
 	}
 
+	/**
+	 * 新增或修改 箱租金条款
+	 */
+	@PostMapping("/submitList")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入rentTerm")
+	public R submitList(@Valid @RequestBody List<RentTerm> rentTermList) {
+		rentTermService.saveOrUpdateBatch(rentTermList);
+		return R.data(rentTermList);
+	}
+
 
 	/**
 	 * 删除 箱租金条款

+ 10 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java

@@ -335,4 +335,14 @@ public class TradingBoxController extends BladeController {
 		return tradingBoxService.revokeCountRent(tradingBox);
 	}
 
+	/**
+	 * 修改打印人,打印日期
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 6)
+	@RepeatSubmit
+	public R update(@Valid @RequestBody TradingBox tradingBox) {
+		return R.data(tradingBoxService.updateById(tradingBox));
+	}
+
 }

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/ExpenseApplicationMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.mapper;
+
+import org.springblade.los.box.entity.ExpenseApplication;
+import org.springblade.los.box.vo.ExpenseApplicationVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 费用申请表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-05-07
+ */
+public interface ExpenseApplicationMapper extends BaseMapper<ExpenseApplication> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param expenseApplication
+	 * @return
+	 */
+	List<ExpenseApplicationVO> selectExpenseApplicationPage(IPage page, ExpenseApplicationVO expenseApplication);
+
+}

+ 34 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/ExpenseApplicationMapper.xml

@@ -0,0 +1,34 @@
+<?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="org.springblade.los.box.mapper.ExpenseApplicationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="expenseApplicationResultMap" type="org.springblade.los.box.entity.ExpenseApplication">
+        <id column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="src_type" property="srcType"/>
+        <result column="src_bus_date" property="srcBusDate"/>
+        <result column="src_id" property="srcId"/>
+        <result column="src_no" property="srcNo"/>
+        <result column="src_mblno" property="srcMblno"/>
+        <result column="src_container_number" property="srcContainerNumber"/>
+        <result column="src_contract_no" property="srcContractNo"/>
+        <result column="status" property="status"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+    </resultMap>
+
+
+    <select id="selectExpenseApplicationPage" resultMap="expenseApplicationResultMap">
+        select * from logistics_expense_application where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/IExpenseApplicationService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.service;
+
+import org.springblade.los.box.entity.ExpenseApplication;
+import org.springblade.los.box.vo.ExpenseApplicationVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 费用申请表 服务类
+ *
+ * @author BladeX
+ * @since 2025-05-07
+ */
+public interface IExpenseApplicationService extends IService<ExpenseApplication> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param expenseApplication
+	 * @return
+	 */
+	IPage<ExpenseApplicationVO> selectExpenseApplicationPage(IPage<ExpenseApplicationVO> page, ExpenseApplicationVO expenseApplication);
+
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.service.impl;
+
+import org.springblade.los.box.entity.ExpenseApplication;
+import org.springblade.los.box.vo.ExpenseApplicationVO;
+import org.springblade.los.box.mapper.ExpenseApplicationMapper;
+import org.springblade.los.box.service.IExpenseApplicationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 费用申请表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-05-07
+ */
+@Service
+public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicationMapper, ExpenseApplication> implements IExpenseApplicationService {
+
+	@Override
+	public IPage<ExpenseApplicationVO> selectExpenseApplicationPage(IPage<ExpenseApplicationVO> page, ExpenseApplicationVO expenseApplication) {
+		return page.setRecords(baseMapper.selectExpenseApplicationPage(page, expenseApplication));
+	}
+
+}

+ 148 - 175
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/RouteCostServiceImpl.java

@@ -173,52 +173,46 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 				int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
 				List<RouteCostFee> costFeeList = routeCost.getCostFeeList();
 				for (RouteCostItem routeCostItem : routeCost.getCostItemList()) {
-					if ("SOC".equals(routeCost.getBusinessType())) {
-						//一程POL杂费成本
-						routeCostItem.setPolCost(computationalCost(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POL杂费收入
-						routeCostItem.setPolIncome(computationalIncome(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POD杂费成本
-						routeCostItem.setPodCost(computationalCost(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POD杂费收入
-						routeCostItem.setPodIncome(computationalIncome(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程用箱成本
-						if (0 != days && ObjectUtils.isNotNull(routeCostItem.getBoxCost()) &&
-							routeCostItem.getBoxCost().compareTo(new BigDecimal("0.00")) != 0) {
-							BigDecimal boxCost = new BigDecimal(days).multiply(routeCostItem.getBoxCost());
-							routeCostItem.setUseBoxCost(boxCost);
-						} else {
-							routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
-						}
-						// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
-						routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
-							.add(routeCostItem.getUseBoxCost()));
-						//一程合计利润
-						routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().add(routeCostItem.getPolIncome())
-							.add(routeCostItem.getPodIncome()).subtract(routeCostItem.getCostPrice()));
-						if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
-							//二程POL杂费成本
-							routeCostItem.setPolCostTwo(computationalCost(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POL杂费收入
-							routeCostItem.setPolIncomeTwo(computationalIncome(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POD杂费成本
-							routeCostItem.setPodCostTwo(computationalCost(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POD杂费收入
-							routeCostItem.setPodIncomeTwo(computationalIncome(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
-							routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
-							//二程合计利润
-							routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().add(routeCostItem.getPolIncomeTwo())
-								.add(routeCostItem.getPodIncomeTwo()).subtract(routeCostItem.getCostPriceTwo()));
-						}
-						//合计利润
-						routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
+					//一程POL杂费成本
+					routeCostItem.setPolCost(computationalCost(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POL杂费收入
+					routeCostItem.setPolIncome(computationalIncome(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POD杂费成本
+					routeCostItem.setPodCost(computationalCost(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POD杂费收入
+					routeCostItem.setPodIncome(computationalIncome(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程用箱成本
+					if (0 != days && ObjectUtils.isNotNull(routeCostItem.getBoxCost()) &&
+						routeCostItem.getBoxCost().compareTo(new BigDecimal("0.00")) != 0) {
+						BigDecimal boxCost = new BigDecimal(days).multiply(routeCostItem.getBoxCost());
+						routeCostItem.setUseBoxCost(boxCost);
 					} else {
-						//一程合计利润
-						routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
-						//合计利润
-						routeCostItem.setProfit(routeCostItem.getTotalProfit());
+						routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
+					}
+					// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
+					routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
+						.add(routeCostItem.getUseBoxCost()));
+					//一程合计利润
+					routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().add(routeCostItem.getPolIncome())
+						.add(routeCostItem.getPodIncome()).subtract(routeCostItem.getCostPrice()));
+					if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
+						//二程POL杂费成本
+						routeCostItem.setPolCostTwo(computationalCost(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POL杂费收入
+						routeCostItem.setPolIncomeTwo(computationalIncome(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POD杂费成本
+						routeCostItem.setPodCostTwo(computationalCost(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POD杂费收入
+						routeCostItem.setPodIncomeTwo(computationalIncome(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
+						routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
+						//二程合计利润
+						routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().add(routeCostItem.getPolIncomeTwo())
+							.add(routeCostItem.getPodIncomeTwo()).subtract(routeCostItem.getCostPriceTwo()));
 					}
+					//合计利润
+					routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
+
 					if (routeCostItem.getId() == null) {
 						routeCostItem.setPid(routeCost.getId());
 						routeCostItem.setCreateTime(new Date());
@@ -509,52 +503,45 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 			if (ObjectUtils.isNotNull(routeCostItemList)) {
 				int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
 				for (RouteCostItem routeCostItem : routeCostItemList) {
-					if ("SOC".equals(routeCost.getBusinessType())) {
-						//一程POL杂费成本
-						routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POL杂费收入
-						routeCostItem.setPolIncome(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POD杂费成本
-						routeCostItem.setPodCost(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POD杂费收入
-						routeCostItem.setPodIncome(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程用箱成本
-						if (0 != days && ObjectUtils.isNotNull(routeCostItem.getBoxCost()) &&
-							routeCostItem.getBoxCost().compareTo(new BigDecimal("0.00")) != 0) {
-							BigDecimal boxCost = new BigDecimal(days).multiply(routeCostItem.getBoxCost());
-							routeCostItem.setUseBoxCost(boxCost);
-						} else {
-							routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
-						}
-						// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
-						routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
-							.add(routeCostItem.getUseBoxCost()));
-						//一程合计利润
-						routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().add(routeCostItem.getPolIncome())
-							.add(routeCostItem.getPodIncome()).subtract(routeCostItem.getCostPrice()));
-						if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
-							//二程POL杂费成本
-							routeCostItem.setPolCostTwo(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POL杂费收入
-							routeCostItem.setPolIncomeTwo(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POD杂费成本
-							routeCostItem.setPodCostTwo(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POD杂费收入
-							routeCostItem.setPodIncomeTwo(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
-							routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
-							//二程合计利润
-							routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().add(routeCostItem.getPolIncomeTwo())
-								.add(routeCostItem.getPodIncomeTwo()).subtract(routeCostItem.getCostPriceTwo()));
-						}
-						//合计利润
-						routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
+					//一程POL杂费成本
+					routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POL杂费收入
+					routeCostItem.setPolIncome(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POD杂费成本
+					routeCostItem.setPodCost(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POD杂费收入
+					routeCostItem.setPodIncome(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程用箱成本
+					if (0 != days && ObjectUtils.isNotNull(routeCostItem.getBoxCost()) &&
+						routeCostItem.getBoxCost().compareTo(new BigDecimal("0.00")) != 0) {
+						BigDecimal boxCost = new BigDecimal(days).multiply(routeCostItem.getBoxCost());
+						routeCostItem.setUseBoxCost(boxCost);
 					} else {
-						//一程合计利润
-						routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
-						//合计利润
-						routeCostItem.setProfit(routeCostItem.getTotalProfit());
+						routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
 					}
+					// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
+					routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
+						.add(routeCostItem.getUseBoxCost()));
+					//一程合计利润
+					routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().add(routeCostItem.getPolIncome())
+						.add(routeCostItem.getPodIncome()).subtract(routeCostItem.getCostPrice()));
+					if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
+						//二程POL杂费成本
+						routeCostItem.setPolCostTwo(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POL杂费收入
+						routeCostItem.setPolIncomeTwo(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POD杂费成本
+						routeCostItem.setPodCostTwo(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POD杂费收入
+						routeCostItem.setPodIncomeTwo(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
+						routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
+						//二程合计利润
+						routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().add(routeCostItem.getPolIncomeTwo())
+							.add(routeCostItem.getPodIncomeTwo()).subtract(routeCostItem.getCostPriceTwo()));
+					}
+					//合计利润
+					routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
 					if (routeCostItem.getId() == null) {
 						routeCostItem.setPid(routeCost.getId());
 						routeCostItem.setCreateTime(new Date());
@@ -595,89 +582,6 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 			if (ObjectUtils.isNotNull(routeCostItemList)) {
 				int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
 				for (RouteCostItem routeCostItem : routeCostItemList) {
-					if ("SOC".equals(routeCost.getBusinessType())) {
-						//一程POL杂费成本
-						routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POL杂费收入
-						routeCostItem.setPolIncome(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POD杂费成本
-						routeCostItem.setPodCost(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程POD杂费收入
-						routeCostItem.setPodIncome(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
-						//一程用箱成本
-						if (0 != days && ObjectUtils.isNotNull(routeCostItem.getBoxCost()) &&
-							routeCostItem.getBoxCost().compareTo(new BigDecimal("0.00")) != 0) {
-							BigDecimal boxCost = new BigDecimal(days).multiply(routeCostItem.getBoxCost());
-							routeCostItem.setUseBoxCost(boxCost);
-
-						} else {
-							routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
-						}
-						// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
-						routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
-							.add(routeCostItem.getUseBoxCost()));
-						//一程合计利润
-						routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().add(routeCostItem.getPolIncome())
-							.add(routeCostItem.getPodIncome()).subtract(routeCostItem.getCostPrice()));
-						if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
-							//二程POL杂费成本
-							routeCostItem.setPolCostTwo(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POL杂费收入
-							routeCostItem.setPolIncomeTwo(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POD杂费成本
-							routeCostItem.setPodCostTwo(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							//二程POD杂费收入
-							routeCostItem.setPodIncomeTwo(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
-							// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
-							routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
-							//二程合计利润
-							routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().add(routeCostItem.getPolIncomeTwo())
-								.add(routeCostItem.getPodIncomeTwo()).subtract(routeCostItem.getCostPriceTwo()));
-						}
-						//合计利润
-						routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
-					} else {
-						//一程合计利润
-						routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
-						//合计利润
-						routeCostItem.setProfit(routeCostItem.getTotalProfit());
-					}
-					if (routeCostItem.getId() == null) {
-						routeCostItem.setPid(routeCost.getId());
-						routeCostItem.setCreateTime(new Date());
-						routeCostItem.setCreateUser(AuthUtil.getUserId());
-						routeCostItem.setCreateUserName(AuthUtil.getUserName());
-					} else {
-						routeCostItem.setUpdateUser(AuthUtil.getUserId());
-						routeCostItem.setUpdateTime(new Date());
-						routeCostItem.setUpdateUserName(AuthUtil.getUserName());
-					}
-				}
-				routeCostItemService.updateBatchById(routeCostItemList);
-				routeCost.setProfit20(totalProfit(routeCostItemList, "20"));
-				routeCost.setProfit40(totalProfit(routeCostItemList, "40"));
-				routeCost.setProfitHc(totalProfit(routeCostItemList, "40HC"));
-				routeCost.setOtherProfit(totalProfit(routeCostItemList, "other"));
-				routeCost.setTotalProfit(routeCost.getProfit20().add(routeCost.getProfit40()).add(routeCost.getProfitHc()).add(routeCost.getOtherProfit()));
-				baseMapper.updateById(routeCost);
-			}
-			routeCostFeeService.removeByIds(longList);
-		}
-		return R.success("操作成功");
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public R submitItemList(List<RouteCostItem> routeCostItemList) {
-		if (!routeCostItemList.isEmpty()) {
-			RouteCost routeCost = baseMapper.selectById(routeCostItemList.get(0).getPid());
-			List<RouteCostFee> routeCostFeeList = routeCostFeeService.list(new LambdaQueryWrapper<RouteCostFee>()
-				.eq(RouteCostFee::getTenantId, AuthUtil.getTenantId())
-				.eq(RouteCostFee::getIsDeleted, 0)
-				.eq(RouteCostFee::getPid, routeCostItemList.get(0).getPid()));
-			int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
-			for (RouteCostItem routeCostItem : routeCostItemList) {
-				if ("SOC".equals(routeCost.getBusinessType())) {
 					//一程POL杂费成本
 					routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
 					//一程POL杂费收入
@@ -691,6 +595,7 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 						routeCostItem.getBoxCost().compareTo(new BigDecimal("0.00")) != 0) {
 						BigDecimal boxCost = new BigDecimal(days).multiply(routeCostItem.getBoxCost());
 						routeCostItem.setUseBoxCost(boxCost);
+
 					} else {
 						routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
 					}
@@ -717,12 +622,80 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 					}
 					//合计利润
 					routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
+					if (routeCostItem.getId() == null) {
+						routeCostItem.setPid(routeCost.getId());
+						routeCostItem.setCreateTime(new Date());
+						routeCostItem.setCreateUser(AuthUtil.getUserId());
+						routeCostItem.setCreateUserName(AuthUtil.getUserName());
+					} else {
+						routeCostItem.setUpdateUser(AuthUtil.getUserId());
+						routeCostItem.setUpdateTime(new Date());
+						routeCostItem.setUpdateUserName(AuthUtil.getUserName());
+					}
+				}
+				routeCostItemService.updateBatchById(routeCostItemList);
+				routeCost.setProfit20(totalProfit(routeCostItemList, "20"));
+				routeCost.setProfit40(totalProfit(routeCostItemList, "40"));
+				routeCost.setProfitHc(totalProfit(routeCostItemList, "40HC"));
+				routeCost.setOtherProfit(totalProfit(routeCostItemList, "other"));
+				routeCost.setTotalProfit(routeCost.getProfit20().add(routeCost.getProfit40()).add(routeCost.getProfitHc()).add(routeCost.getOtherProfit()));
+				baseMapper.updateById(routeCost);
+			}
+			routeCostFeeService.removeByIds(longList);
+		}
+		return R.success("操作成功");
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R submitItemList(List<RouteCostItem> routeCostItemList) {
+		if (!routeCostItemList.isEmpty()) {
+			RouteCost routeCost = baseMapper.selectById(routeCostItemList.get(0).getPid());
+			List<RouteCostFee> routeCostFeeList = routeCostFeeService.list(new LambdaQueryWrapper<RouteCostFee>()
+				.eq(RouteCostFee::getTenantId, AuthUtil.getTenantId())
+				.eq(RouteCostFee::getIsDeleted, 0)
+				.eq(RouteCostFee::getPid, routeCostItemList.get(0).getPid()));
+			int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
+			for (RouteCostItem routeCostItem : routeCostItemList) {
+				//一程POL杂费成本
+				routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+				//一程POL杂费收入
+				routeCostItem.setPolIncome(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+				//一程POD杂费成本
+				routeCostItem.setPodCost(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+				//一程POD杂费收入
+				routeCostItem.setPodIncome(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+				//一程用箱成本
+				if (0 != days && ObjectUtils.isNotNull(routeCostItem.getBoxCost()) &&
+					routeCostItem.getBoxCost().compareTo(new BigDecimal("0.00")) != 0) {
+					BigDecimal boxCost = new BigDecimal(days).multiply(routeCostItem.getBoxCost());
+					routeCostItem.setUseBoxCost(boxCost);
 				} else {
-					//一程合计利润
-					routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
-					//合计利润
-					routeCostItem.setProfit(routeCostItem.getTotalProfit());
+					routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
+				}
+				// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
+				routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
+					.add(routeCostItem.getUseBoxCost()));
+				//一程合计利润
+				routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().add(routeCostItem.getPolIncome())
+					.add(routeCostItem.getPodIncome()).subtract(routeCostItem.getCostPrice()));
+				if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
+					//二程POL杂费成本
+					routeCostItem.setPolCostTwo(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					//二程POL杂费收入
+					routeCostItem.setPolIncomeTwo(computationalIncome(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					//二程POD杂费成本
+					routeCostItem.setPodCostTwo(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					//二程POD杂费收入
+					routeCostItem.setPodIncomeTwo(computationalIncome(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
+					routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
+					//二程合计利润
+					routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().add(routeCostItem.getPolIncomeTwo())
+						.add(routeCostItem.getPodIncomeTwo()).subtract(routeCostItem.getCostPriceTwo()));
 				}
+				//合计利润
+				routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
 				if (routeCostItem.getId() == null) {
 					routeCostItem.setPid(routeCost.getId());
 					routeCostItem.setCreateTime(new Date());

+ 33 - 10
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -40,6 +40,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.time.Duration;
 import java.time.Instant;
 import java.time.LocalDate;
@@ -189,7 +190,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		} else if ("CCSQ".equals(tradingBox.getType())) {
 			billNoFormat = "CCSQ";
 			businessTypeCode = "CCSQ";
-		}else if ("DXCB".equals(tradingBox.getType())) {
+		} else if ("DXCB".equals(tradingBox.getType())) {
 			billNoFormat = "DXCB";
 			businessTypeCode = "DXCB";
 		} else {
@@ -456,7 +457,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 					item.setPid(tradingBox.getId());
 				}
 			}
-			if (!"XGDX,CCSQ".contains(tradingBox.getType())){
+			if (!"XGDX,CCSQ".contains(tradingBox.getType())) {
 				tradingBox.setBoxTypeQuantityOne(boxTypeText.toString());
 			}
 			tradingBoxTypeService.saveOrUpdateBatch(boxTypeList);
@@ -1930,7 +1931,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		tradingBox.setUpdateUser(AuthUtil.getUserId());
 		tradingBox.setUpdateUserName(AuthUtil.getUserName());
 		baseMapper.updateById(tradingBox);
-		if ("XGDX".equals(tradingBox.getType()) || "CCSQ".equals(tradingBox.getType())) {
+		/*if ("XGDX".equals(tradingBox.getType()) || "CCSQ".equals(tradingBox.getType())) {
 			List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
 				.eq(TradingBoxItem::getPid, tradingBox.getId())
 				.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
@@ -2012,7 +2013,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			if (!archivesTrajectoryList.isEmpty()) {
 				archivesTrajectoryService.saveBatch(archivesTrajectoryList);
 			}
-		}
+		}*/
 		return tradingBox;
 	}
 
@@ -2066,6 +2067,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		}
 		BigDecimal exrateC = bCurrencyService.getCnyExrate(new Date(), "USD", "C", "1");
 		List<FeeCenter> feeCenterList = new ArrayList<>();
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 		for (TradingBoxItem item : putBoxItemsList) {
 			FeeCenter feeCenter = new FeeCenter();
 			feeCenter.setBillType("箱东");
@@ -2097,10 +2099,23 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			LocalDate date1 = instant1.atZone(ZoneId.systemDefault()).toLocalDate();
 			LocalDate date2 = instant2.atZone(ZoneId.systemDefault()).toLocalDate();
 			Duration duration = Duration.between(date1.atStartOfDay(), date2.atStartOfDay());
-			feeCenter.setStorageDate(item.getRentEndDate());
-			feeCenter.setDays(Integer.parseInt(duration.toDays() + ""));
+			if (!dateFormat.format(item.getRentEndDate()).equals(dateFormat.format(item.getPolStationEmptyContainerExitDate()))) {
+				Calendar calendar = Calendar.getInstance();
+				calendar.setTime(item.getRentEndDate());
+				calendar.add(Calendar.DAY_OF_MONTH, 1);
+				feeCenter.setStorageDate(calendar.getTime());
+				feeCenter.setDays(Integer.parseInt(duration.toDays() + ""));
+			} else {
+				feeCenter.setStorageDate(item.getRentEndDate());
+				feeCenter.setDays(Integer.parseInt(duration.toDays() + "") + 1);
+			}
 			Integer days = feeCenter.getDays();
-			int earlySumDays = 0;
+			Instant instant3 = item.getRentEndDate().toInstant();
+			Instant instant4 = item.getPolStationEmptyContainerExitDate().toInstant();
+			LocalDate date3 = instant3.atZone(ZoneId.systemDefault()).toLocalDate();
+			LocalDate date4 = instant4.atZone(ZoneId.systemDefault()).toLocalDate();
+			Duration duratio1 = Duration.between(date4.atStartOfDay(), date3.atStartOfDay());
+			int earlySumDays = Integer.parseInt(duratio1.toDays() + "");
 			String text = "";
 			int dayLength;
 			BigDecimal amount = new BigDecimal("0.00");
@@ -2116,14 +2131,19 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 					days -= tempDays;
 					BigDecimal calculate = term.getRate().multiply(new BigDecimal(tempDays + ""));
 					amount = amount.add(calculate);
-					text = tempDays + "天*" + term.getRate() + "元=" + calculate + "元,";
+					text = text + tempDays + "天*" + term.getRate() + "元=" + calculate + "元,";
 				} else {
 					BigDecimal calculate = term.getRate().multiply(new BigDecimal(days + ""));
 					amount = amount.add(calculate);
-					text = days + "天*" + term.getRate() + "元=" + calculate + "元";
+					text = text + days + "天*" + term.getRate() + "元=" + calculate + "元";
 					break;
 				}
 			}
+			if (days != 0) {
+				BigDecimal calculate = rentTermList.get(rentTermList.size() - 1).getRate().multiply(new BigDecimal(days + ""));
+				amount = amount.add(calculate);
+				text = text + "超出费用:" + days + "天*" + rentTermList.get(rentTermList.size() - 1).getRate() + "元=" + calculate + "元,";
+			}
 			if ("CNY".equals(feeCenter.getCurCode())) {
 				feeCenter.setExrate(new BigDecimal("1.00"));
 			} else {
@@ -2197,7 +2217,10 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				if (feeCenterList.size() == 1) {
 					item.setRentEndDate(item.getPolStationEmptyContainerExitDate());
 				} else {
-					item.setRentEndDate(feeCenter.getStorageDate());
+					Calendar calendar = Calendar.getInstance();
+					calendar.setTime(feeCenter.getStorageDate());
+					calendar.add(Calendar.DAY_OF_MONTH, -1);
+					item.setRentEndDate(calendar.getTime());
 				}
 				itemList.add(item);
 			}