Commit bdd71966 authored by yanghao's avatar yanghao

chore: 发送短信时添加收货人是否为空的判断

parent cf96645e
...@@ -2272,24 +2272,12 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -2272,24 +2272,12 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
String consignorPhone = orderConsignorDO.getPhone(); String consignorPhone = orderConsignorDO.getPhone();
Long consignorCustomerId = orderConsignorDO.getCustomerId(); Long consignorCustomerId = orderConsignorDO.getCustomerId();
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId)
.last("limit 1"));
// 收货人 短信发送信息
String consigneeCountryCode = orderConsigneeDO.getCountryCode();
String consigneePhone = orderConsigneeDO.getPhone();
Long consigneeCustomerId = orderConsigneeDO.getCustomerId();
// 查询仓库 // 查询仓库
LogisticsInfoDto logisticsInfoDto = warehouseLineMapper.getStartInfoAndDestInfoByLineId(orderDO.getLineId()); LogisticsInfoDto logisticsInfoDto = warehouseLineMapper.getStartInfoAndDestInfoByLineId(orderDO.getLineId());
String consignorStartWarehouseName = consignorCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn(); String consignorStartWarehouseName = consignorCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn();
String consignorDestWearehouseName = consignorCountryCode.equals("86") ? logisticsInfoDto.getDestTitleZh() : logisticsInfoDto.getDestTitleEn(); String consignorDestWearehouseName = consignorCountryCode.equals("86") ? logisticsInfoDto.getDestTitleZh() : logisticsInfoDto.getDestTitleEn();
String consigneeStartWarehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn();
String consigneeDestWearehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getDestTitleZh() : logisticsInfoDto.getDestTitleEn();
DateTime ruchang = DateTime.of(orderDO.getRucangTime()); DateTime ruchang = DateTime.of(orderDO.getRucangTime());
// 追加短信 // 追加短信
...@@ -2396,22 +2384,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -2396,22 +2384,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
consignorParamMap.put("cmb", chargeVolume); consignorParamMap.put("cmb", chargeVolume);
consignorParamMap.put("kg", chargeWeight); consignorParamMap.put("kg", chargeWeight);
Map<String, Object> consigneeParamMap = new HashMap<>();
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
consigneeParamMap.put("date", DateUtils.formatDateTime(orderDO.getRucangTime()));
consigneeParamMap.put("cnts", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("warehouse", consigneeStartWarehouseName); // 入仓名 Map<String, Object> consigneeParamMap = new HashMap<>();
consigneeParamMap.put("year", ruchang.year());
consigneeParamMap.put("month", ruchang.month() + 1);
consigneeParamMap.put("day", ruchang.dayOfMonth());
consigneeParamMap.put("order", orderDO.getOrderNo()); // orderNo
consigneeParamMap.put("branch", consigneeDestWearehouseName); // 提货点
consigneeParamMap.put("box", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("marks", marks);
consigneeParamMap.put("cmb", chargeVolume);
consigneeParamMap.put("kg", chargeWeight);
}
if (orderDO.getIsCollection()) { if (orderDO.getIsCollection()) {
Map<Integer, CurrencyRespDTO> currencyRespDTOMap = currencyApi.getAllCurrency(); Map<Integer, CurrencyRespDTO> currencyRespDTOMap = currencyApi.getAllCurrency();
...@@ -2430,11 +2404,41 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -2430,11 +2404,41 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
} }
// 给发货人发送短信 // 给发货人发送短信
this.smsSendNotice(consignorCountryCode, consignorPhone, consignorCustomerId, templateCode, consignorParamMap); this.smsSendNotice(consignorCountryCode, consignorPhone, consignorCustomerId, templateCode, consignorParamMap);
// 收货人 短信发送信息
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId)
.last("limit 1"));
if (orderConsigneeDO != null) {
String consigneeCountryCode = orderConsigneeDO.getCountryCode();
String consigneePhone = orderConsigneeDO.getPhone();
Long consigneeCustomerId = orderConsigneeDO.getCustomerId();
String consigneeStartWarehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn();
String consigneeDestWearehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getDestTitleZh() : logisticsInfoDto.getDestTitleEn();
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
consigneeParamMap.put("date", DateUtils.formatDateTime(orderDO.getRucangTime()));
consigneeParamMap.put("cnts", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("warehouse", consigneeStartWarehouseName); // 入仓名
consigneeParamMap.put("year", ruchang.year());
consigneeParamMap.put("month", ruchang.month() + 1);
consigneeParamMap.put("day", ruchang.dayOfMonth());
consigneeParamMap.put("order", orderDO.getOrderNo()); // orderNo
consigneeParamMap.put("branch", consigneeDestWearehouseName); // 提货点
consigneeParamMap.put("box", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("marks", marks);
consigneeParamMap.put("cmb", chargeVolume);
consigneeParamMap.put("kg", chargeWeight);
}
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) { if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
// 给收货人发送短信 // 给收货人发送短信
this.smsSendNotice(consigneeCountryCode, consigneePhone, consigneeCustomerId, templateCode, consigneeParamMap); this.smsSendNotice(consigneeCountryCode, consigneePhone, consigneeCustomerId, templateCode, consigneeParamMap);
} }
} }
}
// 更新订单入仓短信已发送 // 更新订单入仓短信已发送
orderService.update(null, new LambdaUpdateWrapper<OrderDO>() orderService.update(null, new LambdaUpdateWrapper<OrderDO>()
...@@ -2482,7 +2486,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -2482,7 +2486,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 收货人 // 收货人
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()) OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId).last("limit 1")); .orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
if (orderConsigneeDO.getCustomerId() != null) { if (orderConsigneeDO != null && orderConsigneeDO.getCustomerId() != null) {
Long consigneeUserId = getUserId(orderConsigneeDO.getCustomerId()); Long consigneeUserId = getUserId(orderConsigneeDO.getCustomerId());
if (consigneeUserId != null) { if (consigneeUserId != null) {
internalMsgUserIdSet.add(consigneeUserId); internalMsgUserIdSet.add(consigneeUserId);
......
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