Commit 59e18dab authored by 332784038@qq.com's avatar 332784038@qq.com

web-app下单对收货人校验规则的修改

parent 910207c2
...@@ -519,6 +519,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -519,6 +519,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.eq(CustomerContactsDO::getPhoneNew, memberUserDO.getMobile()) .eq(CustomerContactsDO::getPhoneNew, memberUserDO.getMobile())
.eq(CustomerContactsDO::getAreaCode, memberUserDO.getAreaCode())).eq(CustomerContactsDO::getDeleted, 0).last("limit 1")); .eq(CustomerContactsDO::getAreaCode, memberUserDO.getAreaCode())).eq(CustomerContactsDO::getDeleted, 0).last("limit 1"));
} }
Boolean noConsignee = false;
if (Objects.nonNull(customerContacts)) { if (Objects.nonNull(customerContacts)) {
//发货人联系人 //发货人联系人
consignorCustomerDO = customerService.getCustomer(customerContacts.getCustomerId()); consignorCustomerDO = customerService.getCustomer(customerContacts.getCustomerId());
...@@ -529,6 +530,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -529,6 +530,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (consignorCountryDO != null) { if (consignorCountryDO != null) {
orderConsignorDO.setCountryAbbreviation(consignorCountryDO.getNameShort()); orderConsignorDO.setCountryAbbreviation(consignorCountryDO.getNameShort());
} }
noConsignee = Objects.nonNull(consignorCustomerDO.getNoConsignee()) && consignorCustomerDO.getNoConsignee();
} }
if (StringUtils.isBlank(customerContacts.getPhoneNew())) { if (StringUtils.isBlank(customerContacts.getPhoneNew())) {
throw exception(CONSIGNOR_PHONE_NOT_NULL); throw exception(CONSIGNOR_PHONE_NOT_NULL);
...@@ -584,8 +586,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -584,8 +586,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderCargoControlDO.setIsActual(Boolean.TRUE); orderCargoControlDO.setIsActual(Boolean.TRUE);
orderCargoControlMapper.insert(orderCargoControlDO); orderCargoControlMapper.insert(orderCargoControlDO);
} }
OrderConsigneeDO orderConsigneeDO = null;
OrderConsigneeDO orderConsigneeDO = new OrderConsigneeDO(); // 当订单为控货订单,且发货人客户档案未设置控货无收货人,则需要校验收货人信息
if (order.getIsCargoControl() && !noConsignee) {
orderConsigneeDO = new OrderConsigneeDO();
orderConsigneeDO.setOrderId(order.getOrderId()); orderConsigneeDO.setOrderId(order.getOrderId());
orderConsigneeDO.setCreator(creator); orderConsigneeDO.setCreator(creator);
orderConsigneeDO.setUpdater(creator); orderConsigneeDO.setUpdater(creator);
...@@ -664,6 +668,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -664,6 +668,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} }
} }
orderConsigneeService.save(orderConsigneeDO); orderConsigneeService.save(orderConsigneeDO);
}
if (!Objects.equals(createReqVO.getStatus(), OrderStatusEnum.DRAFT.getValue())) { if (!Objects.equals(createReqVO.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
//customerType 发货人-1 收货人 2 //customerType 发货人-1 收货人 2
int customerType = this.checkOrderSalesman(order, createReqVO.getOfferId(), null, null, orderConsignorDO, orderConsigneeDO); int customerType = this.checkOrderSalesman(order, createReqVO.getOfferId(), null, null, orderConsignorDO, orderConsigneeDO);
......
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