Commit f3b81e39 authored by 332784038@qq.com's avatar 332784038@qq.com

订单产品项单价最后变更时间补充

parent 230c1b94
-- 增加订单产品项最后单价变更时间
alter table ecw_order_item
add COLUMN `last_charge_price_time` datetime DEFAULT NULL COMMENT '最后单价变更时间';
-- 批量更新订单产品项的最后单价变更时间
update ecw_order_item set `last_charge_price_time` = update_time where last_charge_price_time is null;
\ No newline at end of file
......@@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Objects;
......@@ -440,6 +441,9 @@ public class OrderItemDO extends BaseDO {
@ApiModelProperty(value = "到仓:0 无牌 1 有牌 2 中性")
private Integer checkBrandType;
@ApiModelProperty(value = "最后单价变更时间")
private Date lastChargePriceTime;
/**
* 到仓信息json
*/
......
......@@ -3673,8 +3673,13 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
for (OrderItemDO orderItemDO : orderItemDOList) {
for (ProdCostDto prodCostDto : resultDto.getProdCostDtoList()) {
if (Objects.equals(prodCostDto.getItemId(), orderItemDO.getOrderItemId())) {
boolean isChargePrice = false;
orderItemDO.setOriginalSeaFreight(prodCostDto.getOrgFreightPrice());
if ((Objects.isNull(prodCostDto.getOneFreight()) && Objects.nonNull(orderItemDO.getOneSeaFreight())) ||
(Objects.nonNull(prodCostDto.getOneFreight()) && Objects.isNull(orderItemDO.getOneSeaFreight())) ||
(Objects.nonNull(prodCostDto.getOneFreight()) && Objects.nonNull(orderItemDO.getOneSeaFreight()) && orderItemDO.getOneSeaFreight().compareTo(prodCostDto.getOneFreight()) != 0)){
isChargePrice = true;
}
orderItemDO.setOneSeaFreight(prodCostDto.getOneFreight());
orderItemDO.setDiscountFreightPrice(prodCostDto.getDiscountFreightPrice());
orderItemDO.setDiscountFreightTotalPrice(prodCostDto.getDiscountFreightTotalPrice());
......@@ -3721,6 +3726,11 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderItemDO.setMinMeteringWeight(prodCostDto.getMinMeteringWeight());
orderItemDO.setOriginalClearanceFreight(prodCostDto.getOrgClearanceFeePrice());
if ((Objects.isNull(prodCostDto.getOneClearanceFee()) && Objects.nonNull(orderItemDO.getOneClearanceFreight())) ||
(Objects.nonNull(prodCostDto.getOneClearanceFee()) && Objects.isNull(orderItemDO.getOneClearanceFreight())) ||
(Objects.nonNull(prodCostDto.getOneClearanceFee()) && Objects.nonNull(orderItemDO.getOneClearanceFreight()) && orderItemDO.getOneClearanceFreight().compareTo(prodCostDto.getOneClearanceFee()) != 0)){
isChargePrice = true;
}
orderItemDO.setOneClearanceFreight(prodCostDto.getOneClearanceFee());
orderItemDO.setDiscountClearanceFeePrice(prodCostDto.getDiscountClearanceFeePrice());
orderItemDO.setDiscountClearanceFeeTotalPrice(prodCostDto.getDiscountClearanceFeeTotalPrice());
......@@ -3757,6 +3767,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
orderItemDO.setCharging(prodCostDto.getCharging());
orderItemDO.setIsPayAdvance(prodCostDto.getIsPayAdvance());
if (isChargePrice){
orderItemDO.setLastChargePriceTime(new Date());
}
}
}
if (Objects.isNull(orderItemDO.getItemStatus()) ||
......
......@@ -463,6 +463,9 @@ public class OrderItemBackVO {
@ApiModelProperty(value = "到仓:0 无牌 1 有牌 2 中性")
private Integer checkBrandType;
@ApiModelProperty(value = "最后单价变更时间")
private Date lastChargePriceTime;
/**
* 到仓信息json
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment