From c8cfc3f292979cee0b9b65d31294f3dcb9f7d73c Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 23 Nov 2020 10:40:59 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/job/business/DingtalkBusiness.java | 17 ++++++++--------- .../com/lz/modules/sys/oauth2/OAuth2Filter.java | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java index 9ad9252a..d607ce57 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -234,7 +234,7 @@ public class DingtalkBusiness { public String sendWorkMSGWithAsyn(Long resultRecordId ,Long flowRecordId, int type) { - + logger.info("开始处理数据"); //流程跳转专用 ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId); if(resultRecord != null){ @@ -244,27 +244,26 @@ public class DingtalkBusiness { fromStaff.setFlowStart(flowStart); fromStaff.setFlowRecordId(flowRecordId); if(type == WorkMsgTypeEnum.REJECT.getType()){//被拒 - sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.REJECT.getType()); + return sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.REJECT.getType()); }else if(type == WorkMsgTypeEnum.URGING.getType()){//被拒 - sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.URGING.getType()); + return sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.URGING.getType()); }else if(type == WorkMsgTypeEnum.SKIP.getType()){//被拒 - sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.SKIP.getType()); + return sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.SKIP.getType()); }else if(type == WorkMsgTypeEnum.TRANSFER.getType()){//被拒 - sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.TRANSFER.getType()); + return sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.TRANSFER.getType()); }else{ - sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.PROCESS.getType()); + return sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.PROCESS.getType()); } - - - } + logger.info("无记录"); return "error"; } //流程流转发送消息 public String sendWorkMSGWithAsyn(Long resultRecordId , int type) { + logger.info("流程流转发送消息"); return sendWorkMSGWithAsyn(resultRecordId, 0L, type); } diff --git a/src/main/java/com/lz/modules/sys/oauth2/OAuth2Filter.java b/src/main/java/com/lz/modules/sys/oauth2/OAuth2Filter.java index ab61ede1..91b5e54a 100644 --- a/src/main/java/com/lz/modules/sys/oauth2/OAuth2Filter.java +++ b/src/main/java/com/lz/modules/sys/oauth2/OAuth2Filter.java @@ -62,7 +62,7 @@ public class OAuth2Filter extends AuthenticatingFilter { httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); - String json = new Gson().toJson(R.error(HttpStatus.SC_UNAUTHORIZED, "invalid token")); + String json = new Gson().toJson(R.error(HttpStatus.SC_UNAUTHORIZED, "登录已过期,请重新登录")); httpResponse.getWriter().print(json); return false; From ef77ca95481bcf900b7a7ac402dbcf14dbfe0d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Mon, 23 Nov 2020 11:01:42 +0800 Subject: [PATCH 2/5] fix --- src/main/resources/mapper/flow/FlowRecordMapper.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/mapper/flow/FlowRecordMapper.xml b/src/main/resources/mapper/flow/FlowRecordMapper.xml index 2a34cc6b..1055a137 100644 --- a/src/main/resources/mapper/flow/FlowRecordMapper.xml +++ b/src/main/resources/mapper/flow/FlowRecordMapper.xml @@ -175,25 +175,25 @@ From dd3914887425f2d5964c1e06e37a74f165505247 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 23 Nov 2020 11:24:32 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=85=E5=8A=9E?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job/business/DingtalkBusiness.java | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java index d607ce57..2ac98221 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -270,32 +270,31 @@ public class DingtalkBusiness { public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List toStaffids, int type) { - if(toStaffids != null && toStaffids.size() > 0){ - if (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0) { - //查询第三方id - List ids = toStaffids.stream().map(new Function() { - @Override - public Long apply(StaffSimpleInfo staffSimpleInfo) { - return staffSimpleInfo.getId(); - } - }).collect(Collectors.toList()); - List staffSimpleInfos = staffService.selectStaffSimpleInfos(ids); - Map map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e -> e)); - for (StaffSimpleInfo staff : staffSimpleInfos - ) { - StaffSimpleInfo staff1 = map.get(staff.getId()); - staff1.setEmployeeId(staff1.getEmployeeId()); + + if (toStaffids != null && toStaffids.size() > 0 && (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0)) { + //查询第三方id + List ids = toStaffids.stream().map(new Function() { + @Override + public Long apply(StaffSimpleInfo staffSimpleInfo) { + return staffSimpleInfo.getId(); } + }).collect(Collectors.toList()); + List staffSimpleInfos = staffService.selectStaffSimpleInfos(ids); + Map map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e -> e)); + for (StaffSimpleInfo staff : staffSimpleInfos + ) { + StaffSimpleInfo staff1 = map.get(staff.getId()); + staff1.setEmployeeId(staff1.getEmployeeId()); } - WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type); - - ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid); - Thread thread = new Thread(threadSendMessage); - thread.start(); - - return "OK"; } - return "error"; + WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type); + + ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid); + Thread thread = new Thread(threadSendMessage); + thread.start(); + + return "OK"; + } From 1de8ddaa6c65e77f173f7d36b03315e305c0ef1f Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 23 Nov 2020 11:44:49 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=97=A5=E5=BF=97null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lz/modules/job/business/DingtalkBusiness.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java index 2ac98221..6d472784 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -432,9 +432,10 @@ public class DingtalkBusiness { dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token); } }else{ - logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid); + logger.info("开始批量推送消息,appid{}", toStaffids.size(), appid); if(toStaffids == null){//流程流转走的代码 + logger.info("需要处理人员信息{}", fromStaff); String url = hostUrl; if(url.contains("?")){ url += "&halokit=" + System.currentTimeMillis(); @@ -570,6 +571,7 @@ public class DingtalkBusiness { }else{//批量推送给指定人员 + logger.info("批量推送数量{}", toStaffids.size()); for (StaffSimpleInfo info:toStaffids ) { From 60d4e006ab79bdb2120262456bf869a646a710c4 Mon Sep 17 00:00:00 2001 From: wulin Date: Mon, 23 Nov 2020 11:49:05 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lz/modules/job/business/DingtalkBusiness.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java index 6d472784..2e017239 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -432,7 +432,7 @@ public class DingtalkBusiness { dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token); } }else{ - logger.info("开始批量推送消息,appid{}", toStaffids.size(), appid); + logger.info("开始批量推送消息,appid{}", appid); if(toStaffids == null){//流程流转走的代码 logger.info("需要处理人员信息{}", fromStaff);