Commit ac35445a authored by Administrator's avatar Administrator

Merge branch 'release' into 'jd_dev'

Release代码合并到jd分支20241224

See merge request !54
parents 472125ca 437b6337
......@@ -25,6 +25,7 @@ import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
......@@ -148,7 +149,7 @@ public class BpmTaskController {
taskExtMapper.selectListByProcessInstanceId(reqVO.getId());
if (taskList1 == null || taskList1.size() == 0) continue;
List<BpmTaskExtDO> taskList = taskList1.stream().filter(t -> t.getAssigneeUserId() == l.getId()).
List<BpmTaskExtDO> taskList = taskList1.stream().filter(t -> Objects.equals(t.getAssigneeUserId(),l.getId())).
sorted(Comparator.comparingLong(BpmTaskExtDO::getId).reversed()).
collect(Collectors.toList());
if (taskList == null) continue;
......
......@@ -586,7 +586,7 @@ public class OrderDO extends BaseDO {
@TableField(exist = false)
@ApiModelProperty(value = "收货人信息")
@NotNull(message = "收货人信息不能为空")
// @NotNull(message = "收货人信息不能为空")
private OrderConsigneeDO orderConsigneeDO;
@TableField(exist = false)
......
......@@ -517,7 +517,9 @@ public class MergeServiceImpl extends AbstractService<MergeMapper, MergeDO> impl
orderDO.setOrderNo(newOrderNo);
//将几个id设置成空 生成新的收货 发货人和始发 目的信息
orderDO.getOrderDepartureDO().setId(null);
if (Objects.nonNull(orderDO.getOrderConsigneeDO())) {
orderDO.getOrderConsigneeDO().setId(null);
}
orderDO.getOrderConsignorDO().setId(null);
orderDO.getOrderObjectiveDO().setId(null);
orderDO.setGuanLianOrderStatus(null);
......
......@@ -2017,19 +2017,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());
......@@ -2039,7 +2039,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("控货订单是否有无收货人");
......@@ -2052,7 +2052,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);
// 比较收货人信息
......@@ -2086,7 +2086,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 {
// 控货订单发货人设置为控货无收货人,这里需要处理掉订单的收货人信息
......@@ -2213,8 +2213,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) {
......@@ -2314,7 +2313,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;
// 目的港清关
......@@ -2437,7 +2436,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();
......@@ -2544,7 +2543,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
// 线路变动肯定要重新计价
vo.setIsResetPrice(true);
vo.setIsResetPrice(!isShipment);
}
vo.setChannelId(Objects.isNull(vo.getChannelId()) ? 0L : vo.getChannelId());
......@@ -2570,12 +2569,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);
......@@ -2657,7 +2656,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorBackVO.setIsCharge(true);
// 重新定价
// 重新定价
vo.setIsResetPrice(true);
vo.setIsResetPrice(!isShipment);
vo.setConsignorVO(orderConsignorBackVO);
}
......@@ -2665,7 +2664,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;
......@@ -2748,7 +2747,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 收货人信息有变动
orderConsigneeBackVO.setIsCharge(true);
// 重新定价
vo.setIsResetPrice(true);
vo.setIsResetPrice(!isShipment);
vo.setConsigneeVO(orderConsigneeBackVO);
}
......@@ -2848,8 +2847,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())) ||
......@@ -2887,7 +2885,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();
......@@ -2934,7 +2932,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);
}
// 出单方式
......@@ -3806,6 +3804,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
// 订单收货人信息
OrderConsigneeDO consigneeDO = orderDO.getOrderConsigneeDO();
if(Objects.nonNull(consigneeDO)) {
consigneeDO.setUpdater(creator);
consigneeDO.setUpdateTime(now);
if (consigneeDO.getId() == null || consigneeDO.getId() <= 0L) {
......@@ -3816,6 +3815,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else {
orderConsigneeService.updateById(consigneeDO);
}
}
List<OrderItemDO> orderItemDOList = orderDO.getOrderItemDOList();
// 订单控货人信息
if (orderDO.getIsCargoControl()) {
......@@ -4081,6 +4081,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorService.saveOrUpdate(consignorDO);
// 订单收货人信息
OrderConsigneeDO consigneeDO = orderDO.getOrderConsigneeDO();
if (Objects.nonNull(consigneeDO)) {
if (Objects.nonNull(oldOrder)) {
OrderConsigneeDO oldConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, oldOrder.getOrderId()).last("limit 1"));
consigneeDO.setId(oldConsigneeDO.getId());
......@@ -4093,6 +4094,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
consigneeDO.setUpdateTime(now);
consigneeDO.setOrderId(orderDO.getOrderId());
orderConsigneeService.saveOrUpdate(consigneeDO);
}
// 订单控货人信息
if (orderDO.getIsCargoControl()) {
......@@ -4423,8 +4425,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
BoxCheckOrderApprovalEvent boxCheckOrderApprovalEvent = new BoxCheckOrderApprovalEvent(orderDO.getOrderId(), orderDO.getContainerNumber(), auditType, auditResult, false);
applicationContext.publishEvent(boxCheckOrderApprovalEvent);
if (boxCheckOrderApprovalEvent.getIsExists()) {
orderDO.setAuditType(auditType);
orderDO.setAuditResult(auditResult);
orderDO.setAuditType(boxCheckOrderApprovalEvent.getAuditType());
orderDO.setAuditResult(boxCheckOrderApprovalEvent.getAuditResult());
return;
}
}
......
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