|
|
@@ -184,7 +184,7 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
|
|
|
// 4---开始公证(待公证) -- 2个公证员
|
|
|
@Override
|
|
|
public void startNotarize(String businessNo) {
|
|
|
-
|
|
|
+
|
|
|
QueryWrapper<SmsSendLogEntity> smsSend = new QueryWrapper<>();
|
|
|
smsSend.eq("business_no", businessNo);
|
|
|
smsSend.eq("order_type", 4);
|
|
|
@@ -192,12 +192,12 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
|
|
|
if (count == 0) {
|
|
|
sendNotary(4, businessNo, "公证员", sendSmsPhone());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- public Set<String> sendSmsPhone() {
|
|
|
+ public List<String> sendSmsPhone() {
|
|
|
String value = dictService.getLabelValue("sms_msg", "send_sms_phone");
|
|
|
- Set<String> sendPhone = new HashSet<>();
|
|
|
+ List<String> sendPhone = new ArrayList<>();
|
|
|
if (StringUtils.isNoneBlank(value)) {
|
|
|
if (value.contains(",")) {
|
|
|
List<String> phone = Arrays.asList(value.split(","));
|
|
|
@@ -281,7 +281,7 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
|
|
|
* @param businessNo 业务编号
|
|
|
* @param notaryName 查询公证员
|
|
|
*/
|
|
|
- private void sendNotary(Integer orderType, String businessNo, String notaryName, Set<String> sendPhone) {
|
|
|
+ private void sendNotary(Integer orderType, String businessNo, String notaryName, List<String> sendPhone) {
|
|
|
Long templateId = getTemplateId(orderType);
|
|
|
if (templateId == null) {
|
|
|
log.warn("短信模板不存在或者被停用订单类型 {} ", orderType);
|
|
|
@@ -295,12 +295,35 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
|
|
|
param.add(orderEntity.getCustomerName());
|
|
|
}
|
|
|
param.add(orderEntity.getConsultNo());
|
|
|
- Set<String> phone = userDao.queryPhone(orderEntity.getBankId(), notaryName);
|
|
|
- if (CollectionUtils.isNotEmpty(sendPhone)) {
|
|
|
- phone.addAll(sendPhone);
|
|
|
+
|
|
|
+ // 所有公证员
|
|
|
+ List<String> phone = null;
|
|
|
+ if (orderType == 1 && StringUtils.isNotBlank(orderEntity.getNotaryUserId())) {
|
|
|
+ QueryWrapper<SysUserEntity> userWrapper = new QueryWrapper<>();
|
|
|
+ userWrapper.eq("user_id", orderEntity.getNotaryUserId());
|
|
|
+ SysUserEntity sysUserEntity = userDao.selectOne(userWrapper);
|
|
|
+ phone = new ArrayList<>();
|
|
|
+ phone.add(sysUserEntity.getPhone());
|
|
|
+ if (CollectionUtils.isNotEmpty(sendPhone)) {
|
|
|
+ QueryWrapper<SmsSendLogEntity> sendLogWrapper = new QueryWrapper<>();
|
|
|
+ sendLogWrapper.eq("business_no", businessNo);
|
|
|
+ sendLogWrapper.eq("order_type", orderType);
|
|
|
+ sendLogWrapper.like("phone", StringUtils.join(sendPhone, ","));
|
|
|
+ long count = sendLogMapper.selectCount(sendLogWrapper);
|
|
|
+ if (count == 0)
|
|
|
+ phone.addAll(sendPhone);
|
|
|
+ }
|
|
|
+ // 判断是否已经存在了发送的手机号
|
|
|
+
|
|
|
+ } else {
|
|
|
+ phone = userDao.queryPhone(orderEntity.getBankId(), notaryName);
|
|
|
+ if (CollectionUtils.isNotEmpty(sendPhone)) {
|
|
|
+ phone.addAll(sendPhone);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
SmsSendVo smsSend = new SmsSendVo();
|
|
|
- smsSend.setSetPhoneNumberSet(phone);
|
|
|
+ smsSend.setSetPhoneNumberSet(new HashSet<>(phone));
|
|
|
smsSend.setTemplateId(String.valueOf(templateId));
|
|
|
smsSend.setTemplateParam(param);
|
|
|
String result = smsTemplate.sendMsg(smsSend);
|