|
@@ -722,22 +722,22 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
*
|
|
|
* @description: 给运营发送消息
|
|
|
*
|
|
|
- * @param userId
|
|
|
+ * @param
|
|
|
* @return: org.jeecg.common.api.vo.Result
|
|
|
* @author: zianY
|
|
|
*/
|
|
|
@Override
|
|
|
- public Result sendMessageToOperate(String userId) {
|
|
|
+ public Result sendMessageToOperate() {
|
|
|
int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
|
|
|
int productNum = 0;
|
|
|
int accountNum = 0;
|
|
|
String productInfo = null;
|
|
|
- String message = "运营人{0},您好!您{1}月份有{2}个产品的账户需要进行媒体后台消耗截图上传,共计{3}个账户。产品分别为:{4}。请及时上传,多谢配合!";
|
|
|
+ String message = "{0},您好!您{1}月份有{2}个产品的账户需要进行媒体后台消耗截图上传,共计{3}个账户。产品分别为:{4}。请及时上传,多谢配合!";
|
|
|
|
|
|
//查询所有 运营绑定的账户
|
|
|
List<Map<String,Object>> userList = reportSettlementMapper.getAccountOperateUserId();
|
|
|
for (Map<String, Object> userMap : userList) {
|
|
|
- userId = userMap.get("userId").toString();
|
|
|
+ String userId = userMap.get("userId").toString();
|
|
|
//查询运营下的 账户 和 产品信息
|
|
|
List<Map<String,Object>> productList = reportSettlementMapper.getAccountAndProductByOperate(userId);
|
|
|
if (Check.isNull(productList)){
|
|
@@ -750,13 +750,44 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
productInfo = StringUtils.join(product.toArray(),"、");
|
|
|
|
|
|
//发送微信通知
|
|
|
- JSONObject jsonObject = mailLogMapper.getWChatIdByUserId("f990f815ecef43fab9cbe1bb22bb6d63");
|
|
|
+ JSONObject jsonObject = mailLogMapper.getWChatIdByUserId(userId);
|
|
|
String msg = MessageFormat.format(message,userMap.get("userName").toString(),month,productNum,accountNum,productInfo);
|
|
|
corpWexinUtils.sendMessageByWeChatId(jsonObject,msg);
|
|
|
}
|
|
|
return Result.successMsg("成功",null);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result sendMessageToOperateDemo(String userId) {
|
|
|
+ int month = Calendar.getInstance().get(Calendar.MONTH) + 1;
|
|
|
+ int productNum = 0;
|
|
|
+ int accountNum = 0;
|
|
|
+ String productInfo = null;
|
|
|
+ String message = "{0},您好!您{1}月份有{2}个产品的账户需要进行媒体后台消耗截图上传,共计{3}个账户。产品分别为:{4}。请及时上传,多谢配合!";
|
|
|
+
|
|
|
+ //查询所有 运营绑定的账户
|
|
|
+ List<Map<String,Object>> userList = reportSettlementMapper.getAccountOperateUserId();
|
|
|
+ for (Map<String, Object> userMap : userList) {
|
|
|
+ String realUserId = userMap.get("userId").toString();
|
|
|
+ //查询运营下的 账户 和 产品信息
|
|
|
+ List<Map<String,Object>> productList = reportSettlementMapper.getAccountAndProductByOperate(realUserId);
|
|
|
+ if (Check.isNull(productList)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //产品名称
|
|
|
+ List product = productList.stream().map(map -> map.get("productName")).distinct().collect(Collectors.toList());
|
|
|
+ productNum = product.size();
|
|
|
+ accountNum = productList.size();
|
|
|
+ productInfo = StringUtils.join(product.toArray(),"、");
|
|
|
+
|
|
|
+ //发送微信通知
|
|
|
+ JSONObject jsonObject = mailLogMapper.getWChatIdByUserId(userId);
|
|
|
+ String msg = MessageFormat.format(message,userMap.get("userName").toString(),month,productNum,accountNum,productInfo);
|
|
|
+ corpWexinUtils.sendMessageByWeChatId(jsonObject,msg);
|
|
|
+ }
|
|
|
+ return Result.successMsg("发送微信通知成功-test",null);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
@Resource
|