Browse Source

1.航线成本-主表,明细,费用补充二程所需字段
2.航线利润列表接口取值字段修改
3.航线成本保存接口利润计算逻辑修改
4.航线成本明细一键保存接口计算主表利润逻辑修改
5.航线成本明细一键删除接口计算主表利润逻辑修改
6.航线成本费用一键保存接口计算主表利润逻辑修改
7.航线成本费用一键删除接口计算主表利润逻辑修改

纪新园 9 months ago
parent
commit
7fd51bfc83

+ 57 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/logistics/route/entity/RouteCost.java

@@ -400,6 +400,63 @@ public class RouteCost implements Serializable {
 	private BigDecimal totalProfit;
 
 	/**
+	 * 二程实际船公司
+	 */
+	@ApiModelProperty(value = "二程实际船公司")
+	private Long actualShippingCompanyIdTwo;
+	/**
+	 * 二程实际船公司中文
+	 */
+	@ApiModelProperty(value = "二程实际船公司中文")
+	private String actualShippingCompanyCnameTwo;
+	/**
+	 * 二程实际船公司英文
+	 */
+	@ApiModelProperty(value = "二程实际船公司英文")
+	private String actualShippingCompanyEnameTwo;
+	/**
+	 * 二程实际船公司代码
+	 */
+	@ApiModelProperty(value = "二程实际船公司代码")
+	private String actualShippingCompanyCodeTwo;
+	/**
+	 * 二程实际船公司简称
+	 */
+	@ApiModelProperty(value = "二程实际船公司简称")
+	private String actualShippingCompanyAbbreviationTwo;
+	/**
+	 * 二程船名
+	 */
+	@ApiModelProperty(value = "二程船名")
+	private Long shipNameIdTwo;
+	/**
+	 * 二程船名中文
+	 */
+	@ApiModelProperty(value = "二程船名中文")
+	private String shipCnameTwo;
+	/**
+	 * 二程船名英文
+	 */
+	@ApiModelProperty(value = "二程船名英文")
+	private String shipEnameTwo;
+	/**
+	 * 二程船名代码
+	 */
+	@ApiModelProperty(value = "二程船名代码")
+	private String shipCodeTwo;
+	/**
+	 * 二程航次
+	 */
+	@ApiModelProperty(value = "二程航次")
+	private String voyageTwo;
+	/**
+	 * 二程运输条款
+	 */
+	@ApiModelProperty(value = "二程运输条款")
+	private String transportationTermsTwo;
+
+
+	/**
 	 * 费用明细
 	 */
 	@TableField(exist = false)

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/logistics/route/entity/RouteCostFee.java

@@ -155,6 +155,11 @@ public class RouteCostFee implements Serializable {
 	@ApiModelProperty(value = "费用明细类型  POL  POD  POT")
 	private String busType;
 	/**
+	 * 来源类型  0=1程费用  1=2程费用
+	 */
+	@ApiModelProperty(value = "来源类型")
+	private String srcType;
+	/**
 	 * 租户
 	 */
 	@ApiModelProperty(value = "租户")

+ 52 - 17
blade-service-api/blade-los-api/src/main/java/org/springblade/los/logistics/route/entity/RouteCostItem.java

@@ -105,51 +105,86 @@ public class RouteCostItem implements Serializable {
 	@ApiModelProperty(value = "汇率")
 	private BigDecimal exrate;
 	/**
-	 * 销售价
+	 * 一程销售价
 	 */
-	@ApiModelProperty(value = "销售价")
+	@ApiModelProperty(value = "一程销售价")
 	private BigDecimal salesPrice;
 	/**
-	 * 成本价
+	 * 一程成本价
 	 */
-	@ApiModelProperty(value = "成本价")
+	@ApiModelProperty(value = "一程成本价")
 	private BigDecimal costPrice;
 	/**
-	 * 合计利润
+	 * 一程合计利润
 	 */
-	@ApiModelProperty(value = "合计利润")
+	@ApiModelProperty(value = "一程合计利润")
 	private BigDecimal totalProfit;
 	/**
-	 * 海运费
+	 * 一程海运费
 	 */
-	@ApiModelProperty(value = "海运费")
+	@ApiModelProperty(value = "一程海运费")
 	private BigDecimal oceanFreight;
 	/**
-	 * 箱成本
+	 * 一程箱成本
 	 */
-	@ApiModelProperty(value = "箱成本")
+	@ApiModelProperty(value = "一程箱成本")
 	private BigDecimal boxCost;
 	/**
-	 * 用箱成本
+	 * 一程用箱成本
 	 */
-	@ApiModelProperty(value = "用箱成本")
+	@ApiModelProperty(value = "一程用箱成本")
 	private BigDecimal useBoxCost;
 	/**
-	 * POL杂费成本
+	 * 一程POL杂费成本
 	 */
-	@ApiModelProperty(value = "POL杂费成本")
+	@ApiModelProperty(value = "一程POL杂费成本")
 	private BigDecimal polCost;
 	/**
-	 * POD杂费成本
+	 * 一程POD杂费成本
 	 */
-	@ApiModelProperty(value = "POD杂费成本")
+	@ApiModelProperty(value = "一程POD杂费成本")
 	private BigDecimal podCost;
 	/**
-	 * POT费用
+	 * POT费用(作废)
 	 */
 	@ApiModelProperty(value = "POT费用")
 	private BigDecimal potCost;
 	/**
+	 * 二程销售价
+	 */
+	@ApiModelProperty(value = "二程销售价")
+	private BigDecimal salesPriceTwo;
+	/**
+	 * 二程成本价
+	 */
+	@ApiModelProperty(value = "二程成本价")
+	private BigDecimal costPriceTwo;
+	/**
+	 * 二程合计利润
+	 */
+	@ApiModelProperty(value = "二程合计利润")
+	private BigDecimal totalProfitTwo;
+	/**
+	 * 二程海运费
+	 */
+	@ApiModelProperty(value = "二程海运费")
+	private BigDecimal oceanFreightTwo;
+	/**
+	 * 二程POL杂费成本
+	 */
+	@ApiModelProperty(value = "二程POL杂费成本")
+	private BigDecimal polCostTwo;
+	/**
+	 * 二程POD杂费成本
+	 */
+	@ApiModelProperty(value = "二程POD杂费成本")
+	private BigDecimal podCostTwo;
+	/**
+	 * 合计利润
+	 */
+	@ApiModelProperty(value = "合计利润")
+	private BigDecimal profit;
+	/**
 	 * 租户
 	 */
 	@ApiModelProperty(value = "租户")

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/logistics/route/mapper/RouteCostFeeMapper.xml

@@ -28,6 +28,7 @@
         <result column="sales_price" property="salesPrice"/>
         <result column="cost_price" property="costPrice"/>
         <result column="bus_type" property="busType"/>
+        <result column="src_type" property="srcType"/>
     </resultMap>
 
 

+ 7 - 0
blade-service/blade-los/src/main/java/org/springblade/los/logistics/route/mapper/RouteCostItemMapper.xml

@@ -27,6 +27,13 @@
         <result column="pol_cost" property="polCost"/>
         <result column="pod_cost" property="podCost"/>
         <result column="pot_cost" property="potCost"/>
+        <result column="sales_price_two" property="salesPriceTwo"/>
+        <result column="cost_price_two" property="costPriceTwo"/>
+        <result column="total_profit_two" property="totalProfitTwo"/>
+        <result column="ocean_freight_two" property="oceanFreightTwo"/>
+        <result column="pol_cost_two" property="polCostTwo"/>
+        <result column="pod_cost_two" property="podCostTwo"/>
+        <result column="profit" property="profit"/>
     </resultMap>
 
 

+ 13 - 2
blade-service/blade-los/src/main/java/org/springblade/los/logistics/route/mapper/RouteCostMapper.xml

@@ -68,6 +68,17 @@
         <result column="effective_end_date" property="effectiveEndDate"/>
         <result column="payment_location" property="paymentLocation"/>
         <result column="exrate_date" property="exrateDate"/>
+        <result column="actual_shipping_company_id_two" property="actualShippingCompanyIdTwo"/>
+        <result column="actual_shipping_company_cname_two" property="actualShippingCompanyCnameTwo"/>
+        <result column="actual_shipping_company_ename_two" property="actualShippingCompanyEnameTwo"/>
+        <result column="actual_shipping_company_code_two" property="actualShippingCompanyCodeTwo"/>
+        <result column="actual_shipping_company_abbreviation_two" property="actualShippingCompanyAbbreviationTwo"/>
+        <result column="ship_name_id_two" property="shipNameIdTwo"/>
+        <result column="ship_cname_two" property="shipCnameTwo"/>
+        <result column="ship_ename_two" property="shipEnameTwo"/>
+        <result column="ship_code_two" property="shipCodeTwo"/>
+        <result column="voyage_two" property="voyageTwo"/>
+        <result column="transportation_terms_two" property="transportationTermsTwo"/>
     </resultMap>
 
 
@@ -79,7 +90,7 @@
         item.box_type as boxType,
         lrc.pod_cname as podCname,
         lrc.destination_cname as destinationCname,
-        item.total_profit as profit,
+        item.profit as profit,
         lrc.effective_start_date as effectiveStartDate,
         lrc.effective_end_date as effectiveEndDate,
         lrc.airline_cname as airlineCname,
@@ -156,7 +167,7 @@
         item.box_type as boxType,
         lrc.pod_cname as podCname,
         lrc.destination_cname as destinationCname,
-        item.total_profit as profit,
+        item.profit as profit,
         lrc.effective_start_date as effectiveStartDate,
         lrc.effective_end_date as effectiveEndDate,
         lrc.airline_cname as airlineCname,

+ 82 - 45
blade-service/blade-los/src/main/java/org/springblade/los/logistics/route/service/impl/RouteCostServiceImpl.java

@@ -163,13 +163,11 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 			int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
 			List<RouteCostFee> costFeeList = routeCost.getCostFeeList();
 			for (RouteCostItem routeCostItem : routeCost.getCostItemList()) {
-				//POL杂费成本
-				routeCostItem.setPolCost(computationalCost(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-				//POD杂费成本
-				routeCostItem.setPodCost(computationalCost(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-				//POT杂费成本
-				routeCostItem.setPotCost(computationalCost(costFeeList, "POT", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-				//用箱成本
+				//一程POL杂费成本
+				routeCostItem.setPolCost(computationalCost(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+				//一程POD杂费成本
+				routeCostItem.setPodCost(computationalCost(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());
@@ -177,11 +175,23 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 				} else {
 					routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
 				}
-				// 成本价 = 海运费+用箱成本+pol杂费+pod成本
+				// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
 				routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
 					.add(routeCostItem.getUseBoxCost()));
-				//合计利润
+				//一程合计利润
 				routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
+				if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
+					//二程POL杂费成本
+					routeCostItem.setPolCostTwo(computationalCost(costFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					//二程POD杂费成本
+					routeCostItem.setPodCostTwo(computationalCost(costFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
+					routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
+					//二程合计利润
+					routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().subtract(routeCostItem.getCostPriceTwo()));
+				}
+				//合计利润
+				routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
 				if (routeCostItem.getId() == null) {
 					routeCostItem.setPid(routeCost.getId());
 					routeCostItem.setCreateTime(new Date());
@@ -456,13 +466,11 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 			if (ObjectUtils.isNotNull(routeCostItemList)) {
 				int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
 				for (RouteCostItem routeCostItem : routeCostItemList) {
-					//POL杂费成本
-					routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-					//POD杂费成本
-					routeCostItem.setPodCost(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-					//POT杂费成本
-					routeCostItem.setPotCost(computationalCost(routeCostFeeList, "POT", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-					//用箱成本
+					//一程POL杂费成本
+					routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POD杂费成本
+					routeCostItem.setPodCost(computationalCost(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());
@@ -470,11 +478,23 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 					} else {
 						routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
 					}
-					// 成本价 = 海运费+用箱成本+pol杂费+pod成本
+					// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
 					routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
 						.add(routeCostItem.getUseBoxCost()));
-					//合计利润
+					//一程合计利润
 					routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
+					if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
+						//二程POL杂费成本
+						routeCostItem.setPolCostTwo(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POD杂费成本
+						routeCostItem.setPodCostTwo(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
+						routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
+						//二程合计利润
+						routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().subtract(routeCostItem.getCostPriceTwo()));
+					}
+					//合计利润
+					routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
 					if (routeCostItem.getId() == null) {
 						routeCostItem.setPid(routeCost.getId());
 						routeCostItem.setCreateTime(new Date());
@@ -507,8 +527,6 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 				.eq(RouteCostFee::getTenantId, AuthUtil.getTenantId())
 				.eq(RouteCostFee::getIsDeleted, 0)
 				.eq(RouteCostFee::getPid, routeCostFee.getPid()));
-			List<RouteCostFee> routeCostFeeListNew = routeCostFeeList.stream().filter(e -> !longList.contains(e.getId()))
-				.collect(Collectors.toList());
 			RouteCost routeCost = baseMapper.selectById(routeCostFee.getPid());
 			List<RouteCostItem> routeCostItemList = routeCostItemService.list(new LambdaQueryWrapper<RouteCostItem>()
 				.eq(RouteCostItem::getTenantId, AuthUtil.getTenantId())
@@ -517,14 +535,11 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 			if (ObjectUtils.isNotNull(routeCostItemList)) {
 				int days = routeCost.getNavigateDay() + routeCost.getExistStationDay();
 				for (RouteCostItem routeCostItem : routeCostItemList) {
-					//POL杂费成本
-					routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-					//POD杂费成本
-					routeCostItem.setPodCost(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-					//POT杂费成本
-					routeCostItem.setPotCost(computationalCost(routeCostFeeList, "POT", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-
-					//用箱成本
+					//一程POL杂费成本
+					routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+					//一程POD杂费成本
+					routeCostItem.setPodCost(computationalCost(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());
@@ -532,11 +547,23 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 					} else {
 						routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
 					}
-					// 成本价 = 海运费+用箱成本+pol杂费+pod成本
+					// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
 					routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
 						.add(routeCostItem.getUseBoxCost()));
-					//合计利润
+					//一程合计利润
 					routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
+					if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
+						//二程POL杂费成本
+						routeCostItem.setPolCostTwo(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						//二程POD杂费成本
+						routeCostItem.setPodCostTwo(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+						// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
+						routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
+						//二程合计利润
+						routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().subtract(routeCostItem.getCostPriceTwo()));
+					}
+					//合计利润
+					routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
 					if (routeCostItem.getId() == null) {
 						routeCostItem.setPid(routeCost.getId());
 						routeCostItem.setCreateTime(new Date());
@@ -572,13 +599,11 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 				.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()));
-				//POD杂费成本
-				routeCostItem.setPodCost(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-				//POT杂费成本
-				routeCostItem.setPotCost(computationalCost(routeCostFeeList, "POT", routeCostItem.getBoxType(), routeCostItem.getExrate()));
-				//用箱成本
+				//一程POL杂费成本
+				routeCostItem.setPolCost(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "0"));
+				//一程POD杂费成本
+				routeCostItem.setPodCost(computationalCost(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());
@@ -586,11 +611,23 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 				} else {
 					routeCostItem.setUseBoxCost(new BigDecimal("0.00"));
 				}
-				// 成本价 = 海运费+用箱成本+pol杂费+pod成本
+				// 一程成本价 = 一程海运费+一程用箱成本+一程pol杂费+一程pod成本
 				routeCostItem.setCostPrice(routeCostItem.getOceanFreight().add(routeCostItem.getPodCost()).add(routeCostItem.getPolCost())
 					.add(routeCostItem.getUseBoxCost()));
-				//合计利润
+				//一程合计利润
 				routeCostItem.setTotalProfit(routeCostItem.getSalesPrice().subtract(routeCostItem.getCostPrice()));
+				if ("转船".equals(routeCost.getFlightType()) && "自转".equals(routeCost.getChangeShipType())) {
+					//二程POL杂费成本
+					routeCostItem.setPolCostTwo(computationalCost(routeCostFeeList, "POL", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					//二程POD杂费成本
+					routeCostItem.setPodCostTwo(computationalCost(routeCostFeeList, "POD", routeCostItem.getBoxType(), routeCostItem.getExrate(), "1"));
+					// 二程成本价 = 二程海运费+二程pol杂费+二程pod成本
+					routeCostItem.setCostPriceTwo(routeCostItem.getOceanFreightTwo().add(routeCostItem.getPodCostTwo()).add(routeCostItem.getPolCostTwo()));
+					//二程合计利润
+					routeCostItem.setTotalProfitTwo(routeCostItem.getSalesPriceTwo().subtract(routeCostItem.getCostPriceTwo()));
+				}
+				//合计利润
+				routeCostItem.setProfit(routeCostItem.getTotalProfit().add(routeCostItem.getTotalProfitTwo()));
 				if (routeCostItem.getId() == null) {
 					routeCostItem.setPid(routeCost.getId());
 					routeCostItem.setCreateTime(new Date());
@@ -647,11 +684,11 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 	 * @param boxType          箱型
 	 * @param exrate           汇率
 	 */
-	public BigDecimal computationalCost(List<RouteCostFee> routeCostFeeList, String type, String boxType, BigDecimal exrate) {
+	public BigDecimal computationalCost(List<RouteCostFee> routeCostFeeList, String type, String boxType, BigDecimal exrate, String srcType) {
 		BigDecimal amount = new BigDecimal("0.00");
 		if (!routeCostFeeList.isEmpty()) {
 			amount = routeCostFeeList.stream().filter(e -> e.getBoxType().equals(boxType)
-				&& type.equals(e.getBusType())).reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getExrate().multiply(y.getCostPrice())), BigDecimal::add);
+				&& type.equals(e.getBusType()) && srcType.equals(e.getSrcType())).reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getExrate().multiply(y.getCostPrice())), BigDecimal::add);
 			if (new BigDecimal("0.00").compareTo(amount) != 0) {
 				amount = amount.divide(exrate, 4, RoundingMode.HALF_UP);
 			} else {
@@ -672,17 +709,17 @@ public class RouteCostServiceImpl extends ServiceImpl<RouteCostMapper, RouteCost
 		if (!routeCostItemList.isEmpty()) {
 			if ("20".equals(type)) {
 				profit = routeCostItemList.stream().filter(e -> e.getBoxType().contains("20"))
-					.map(RouteCostItem::getTotalProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
+					.map(RouteCostItem::getProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
 			} else if ("40".equals(type)) {
 				profit = routeCostItemList.stream().filter(e -> e.getBoxType().contains("40") &&
-					!e.getBoxType().equals("40HC")).map(RouteCostItem::getTotalProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
+					!e.getBoxType().equals("40HC")).map(RouteCostItem::getProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
 			} else if ("40HC".equals(type)) {
 				profit = routeCostItemList.stream().filter(e -> e.getBoxType().contains("40HC"))
-					.map(RouteCostItem::getTotalProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
+					.map(RouteCostItem::getProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
 			} else {
 				profit = routeCostItemList.stream().filter(e -> !e.getBoxType().equals("40HC") &&
 						!e.getBoxType().contains("20") && !e.getBoxType().contains("40"))
-					.map(RouteCostItem::getTotalProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
+					.map(RouteCostItem::getProfit).reduce(BigDecimal.ZERO, BigDecimal::add);
 			}
 		} else {
 			profit = new BigDecimal("0.00");