Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
062741f1b2
@ -26,6 +26,7 @@ public enum WorkMsgTypeEnum {
|
||||
CLEARN(12, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
|
||||
TASK_COMMENT(13, "任务评论", "去查看", "# 任务评论\n ## @1评论了你的@2的任务"),
|
||||
TASK_UPDATE(14, "任务更新", "去更新", "# 任务更新\n ## 记得每天来更新任务哦"),
|
||||
TASK_REPLY_COMMENT(15, "任务评论", "去查看", "# 任务评论\n ## @1在@2的任务中@的了你"),
|
||||
// 您的2020年10月绩效考核已经开始,请尽快制定绩效目标
|
||||
// 吴林的2020年12月绩效考核的目标需要您确认,点击前往确认
|
||||
;
|
||||
|
||||
@ -693,7 +693,7 @@ public class DingtalkBusiness {
|
||||
|
||||
public String sendTaskNoticeMsg(Long detailId, Long taskId) {
|
||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(detailId);
|
||||
logger.info("评论通知指标id{}, 任务id{}", detailId, taskId);
|
||||
logger.info("评论通知指标id{}, 任务id{}, 指标信息{}", detailId, taskId, resultDetail);
|
||||
if(resultDetail != null){
|
||||
TaskProcessRecord taskProcessRecord = null;
|
||||
if(taskId == null){
|
||||
@ -701,17 +701,13 @@ public class DingtalkBusiness {
|
||||
}else{
|
||||
taskProcessRecord = taskProcessRecordService.selectCommentTaskProcessRecordByTaskId(taskId);
|
||||
}
|
||||
StaffSimpleInfo fromStaffSimpleInfo = staffService.selectStaffSimpleInfo(taskProcessRecord.getStaffId());
|
||||
StaffSimpleInfo toStaffSimpleInfo = staffService.selectStaffSimpleInfo(resultDetail.getStaffId());
|
||||
|
||||
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
||||
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
||||
if(token != null && token.length() > 0){
|
||||
|
||||
if(taskProcessRecord != null) {
|
||||
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
||||
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
||||
String url = homeUrl;
|
||||
if(url.contains("?")){
|
||||
if (url.contains("?")) {
|
||||
url += "&halokit=" + System.currentTimeMillis();
|
||||
}else{
|
||||
} else {
|
||||
url += "?halokit=" + System.currentTimeMillis();
|
||||
}
|
||||
url += ("&detail=1&id=" + resultDetail.getRecordId());
|
||||
@ -721,20 +717,71 @@ public class DingtalkBusiness {
|
||||
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
|
||||
"&container_type=work_platform&app_id=0_" +
|
||||
appid + "&redirect_type=jump&redirect_url=" + url;
|
||||
StaffEntity info = new StaffEntity();
|
||||
info.setId(toStaffSimpleInfo.getId());
|
||||
info.setEmployeeId(toStaffSimpleInfo.getEmployeeId());
|
||||
String content = WorkMsgTypeEnum.TASK_COMMENT.getContent().replace("@1", fromStaffSimpleInfo.getName());
|
||||
content = content.replace("@2", "“" + resultDetail.getTarget() + "”");
|
||||
logger.info("通知内容{},url{}", content, url);
|
||||
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.TASK_COMMENT.getTitle(),
|
||||
content, WorkMsgTypeEnum.TASK_COMMENT.getBtnText(), url, token);
|
||||
if (token != null && token.length() > 0) {
|
||||
|
||||
return "OK";
|
||||
StaffSimpleInfo fromStaffSimpleInfo = staffService.selectStaffSimpleInfo(taskProcessRecord.getStaffId());
|
||||
if (taskProcessRecord.getStaffId().longValue() != resultDetail.getId().longValue()) {
|
||||
//自己评论自己的不允许给自己发消息
|
||||
StaffSimpleInfo toStaffSimpleInfo = staffService.selectStaffSimpleInfo(resultDetail.getStaffId());
|
||||
|
||||
StaffEntity info = new StaffEntity();
|
||||
info.setId(toStaffSimpleInfo.getId());
|
||||
info.setEmployeeId(toStaffSimpleInfo.getEmployeeId());
|
||||
String content = WorkMsgTypeEnum.TASK_COMMENT.getContent().replace("@1", fromStaffSimpleInfo.getName());
|
||||
content = content.replace("@2", "“" + resultDetail.getTarget() + "”");
|
||||
logger.info("通知内容{},url{}", content, url);
|
||||
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.TASK_COMMENT.getTitle(),
|
||||
content, WorkMsgTypeEnum.TASK_COMMENT.getBtnText(), url, token);
|
||||
|
||||
}
|
||||
if(taskProcessRecord.getAtStaffIds().length() > 0){
|
||||
//@的人员
|
||||
List<Long> ids = Arrays.stream(taskProcessRecord.getAtStaffIds().split(","))
|
||||
.map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
List<StaffEntity> staffEntities = staffService.selectByIds(ids);
|
||||
logger.info("评论推送人员个数{}", staffEntities.size());
|
||||
String content = WorkMsgTypeEnum.TASK_REPLY_COMMENT.getContent().replace("@1", fromStaffSimpleInfo.getName());
|
||||
content = content.replace("@2", "“" + resultDetail.getTarget() + "”");
|
||||
logger.info("通知内容{},url{}", content, url);
|
||||
String userIds = "";
|
||||
int m = 0;
|
||||
for (int i = 0; i < staffEntities.size(); i++) {
|
||||
StaffEntity staff = staffEntities.get(i);
|
||||
userIds += (staff.getEmployeeId() + ",");
|
||||
if(m >= 99 || i == staffEntities.size() - 1){
|
||||
//发送消息
|
||||
StaffEntity info = new StaffEntity();
|
||||
info.setId(0L);
|
||||
info.setEmployeeId(userIds);
|
||||
logger.info("推送的人员信息{}", info);
|
||||
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getTitle(),
|
||||
WorkMsgTypeEnum.TASK_REPLY_COMMENT.getContent(), WorkMsgTypeEnum.TASK_REPLY_COMMENT.getBtnText(), url, token);
|
||||
m = 0;
|
||||
userIds = "";
|
||||
continue;
|
||||
}
|
||||
m++;
|
||||
}
|
||||
/*for (StaffEntity info:staffEntities
|
||||
) {
|
||||
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getTitle(),
|
||||
content, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getBtnText(), url, token);
|
||||
}*/
|
||||
|
||||
}
|
||||
return "OK";
|
||||
}else {
|
||||
return "token无效";
|
||||
}
|
||||
}else{
|
||||
return "token无效";
|
||||
logger.info("任务不存在");
|
||||
}
|
||||
|
||||
}
|
||||
return "OK";
|
||||
}
|
||||
|
||||
@ -69,6 +69,7 @@ public class MysqlMain {
|
||||
|
||||
|
||||
|
||||
|
||||
String path = ResourceUtils.getURL("classpath:").getPath();
|
||||
System.out.println(path);
|
||||
String dir = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user