Commit fbd88a3f authored by yanghao's avatar yanghao

Merge branch '_dev_yh' into dev

parents d1e74ee7 b0ff6c5f
-- 添加新字段
alter table `ecw_customer` add column `no_consignee` bit(1) NOT NULL DEFAULT b'0' COMMENT '控货无收货人';
alter table `ecw_customer` add column `default_pay` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否默认付款';
-- 添加新字段
alter table `ecw_warehouse` add column `rent_free_days` int DEFAULT NULL COMMENT '仓库免租期';
alter table `ecw_warehouse` add column `lock_recipient_days` int DEFAULT NULL COMMENT '锁定收货人天数';
......@@ -98,8 +98,8 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"left join ecw_country country on c.country = country.id",
"left join ecw_product_type pt on c.product_type = pt.id",
"left join system_user u on c.customer_service = u.id",
"left join system_user uc on c.creator = u.id",
"left join system_user uu on c.updater = u.id",
"left join system_user uc on c.creator = uc.id",
"left join system_user uu on c.updater = uu.id",
"where c.id = #{id}",
"</script>"
})
......
......@@ -2272,24 +2272,12 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
String consignorPhone = orderConsignorDO.getPhone();
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());
String consignorStartWarehouseName = consignorCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn();
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());
// 追加短信
......@@ -2396,22 +2384,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
consignorParamMap.put("cmb", chargeVolume);
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); // 入仓名
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()) {
Map<Integer, CurrencyRespDTO> currencyRespDTOMap = currencyApi.getAllCurrency();
......@@ -2430,9 +2404,39 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
}
// 给发货人发送短信
this.smsSendNotice(consignorCountryCode, consignorPhone, consignorCustomerId, templateCode, consignorParamMap);
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
// 给收货人发送短信
this.smsSendNotice(consigneeCountryCode, consigneePhone, consigneeCustomerId, templateCode, consigneeParamMap);
// 收货人 短信发送信息
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))) {
// 给收货人发送短信
this.smsSendNotice(consigneeCountryCode, consigneePhone, consigneeCustomerId, templateCode, consigneeParamMap);
}
}
}
......@@ -2482,7 +2486,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 收货人
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
if (orderConsigneeDO.getCustomerId() != null) {
if (orderConsigneeDO != null && orderConsigneeDO.getCustomerId() != null) {
Long consigneeUserId = getUserId(orderConsigneeDO.getCustomerId());
if (consigneeUserId != null) {
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