|
|
@@ -34,13 +34,16 @@ import me.zhengjie.base.sms.SmsSendVo;
|
|
|
import me.zhengjie.base.sms.SmsTemplateVo;
|
|
|
import me.zhengjie.base.util.BeanCopyUtils;
|
|
|
import me.zhengjie.dao.mybatis.entity.ContractOrderEntity;
|
|
|
+import me.zhengjie.dao.mybatis.entity.OfficeXbankEntity;
|
|
|
import me.zhengjie.dao.mybatis.entity.SmsSendLogEntity;
|
|
|
import me.zhengjie.dao.mybatis.entity.SmsTemplateEntity;
|
|
|
import me.zhengjie.dao.mybatis.entity.SysUserEntity;
|
|
|
import me.zhengjie.dao.mybatis.mapper.ContractOrderMapper;
|
|
|
import me.zhengjie.dao.mybatis.mapper.ISmsSendLogMapper;
|
|
|
import me.zhengjie.dao.mybatis.mapper.ISmsTemplateDao;
|
|
|
+import me.zhengjie.dao.mybatis.mapper.OfficeXbankMapper;
|
|
|
import me.zhengjie.dao.mybatis.mapper.SysUserMapper;
|
|
|
+import me.zhengjie.security.service.OnlineUserService;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -54,7 +57,8 @@ import me.zhengjie.dao.mybatis.mapper.SysUserMapper;
|
|
|
@Slf4j
|
|
|
public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao, SmsTemplateEntity>
|
|
|
implements SmsTemplateService {
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ OfficeXbankMapper officeXbankMapper;
|
|
|
@Autowired
|
|
|
SmsRequest smsTemplate;
|
|
|
@Autowired
|
|
|
@@ -65,6 +69,8 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
|
|
|
ContractOrderMapper contractOrderMapper;
|
|
|
@Autowired
|
|
|
ISmsSendLogMapper sendLogMapper;
|
|
|
+ @Autowired
|
|
|
+ OnlineUserService onlineUserService;
|
|
|
|
|
|
@Override
|
|
|
public AppBaseResponse<List<SmsTemplateEntity>> query(SmsTemplateVo req) {
|
|
|
@@ -315,7 +321,16 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
|
|
|
phone.addAll(sendPhone);
|
|
|
}
|
|
|
} else {
|
|
|
- phone = userDao.queryPhone(orderEntity.getBankId(), notaryName);
|
|
|
+ //
|
|
|
+ QueryWrapper<OfficeXbankEntity> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("bank_id", orderEntity.getBankId());
|
|
|
+ OfficeXbankEntity bankEntity = officeXbankMapper.selectOne(qw);
|
|
|
+ String notaryId = bankEntity.getNotaryOfficeId();
|
|
|
+ //先看一下是否有登录的公证员
|
|
|
+ phone = onlineUserService.getLoginNotaryByAttr("notary_" + notaryId, "phone");
|
|
|
+ if(CollectionUtils.isEmpty(phone)) {
|
|
|
+ phone = userDao.queryPhone(orderEntity.getBankId(), notaryName);
|
|
|
+ }
|
|
|
if (CollectionUtils.isNotEmpty(sendPhone)) {
|
|
|
phone.addAll(sendPhone);
|
|
|
}
|
|
|
@@ -325,7 +340,7 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
|
|
|
smsSend.setSetPhoneNumberSet(new HashSet<>(phone));
|
|
|
smsSend.setTemplateId(String.valueOf(templateId));
|
|
|
smsSend.setTemplateParam(param);
|
|
|
- String result = smsTemplate.sendMsg(smsSend);
|
|
|
+ String result = smsTemplate.sendMsg(smsSend);
|
|
|
SmsSendLogEntity log = new SmsSendLogEntity();
|
|
|
log.setBusinessNo(businessNo);
|
|
|
log.setTemplateId(templateId);
|