Commit c16a8845 authored by zhengyi's avatar zhengyi

出货阶段的订单信息修改都不对订单产品价格进行重置计算

parent 2031c168
......@@ -2032,19 +2032,19 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
LinkedList<ApplyInfoVO> applyInfoList = new LinkedList<>();
// 通用信息比较
this.compareGenericForms(updateReqVO, vo, applyInfoList);
this.compareGenericForms(updateReqVO, vo, isShipment, applyInfoList);
// 空运信息比较
if (Objects.equals(updateReqVO.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue()) || Objects.equals(updateReqVO.getTransportId(), TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue())) {
// 空运需要设置空运相关信息
this.compareAirInfo(updateReqVO, vo, applyInfoList);
this.compareAirInfo(updateReqVO, vo, isShipment, applyInfoList);
}
if ((Objects.equals(vo.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue()) || Objects.equals(vo.getTransportId(), TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue()))
&& (!Objects.equals(updateReqVO.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue()) && !Objects.equals(updateReqVO.getTransportId(), TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue()))) {
// 原订单是空运,当前改为非空运则要清空空运相关设置信息
this.compareClearAirInfo(updateReqVO, vo, applyInfoList);
this.compareClearAirInfo(updateReqVO, vo, isShipment, applyInfoList);
}
// 线路信息比较
this.compareLine(updateReqVO, vo, applyInfoList, logisticsInfoDto);
this.compareLine(updateReqVO, vo, isShipment, applyInfoList, logisticsInfoDto);
// 比较发货人信息
CustomerContactsDO consignorContactsDO = customerContactsService.getCustomerContacts(updateReqVO.getConsignorContactsId());
......@@ -2054,7 +2054,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(consignorContactsDO)) {
consignorDO = customerService.getById(consignorContactsDO.getCustomerId());
if (Objects.nonNull(consignorDO)) {
// TODO 非控货订单是否必须有收货人
// 非控货订单必须有收货人
if (vo.getIsCargoControl() && vo.getHasConsignee() != hasConsignee) {
ApplyInfoVO infoVO = new ApplyInfoVO();
infoVO.setName("控货订单是否有无收货人");
......@@ -2067,7 +2067,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
orderConsignorBackVO.setCustomerNumber(consignorDO.getNumber());
}
this.compareConsignorInfo(updateReqVO, consignorContactsDO, orderConsignorBackVO, applyInfoList, vo);
this.compareConsignorInfo(updateReqVO, consignorContactsDO, orderConsignorBackVO, applyInfoList, vo, isShipment);
}
vo.setConsignorVO(orderConsignorBackVO);
// 比较收货人信息
......@@ -2101,7 +2101,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
if (Objects.nonNull(consigneeContactsDO)) {
this.compareConsigneeInfo(updateReqVO, consigneeContactsDO, orderConsigneeBackVO, applyInfoList, vo, dictDataRespDTO);
this.compareConsigneeInfo(updateReqVO, consigneeContactsDO, orderConsigneeBackVO, applyInfoList, vo, dictDataRespDTO, isShipment);
}
} else {
// 控货订单发货人设置为控货无收货人,这里需要处理掉订单的收货人信息
......@@ -2228,8 +2228,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
private void compareClearAirInfo(OrderUpdateReqVO updateReqVO, OrderBackVO
vo, List<ApplyInfoVO> applyInfoList) {
private void compareClearAirInfo(OrderUpdateReqVO updateReqVO, OrderBackVO vo, boolean isShipment, List<ApplyInfoVO> applyInfoList) {
ApplyInfoVO infoVO;
// 目的港清关
if (Objects.nonNull(vo.getPortDestCustomsClear()) && vo.getPortDestCustomsClear() != 0) {
......@@ -2329,7 +2328,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
private void compareAirInfo(OrderUpdateReqVO updateReqVO, OrderBackVO vo, List<ApplyInfoVO> applyInfoList) {
private void compareAirInfo(OrderUpdateReqVO updateReqVO, OrderBackVO vo, boolean isShipment, List<ApplyInfoVO> applyInfoList) {
ApplyInfoVO infoVO;
// 目的港清关
......@@ -2452,7 +2451,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
* @param vo 原订单数据
* @param applyInfoList 变更详情记录
*/
private void compareLine(OrderUpdateReqVO updateReqVO, OrderBackVO vo, List<ApplyInfoVO> applyInfoList, LogisticsInfoDto logisticsInfoDto) {
private void compareLine(OrderUpdateReqVO updateReqVO, OrderBackVO vo, boolean isShipment, List<ApplyInfoVO> applyInfoList, LogisticsInfoDto logisticsInfoDto) {
ApplyInfoVO infoVO;
// 原线路信息
LogisticsInfoDto orgLogisticsInfoDto = vo.getLogisticsInfoDto();
......@@ -2559,7 +2558,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
// 线路变动肯定要重新计价
vo.setIsResetPrice(true);
vo.setIsResetPrice(!isShipment);
}
vo.setChannelId(Objects.isNull(vo.getChannelId()) ? 0L : vo.getChannelId());
......@@ -2585,12 +2584,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
applyInfoList.add(infoVO);
vo.setChannelId(updateReqVO.getChannelId());
// 线路变动肯定要重新计价
vo.setIsResetPrice(true);
vo.setIsResetPrice(!isShipment);
}
}
private void compareConsignorInfo(OrderUpdateReqVO updateReqVO, CustomerContactsDO consignorContactsDO,
OrderConsignorBackVO orderConsignorBackVO, List<ApplyInfoVO> applyInfoList, OrderBackVO vo) {
OrderConsignorBackVO orderConsignorBackVO, List<ApplyInfoVO> applyInfoList, OrderBackVO vo, boolean isShipment) {
// 验证该订单是否有核销应收
receivableService.verificationReceivableIsWriteOff(vo.getOrderId(), null);
......@@ -2672,7 +2671,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorBackVO.setIsCharge(true);
// 重新定价
// 重新定价
vo.setIsResetPrice(true);
vo.setIsResetPrice(!isShipment);
vo.setConsignorVO(orderConsignorBackVO);
}
......@@ -2680,7 +2679,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
private void compareConsigneeInfo(OrderUpdateReqVO updateReqVO, CustomerContactsDO consigneeContactsDO,
OrderConsigneeBackVO orderConsigneeBackVO, List<ApplyInfoVO> applyInfoList,
OrderBackVO vo, DictDataRespDTO dictDataRespDTO) {
OrderBackVO vo, DictDataRespDTO dictDataRespDTO, boolean isShipment) {
// 验证该订单是否有核销应收
receivableService.verificationReceivableIsWriteOff(vo.getOrderId(), null);
ApplyInfoVO infoVO;
......@@ -2763,7 +2762,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 收货人信息有变动
orderConsigneeBackVO.setIsCharge(true);
// 重新定价
vo.setIsResetPrice(true);
vo.setIsResetPrice(!isShipment);
vo.setConsigneeVO(orderConsigneeBackVO);
}
......@@ -2863,8 +2862,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
private void compareGenericForms(OrderUpdateReqVO updateReqVO, OrderBackVO
vo, List<ApplyInfoVO> applyInfoList) {
private void compareGenericForms(OrderUpdateReqVO updateReqVO, OrderBackVO vo, boolean isShipment, List<ApplyInfoVO> applyInfoList) {
ApplyInfoVO infoVO;
// 订单服务类型
if ((StringUtils.isNotBlank(vo.getType()) && StringUtils.isBlank(updateReqVO.getType())) ||
......@@ -2902,7 +2900,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
infoVO.setOrgValue(vo.getIsCargoControl() ? "是/yes" : "否/no");
infoVO.setNewValue(updateReqVO.getIsCargoControl() ? "是/yes" : "否/no");
vo.setIsCargoControl(updateReqVO.getIsCargoControl());
vo.setIsCheckCoupon(Boolean.TRUE);
vo.setIsCheckCoupon(!isShipment);
applyInfoList.add(infoVO);
}
Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency();
......@@ -2949,7 +2947,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
infoVO.setOrgValue(vo.getCustomsType() == 1 ? "我司全代/Our full representative" : (vo.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration"));
infoVO.setNewValue(updateReqVO.getCustomsType() == 1 ? "我司全代/Our full representative" : (updateReqVO.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration"));
vo.setCustomsType(updateReqVO.getCustomsType());
vo.setIsCheckCoupon(Boolean.TRUE);
vo.setIsCheckCoupon(!isShipment);
applyInfoList.add(infoVO);
}
// 出单方式
......
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