|
@ -201,7 +201,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity> |
|
|
@Override |
|
|
@Override |
|
|
public void projectSendMsg(List<ProjectSendMsgFormDTO> formDTOList) { |
|
|
public void projectSendMsg(List<ProjectSendMsgFormDTO> formDTOList) { |
|
|
if (CollectionUtils.isEmpty(formDTOList)){ |
|
|
if (CollectionUtils.isEmpty(formDTOList)){ |
|
|
logger.error(SysSmsConstant.IS_NULL_PARAM_LIST); |
|
|
logger.warn(SysSmsConstant.IS_NULL_PARAM_LIST); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
Map<String, List<ProjectSendMsgFormDTO>> groupByCustomer = formDTOList.stream().collect(Collectors.groupingBy(ProjectSendMsgFormDTO::getCustomerId)); |
|
|
Map<String, List<ProjectSendMsgFormDTO>> groupByCustomer = formDTOList.stream().collect(Collectors.groupingBy(ProjectSendMsgFormDTO::getCustomerId)); |
|
@ -213,7 +213,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity> |
|
|
} |
|
|
} |
|
|
List<CrmParameterResultDTO> parameterResult = listResult.getData(); |
|
|
List<CrmParameterResultDTO> parameterResult = listResult.getData(); |
|
|
if (CollectionUtils.isEmpty(parameterResult)){ |
|
|
if (CollectionUtils.isEmpty(parameterResult)){ |
|
|
logger.error(SysSmsConstant.PARAMETER_INFO_IS_ZERO); |
|
|
logger.warn(SysSmsConstant.PARAMETER_INFO_IS_ZERO); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
groupByCustomer.forEach((customerId,v) -> { |
|
|
groupByCustomer.forEach((customerId,v) -> { |
|
@ -230,11 +230,11 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity> |
|
|
if (customerId.equals(p.getCustomerId())){ |
|
|
if (customerId.equals(p.getCustomerId())){ |
|
|
// 判断参数开关是否打开,false:未打开
|
|
|
// 判断参数开关是否打开,false:未打开
|
|
|
if (p.getSwitchStatus() == false){ |
|
|
if (p.getSwitchStatus() == false){ |
|
|
logger.error(String.format(SysSmsConstant.NOT_ON_SWITCH,customerId,p.getParameterKey())); |
|
|
logger.warn(String.format(SysSmsConstant.NOT_ON_SWITCH,customerId,p.getParameterKey())); |
|
|
}else { |
|
|
}else { |
|
|
// 判断余额状态 false:余额不足
|
|
|
// 判断余额状态 false:余额不足
|
|
|
if (p.getBalanceStatus() == false){ |
|
|
if (p.getBalanceStatus() == false){ |
|
|
logger.error(String.format(SysSmsConstant.NOT_ENOUGH_BALANCE,customerId,p.getParameterValue())); |
|
|
logger.warn(String.format(SysSmsConstant.NOT_ENOUGH_BALANCE,customerId,p.getParameterValue())); |
|
|
}else { |
|
|
}else { |
|
|
v.forEach(dto->{ |
|
|
v.forEach(dto->{ |
|
|
SysSmsDTO sysSmsDTO = new SysSmsDTO(); |
|
|
SysSmsDTO sysSmsDTO = new SysSmsDTO(); |
|
@ -249,7 +249,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity> |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}catch (RenException e){ |
|
|
}catch (RenException e){ |
|
|
logger.error(e.getInternalMsg()); |
|
|
logger.warn(e.getInternalMsg()); |
|
|
} |
|
|
} |
|
|
Map<Boolean, List<CrmParameterResultDTO>> groupBySwitch = parameterResult.stream().collect(Collectors.groupingBy(CrmParameterResultDTO::getSwitchStatus)); |
|
|
Map<Boolean, List<CrmParameterResultDTO>> groupBySwitch = parameterResult.stream().collect(Collectors.groupingBy(CrmParameterResultDTO::getSwitchStatus)); |
|
|
List<CrmParameterResultDTO> crmParameterTrue = groupBySwitch.get(true); |
|
|
List<CrmParameterResultDTO> crmParameterTrue = groupBySwitch.get(true); |
|
@ -274,7 +274,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity> |
|
|
//短信服务
|
|
|
//短信服务
|
|
|
AbstractSmsService service = SmsFactory.build(); |
|
|
AbstractSmsService service = SmsFactory.build(); |
|
|
if (service == null) { |
|
|
if (service == null) { |
|
|
logger.error("发送短信异常,ErrorCode:%s,异常AbstractSmsService is null", ModuleErrorCode.SMS_CONFIG); |
|
|
logger.warn("发送短信异常,ErrorCode:%s,异常AbstractSmsService is null", ModuleErrorCode.SMS_CONFIG); |
|
|
} |
|
|
} |
|
|
//发送短信
|
|
|
//发送短信
|
|
|
if (StringUtils.isNotBlank(sysSmsDTO.getAliyunTemplateCode())) { |
|
|
if (StringUtils.isNotBlank(sysSmsDTO.getAliyunTemplateCode())) { |
|
@ -283,7 +283,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity> |
|
|
service.sendSms(sysSmsDTO.getMobile(), map); |
|
|
service.sendSms(sysSmsDTO.getMobile(), map); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
logger.error(String.format("项目提醒发送短信失败,失败手机号:%s,ErrorCode:%s", sysSmsDTO.getMobile(), e.getMessage())); |
|
|
logger.warn(String.format("项目提醒发送短信失败,失败手机号:%s,ErrorCode:%s", sysSmsDTO.getMobile(), e.getMessage())); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|