|
@@ -23,7 +23,6 @@ import org.apache.poi.hssf.usermodel.*;
|
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
@@ -1400,42 +1399,44 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<CompanyDingding> companyDingdingList = companyDingdingService.list(new QueryWrapper<CompanyDingding>().eq("company_id", company.getId()));
|
|
|
String pNames = projectList.stream().map(Project::getProjectName).collect(Collectors.joining(", ", "[", "]"));
|
|
|
//审核通过操作 向被审核人推送消息
|
|
|
- for (Report report : reportList) {
|
|
|
- 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");
|
|
|
+ if(timeType.getReportApproveMsgpush()==1){
|
|
|
+ for (Report report : reportList) {
|
|
|
+ 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);
|
|
|
}
|
|
|
- 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());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2183,43 +2184,45 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
List<CompanyDingding> companyDingdingList = companyDingdingService.list(new QueryWrapper<CompanyDingding>().eq("company_id", company.getId()));
|
|
|
String s = org.apache.commons.lang3.StringUtils.join(stringList, ",");
|
|
|
int channel = oldState == -1?0:1; //0-导入审核, 项目报告审核
|
|
|
- //审核通过操作 向被审核人推送消息
|
|
|
- for (Report report : allReports) {
|
|
|
- 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");
|
|
|
+ if(timeType.getReportApproveMsgpush()==1){
|
|
|
+ //审核通过操作 向被审核人推送消息
|
|
|
+ for (Report report : allReports) {
|
|
|
+ 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);
|
|
|
}
|
|
|
- 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());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|