|
@@ -1401,36 +1401,42 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
String pNames = projectList.stream().map(Project::getProjectName).collect(Collectors.joining(", ", "[", "]"));
|
|
|
//审核通过操作 向被审核人推送消息
|
|
|
for (Report report : reportList) {
|
|
|
- String uId = report.getCreatorId();
|
|
|
- Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(uId)).findFirst();
|
|
|
- if(first.isPresent()){
|
|
|
- User u = first.get();
|
|
|
- if(u.getCorpwxUserid()!=null){
|
|
|
- if(wxCorpInfoList.size()>0){
|
|
|
- JSONObject json=new JSONObject();
|
|
|
- JSONArray dataJson=new JSONArray();
|
|
|
- JSONObject item=new JSONObject();
|
|
|
- item.put("key","审核人");
|
|
|
- item.put("value",user.getName());
|
|
|
- if(timeType.getNeedEvaluate()==1){
|
|
|
- item.put("key","评价");
|
|
|
- item.put("value",report.getEvaluate());
|
|
|
- json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
|
|
|
- }else {
|
|
|
- json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
|
|
|
+ if(report.getState()==1){
|
|
|
+ String uId = report.getCreatorId();
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(uId)).findFirst();
|
|
|
+ if(first.isPresent()){
|
|
|
+ User u = first.get();
|
|
|
+ if(u.getCorpwxUserid()!=null){
|
|
|
+ if(wxCorpInfoList.size()>0){
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
+ JSONArray dataJson=new JSONArray();
|
|
|
+ JSONObject item=new JSONObject();
|
|
|
+ item.put("key","审核人");
|
|
|
+ item.put("value",user.getName());
|
|
|
+ dataJson.add(item);
|
|
|
+ if(timeType.getNeedEvaluate()==1){
|
|
|
+ JSONObject item1=new JSONObject();
|
|
|
+ item1.put("key","评价");
|
|
|
+ item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
|
|
|
+ dataJson.add(item1);
|
|
|
+ json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
|
|
|
+ }else {
|
|
|
+ json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
|
|
|
+ }
|
|
|
+ JSONObject item2=new JSONObject();
|
|
|
+ item2.put("key","日期");
|
|
|
+ item2.put("value",report.getCreateDate());
|
|
|
+ dataJson.add(item2);
|
|
|
+ json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
+ json.put("content_item",dataJson);
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfoList.get(0),u.getCorpwxUserid(),json);
|
|
|
}
|
|
|
- item.put("key","日期");
|
|
|
- item.put("value",report.getCreateDate());
|
|
|
- dataJson.add(item);
|
|
|
- json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
- json.put("content_item",dataJson);
|
|
|
- wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfoList.get(0),u.getCorpwxUserid(),json);
|
|
|
}
|
|
|
- }
|
|
|
- if(u.getDingdingUserid()!=null){
|
|
|
- if(companyDingdingList.size()>0){
|
|
|
- CompanyDingding companyDingding = companyDingdingList.get(0);
|
|
|
- companyDingdingService.sendReportApproveMsg(company.getId(),companyDingding.getAgentId(),user.getName(),report.getEvaluate(),report.getCreateDate(),u.getDingdingUserid());
|
|
|
+ if(u.getDingdingUserid()!=null){
|
|
|
+ if(companyDingdingList.size()>0){
|
|
|
+ CompanyDingding companyDingding = companyDingdingList.get(0);
|
|
|
+ companyDingdingService.sendReportApproveMsg(company.getId(),companyDingding.getAgentId(),user.getName(),report.getEvaluate(),report.getCreateDate(),u.getDingdingUserid());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2179,32 +2185,42 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
int channel = oldState == -1?0:1; //0-导入审核, 项目报告审核
|
|
|
//审核通过操作 向被审核人推送消息
|
|
|
for (Report report : allReports) {
|
|
|
- String uId = report.getCreatorId();
|
|
|
- Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(uId)).findFirst();
|
|
|
- if(first.isPresent()){
|
|
|
- User u = first.get();
|
|
|
- if(u.getCorpwxUserid()!=null){
|
|
|
- if(wxCorpInfoList.size()>0){
|
|
|
- JSONObject json=new JSONObject();
|
|
|
- JSONArray dataJson=new JSONArray();
|
|
|
- JSONObject item=new JSONObject();
|
|
|
- item.put("key","审核人");
|
|
|
- item.put("value",user.getName());
|
|
|
- item.put("key","评价");
|
|
|
- item.put("value",report.getEvaluate());
|
|
|
- item.put("key","日期");
|
|
|
- item.put("value",report.getCreateDate());
|
|
|
- dataJson.add(item);
|
|
|
- json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
|
|
|
- json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
- json.put("content_item",dataJson);
|
|
|
- wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfoList.get(0),u.getCorpwxUserid(),json);
|
|
|
+ if(report.getState()==1){
|
|
|
+ String uId = report.getCreatorId();
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(uId)).findFirst();
|
|
|
+ if(first.isPresent()){
|
|
|
+ User u = first.get();
|
|
|
+ if(u.getCorpwxUserid()!=null){
|
|
|
+ if(wxCorpInfoList.size()>0){
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
+ JSONArray dataJson=new JSONArray();
|
|
|
+ JSONObject item=new JSONObject();
|
|
|
+ item.put("key","审核人");
|
|
|
+ item.put("value",user.getName());
|
|
|
+ dataJson.add(item);
|
|
|
+ if(timeType.getNeedEvaluate()==1){
|
|
|
+ JSONObject item1=new JSONObject();
|
|
|
+ item1.put("key","评价");
|
|
|
+ item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
|
|
|
+ dataJson.add(item1);
|
|
|
+ json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
|
|
|
+ }else {
|
|
|
+ json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
|
|
|
+ }
|
|
|
+ JSONObject item2=new JSONObject();
|
|
|
+ item2.put("key","日期");
|
|
|
+ item2.put("value",report.getCreateDate());
|
|
|
+ dataJson.add(item2);
|
|
|
+ json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
+ json.put("content_item",dataJson);
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfoList.get(0),u.getCorpwxUserid(),json);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if(u.getDingdingUserid()!=null){
|
|
|
- if(companyDingdingList.size()>0){
|
|
|
- CompanyDingding companyDingding = companyDingdingList.get(0);
|
|
|
- companyDingdingService.sendReportApproveMsg(company.getId(),companyDingding.getAgentId(),user.getName(),report.getEvaluate(),report.getCreateDate(),u.getDingdingUserid());
|
|
|
+ if(u.getDingdingUserid()!=null){
|
|
|
+ if(companyDingdingList.size()>0){
|
|
|
+ CompanyDingding companyDingding = companyDingdingList.get(0);
|
|
|
+ companyDingdingService.sendReportApproveMsg(company.getId(),companyDingding.getAgentId(),user.getName(),report.getEvaluate(),report.getCreateDate(),u.getDingdingUserid());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|