|
@@ -936,90 +936,205 @@ public class TimingTask {
|
|
private void alertWaitingApprove() {
|
|
private void alertWaitingApprove() {
|
|
if (isDev) return;
|
|
if (isDev) return;
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
- DateTimeFormatter df=DateTimeFormatter.ofPattern("HH:mm");
|
|
|
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("HH:mm");
|
|
List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("wait_check_alert_time", df.format(now.toLocalTime())));
|
|
List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("wait_check_alert_time", df.format(now.toLocalTime())));
|
|
List<Integer> companyIds = timeTypeList.stream().map(TimeType::getCompanyId).distinct().collect(Collectors.toList());
|
|
List<Integer> companyIds = timeTypeList.stream().map(TimeType::getCompanyId).distinct().collect(Collectors.toList());
|
|
companyIds.add(-1);
|
|
companyIds.add(-1);
|
|
List<CompanyDingding> list = companyDingdingMapper.getDingdingCompanyList(companyIds);
|
|
List<CompanyDingding> list = companyDingdingMapper.getDingdingCompanyList(companyIds);
|
|
for (CompanyDingding companyDingding : list) {
|
|
for (CompanyDingding companyDingding : list) {
|
|
- List<Map<String, Object>> result = reportMapper.getProWaitingApproveCnt(companyDingding.getCompanyId());
|
|
|
|
- List<Map<String, Object>> result1 = reportMapper.getDeptWaitingApproveCnt(companyDingding.getCompanyId());
|
|
|
|
- List<Object> resultCorpwxUserIds = result.stream().map(rl -> rl.get("auditorDDId")).collect(Collectors.toList());
|
|
|
|
- for (Map<String, Object> map : result) {
|
|
|
|
- Optional<Map<String, Object>> first = result1.stream().filter(r1 -> r1.get("auditorDDId") != null && r1.get("auditorDDId").equals(map.get("auditorDDId"))).findFirst();
|
|
|
|
- Long num = Long.valueOf(String.valueOf(map.get("num")));
|
|
|
|
- BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
- if(first.isPresent()){
|
|
|
|
- bigDecimal=bigDecimal.add(new BigDecimal(String.valueOf(first.get().get("num"))));
|
|
|
|
- }
|
|
|
|
- companyDingdingService.sendReportWaitingApplyMsg(companyDingding.getCompanyId(), companyDingding.getAgentId(),
|
|
|
|
- bigDecimal.longValue(), (String)map.get("auditorDDId"));
|
|
|
|
|
|
+ //发送推送提醒
|
|
|
|
+ Integer companyId = companyDingding.getCompanyId();
|
|
|
|
+ Company company = companyMapper.selectById(companyId);
|
|
|
|
+ //过期公司不提醒
|
|
|
|
+ if(company.getExpirationDate().isBefore(LocalDateTime.now())){
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
- for (Map<String, Object> map : result1) {
|
|
|
|
- if(!resultCorpwxUserIds.stream().anyMatch(ol->ol != null && ((String)ol).equals(map.get("auditorDDId")))){
|
|
|
|
- Long num = Long.valueOf(String.valueOf(map.get("num")));
|
|
|
|
- BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
- companyDingdingService.sendReportWaitingApplyMsg(companyDingding.getCompanyId(), companyDingding.getAgentId(),
|
|
|
|
- bigDecimal.longValue(), (String)map.get("auditorDDId"));
|
|
|
|
|
|
+ //判断日报审核类型
|
|
|
|
+ timeTypeList.stream().filter(timeType -> timeType.getCompanyId().equals(companyId)).findFirst().ifPresent(timeType -> {
|
|
|
|
+ if (timeType.getReportAuditType() == 7) {//并行审核模式
|
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id,dingding_userid", "corpwx_userid").eq("company_id", companyId));
|
|
|
|
+ List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id, project_auditor_id, audit_dept_managerid,project_audit_state,department_audit_state").eq("company_id", companyId).eq("state", 0));
|
|
|
|
+ HashMap<String, Long> auditorMap = new HashMap();
|
|
|
|
+ for (Report report : reportList) {
|
|
|
|
+ //按审核人汇总统计
|
|
|
|
+ String pAuditorId = null;
|
|
|
|
+ if (report.getProjectAuditState() == 0) {
|
|
|
|
+ pAuditorId = report.getProjectAuditorId();
|
|
|
|
+ if (auditorMap.get(pAuditorId) == null) {
|
|
|
|
+ auditorMap.put(pAuditorId, 1L);
|
|
|
|
+ } else {
|
|
|
|
+ auditorMap.put(pAuditorId, auditorMap.get(pAuditorId) + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String deptAuditorId = null;
|
|
|
|
+ if (report.getDepartmentAuditState() == 0) {
|
|
|
|
+ deptAuditorId = report.getAuditDeptManagerid();
|
|
|
|
+ if (!deptAuditorId.equals(pAuditorId)) {
|
|
|
|
+ //不是同一个人,需要单独统计
|
|
|
|
+ if (auditorMap.get(deptAuditorId) == null) {
|
|
|
|
+ auditorMap.put(deptAuditorId, 1L);
|
|
|
|
+ } else {
|
|
|
|
+ auditorMap.put(deptAuditorId, auditorMap.get(deptAuditorId) + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (Map.Entry<String, Long> entry : auditorMap.entrySet()) {
|
|
|
|
+ String auditorId = entry.getKey();
|
|
|
|
+ Long num = entry.getValue();
|
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(auditorId)).findFirst();
|
|
|
|
+ if (first.isPresent()) {
|
|
|
|
+ companyDingdingService.sendReportWaitingApplyMsg(companyId, companyDingding.getAgentId(), num, first.get().getDingdingUserid());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ List<Map<String, Object>> result = reportMapper.getProWaitingApproveCnt(companyDingding.getCompanyId());
|
|
|
|
+ List<Map<String, Object>> result1 = reportMapper.getDeptWaitingApproveCnt(companyDingding.getCompanyId());
|
|
|
|
+ List<Object> resultCorpwxUserIds = result.stream().map(rl -> rl.get("auditorDDId")).collect(Collectors.toList());
|
|
|
|
+ for (Map<String, Object> map : result) {
|
|
|
|
+ Optional<Map<String, Object>> first = result1.stream().filter(r1 -> r1.get("auditorDDId") != null && r1.get("auditorDDId").equals(map.get("auditorDDId"))).findFirst();
|
|
|
|
+ Long num = Long.valueOf(String.valueOf(map.get("num")));
|
|
|
|
+ BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ bigDecimal=bigDecimal.add(new BigDecimal(String.valueOf(first.get().get("num"))));
|
|
|
|
+ }
|
|
|
|
+ companyDingdingService.sendReportWaitingApplyMsg(companyId, companyDingding.getAgentId(),
|
|
|
|
+ bigDecimal.longValue(), (String)map.get("auditorDDId"));
|
|
|
|
+ }
|
|
|
|
+ for (Map<String, Object> map : result1) {
|
|
|
|
+ if(!resultCorpwxUserIds.stream().anyMatch(ol->ol != null && ((String)ol).equals(map.get("auditorDDId")))){
|
|
|
|
+ Long num = Long.valueOf(String.valueOf(map.get("num")));
|
|
|
|
+ BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
+ companyDingdingService.sendReportWaitingApplyMsg(companyId, companyDingding.getAgentId(),
|
|
|
|
+ bigDecimal.longValue(), (String)map.get("auditorDDId"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
List<WxCorpInfo> wxCorpInfoList = wxCorpInfoMapper.getWxCompanyList(companyIds);
|
|
List<WxCorpInfo> wxCorpInfoList = wxCorpInfoMapper.getWxCompanyList(companyIds);
|
|
for (WxCorpInfo wxCorpInfo : wxCorpInfoList) {
|
|
for (WxCorpInfo wxCorpInfo : wxCorpInfoList) {
|
|
if (wxCorpInfo!=null) {
|
|
if (wxCorpInfo!=null) {
|
|
- List<Map<String, Object>> result = reportMapper.getProWaitingApproveCnt(wxCorpInfo.getCompanyId());
|
|
|
|
- List<Map<String, Object>> result1 = reportMapper.getDeptWaitingApproveCnt(wxCorpInfo.getCompanyId());
|
|
|
|
- List<Object> resultCorpwxUserIds = result.stream().map(rl -> rl.get("corpwxUserid")).collect(Collectors.toList());
|
|
|
|
- for (Map<String, Object> map : result) {
|
|
|
|
- Optional<Map<String, Object>> first = result1.stream().filter(r1 -> r1.get("corpwxUserid") != null && r1.get("corpwxUserid").equals(map.get("corpwxUserid"))).findFirst();
|
|
|
|
- if(map.get("corpwxUserid")!=null){
|
|
|
|
- String corpwxUserid = (String) map.get("corpwxUserid");
|
|
|
|
- //推送到企业微信
|
|
|
|
- JSONObject json=new JSONObject();
|
|
|
|
- JSONArray dataJson=new JSONArray();
|
|
|
|
- JSONObject jsonObj=new JSONObject();
|
|
|
|
- Integer num = Integer.valueOf(String.valueOf(map.get("num")));
|
|
|
|
- BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
- if(first.isPresent()){
|
|
|
|
- bigDecimal=bigDecimal.add(new BigDecimal(String.valueOf(first.get().get("num"))));
|
|
|
|
- }
|
|
|
|
- jsonObj.put("key", "待审核数量");
|
|
|
|
- jsonObj.put("value",bigDecimal.toPlainString());
|
|
|
|
- dataJson.add(jsonObj);
|
|
|
|
- if(isPrivateDeploy){
|
|
|
|
- json.put("content","待审核数量: "+(bigDecimal.toPlainString())+"\\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 {
|
|
|
|
- json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
|
|
|
|
- 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);
|
|
|
|
- }
|
|
|
|
- wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
|
|
|
|
- }
|
|
|
|
|
|
+ //发送推送提醒
|
|
|
|
+ Company company = companyMapper.selectById(wxCorpInfo.getCompanyId());
|
|
|
|
+ Integer companyId = company.getId();
|
|
|
|
+ //过期公司不提醒
|
|
|
|
+ if(company.getExpirationDate().isBefore(LocalDateTime.now())){
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
- for (Map<String, Object> map : result1) {
|
|
|
|
- if(!resultCorpwxUserIds.stream().anyMatch(ol->ol != null && ((String)ol).equals(map.get("corpwxUserid")))){
|
|
|
|
- if(map.get("corpwxUserid")!=null){
|
|
|
|
- String corpwxUserid = (String) map.get("corpwxUserid");
|
|
|
|
- //推送到企业微信
|
|
|
|
- JSONObject json=new JSONObject();
|
|
|
|
- JSONArray dataJson=new JSONArray();
|
|
|
|
- JSONObject jsonObj=new JSONObject();
|
|
|
|
- Integer num = Integer.valueOf(String.valueOf(map.get("num")));
|
|
|
|
- BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
- jsonObj.put("key", "待审核数量");
|
|
|
|
- jsonObj.put("value",bigDecimal.toPlainString());
|
|
|
|
- dataJson.add(jsonObj);
|
|
|
|
- if(isPrivateDeploy){
|
|
|
|
- json.put("content","待审核数量: "+(bigDecimal.toPlainString())+"\\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 {
|
|
|
|
- json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
|
|
|
|
- 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);
|
|
|
|
|
|
+ //判断日报审核类型
|
|
|
|
+ timeTypeList.stream().filter(timeType -> timeType.getCompanyId().equals(companyId)).findFirst().ifPresent(timeType -> {
|
|
|
|
+ if (timeType.getReportAuditType() == 7) {//并行审核模式
|
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id,dingding_userid", "corpwx_userid").eq("company_id", companyId));
|
|
|
|
+ List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id, project_auditor_id, audit_dept_managerid,project_audit_state,department_audit_state").eq("company_id", companyId).eq("state", 0));
|
|
|
|
+ HashMap<String, Long> auditorMap = new HashMap();
|
|
|
|
+ for (Report report : reportList) {
|
|
|
|
+ //按审核人汇总统计
|
|
|
|
+ String pAuditorId = null;
|
|
|
|
+ if (report.getProjectAuditState() == 0) {
|
|
|
|
+ pAuditorId = report.getProjectAuditorId();
|
|
|
|
+ if (auditorMap.get(pAuditorId) == null) {
|
|
|
|
+ auditorMap.put(pAuditorId, 1L);
|
|
|
|
+ } else {
|
|
|
|
+ auditorMap.put(pAuditorId, auditorMap.get(pAuditorId) + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String deptAuditorId = null;
|
|
|
|
+ if (report.getDepartmentAuditState() == 0) {
|
|
|
|
+ deptAuditorId = report.getAuditDeptManagerid();
|
|
|
|
+ if (!deptAuditorId.equals(pAuditorId)) {
|
|
|
|
+ //不是同一个人,需要单独统计
|
|
|
|
+ if (auditorMap.get(deptAuditorId) == null) {
|
|
|
|
+ auditorMap.put(deptAuditorId, 1L);
|
|
|
|
+ } else {
|
|
|
|
+ auditorMap.put(deptAuditorId, auditorMap.get(deptAuditorId) + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (Map.Entry<String, Long> entry : auditorMap.entrySet()) {
|
|
|
|
+ String auditorId = entry.getKey();
|
|
|
|
+ Long num = entry.getValue();
|
|
|
|
+ Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(auditorId)).findFirst();
|
|
|
|
+ if (first.isPresent()) {
|
|
|
|
+ if (first.get().getCorpwxUserid() != null) {
|
|
|
|
+ String corpwxUserid = first.get().getCorpwxUserid();
|
|
|
|
+ //推送到企业微信
|
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
|
+ JSONArray dataJson=new JSONArray();
|
|
|
|
+ JSONObject jsonObj=new JSONObject();
|
|
|
|
+ jsonObj.put("key", "待审核数量");
|
|
|
|
+ jsonObj.put("value",num+"");
|
|
|
|
+ dataJson.add(jsonObj);
|
|
|
|
+ if(isPrivateDeploy){
|
|
|
|
+ json.put("content","待审核数量: "+num+"\\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 {
|
|
|
|
+ json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
|
|
|
|
+ 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("发送企业微信消息==用户:"+first.get().getId()+", name="+first.get().getName()+", "+json.toJSONString());
|
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ List<Map<String, Object>> result = reportMapper.getProWaitingApproveCnt(wxCorpInfo.getCompanyId());
|
|
|
|
+ List<Map<String, Object>> result1 = reportMapper.getDeptWaitingApproveCnt(wxCorpInfo.getCompanyId());
|
|
|
|
+ List<Object> resultCorpwxUserIds = result.stream().map(rl -> rl.get("corpwxUserid")).collect(Collectors.toList());
|
|
|
|
+ for (Map<String, Object> map : result) {
|
|
|
|
+ Optional<Map<String, Object>> first = result1.stream().filter(r1 -> r1.get("corpwxUserid") != null && r1.get("corpwxUserid").equals(map.get("corpwxUserid"))).findFirst();
|
|
|
|
+ if(map.get("corpwxUserid")!=null){
|
|
|
|
+ String corpwxUserid = (String) map.get("corpwxUserid");
|
|
|
|
+ //推送到企业微信
|
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
|
+ JSONArray dataJson=new JSONArray();
|
|
|
|
+ JSONObject jsonObj=new JSONObject();
|
|
|
|
+ Integer num = Integer.valueOf(String.valueOf(map.get("num")));
|
|
|
|
+ BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ bigDecimal=bigDecimal.add(new BigDecimal(String.valueOf(first.get().get("num"))));
|
|
|
|
+ }
|
|
|
|
+ jsonObj.put("key", "待审核数量");
|
|
|
|
+ jsonObj.put("value",bigDecimal.toPlainString());
|
|
|
|
+ dataJson.add(jsonObj);
|
|
|
|
+ if(isPrivateDeploy){
|
|
|
|
+ json.put("content","待审核数量: "+(bigDecimal.toPlainString())+"\\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 {
|
|
|
|
+ json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (Map<String, Object> map : result1) {
|
|
|
|
+ if(!resultCorpwxUserIds.stream().anyMatch(ol->ol != null && ((String)ol).equals(map.get("corpwxUserid")))){
|
|
|
|
+ if(map.get("corpwxUserid")!=null){
|
|
|
|
+ String corpwxUserid = (String) map.get("corpwxUserid");
|
|
|
|
+ //推送到企业微信
|
|
|
|
+ JSONObject json=new JSONObject();
|
|
|
|
+ JSONArray dataJson=new JSONArray();
|
|
|
|
+ JSONObject jsonObj=new JSONObject();
|
|
|
|
+ Integer num = Integer.valueOf(String.valueOf(map.get("num")));
|
|
|
|
+ BigDecimal bigDecimal=new BigDecimal(num);
|
|
|
|
+ jsonObj.put("key", "待审核数量");
|
|
|
|
+ jsonObj.put("value",bigDecimal.toPlainString());
|
|
|
|
+ dataJson.add(jsonObj);
|
|
|
|
+ if(isPrivateDeploy){
|
|
|
|
+ json.put("content","待审核数量: "+(bigDecimal.toPlainString())+"\\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 {
|
|
|
|
+ json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1341,7 +1456,7 @@ public class TimingTask {
|
|
if (str.equals(t.getAlertTime())) {
|
|
if (str.equals(t.getAlertTime())) {
|
|
//节假日是否提醒
|
|
//节假日是否提醒
|
|
Boolean workDay = timeTypeService.isWorkDay(t.getCompanyId(), localDate);
|
|
Boolean workDay = timeTypeService.isWorkDay(t.getCompanyId(), localDate);
|
|
- if (!workDay){
|
|
|
|
|
|
+ if ((t.getAlertType() == 0 || t.getAlertType() == 1) && !workDay){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//发送推送提醒
|
|
//发送推送提醒
|
|
@@ -1455,6 +1570,9 @@ public class TimingTask {
|
|
if (u.get("corpwxUserid") != null){
|
|
if (u.get("corpwxUserid") != null){
|
|
//推送到企业微信
|
|
//推送到企业微信
|
|
String corpUid = (String) u.get("corpwxUserid");
|
|
String corpUid = (String) u.get("corpwxUserid");
|
|
|
|
+ if ("woy9TkCAAAyVAc5oXhGwCO-DFWF8SfKg".equals(corpUid)){
|
|
|
|
+ System.out.println("发送给 【顾焕峰】漏填提醒");
|
|
|
|
+ }
|
|
JSONObject json=new JSONObject();
|
|
JSONObject json=new JSONObject();
|
|
JSONArray dataJson = new JSONArray();
|
|
JSONArray dataJson = new JSONArray();
|
|
JSONObject jsonObj = new JSONObject();
|
|
JSONObject jsonObj = new JSONObject();
|
|
@@ -1468,7 +1586,13 @@ public class TimingTask {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if (finalLastWeekNotFill) {
|
|
if (finalLastWeekNotFill) {
|
|
- jsonObj.put("value", "您上周有"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写");
|
|
|
|
|
|
+ String text = null;
|
|
|
|
+ if (!StringUtils.isEmpty(t.getAlertMsg()) && t.getAlertMsg().contains("{0}")) {
|
|
|
|
+ text = t.getAlertMsg().replace("{0}", u.get("daysTxt").toString());
|
|
|
|
+ } else {
|
|
|
|
+ text = "您上周有"+(Integer)u.get("days")+"天未填写工时报告,请尽快填写";
|
|
|
|
+ }
|
|
|
|
+ jsonObj.put("value", text);
|
|
} else {
|
|
} else {
|
|
jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
|
|
jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
|
|
}
|
|
}
|
|
@@ -1482,7 +1606,7 @@ public class TimingTask {
|
|
json.put("content_item",dataJson);
|
|
json.put("content_item",dataJson);
|
|
}
|
|
}
|
|
if (cpList.size() > 0) {
|
|
if (cpList.size() > 0) {
|
|
-// System.out.println("发送企业微信漏填提醒:" + LocalDateTime.now().toString() + ", corpUid=" + corpUid + ", json=" + json.toJSONString());
|
|
|
|
|
|
+ System.out.println("发送企业微信漏填提醒:" + LocalDateTime.now().toString() + ", corpUid=" + corpUid + ", json=" + json.toJSONString());
|
|
wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
|
|
wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
|
|
}
|
|
}
|
|
} else if (u.get("wxOpenid") != null) {
|
|
} else if (u.get("wxOpenid") != null) {
|
|
@@ -1497,7 +1621,6 @@ public class TimingTask {
|
|
companyDingdingService.sendFillReportAlertMsg(t.getCompanyId(), compDingding.getAgentId(), t.getAlertMsg(), idStr);
|
|
companyDingdingService.sendFillReportAlertMsg(t.getCompanyId(), compDingding.getAgentId(), t.getAlertMsg(), idStr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (isDev) {
|
|
if (isDev) {
|