Commit eaf0b25b authored by lanbaoming's avatar lanbaoming

2024-06-22提交

parent 370dc895
...@@ -93,17 +93,23 @@ public class LineChannelPackagingServiceImpl extends AbstractService<LineChannel ...@@ -93,17 +93,23 @@ public class LineChannelPackagingServiceImpl extends AbstractService<LineChannel
} }
@Override @Override
public List<LineChannelPackagingDO> queryAirClearancePrice(List<String> packages, Long channelId, Long lineId) { public List<LineChannelPackagingDO> queryAirClearancePrice(
List<String> packages,
Long channelId,
Long lineId) {
List<LineChannelPackagingDO> list = new ArrayList<>(); List<LineChannelPackagingDO> list = new ArrayList<>();
if (CollectionUtil.isNotEmpty(packages)) { if (CollectionUtil.isNotEmpty(packages)) {
for (String packageType : packages) { for (String packageType : packages) {
List<LineChannelPackagingDO> packagingDOList = lineChannelPackagingMapper.queryAirClearancePrice(packageType, channelId, lineId); List<LineChannelPackagingDO> packagingDOList =
lineChannelPackagingMapper.queryAirClearancePrice(packageType,
channelId, lineId);
if (CollectionUtil.isNotEmpty(packagingDOList)){ if (CollectionUtil.isNotEmpty(packagingDOList)){
list.addAll(packagingDOList); list.addAll(packagingDOList);
} }
} }
} else { } else {
list = lineChannelPackagingMapper.queryAirClearancePrice(null, channelId, lineId); list = lineChannelPackagingMapper.queryAirClearancePrice(null,
channelId, lineId);
} }
return list; return list;
} }
......
...@@ -613,13 +613,16 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -613,13 +613,16 @@ public class OrderQueryServiceImpl implements OrderQueryService {
initialLogisticsInfoDto.setLineId(dto.getLineId()); initialLogisticsInfoDto.setLineId(dto.getLineId());
initialLogisticsInfoDto.setTransportId(dto.getTransportId()); initialLogisticsInfoDto.setTransportId(dto.getTransportId());
initialLogisticsInfoDto.setChannelId(dto.getChannelId()); initialLogisticsInfoDto.setChannelId(dto.getChannelId());
// 保存初始物流信息,该信息为收费信息 //保存初始物流信息,该信息为收费信息
dto.setInitialLogisticsInfoDto(initialLogisticsInfoDto); dto.setInitialLogisticsInfoDto(initialLogisticsInfoDto);
LogisticsInfoDto logisticsInfoDto = new LogisticsInfoDto(); LogisticsInfoDto logisticsInfoDto = new LogisticsInfoDto();
BeanUtils.copyProperties(initialLogisticsInfoDto, logisticsInfoDto); BeanUtils.copyProperties(initialLogisticsInfoDto, logisticsInfoDto);
if (Objects.nonNull(dto.getAdjustToDestWarehouseId()) && dto.getAdjustToDestWarehouseId() > 0L) { if (Objects.nonNull(dto.getAdjustToDestWarehouseId()) &&
dto.getAdjustToDestWarehouseId() > 0L) {
// 如果有始发仓调仓记录id,则获取最新的调仓仓库信息 // 如果有始发仓调仓记录id,则获取最新的调仓仓库信息
WarehouseRegionVO startWarehouseRegionVO = warehouseMapper.findWarehouseRegion(dto.getAdjustToDestWarehouseId()); WarehouseRegionVO startWarehouseRegionVO =
warehouseMapper.findWarehouseRegion(dto.getAdjustToDestWarehouseId());
if (Objects.nonNull(startWarehouseRegionVO)) { if (Objects.nonNull(startWarehouseRegionVO)) {
logisticsInfoDto.setStartWarehouseId(dto.getAdjustToDestWarehouseId()); logisticsInfoDto.setStartWarehouseId(dto.getAdjustToDestWarehouseId());
logisticsInfoDto.setStartCityId(startWarehouseRegionVO.getShi()); logisticsInfoDto.setStartCityId(startWarehouseRegionVO.getShi());
...@@ -632,7 +635,8 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -632,7 +635,8 @@ public class OrderQueryServiceImpl implements OrderQueryService {
logisticsInfoDto.setStartVolume(startWarehouseRegionVO.getVolume()); logisticsInfoDto.setStartVolume(startWarehouseRegionVO.getVolume());
} }
} }
if (Objects.nonNull(dto.getDestAdjustToDestWarehouseId()) && dto.getDestAdjustToDestWarehouseId() > 0L) { if (Objects.nonNull(dto.getDestAdjustToDestWarehouseId()) &&
dto.getDestAdjustToDestWarehouseId() > 0L) {
// 如果有目的地的目的仓调仓记录id,则获取最新的调仓仓库信息 // 如果有目的地的目的仓调仓记录id,则获取最新的调仓仓库信息
WarehouseRegionVO destWarehouseRegionVO = warehouseMapper.findWarehouseRegion(dto.getDestAdjustToDestWarehouseId()); WarehouseRegionVO destWarehouseRegionVO = warehouseMapper.findWarehouseRegion(dto.getDestAdjustToDestWarehouseId());
if (Objects.nonNull(destWarehouseRegionVO)) { if (Objects.nonNull(destWarehouseRegionVO)) {
......
...@@ -4894,7 +4894,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -4894,7 +4894,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
} }
@Override @Override
public List<OrderWarehouseInWithAttrVO> getOrderWarehouseInCommonAttrList(Long orderId, Long excludeOrderWarehouseInId) { public List<OrderWarehouseInWithAttrVO> getOrderWarehouseInCommonAttrList(
Long orderId, Long excludeOrderWarehouseInId) {
// 根据订单id获取入库详情 // 根据订单id获取入库详情
OrderDO orderDO = orderService.getById(orderId); OrderDO orderDO = orderService.getById(orderId);
...@@ -4902,13 +4903,19 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -4902,13 +4903,19 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
throw ServiceExceptionUtil.exception(ErrorCodeConstants.ORDER_NOT_EXISTS); throw ServiceExceptionUtil.exception(ErrorCodeConstants.ORDER_NOT_EXISTS);
} }
List<OrderItemDO> orderItemDOList = orderItemService.list(new LambdaQueryWrapper<OrderItemDO>() //订单明细
List<OrderItemDO> orderItemDOList =
orderItemService.list(new LambdaQueryWrapper<OrderItemDO>()
.eq(OrderItemDO::getOrderId, orderId).orderByAsc(OrderItemDO::getOrderItemId)); .eq(OrderItemDO::getOrderId, orderId).orderByAsc(OrderItemDO::getOrderItemId));
List<OrderWarehouseInDO> orderWarehouseInDOList = orderWarehouseInMapper.selectList(new LambdaQueryWrapper<OrderWarehouseInDO>() //ecw_order_warehouse_in 入仓货物详情表
List<OrderWarehouseInDO> orderWarehouseInDOList =
orderWarehouseInMapper.selectList(
new LambdaQueryWrapper<OrderWarehouseInDO>()
.eq(OrderWarehouseInDO::getOrderId, orderId).orderByAsc(OrderWarehouseInDO::getId)); .eq(OrderWarehouseInDO::getOrderId, orderId).orderByAsc(OrderWarehouseInDO::getId));
if (excludeOrderWarehouseInId != null) { if (excludeOrderWarehouseInId != null) {
orderWarehouseInDOList = orderWarehouseInDOList.stream().filter(t -> !t.getId().equals(excludeOrderWarehouseInId)).collect(Collectors.toList()); orderWarehouseInDOList =
orderWarehouseInDOList.stream().filter(t -> !t.getId().equals(excludeOrderWarehouseInId)).collect(Collectors.toList());
} }
List<OrderWarehouseInWithAttrVO> resultList = new ArrayList<>(); List<OrderWarehouseInWithAttrVO> resultList = new ArrayList<>();
......
...@@ -762,6 +762,10 @@ public class ProdCostCalculation { ...@@ -762,6 +762,10 @@ public class ProdCostCalculation {
BigDecimal transportPrice = BigDecimal.ZERO;// 初始化商品单价运费 BigDecimal transportPrice = BigDecimal.ZERO;// 初始化商品单价运费
BigDecimal clearancePrice = BigDecimal.ZERO;// 初始化商品单价清关费 BigDecimal clearancePrice = BigDecimal.ZERO;// 初始化商品单价清关费
//是否拆单自定义价格 getIsPriced
//是否特价 getSpecialPriceType
//是否为渠道/单询手动定价 getChannelManualPricing
//是否已定价 getIsPriced
if ((Objects.isNull(prodParam.getIsPriced()) || !prodParam.getIsPriced()) if ((Objects.isNull(prodParam.getIsPriced()) || !prodParam.getIsPriced())
&& !prodParam.getSplitCustomPriceType() && && !prodParam.getSplitCustomPriceType() &&
!prodParam.getSpecialPriceType() && !prodParam.getSpecialPriceType() &&
...@@ -779,7 +783,7 @@ public class ProdCostCalculation { ...@@ -779,7 +783,7 @@ public class ProdCostCalculation {
//专线空运 //专线空运
zTest3 z = new zTest3(); zTest3 z = new zTest3();
z.setCreatedate(new Date()); z.setCreatedate(new Date());
String s = "开始计算空运清关价 airStepSelect,lineId=" + lineId + String s = "1开始计算空运清关价 airStepSelect,lineId=" + lineId +
" 渠道channelId=" + channelId; " 渠道channelId=" + channelId;
z.setTestname(s); z.setTestname(s);
zTestMapper.insert(z); zTestMapper.insert(z);
...@@ -787,6 +791,13 @@ public class ProdCostCalculation { ...@@ -787,6 +791,13 @@ public class ProdCostCalculation {
this.airStepSelect(unitDOMap, prodParam, this.airStepSelect(unitDOMap, prodParam,
productPriceDO, lineId, channelId); productPriceDO, lineId, channelId);
} }
} else {
zTest3 z = new zTest3();
z.setCreatedate(new Date());
String s = "不是阶梯价 airStepSelect,lineId=" + lineId +
" 渠道channelId=" + channelId;
z.setTestname(s);
zTestMapper.insert(z);
} }
prodParam.setIsPayAdvance(productPriceDO.getNeedPay()); prodParam.setIsPayAdvance(productPriceDO.getNeedPay());
...@@ -982,6 +993,13 @@ public class ProdCostCalculation { ...@@ -982,6 +993,13 @@ public class ProdCostCalculation {
} }
} else { } else {
zTest3 z = new zTest3();
z.setCreatedate(new Date());
String s = "产品线路价格为空";
z.setTestname(s);
zTestMapper.insert(z);
if (!prodParam.getSpecialPriceType()) { if (!prodParam.getSpecialPriceType()) {
prodParam.setOneFreight(transportPrice); prodParam.setOneFreight(transportPrice);
prodParam.setOneClearanceFee(clearancePrice); prodParam.setOneClearanceFee(clearancePrice);
...@@ -1010,6 +1028,12 @@ public class ProdCostCalculation { ...@@ -1010,6 +1028,12 @@ public class ProdCostCalculation {
prodParam.setPlainCommission(BigDecimal.ZERO); prodParam.setPlainCommission(BigDecimal.ZERO);
prodParam.setHiddenCommission(BigDecimal.ZERO); prodParam.setHiddenCommission(BigDecimal.ZERO);
} }
} else {
zTest3 z = new zTest3();
z.setCreatedate(new Date());
String s = "不符合定价条件";
z.setTestname(s);
zTestMapper.insert(z);
} }
} }
...@@ -1175,8 +1199,11 @@ public class ProdCostCalculation { ...@@ -1175,8 +1199,11 @@ public class ProdCostCalculation {
* @param type 类型:0 空运清关费入仓值为准 1 空运运费收费值为准 2 海运计算 * @param type 类型:0 空运清关费入仓值为准 1 空运运费收费值为准 2 海运计算
* @return 计量值 * @return 计量值
*/ */
private BigDecimal calculationUnitAsValue(ProdConditionParam prodParam, ProductPriceDO productPriceDO, UnitDO private BigDecimal calculationUnitAsValue(ProdConditionParam prodParam,
unitDO, Integer type) { ProductPriceDO productPriceDO,
UnitDO unitDO,
Integer type) {
BigDecimal num; BigDecimal num;
if (StringUtils.equals("m³", unitDO.getFuhao())) { if (StringUtils.equals("m³", unitDO.getFuhao())) {
// 体积 // 体积
...@@ -1258,16 +1285,28 @@ public class ProdCostCalculation { ...@@ -1258,16 +1285,28 @@ public class ProdCostCalculation {
} else { } else {
productPriceDO.setAllPrice(BigDecimal.ZERO); productPriceDO.setAllPrice(BigDecimal.ZERO);
} }
zTest3 z = new zTest3();
z.setCreatedate(new Date());
z.setTestname("2运费计量单位 为空");
zTestMapper.insert(z);
return; return;
} }
//计量单位符号
BigDecimal num = this.calculationUnitAsValue(prodParam, BigDecimal num = this.calculationUnitAsValue(prodParam,
productPriceDO, productPriceDO,
prodParam.getUnitDO(), prodParam.getUnitDO(),
1); 1);
//lanbm 2024-06-21 添加的逻辑 //lanbm 2024-06-21 添加的逻辑
if (productPriceDO.getPriceType() == null) return; if (productPriceDO.getPriceType() == null) {
zTest3 z = new zTest3();
z.setCreatedate(new Date());
z.setTestname("3价格类型 为空");
zTestMapper.insert(z);
return;
}
//全包价 //全包价
if (productPriceDO.getPriceType() == 1) { if (productPriceDO.getPriceType() == 1) {
...@@ -1285,6 +1324,10 @@ public class ProdCostCalculation { ...@@ -1285,6 +1324,10 @@ public class ProdCostCalculation {
productPriceDO.setNeedPay(null); productPriceDO.setNeedPay(null);
productPriceDO.setAllPrice(BigDecimal.ZERO); productPriceDO.setAllPrice(BigDecimal.ZERO);
} }
zTest3 z = new zTest3();
z.setCreatedate(new Date());
z.setTestname("4价格类型 为全包价,无需计算清关费");
zTestMapper.insert(z);
return; return;
} }
...@@ -1294,27 +1337,38 @@ public class ProdCostCalculation { ...@@ -1294,27 +1337,38 @@ public class ProdCostCalculation {
productPriceStepService.getProductPriceStep( productPriceStepService.getProductPriceStep(
productPriceDO.getId(), num, 0); productPriceDO.getId(), num, 0);
if (Objects.nonNull(transportBasePrice)) { if (Objects.nonNull(transportBasePrice)) {
log.info("===== 线路无牌无液无电运费阶梯价:{} =====", log.info("线路无牌无液无电运费阶梯价:{} =====",
JSONObject.toJSONString(transportBasePrice)); JSONObject.toJSONString(transportBasePrice));
productPriceDO.setTransportPrice(transportBasePrice.getTransportPrice()); productPriceDO.setTransportPrice(
productPriceDO.setTransportStepPriceId(transportBasePrice.getTransportStepPriceId()); transportBasePrice.getTransportPrice());
productPriceDO.setTransportStepPriceId(
transportBasePrice.getTransportStepPriceId());
} else { } else {
log.info("===== 线路无牌无液无电运费阶梯价不存在【{} {}】该档次 =====",
num, prodParam.getUnitDO().getFuhao());
productPriceDO.setNeedPay(null); productPriceDO.setNeedPay(null);
productPriceDO.setTransportPrice(BigDecimal.ZERO); productPriceDO.setTransportPrice(BigDecimal.ZERO);
String s = "5线路无牌无液无电运费阶梯价不存在【" + num +
prodParam.getUnitDO().getFuhao() + "】该档次";
zTest3 z = new zTest3();
z.setCreatedate(new Date());
z.setTestname(s);
zTestMapper.insert(z);
} }
if (prodParam.getClearanceUnitDO() == null) { if (prodParam.getClearanceUnitDO() == null) {
//清关费单位为空,设置清关费为0 //清关费单位为空,设置清关费为0
productPriceDO.setClearancePrice(BigDecimal.ZERO); productPriceDO.setClearancePrice(BigDecimal.ZERO);
zTest3 z = new zTest3();
z.setCreatedate(new Date());
z.setTestname("6清关费单位为空");
zTestMapper.insert(z);
return; return;
} }
// 清关费以实际入仓值来匹配 // 清关费以实际入仓值来匹配
// 2024-1-17 空运清关费改为和空运运费一样使用订单总收费值来匹配 // 2024-1-17 空运清关费改为和空运运费一样使用订单总收费值来匹配
//BigDecimal clearanceNum = this.calculationUnitAsValue(prodParam, productPriceDO, prodParam.getClearanceUnitDO(), 0); //BigDecimal clearanceNum = this.calculationUnitAsValue(prodParam, productPriceDO, prodParam.getClearanceUnitDO(), 0);
//清关价计量单位
BigDecimal clearanceNum = num; BigDecimal clearanceNum = num;
//获取阶梯价 //获取阶梯价
BasePrice clearanceBasePrice = BasePrice clearanceBasePrice =
...@@ -1326,7 +1380,7 @@ public class ProdCostCalculation { ...@@ -1326,7 +1380,7 @@ public class ProdCostCalculation {
clearanceBasePrice.setClearanceVolumeUnit( clearanceBasePrice.setClearanceVolumeUnit(
productPriceDO.getClearanceVolumeUnit()); productPriceDO.getClearanceVolumeUnit());
log.info("===== 线路无牌无液无电清关费阶梯价:{} =====", log.info("线路无牌无液无电清关费阶梯价:{}",
JSONObject.toJSONString(clearanceBasePrice)); JSONObject.toJSONString(clearanceBasePrice));
int airClearanceSource = 3; int airClearanceSource = 3;
...@@ -1338,14 +1392,31 @@ public class ProdCostCalculation { ...@@ -1338,14 +1392,31 @@ public class ProdCostCalculation {
&& Objects.nonNull(productPriceDO.getClearancePrice()) && Objects.nonNull(productPriceDO.getClearancePrice())
&& productPriceDO.getClearancePrice().compareTo(BigDecimal.ZERO) > 0) { && productPriceDO.getClearancePrice().compareTo(BigDecimal.ZERO) > 0) {
if (CollectionUtil.isNotEmpty(prodParam.getPackages())) { if (CollectionUtil.isNotEmpty(prodParam.getPackages())) {
zTest3 z = new zTest3(); zTest3 z = new zTest3();
z.setCreatedate(new Date()); z.setCreatedate(new Date());
z.setTestname("产品包装类型为:"+prodParam.getPackages().toString()); z.setTestname("7产品包装类型list为:" +
prodParam.getPackages().toString());
zTestMapper.insert(z);
} else {
zTest3 z = new zTest3();
z.setCreatedate(new Date());
String s = "8产品包装类型List为空";
if (prodParam.getPackaging() == null) {
s += ",包装类型也为空";
} else {
s += ",包装类型" + prodParam.getPackaging();
}
z.setTestname(s);
zTestMapper.insert(z); zTestMapper.insert(z);
} }
//TODO 获取线路设置的空运清关费 //TODO 获取线路设置的空运清关费
//PACKAGING_TYPE 包装要求 数据字典中的数据
// 1箱,2编织袋,3木架,4木箱,5托,6航空箱,7桶,8压缩包,9铁架
//线路渠道清关费包装类型表 ecw_line_channel_packaging //线路渠道清关费包装类型表 ecw_line_channel_packaging
//ecw_line_channel_price_step_clearance 清关费阶梯价
List<LineChannelPackagingDO> lineChannelPackagingDOList = List<LineChannelPackagingDO> lineChannelPackagingDOList =
lineChannelPackagingService.queryAirClearancePrice( lineChannelPackagingService.queryAirClearancePrice(
CollectionUtil.isNotEmpty(prodParam.getPackages()) ? CollectionUtil.isNotEmpty(prodParam.getPackages()) ?
...@@ -1380,6 +1451,13 @@ public class ProdCostCalculation { ...@@ -1380,6 +1451,13 @@ public class ProdCostCalculation {
BigDecimal lineClearanceNum = BigDecimal lineClearanceNum =
this.calculationUnitAsValue(prodParam, this.calculationUnitAsValue(prodParam,
productPriceDO, lineClearanceUnitDO, 0); productPriceDO, lineClearanceUnitDO, 0);
if (lineClearanceNum != null) {
zTest3 z = new zTest3();
z.setCreatedate(new Date());
z.setTestname("99lineClearanceNum=" + lineClearanceNum);
zTestMapper.insert(z);
}
//ecw_line_channel_price_step_clearance //ecw_line_channel_price_step_clearance
//线路渠道清关费阶梯价格 //线路渠道清关费阶梯价格
List<LineChannelPriceStepClearanceDO> List<LineChannelPriceStepClearanceDO>
...@@ -1398,24 +1476,40 @@ public class ProdCostCalculation { ...@@ -1398,24 +1476,40 @@ public class ProdCostCalculation {
packagingStepPriceDOList.stream(). packagingStepPriceDOList.stream().
filter(priceStep -> priceStep.getStartNum(). filter(priceStep -> priceStep.getStartNum().
compareTo(lineClearanceNum) <= 0 compareTo(lineClearanceNum) <= 0
&& priceStep.getEndNum().compareTo(lineClearanceNum) >= 0).findFirst().orElse(null); && priceStep.getEndNum().compareTo(
lineClearanceNum) >= 0).
findFirst().orElse(null);
if (Objects.nonNull(priceStepDO)) { if (Objects.nonNull(priceStepDO)) {
BigDecimal productClearancePrice = BigDecimal productClearancePrice =
productExchangeRate.getCurrencyRate().multiply(priceStepDO.getClearancePrice()).setScale(2, BigDecimal.ROUND_HALF_UP); productExchangeRate.getCurrencyRate().
if (lineClearanceBasePrice.getClearancePrice().compareTo(BigDecimal.ZERO) > 0) { multiply(priceStepDO.getClearancePrice()).
if (productClearancePrice.compareTo(lineClearanceBasePrice.getProductClearanceAsExchangePrice()) > 0) { setScale(2, BigDecimal.ROUND_HALF_UP);
lineClearanceBasePrice.setClearanceStepPriceId(priceStepDO.getId());
if (lineClearanceBasePrice.getClearancePrice().
compareTo(BigDecimal.ZERO) > 0) {
if (productClearancePrice.compareTo(
lineClearanceBasePrice.
getProductClearanceAsExchangePrice()) > 0) {
lineClearanceBasePrice.setClearanceStepPriceId(
priceStepDO.getId());
lineClearanceBasePrice.setAirClearanceSource(4); lineClearanceBasePrice.setAirClearanceSource(4);
lineClearanceBasePrice.setClearancePrice(priceStepDO.getClearancePrice()); lineClearanceBasePrice.setClearancePrice(
lineClearanceBasePrice.setAirClearanceInfo(JSONObject.toJSONString(priceStepDO)); priceStepDO.getClearancePrice());
lineClearanceBasePrice.setAirClearanceInfo(
JSONObject.toJSONString(priceStepDO));
} }
} else { } else {
BeanUtils.copyProperties(priceStepDO, lineClearanceBasePrice); BeanUtils.copyProperties(priceStepDO, lineClearanceBasePrice);
lineClearanceBasePrice.setClearanceStepPriceId(priceStepDO.getId()); lineClearanceBasePrice.setClearanceStepPriceId(
priceStepDO.getId());
lineClearanceBasePrice.setAirClearanceSource(4); lineClearanceBasePrice.setAirClearanceSource(4);
lineClearanceBasePrice.setClearancePrice(priceStepDO.getClearancePrice()); lineClearanceBasePrice.setClearancePrice(
lineClearanceBasePrice.setAirClearanceInfo(JSONObject.toJSONString(priceStepDO)); priceStepDO.getClearancePrice());
lineClearanceBasePrice.setAirClearanceInfo(
JSONObject.toJSONString(priceStepDO));
lineClearanceBasePrice.setProductClearanceAsExchangePrice(productClearancePrice); lineClearanceBasePrice.setProductClearanceAsExchangePrice(productClearancePrice);
} }
} }
...@@ -1423,20 +1517,28 @@ public class ProdCostCalculation { ...@@ -1423,20 +1517,28 @@ public class ProdCostCalculation {
//线路渠道清关费阶梯价格 为空 //线路渠道清关费阶梯价格 为空
zTest3 z = new zTest3(); zTest3 z = new zTest3();
z.setCreatedate(new Date()); z.setCreatedate(new Date());
z.setTestname("线路渠道清关费阶梯价格 为空"); z.setTestname("9线路渠道清关费阶梯价格 为空lineId="
+ lineId + "channelId=" + channelId + "lineClearanceNum=" +
lineClearanceNum);
zTestMapper.insert(z); zTestMapper.insert(z);
} }
} }
if (lineClearanceBasePrice != null) { if (lineClearanceBasePrice != null) {
/*
int result = 0; int result = 0;
if (!clearanceBasePrice.getClearancePriceUnit(). if (!clearanceBasePrice.getClearancePriceUnit().
equals(lineClearanceBasePrice.getClearancePriceUnit())) { equals(lineClearanceBasePrice.getClearancePriceUnit())) {
ExchangeRateRespDTO productExchangeRate = ExchangeRateRespDTO productExchangeRate =
currencyApi.getCurrencyRate( currencyApi.getCurrencyRate(
clearanceBasePrice.getClearancePriceUnit(), 1L); clearanceBasePrice.getClearancePriceUnit(),
1L);
BigDecimal productClearancePrice = BigDecimal productClearancePrice =
productExchangeRate.getCurrencyRate(). productExchangeRate.getCurrencyRate().
multiply(clearanceBasePrice.getClearancePrice()).setScale(2, BigDecimal.ROUND_HALF_UP); multiply(clearanceBasePrice.getClearancePrice()).
setScale(2,
BigDecimal.ROUND_HALF_UP);
BigDecimal lineClearancePrice = BigDecimal lineClearancePrice =
lineClearanceBasePrice.getProductClearanceAsExchangePrice(); lineClearanceBasePrice.getProductClearanceAsExchangePrice();
result = productClearancePrice.compareTo(lineClearancePrice); result = productClearancePrice.compareTo(lineClearancePrice);
...@@ -1445,19 +1547,33 @@ public class ProdCostCalculation { ...@@ -1445,19 +1547,33 @@ public class ProdCostCalculation {
compareTo(lineClearanceBasePrice.getClearancePrice()); compareTo(lineClearanceBasePrice.getClearancePrice());
} }
airClearanceSource = result >= 0 ? 3 : 4; airClearanceSource = result >= 0 ? 3 : 4;
clearancePrice = result >= 0 ? clearanceBasePrice : lineClearanceBasePrice;
clearancePrice = result >= 0 ? clearanceBasePrice :
lineClearanceBasePrice;
*/
clearancePrice=lineClearanceBasePrice;
} else { } else {
clearancePrice = clearanceBasePrice; clearancePrice = clearanceBasePrice;
} }
} else { } else {
zTest3 z = new zTest3(); zTest3 z = new zTest3();
z.setCreatedate(new Date()); z.setCreatedate(new Date());
z.setTestname("线路渠道包装类型为空"); z.setTestname("10线路渠道包装类型为空lineId="
+ lineId + "channelId=" + channelId);
zTestMapper.insert(z); zTestMapper.insert(z);
//产品阶梯价的清关价
clearancePrice = clearanceBasePrice; clearancePrice = clearanceBasePrice;
} }
//设置清关价 //设置清关价
//lanbm 2024-06-21 注释此处 //lanbm 2024-06-21 注释此处
zTest3 z = new zTest3();
z.setCreatedate(new Date());
z.setTestname("计算出的清关价为:" +
clearancePrice.getClearancePrice());
zTestMapper.insert(z);
productPriceDO.setClearancePrice( productPriceDO.setClearancePrice(
clearancePrice.getClearancePrice()); clearancePrice.getClearancePrice());
...@@ -1466,15 +1582,16 @@ public class ProdCostCalculation { ...@@ -1466,15 +1582,16 @@ public class ProdCostCalculation {
productPriceDO.setProductPriceEmptyType( productPriceDO.setProductPriceEmptyType(
clearancePrice.getProductPriceEmptyType()); clearancePrice.getProductPriceEmptyType());
productPriceDO.setAirClearanceInfo( productPriceDO.setAirClearanceInfo(
clearancePrice.getAirClearanceInfo());// 清关费详情 clearancePrice.getAirClearanceInfo()); // 清关费详情
prodParam.setAirClearanceSource(airClearanceSource);// 清关费来源 prodParam.setAirClearanceSource(airClearanceSource);// 清关费来源
prodParam.setAirClearanceInfo( prodParam.setAirClearanceInfo(
productPriceDO.getAirClearanceInfo());// 清关费详情 productPriceDO.getAirClearanceInfo()); // 清关费详情
} else { } else {
zTest3 z = new zTest3(); zTest3 z = new zTest3();
z.setCreatedate(new Date()); z.setCreatedate(new Date());
z.setTestname("线路无牌无液无电清关费阶梯价不存在【" z.setTestname("线路无牌无液无电清关费阶梯价不存在,不符合逻辑条件【"
+ num + + num +
prodParam.getClearanceUnitDO().getFuhao() + "】该档次" prodParam.getClearanceUnitDO().getFuhao() + "】该档次"
); );
......
...@@ -64,7 +64,6 @@ public class ProductPriceStepServiceImpl extends AbstractService<ProductPriceSte ...@@ -64,7 +64,6 @@ public class ProductPriceStepServiceImpl extends AbstractService<ProductPriceSte
BigDecimal num, BigDecimal num,
Integer priceType) { Integer priceType) {
//0-运费,1-全包价, 2-清关费 //0-运费,1-全包价, 2-清关费
List<ProductPriceStepDO> list = this.list( List<ProductPriceStepDO> list = this.list(
new LambdaQueryWrapperX<ProductPriceStepDO>() new LambdaQueryWrapperX<ProductPriceStepDO>()
.eq(ProductPriceStepDO::getProductPriceId, productPriceId) .eq(ProductPriceStepDO::getProductPriceId, productPriceId)
......
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