|
@@ -1338,6 +1338,44 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ //如果是实时提醒审核,需要立即发送消息通知
|
|
|
+ if (timeType.getAlertAuditMode() == 1 && reportList.get(0).getState() == 0) {
|
|
|
+ //检查是否为企业微信用户
|
|
|
+ WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
|
|
|
+ if (wxCorpInfo != null) {
|
|
|
+ for (Report report : reportList) {
|
|
|
+ String corpwxUserid = userMapper.selectById(report.getProjectAuditorId()).getCorpwxUserid();
|
|
|
+ //推送到企业微信
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
+ JSONArray dataJson=new JSONArray();
|
|
|
+ JSONObject jsonObj=new JSONObject();
|
|
|
+ if (timeType.getAlertType() == 4) {
|
|
|
+ jsonObj.put("key", "提示");
|
|
|
+ String msgContent = timeType.getAlertCheckMsg();
|
|
|
+ if (StringUtils.isEmpty(msgContent)) {
|
|
|
+ msgContent = "待审核数量:"+1;
|
|
|
+ } else {
|
|
|
+ msgContent = msgContent.replace("{0}", "1");
|
|
|
+ }
|
|
|
+ jsonObj.put("value",msgContent);
|
|
|
+ } else {
|
|
|
+ jsonObj.put("key", "待审核数量");
|
|
|
+ jsonObj.put("value","1");
|
|
|
+ }
|
|
|
+ dataJson.add(jsonObj);
|
|
|
+// if(isPrivateDeploy){
|
|
|
+// json.put("content","待审核数量: "+1+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri="+pcUrl+"/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去审核</a>");
|
|
|
+// }else {
|
|
|
+ String templateId = timeType.getAlertType() == 4 ? "tty9TkCAAAtDDCqY796mGulF9c5Jmwng":"tty9TkCAAAuPvPjabDdQXGocnG0K24EQ";
|
|
|
+ json.put("template_id",templateId);
|
|
|
+ json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=review#wechat_redirect");
|
|
|
+ json.put("content_item",dataJson);
|
|
|
+// }
|
|
|
+// System.out.println("发送企业微信消息==用户:"+corpwxUserid+", "+json.toJSONString());
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
//没有需要更新的,则
|
|
|
}
|