|
|
|
@ -200,7 +200,7 @@ public class UserAnalysisNoteServiceImpl extends BaseServiceImpl<UserAnalysisNot |
|
|
|
//街道账号电话号
|
|
|
|
List<String> streetMobiles = new ArrayList<>(); |
|
|
|
//街道模板内容
|
|
|
|
List< Map<String,LinkedHashMap<String, String>>> streeContentNoteList = new ArrayList<>(); |
|
|
|
Map<String,LinkedHashMap<String, String>> contentNote = new HashMap<>(); |
|
|
|
//2.查询出要发送的用户信息
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
List<UserAnalysisNoteDTO> userNoteList = baseDao.getList(params); |
|
|
|
@ -215,55 +215,30 @@ public class UserAnalysisNoteServiceImpl extends BaseServiceImpl<UserAnalysisNot |
|
|
|
String mobile = dto.getMobile(); |
|
|
|
districtMobiles.add(mobile); |
|
|
|
}else if ("1".equals(deptType)){ //街道级账号 发送街道模板
|
|
|
|
Map<String,LinkedHashMap<String, String>> contentNote = new HashMap<>(); |
|
|
|
LinkedHashMap<String, String> noteParams = new LinkedHashMap<>(); |
|
|
|
//获取电话号
|
|
|
|
String mobile = dto.getMobile(); |
|
|
|
streetMobiles.add(mobile); |
|
|
|
//获取部门排行
|
|
|
|
Integer ranking = streeRanking.get(dto.getDeptId()); |
|
|
|
noteParams.put("deptName",dto.getDeptName()); |
|
|
|
noteParams.put("deptType","街道"); |
|
|
|
noteParams.put("month",getLastMonth()); |
|
|
|
noteParams.put("sort",ranking.toString()); |
|
|
|
noteParams.put("code",dto.getDeptId()); |
|
|
|
if (ranking<=3){ |
|
|
|
noteParams.put("msmType","恭喜"); |
|
|
|
}else if ( ranking>3 && ranking<=10){ |
|
|
|
noteParams.put("msmType","祝贺"); |
|
|
|
}else if ( ranking>10 && ranking<=18){ |
|
|
|
noteParams.put("msmType","打扰一下"); |
|
|
|
}else { |
|
|
|
noteParams.put("msmType","很遗憾"); |
|
|
|
} |
|
|
|
//组装短信内容参数
|
|
|
|
LinkedHashMap<String, String> noteParams = streeNoteContent(ranking,dto); |
|
|
|
contentNote.put(mobile,noteParams); |
|
|
|
streeContentNoteList.add(contentNote); |
|
|
|
}else {//社区级账号 发送街道模板
|
|
|
|
//获取电话号
|
|
|
|
String mobile = dto.getMobile(); |
|
|
|
streetMobiles.add(mobile); |
|
|
|
Map<String,LinkedHashMap<String, String>> contentNote = new HashMap<>(); |
|
|
|
LinkedHashMap<String, String> noteParams = new LinkedHashMap<>(); |
|
|
|
//获取部门排行
|
|
|
|
Integer ranking = communiytRanking.get(dto.getDeptId()); |
|
|
|
noteParams.put("deptName",dto.getDeptName()); |
|
|
|
noteParams.put("deptType","社区"); |
|
|
|
noteParams.put("month",getLastMonth()); |
|
|
|
noteParams.put("sort",ranking.toString()); |
|
|
|
noteParams.put("code",dto.getDeptId()); |
|
|
|
if (ranking<=3){ |
|
|
|
noteParams.put("msmType","恭喜"); |
|
|
|
}else if ( ranking>23 && ranking<=20){ |
|
|
|
noteParams.put("msmType","很遗憾"); |
|
|
|
}else { |
|
|
|
noteParams.put("msmType","祝贺"); |
|
|
|
} |
|
|
|
Integer rankingCommunity = communiytRanking.get(dto.getDeptId()); |
|
|
|
//组装短信内容参数
|
|
|
|
LinkedHashMap<String, String> noteParams = streeNoteContent(rankingCommunity,dto); |
|
|
|
contentNote.put(mobile,noteParams); |
|
|
|
streeContentNoteList.add(contentNote); |
|
|
|
} |
|
|
|
} |
|
|
|
//6.开始发送发送短信(区级,和街道级分开发)
|
|
|
|
|
|
|
|
//区级 短信
|
|
|
|
sendMessagesDistrict(districtMobiles); |
|
|
|
//街道级短信
|
|
|
|
sendMessages(streetMobiles,contentNote); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -298,21 +273,62 @@ public class UserAnalysisNoteServiceImpl extends BaseServiceImpl<UserAnalysisNot |
|
|
|
* @Description: 发送短信功能 |
|
|
|
* @Param: mobiles 电话号 |
|
|
|
* @Param: streeContentNoteList 短信模板内容 |
|
|
|
* @Param: type 模板类型 0 区 1 ,街道 |
|
|
|
* @return: void |
|
|
|
* @Author: wk |
|
|
|
* @Date: 2020/5/8 |
|
|
|
*/ |
|
|
|
@Async |
|
|
|
public void sendMessages( List<String>mobiles, |
|
|
|
List< Map<String,LinkedHashMap<String, String>>> streeContentNoteList, |
|
|
|
String type){ |
|
|
|
Map<String,LinkedHashMap<String, String>> contentNoteList){ |
|
|
|
//获取所有手机号,以及短信模板
|
|
|
|
SmsNoticeFormDTO smsNoticeFormDTO = new SmsNoticeFormDTO(); |
|
|
|
smsNoticeFormDTO.setMobiles(mobiles); |
|
|
|
smsNoticeFormDTO.setNoteContent(contentNoteList); |
|
|
|
//插入固定短信模板
|
|
|
|
smsNoticeFormDTO.setSmsTemplateType(SMSTYPENAME); |
|
|
|
messageFeignClient.sendSmsNotice(smsNoticeFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @Description: 发送短信功能 -区级 |
|
|
|
* @Param: mobiles 电话号 |
|
|
|
* @Param: streeContentNoteList 短信模板内容 |
|
|
|
* @return: void |
|
|
|
* @Author: wk |
|
|
|
* @Date: 2020/5/8 |
|
|
|
*/ |
|
|
|
@Async |
|
|
|
public void sendMessagesDistrict( List<String>mobiles){ |
|
|
|
//获取所有手机号,以及短信模板
|
|
|
|
SmsNoticeFormDTO smsNoticeFormDTO = new SmsNoticeFormDTO(); |
|
|
|
smsNoticeFormDTO.setMobiles(mobiles); |
|
|
|
//插入固定短信模板
|
|
|
|
smsNoticeFormDTO.setSmsTemplateType(SMSTYPENAME); |
|
|
|
messageFeignClient.sendSmsNoticeDistrict(smsNoticeFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据部门排名,拼接部门短信内容参数 |
|
|
|
* @param ranking |
|
|
|
* @param dto |
|
|
|
* @return wk |
|
|
|
*/ |
|
|
|
private LinkedHashMap<String, String> streeNoteContent(Integer ranking,UserAnalysisNoteDTO dto){ |
|
|
|
LinkedHashMap<String, String> noteParams = new LinkedHashMap<>(); |
|
|
|
noteParams.put("deptName",dto.getDeptName()); |
|
|
|
noteParams.put("deptType","街道"); |
|
|
|
noteParams.put("month",getLastMonth()); |
|
|
|
noteParams.put("sort",ranking.toString()); |
|
|
|
noteParams.put("code",dto.getDeptId()); |
|
|
|
if (ranking<=3){ |
|
|
|
noteParams.put("msmType","恭喜"); |
|
|
|
}else if ( ranking>23 && ranking<=20){ |
|
|
|
noteParams.put("msmType","很遗憾"); |
|
|
|
}else { |
|
|
|
noteParams.put("msmType","祝贺"); |
|
|
|
} |
|
|
|
return noteParams; |
|
|
|
} |
|
|
|
|
|
|
|
} |