Commit a2e874d2 authored by zhengyi's avatar zhengyi

新增和编辑订单和报价单时,如果是控货订单或报价单,收货人不为空,则判断订单收货人手机号必须为国外号码

parent 4477e6eb
......@@ -216,8 +216,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
dto -> "create_order_phone_limit".equals(dto.getLabel())).findFirst().
orElse(null);
if ((Objects.isNull(createReqVO.getIsCargoControl()) ||
!createReqVO.getIsCargoControl()) &&
if (Objects.nonNull(createReqVO.getIsCargoControl()) &&
createReqVO.getIsCargoControl() &&
Objects.nonNull(dictDataRespDTO) &&
StringUtils.equals(dictDataRespDTO.getValue(), "11")
&& StringUtils.isNotBlank(createReqVO.getCountryCode())
......@@ -657,7 +657,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (StringUtils.isBlank(orderConsigneeDO.getName())) {
throw exception(ORDER_CONSIGNEE_NAME_NOT_COMPLETE);
}
if ((Objects.isNull(createReqVO.getIsCargoControl()) || !createReqVO.getIsCargoControl()) && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
if (Objects.nonNull(createReqVO.getIsCargoControl()) && createReqVO.getIsCargoControl() && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.equals("86", orderConsigneeDO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......@@ -937,7 +937,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
throw exception(ORDER_CONSIGNEE_PHONE_INCORRECT_FORMAT);
}
}
if ((Objects.isNull(createReqVO.getIsCargoControl()) || !createReqVO.getIsCargoControl()) && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
if (Objects.nonNull(createReqVO.getIsCargoControl()) && createReqVO.getIsCargoControl() && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.equals("86", orderConsigneeDO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......@@ -1509,15 +1509,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
updateReqVO.setCustomsClearCert(false);
updateReqVO.setAirlineCompany(0L);
}
OrderDO updateObj = OrderConvert.INSTANCE.convert(updateReqVO);
// 获取功能开关
List<DictDataRespDTO> dictList = dictDataApi.getDictDatas("part_function_switch");
// 智慧预装功能开关
DictDataRespDTO dictDataRespDTO = dictList.stream().filter(dto -> "create_order_phone_limit".equals(dto.getLabel())).findFirst().orElse(null);
if ((Objects.isNull(updateReqVO.getIsCargoControl()) || !updateReqVO.getIsCargoControl()) &&
if (Objects.nonNull(updateReqVO.getIsCargoControl()) &&
updateReqVO.getIsCargoControl() &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.isNotBlank(updateReqVO.getCountryCode()) && StringUtils.equals("86", updateReqVO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
OrderDO updateObj = OrderConvert.INSTANCE.convert(updateReqVO);
LogisticsInfoDto logisticsInfoDto = warehouseLineMapper.getStartInfoAndDestInfoByLineId(updateReqVO.getLineId());
if (Objects.isNull(logisticsInfoDto)) {
throw exception(ORDER_LINE_NOT_EXIST);
......@@ -2714,7 +2716,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (!Objects.equals(orderConsigneeBackVO.getCustomerContactsId(), consigneeContactsDO.getId())) {
// 收货人电话
if (!StringUtils.equals(orderConsigneeBackVO.getPhone(), consigneeContactsDO.getPhoneNew()) || !StringUtils.equals(orderConsigneeBackVO.getCountryCode(), consigneeContactsDO.getAreaCode())) {
if ((Objects.isNull(updateReqVO.getIsCargoControl()) || !updateReqVO.getIsCargoControl()) && StringUtils.isNotBlank(consigneeContactsDO.getAreaCode()) &&
if (Objects.nonNull(updateReqVO.getIsCargoControl()) && updateReqVO.getIsCargoControl() && StringUtils.isNotBlank(consigneeContactsDO.getAreaCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals(dictDataRespDTO.getValue(), "11") && StringUtils.equals("86", consigneeContactsDO.getAreaCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......@@ -3541,7 +3543,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setEmail(updateReqVO.getConsigneeEmail());
orderConsigneeDO.setPhone(updateReqVO.getConsigneePhone());
}
if ((Objects.isNull(updateReqVO.getIsCargoControl()) || !updateReqVO.getIsCargoControl()) && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
if (Objects.nonNull(updateReqVO.getIsCargoControl()) && updateReqVO.getIsCargoControl() && StringUtils.isNotBlank(orderConsigneeDO.getCountryCode()) &&
Objects.nonNull(dictDataRespDTO) && StringUtils.equals("11", dictDataRespDTO.getValue()) && StringUtils.equals("86", orderConsigneeDO.getCountryCode())) {
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
......
......@@ -188,7 +188,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
}
}
if (Objects.nonNull(createReqVO.getConsigneeId()) && createReqVO.getConsigneeId() > 0) {
if (Objects.isNull(createReqVO.getControl()) || !createReqVO.getControl()) {
if (Objects.nonNull(createReqVO.getControl()) && createReqVO.getControl()) {
// 获取功能开关
List<DictDataRespDTO> dictList = dictDataApi.getDictDatas("part_function_switch");
// 智慧预装功能开关
......@@ -516,7 +516,7 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
}
}
if (Objects.nonNull(updateReqVO.getConsigneeId()) && updateReqVO.getConsigneeId() > 0) {
if (Objects.isNull(updateReqVO.getControl()) || !updateReqVO.getControl()) {
if (Objects.nonNull(updateReqVO.getControl()) && updateReqVO.getControl()) {
// 获取功能开关
List<DictDataRespDTO> dictList = dictDataApi.getDictDatas("part_function_switch");
// 智慧预装功能开关
......
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