Commit 56cbc670 authored by shangtx's avatar shangtx

feat: 指派估价员短信通知

parent 18399a96
...@@ -36,6 +36,12 @@ public class CommonSmsService { ...@@ -36,6 +36,12 @@ public class CommonSmsService {
@Value("${aliyun.sms.template-code.paid}") @Value("${aliyun.sms.template-code.paid}")
private String paidTmpCode; // 手机号换绑 private String paidTmpCode; // 手机号换绑
@Value("${aliyun.sms.template-code.valuator}")
private String valuatorTmpCode; // 通知客户已派估价员
@Value("${aliyun.sms.template-code.revaluator}")
private String revaluatorTmpCode; // 通知客户已重新指派估价员
@Value("${aliyun.sms.sign}") @Value("${aliyun.sms.sign}")
private String sign; private String sign;
...@@ -56,7 +62,7 @@ public class CommonSmsService { ...@@ -56,7 +62,7 @@ public class CommonSmsService {
/*** /***
* 发送改变信息验证码 * 发送改变信息验证码
*/ */
public void sendChangeInfo(String code, String phone) { public void sendChangePhone(String code, String phone) {
if (StringUtils.isEmpty(phone)) { if (StringUtils.isEmpty(phone)) {
return; return;
} }
...@@ -110,4 +116,26 @@ public class CommonSmsService { ...@@ -110,4 +116,26 @@ public class CommonSmsService {
} }
} }
public void valuator(String phone) {
if (StringUtils.isEmpty(phone)) {
return;
}
try {
smsUtils.send(sign, valuatorTmpCode, null, phone);
} catch (Exception e) {
log.error("发送短信错误", e);
}
}
public void revaluator(String phone) {
if (StringUtils.isEmpty(phone)) {
return;
}
try {
smsUtils.send(sign, revaluatorTmpCode, null, phone);
} catch (Exception e) {
log.error("发送短信错误", e);
}
}
} }
...@@ -107,6 +107,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> { ...@@ -107,6 +107,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
if (result == 1) { if (result == 1) {
// 记录估价员指派时间 // 记录估价员指派时间
serviceValuatorAssignMapper.insertSelective(buildServiceValuatorAssign(dto, userId)); serviceValuatorAssignMapper.insertSelective(buildServiceValuatorAssign(dto, userId));
// 通知用户
commonSmsService.valuator(serviceOrder.getPhone());
String description = String.format(ServiceOrderStatusEnum.VALUATION.getMsg(), user.getName(), valuatorUser.getUserName()); String description = String.format(ServiceOrderStatusEnum.VALUATION.getMsg(), user.getName(), valuatorUser.getUserName());
recordComponent.recordProcess(serviceOrder.getId(), ServiceOrderStatusEnum.VALUATION.getStatus(), description, recordComponent.recordProcess(serviceOrder.getId(), ServiceOrderStatusEnum.VALUATION.getStatus(), description,
...@@ -140,7 +142,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> { ...@@ -140,7 +142,8 @@ public class ServiceOrderService extends AbstractMapper<ServiceOrder> {
disableServiceValuatorAssign(serviceOrder, userId, false); disableServiceValuatorAssign(serviceOrder, userId, false);
// 设置新的估计员世间 // 设置新的估计员世间
serviceValuatorAssignMapper.insertSelective(buildServiceValuatorAssign(dto, userId)); serviceValuatorAssignMapper.insertSelective(buildServiceValuatorAssign(dto, userId));
// 通知用户
commonSmsService.revaluator(serviceOrder.getPhone());
String description = String.format(ServiceOrderStatusEnum.REVALUATION.getMsg(), user.getName(), valuatorUser.getUserName()); String description = String.format(ServiceOrderStatusEnum.REVALUATION.getMsg(), user.getName(), valuatorUser.getUserName());
recordComponent.recordProcess(serviceOrder.getId(), ServiceOrderStatusEnum.REVALUATION.getStatus(), description, recordComponent.recordProcess(serviceOrder.getId(), ServiceOrderStatusEnum.REVALUATION.getStatus(), description,
sourceEnum, valuatorUser.getId(), dto.getRemark(), dto.getExpectArrivalTime()); sourceEnum, valuatorUser.getId(), dto.getRemark(), dto.getExpectArrivalTime());
......
...@@ -23,6 +23,8 @@ aliyun: ...@@ -23,6 +23,8 @@ aliyun:
dispatched: SMS_226505027 # 通知用户已经派单 开发环境使用项目动态替代 dispatched: SMS_226505027 # 通知用户已经派单 开发环境使用项目动态替代
redispatched: SMS_226505027 # 通知用户已经重新派单 开发环境使用项目动态替代 redispatched: SMS_226505027 # 通知用户已经重新派单 开发环境使用项目动态替代
paid: SMS_226505027 # 通知业务人员客户已完成支付 开发环境使用优惠券发放替代 paid: SMS_226505027 # 通知业务人员客户已完成支付 开发环境使用优惠券发放替代
valuator: SMS_226505027 # 通知客户已派估价员 开发环境使用优惠券发放替代
revaluator: SMS_226505027 # 通知客户已重新指派估价员 开发环境使用优惠券发放替代
......
...@@ -2,6 +2,7 @@ package com.onsiteservice.miniapp.service.user; ...@@ -2,6 +2,7 @@ package com.onsiteservice.miniapp.service.user;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.onsiteservice.common.runner.InitDataRunner; import com.onsiteservice.common.runner.InitDataRunner;
import com.onsiteservice.common.service.CommonSmsService;
import com.onsiteservice.constant.constant.Constants; import com.onsiteservice.constant.constant.Constants;
import com.onsiteservice.constant.constant.DictConstants; import com.onsiteservice.constant.constant.DictConstants;
import com.onsiteservice.constant.constant.RedisKeyConstants; import com.onsiteservice.constant.constant.RedisKeyConstants;
...@@ -59,6 +60,7 @@ public class UserService extends AbstractMapper<User> { ...@@ -59,6 +60,7 @@ public class UserService extends AbstractMapper<User> {
private ServiceOrderBizMapper serviceOrderBizMapper; private ServiceOrderBizMapper serviceOrderBizMapper;
private ServiceOrderMapper serviceOrderMapper; private ServiceOrderMapper serviceOrderMapper;
private ServiceValuatorAssignMapper serviceValuatorAssignMapper; private ServiceValuatorAssignMapper serviceValuatorAssignMapper;
private CommonSmsService commonSmsService;
public Result<String> sendCode(SendCodeDTO dto) { public Result<String> sendCode(SendCodeDTO dto) {
...@@ -81,7 +83,7 @@ public class UserService extends AbstractMapper<User> { ...@@ -81,7 +83,7 @@ public class UserService extends AbstractMapper<User> {
// 置入 // 置入
redisTemplate.opsForValue().set(cacheKey, value, RedisKeyConstants.CODE_EXPIRED, TimeUnit.MILLISECONDS); redisTemplate.opsForValue().set(cacheKey, value, RedisKeyConstants.CODE_EXPIRED, TimeUnit.MILLISECONDS);
// TODO 发送短信 commonSmsService.sendChangePhone(code, dto.getTo());
return ResultGenerator.success(); return ResultGenerator.success();
} }
......
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