From 3c8547c3bcc20275de0fca8fbf3c6bc2885a47fa Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Fri, 6 Nov 2020 09:35:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lz/config/ShiroConfig.java | 1 + .../sys/service/app/impl/ResultRecordServiceImpl.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/lz/config/ShiroConfig.java b/src/main/java/com/lz/config/ShiroConfig.java index 36fedbc9..1fe3d0c6 100644 --- a/src/main/java/com/lz/config/ShiroConfig.java +++ b/src/main/java/com/lz/config/ShiroConfig.java @@ -53,6 +53,7 @@ public class ShiroConfig { filterMap.put("/webjars/**", "anon"); filterMap.put("/file/**", "anon"); filterMap.put("/user/lzstaffrole/role/**", "anon"); + filterMap.put("/user/lzresultrecord/**", "anon"); filterMap.put("/test/**", "anon"); filterMap.put("/druid/**", "anon"); filterMap.put("/app/**", "anon"); diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index 01d5c891..bea5b83b 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java @@ -824,6 +824,7 @@ public class ResultRecordServiceImpl extends ServiceImpl currentResultRecords = flowRecordService.selectFlowRecordByRecordIdStatus(recordDetailDto.getResultRecordId(),2); + log.info("当前用户登陆用户 id :" + recordDetailDto.getLoginUserId()); if(currentResultRecords !=null && currentResultRecords.size() > 0 ){ FlowRecord currentResultRecord = null; for(FlowRecord flowRecord:currentResultRecords){ if(flowRecord.getApprovalStaffId().equals(recordDetailDto.getLoginUserId())){ currentResultRecord = flowRecord; + log.info("当前审批用户 id id :" + currentResultRecord.getApprovalStaffId()); break; } } - if(currentResultRecord !=null){ if(StringUtil.isNotBlank(currentResultRecord.getFlowStaffIdRole())){ Map map = JSONObject.parseObject(currentResultRecord.getFlowStaffIdRole(),Map.class); From c221ee5ff8dcd56dc51e0f5107b9f99cd9df7503 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Fri, 6 Nov 2020 09:58:18 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lz/modules/app/controller/TestController.java | 2 +- .../service/app/impl/ResultRecordServiceImpl.java | 5 ++--- src/main/resources/mapper/flow/FlowRecordMapper.xml | 13 ++++++++----- src/test/java/com/lz/mysql/MysqlMain.java | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/lz/modules/app/controller/TestController.java b/src/main/java/com/lz/modules/app/controller/TestController.java index 21ea024a..b1255e5d 100644 --- a/src/main/java/com/lz/modules/app/controller/TestController.java +++ b/src/main/java/com/lz/modules/app/controller/TestController.java @@ -261,7 +261,7 @@ public class TestController { } } - // http://localhost:8080/lz_management/test/resultrecord?resultRecordId=215 + // http://localhost:8080/lz_management/test/resultrecord?resultRecordId=381 @RequestMapping("/test/resultrecord") public void resultRecorcd(Long resultRecordId) throws Exception{ R r = resultRecordService.initFlowRecord(resultRecordId); diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index bea5b83b..cf1a99a0 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java @@ -773,7 +773,6 @@ public class ResultRecordServiceImpl extends ServiceImpl flowApprovalRoles =flowApprovalRoleService.selectFlowApprovalRoleList(flowIds); int i = 0; - List flowRecords = new ArrayList<>(); for (FlowApprovalRole flowApprovalRole : flowApprovalRoles) { FlowRecord flowRecord = new FlowRecord(); flowRecord.setRecordId(resultRecord.getId()); @@ -814,9 +813,9 @@ public class ResultRecordServiceImpl extends ServiceImpl + - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, department_level AS departmentLevel, record_id AS recordId, approval_staff_id AS approvalStaffId, approval_staff_name AS approvalStaffName, flow_name AS flowName, record_staff_id AS recordStaffId, flow_id AS flowId, flow_index AS flowIndex, status AS status, flow_staff_id_role AS flowStaffIdRole, status_name AS statusName, type AS type, process_id AS processId + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, department_level AS departmentLevel, record_id AS recordId, approval_staff_id AS approvalStaffId, approval_staff_name AS approvalStaffName, flow_name AS flowName, record_staff_id AS recordStaffId, flow_id AS flowId, flow_index AS flowIndex, status AS status, flow_staff_id_role AS flowStaffIdRole, status_name AS statusName, type AS type, process_id AS processId, flow_process AS flowProcess @@ -52,6 +53,7 @@ status_name, type, process_id, + flow_process, is_delete, gmt_create, gmt_modified @@ -69,6 +71,7 @@ #{ statusName}, #{ type}, #{ processId}, + #{ flowProcess}, 0, now(), now() @@ -94,7 +97,8 @@ flow_staff_id_role = #{flowStaffIdRole}, status_name = #{statusName}, type = #{type}, - process_id = #{processId} + process_id = #{processId}, + flow_process = #{flowProcess} ,gmt_modified = now() where id = #{id} @@ -119,7 +123,8 @@ flow_staff_id_role = #{flowStaffIdRole}, status_name = #{statusName}, type = #{type}, - process_id = #{processId} + process_id = #{processId}, + flow_process = #{flowProcess} ,gmt_modified = now() where id = #{id} @@ -130,8 +135,6 @@ - - diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 014f5562..d8784020 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -126,7 +126,7 @@ public class MysqlMain { List list = new ArrayList(); - list.add(new TablesBean("lz_evaluation_group")); + list.add(new TablesBean("lz_flow_record")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments(); From a556bbbb6b158cb307b3ac1ea7a53ea3c54160c8 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Fri, 6 Nov 2020 11:14:53 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lz/modules/app/controller/ResultRecordController.java | 2 +- .../modules/sys/service/app/impl/ResultRecordServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 34c3de8e..008916e0 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -999,7 +999,7 @@ public class ResultRecordController extends AbstractController { /** * 删除 */ - // http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=331&loginUserId=825 + // http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=387&loginUserId=380 @RequestMapping("/new/resultRecordDetail") public R newResultRecordList(RecordDetailDto recordDetailDto) { if(recordDetailDto.getLoginUserId() ==null && getUser() !=null ){ diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index cf1a99a0..2e6a569b 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java @@ -1114,8 +1114,8 @@ public class ResultRecordServiceImpl extends ServiceImpl Date: Fri, 6 Nov 2020 14:48:19 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E8=9C=9C=E6=9F=91=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 +- .../com/lz/common/utils/DingTalkUtil.java | 55 ++++++++++- .../service/impl/FlowStartServiceImpl.java | 4 +- .../job/business/DingtalkBusiness.java | 8 +- .../impl/AssessManagerServiceImpl.java | 2 +- .../sys/controller/SysUserController.java | 7 +- .../lz/modules/sys/entity/SysUserEntity.java | 7 ++ .../modules/sys/entity/SysUserEntityDto.java | 97 +++++++++++++++++++ .../lz/modules/sys/oauth2/OAuth2Realm.java | 12 ++- 9 files changed, 180 insertions(+), 18 deletions(-) create mode 100644 src/main/java/com/lz/modules/sys/entity/SysUserEntityDto.java diff --git a/pom.xml b/pom.xml index a9c59a09..6cba1808 100644 --- a/pom.xml +++ b/pom.xml @@ -249,9 +249,9 @@ - taobao-sdk-java-auto_1479188381469 - dingtalk - 20200811 + com.aliyun + alibaba-dingtalk-service-sdk + 1.0.1 diff --git a/src/main/java/com/lz/common/utils/DingTalkUtil.java b/src/main/java/com/lz/common/utils/DingTalkUtil.java index 23a45b7e..a9710b86 100644 --- a/src/main/java/com/lz/common/utils/DingTalkUtil.java +++ b/src/main/java/com/lz/common/utils/DingTalkUtil.java @@ -266,7 +266,7 @@ public class DingTalkUtil { String token = dingTalkUtil.getAccessToken("856016278"); } - + //发送钉钉消息 public String sendSingleActionCardMSG(String appid, StaffEntity staff, String title, String marDown, String singleTitle, String singleUrl, String token) { String msg = "OK"; @@ -318,6 +318,59 @@ public class DingTalkUtil { thirdMsgSendRecordService.insert(thirdMsgSendRecord); return msg; } + //发送待办任务 + public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, String marDown, + String singleTitle, String singleUrl, String token) { + String msg = "OK"; + + ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord(); + thirdMsgSendRecord.setMsgType("work_msg"); + thirdMsgSendRecord.setStaffId(staff.getId()); + thirdMsgSendRecord.setMsgTitle(singleTitle); + thirdMsgSendRecord.setAppId(Long.parseLong(appid)); + thirdMsgSendRecord.setHeadText(title); + thirdMsgSendRecord.setMsgContent(marDown); + thirdMsgSendRecord.setMsgUrl(singleUrl); + thirdMsgSendRecord.setStatus(0); + try{ + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workrecord/add"); + OapiWorkrecordAddRequest req = new OapiWorkrecordAddRequest(); + req.setUserid(staff.getEmployeeId()); + req.setCreateTime(System.currentTimeMillis()); + req.setTitle(singleTitle); + req.setUrl(singleUrl); + List list2 = new ArrayList(); + OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo(); + list2.add(obj3); + obj3.setTitle(title); + obj3.setContent(marDown); + req.setFormItemList(list2); + OapiWorkrecordAddResponse rsp = client.execute(req, token); + + + logger.info("钉钉待办任务请求返回{}", rsp.getBody()); + //插入数据库 + JSONObject json = JSONObject.parseObject(rsp.getBody()); + if(json.getIntValue("errcode") == 0){ + thirdMsgSendRecord.setTaskId(json.getLong("record_id")); + thirdMsgSendRecord.setStatus(1); + }else{ + thirdMsgSendRecord.setTaskId(0L); + thirdMsgSendRecord.setStatus(6); + thirdMsgSendRecord.setRemark(json.getString("errmsg")); + msg = thirdMsgSendRecord.getRemark(); + } + + }catch (ApiException e) { + e.printStackTrace(); + thirdMsgSendRecord.setStatus(6); + thirdMsgSendRecord.setRemark(e.getErrMsg()); + msg = thirdMsgSendRecord.getRemark(); + + } + thirdMsgSendRecordService.insert(thirdMsgSendRecord); + return msg; + } public R getUserIdByCode(String code, String token) { try { diff --git a/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java index 53d2a308..ed7e347d 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java @@ -157,7 +157,7 @@ public class FlowStartServiceImpl extends ServiceImpl toStaffids, int type) { - List staffSimpleInfos = staffService.selectStaffSimpleInfos(toStaffids); - return sendWorkMSGWithThread(staffSimpleInfos, type); - } - public String sendWorkMSGWithThread(List toStaffids, int type) { + public String sendWorkMSGWithAsyn(List toStaffids, int type) { if(toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0){ //查询第三方id @@ -324,7 +320,7 @@ public class DingtalkBusiness { StaffEntity entity = new StaffEntity(); entity.setId(info.getId()); entity.setEmployeeId(info.getEmployeeId()); - dingTalkUtil.sendSingleActionCardMSG(appid, entity, workMsgTypeEnum.getTitle(), + dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(), content, workMsgTypeEnum.getBtnText(), url, token); }else{ logger.info("ThreadSendMessage token无效"); ; diff --git a/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java index ca2e70f7..f2d2d859 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java @@ -310,7 +310,7 @@ public class AssessManagerServiceImpl implements AssessManagerService { //通知评分 try { - dingtalkBusiness.sendWorkMSGWithThread(toStaffids, WorkMsgTypeEnum.START_SCORE.getType()); + dingtalkBusiness.sendWorkMSGWithAsyn(toStaffids, WorkMsgTypeEnum.START_SCORE.getType()); } catch (Exception e) { log.error("通知评分异常:",e); } diff --git a/src/main/java/com/lz/modules/sys/controller/SysUserController.java b/src/main/java/com/lz/modules/sys/controller/SysUserController.java index 75337332..75034d00 100644 --- a/src/main/java/com/lz/modules/sys/controller/SysUserController.java +++ b/src/main/java/com/lz/modules/sys/controller/SysUserController.java @@ -19,12 +19,14 @@ import com.lz.common.validator.group.AddGroup; import com.lz.common.validator.group.UpdateGroup; import com.lz.modules.app.entity.UserEntity; import com.lz.modules.sys.entity.SysUserEntity; +import com.lz.modules.sys.entity.SysUserEntityDto; import com.lz.modules.sys.form.PasswordForm; import com.lz.modules.sys.service.SysUserRoleService; import com.lz.modules.sys.service.SysUserService; import org.apache.commons.lang.ArrayUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.crypto.hash.Sha256Hash; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -67,7 +69,10 @@ public class SysUserController extends AbstractController { */ @GetMapping("/info") public R info() { - return R.ok().put("user", getUser()); + SysUserEntity sysUserEntity = getUser(); + SysUserEntityDto entityDto = new SysUserEntityDto(); + BeanUtils.copyProperties(sysUserEntity, entityDto); + return R.ok().put("user", entityDto); } /** diff --git a/src/main/java/com/lz/modules/sys/entity/SysUserEntity.java b/src/main/java/com/lz/modules/sys/entity/SysUserEntity.java index d49729d2..519500d9 100644 --- a/src/main/java/com/lz/modules/sys/entity/SysUserEntity.java +++ b/src/main/java/com/lz/modules/sys/entity/SysUserEntity.java @@ -49,12 +49,19 @@ public class SysUserEntity implements Serializable { @NotBlank(message="工号不能为空", groups = AddGroup.class) private String userNo; + /** * 用户名 */ @NotBlank(message="账号不能为空", groups = {AddGroup.class, UpdateGroup.class}) private String username; + /** + * 头像 + */ + @TableField(exist = false) + private String avatar; + /** * 密码 */ diff --git a/src/main/java/com/lz/modules/sys/entity/SysUserEntityDto.java b/src/main/java/com/lz/modules/sys/entity/SysUserEntityDto.java new file mode 100644 index 00000000..ef21b58f --- /dev/null +++ b/src/main/java/com/lz/modules/sys/entity/SysUserEntityDto.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) 2020 fumeiai All rights reserved. + * + * + * + * 版权所有,侵权必究! + */ + +package com.lz.modules.sys.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.lz.common.validator.group.AddGroup; +import com.lz.common.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("sys_user") +public class SysUserEntityDto implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @TableId + private Long userId; + + /** + * 员工姓名 + */ + @NotBlank(message="员工姓名不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String realName; + + /** + * 员工工号 + */ + @NotBlank(message="工号不能为空", groups = AddGroup.class) + private String userNo; + + /** + * 头像 + */ + @TableField(exist = false) + private String avatar; + + /** + * 用户名 + */ + @NotBlank(message="账号不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String username; + + + + /** + * 手机号 + */ + @NotBlank(message="手机号不能为空", groups = {AddGroup.class, UpdateGroup.class}) + private String mobile; + + +// /** +// * 邮箱 +// */ +// @NotBlank(message="邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class}) + @Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class}) + private String email; + + + + /** + * 状态 0:禁用 1:正常 + */ + private Integer status; + + + private int type ;// 0 表示系统用户,1 表示普通员工 + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } +} diff --git a/src/main/java/com/lz/modules/sys/oauth2/OAuth2Realm.java b/src/main/java/com/lz/modules/sys/oauth2/OAuth2Realm.java index ca8b60a3..921f11fc 100644 --- a/src/main/java/com/lz/modules/sys/oauth2/OAuth2Realm.java +++ b/src/main/java/com/lz/modules/sys/oauth2/OAuth2Realm.java @@ -11,6 +11,7 @@ package com.lz.modules.sys.oauth2; import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.service.StaffService; import com.lz.modules.sys.entity.SysUserEntity; +import com.lz.modules.sys.entity.SysUserEntityDto; import com.lz.modules.sys.entity.SysUserTokenEntity; import com.lz.modules.sys.service.ShiroService; import org.apache.shiro.authc.*; @@ -71,16 +72,19 @@ public class OAuth2Realm extends AuthorizingRealm { //查询用户信息 SysUserEntity user = null; + StaffEntity staffEntity = staffService.selectStaffById(tokenEntity.getUserId()); if(tokenEntity.getType() == 0){ //如果是系统用户 user = shiroService.queryUser(tokenEntity.getUserId()); + if(staffEntity != null){ + user.setAvatar(staffEntity.getAvatar()); + } + }else{ - user = new SysUserEntity();//如果是普通用户 - StaffEntity staffEntity = staffService.selectStaffById(tokenEntity.getUserId()); - user.setPassword(staffEntity.getPassword()); + user = new SysUserEntity(); user.setMobile(staffEntity.getMobile()); + user.setAvatar(staffEntity.getAvatar()); user.setUserId(staffEntity.getId()); user.setEmail(staffEntity.getEmail()); - user.setSalt(staffEntity.getSalt()); user.setStatus(1); user.setType(1); user.setUsername(staffEntity.getMobile()); From 5e9976a68bbd2454f05972beda202e69bb3a85dd Mon Sep 17 00:00:00 2001 From: wulin Date: Fri, 6 Nov 2020 14:55:20 +0800 Subject: [PATCH 5/7] xiugai pom --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6cba1808..a9c59a09 100644 --- a/pom.xml +++ b/pom.xml @@ -249,9 +249,9 @@ - com.aliyun - alibaba-dingtalk-service-sdk - 1.0.1 + taobao-sdk-java-auto_1479188381469 + dingtalk + 20200811 From f457c0d518af9524e315d4f887dd5452c256531f Mon Sep 17 00:00:00 2001 From: wulin Date: Fri, 6 Nov 2020 15:00:51 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9pom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index a9c59a09..336d33ee 100644 --- a/pom.xml +++ b/pom.xml @@ -249,9 +249,10 @@ - taobao-sdk-java-auto_1479188381469 - dingtalk - 20200811 + com.aliyun + alibaba-dingtalk-service-sdk + 1.0.0 + suibian From 2235ea47145577fccc759fc54c2aa5e71bd7f5d7 Mon Sep 17 00:00:00 2001 From: wulin Date: Fri, 6 Nov 2020 15:15:34 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E4=BA=8B=E9=A1=B9?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=8C=A4=E4=B8=8A=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lz/modules/job/business/DingtalkBusiness.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 c005eb95..ca6900fb 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -289,7 +289,7 @@ public class DingtalkBusiness { List toStaffids; WorkMsgTypeEnum workMsgTypeEnum; String appid; - String url = ""; + String hostUrl = "https://lzmanagement.ldxinyong.com/digitization/dingTalkLogin"; public ThreadSendMessage(List toStaffids, WorkMsgTypeEnum typeEnum, String appid){ this.toStaffids = toStaffids; workMsgTypeEnum = typeEnum; @@ -305,14 +305,15 @@ public class DingtalkBusiness { ) { if(token != null && token.length() > 0){ //下面防止第二次发送消息时钉钉不推送 + String url = hostUrl; if(url.contains("?")){ url += "&halokit=" + System.currentTimeMillis(); }else{ url += "?halokit=" + System.currentTimeMillis(); } + url += ("&detail=1&id=" + info.getRecordId()); url = URLEncoder.encode(url); - /* url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() + - "&container_type=work_platform&app_id=0_" + appid + "&redirect_type=jump&redirect_url=" + url;*/ + url = "dingtalk://dingtalkclient/page/link?pc_slide=true&url=" + url;