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
4d137dda1a
@ -14,7 +14,7 @@ public enum WorkMsgTypeEnum {
|
|||||||
LEADER_PASS(2, "绩效已打分", "去提交给人事", "# 绩效已打分\n ## 你的绩效已经打分"),
|
LEADER_PASS(2, "绩效已打分", "去提交给人事", "# 绩效已打分\n ## 你的绩效已经打分"),
|
||||||
//绩效通过人事,老板审核的最终审核通知
|
//绩效通过人事,老板审核的最终审核通知
|
||||||
PASS(3, "绩效通过", "去查看", "# 绩效通过\n ## 你的绩效已经通过"),
|
PASS(3, "绩效通过", "去查看", "# 绩效通过\n ## 你的绩效已经通过"),
|
||||||
URGING(4, "绩效催办", "去审批", "# 绩效催办\n ## @提醒您审批"),
|
URGING(4, "绩效催办", "去处理", "# 绩效催办\n ## @的绩效需您处理"),
|
||||||
END(5, "绩效终止", "去查看", "# 绩效终止\n ## @,你的绩效终止"),
|
END(5, "绩效终止", "去查看", "# 绩效终止\n ## @,你的绩效终止"),
|
||||||
START_WORK(6, "绩效考评待办事项", "去查看", "# 绩效目标制定\n ## @,你的绩效需要制定目标"),
|
START_WORK(6, "绩效考评待办事项", "去查看", "# 绩效目标制定\n ## @,你的绩效需要制定目标"),
|
||||||
START_SCORE(7, "绩效考评待办事项", "去查看", "# 绩效结果输入\n ## @,你的绩效需要输入结果"),
|
START_SCORE(7, "绩效考评待办事项", "去查看", "# 绩效结果输入\n ## @,你的绩效需要输入结果"),
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import com.lz.modules.flow.entity.*;
|
|||||||
import com.lz.modules.flow.model.*;
|
import com.lz.modules.flow.model.*;
|
||||||
import com.lz.modules.flow.req.ResultDetailReq;
|
import com.lz.modules.flow.req.ResultDetailReq;
|
||||||
import com.lz.modules.flow.service.*;
|
import com.lz.modules.flow.service.*;
|
||||||
|
import com.lz.modules.job.business.DingtalkBusiness;
|
||||||
import com.lz.modules.sys.controller.AbstractController;
|
import com.lz.modules.sys.controller.AbstractController;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
import com.lz.modules.sys.entity.app.ResultComment;
|
import com.lz.modules.sys.entity.app.ResultComment;
|
||||||
@ -105,6 +106,9 @@ public class ResultRecordController extends AbstractController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FlowChartDetailRecordService flowChartDetailRecordService;
|
private FlowChartDetailRecordService flowChartDetailRecordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DingtalkBusiness dingtalkBusiness;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@ -331,6 +335,31 @@ public class ResultRecordController extends AbstractController {
|
|||||||
return R.ok().put("lzResultRecord", lzResultRecord);
|
return R.ok().put("lzResultRecord", lzResultRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/urging")
|
||||||
|
@ApiOperation("绩效催办-吴林")
|
||||||
|
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "绩效id")})
|
||||||
|
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = R.class)})
|
||||||
|
public R getDetail(@RequestParam Long id) {
|
||||||
|
ResultRecord lzResultRecord = lzResultRecordService.selectResultRecordById(id);
|
||||||
|
//获取当前节点,谁在处理
|
||||||
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordsByRecordIdAndStatus(id, 2);
|
||||||
|
if(flowRecords.size() > 0){
|
||||||
|
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
|
||||||
|
@Override
|
||||||
|
public Long apply(FlowRecord flowRecord) {
|
||||||
|
return flowRecord.getApprovalStaffId();
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
List<StaffEntity> staffs = staffService.selectNamesByIds(ids);
|
||||||
|
dingtalkBusiness.sendNoticeMsg(lzResultRecord, staffs);
|
||||||
|
return R.ok("催办成功");
|
||||||
|
}
|
||||||
|
return R.error("无可催办人员");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 信息
|
* 信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -90,5 +90,7 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
|||||||
|
|
||||||
List<FlowRecord> selectSkipFlowRecordsById(@Param("recordId") Long recordId);
|
List<FlowRecord> selectSkipFlowRecordsById(@Param("recordId") Long recordId);
|
||||||
|
|
||||||
List<FlowRecord> selectFirstFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex, int status);
|
List<FlowRecord> selectFirstFlowRecordsByIdAndFlowIndex(@Param("recordId") Long recordId, @Param("flowIndex") int flowIndex, @Param("status") int status);
|
||||||
|
|
||||||
|
List<FlowRecord> selectFlowRecordsByRecordIdAndStatus(@Param("recordId") Long recordId, @Param("status") int status);
|
||||||
}
|
}
|
||||||
@ -86,4 +86,6 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
|||||||
List<FlowRecord> selectSkipFlowRecordsById(Long recordId);
|
List<FlowRecord> selectSkipFlowRecordsById(Long recordId);
|
||||||
|
|
||||||
List<FlowRecord> selectFirstFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex, int status);
|
List<FlowRecord> selectFirstFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex, int status);
|
||||||
|
|
||||||
|
List<FlowRecord> selectFlowRecordsByRecordIdAndStatus(Long recordId, int status);
|
||||||
}
|
}
|
||||||
@ -231,4 +231,9 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
|||||||
return flowRecordMapper.selectFirstFlowRecordsByIdAndFlowIndex(recordId, flowIndex, status);
|
return flowRecordMapper.selectFirstFlowRecordsByIdAndFlowIndex(recordId, flowIndex, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FlowRecord> selectFlowRecordsByRecordIdAndStatus(Long recordId, int status){
|
||||||
|
return flowRecordMapper.selectFlowRecordsByRecordIdAndStatus(recordId, status);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,22 +2,13 @@ package com.lz.modules.flow.service.impl;
|
|||||||
|
|
||||||
import ch.qos.logback.classic.Logger;
|
import ch.qos.logback.classic.Logger;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.lz.common.emun.ChartOptType;
|
import com.lz.common.emun.ChartOptType;
|
||||||
import com.lz.common.emun.CheckStaffType;
|
import com.lz.common.emun.CheckStaffType;
|
||||||
import com.lz.common.emun.WorkMsgTypeEnum;
|
import com.lz.common.emun.WorkMsgTypeEnum;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.common.utils.StringUtil;
|
|
||||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.entity.StaffSimpleInfo;
|
import com.lz.modules.app.entity.StaffSimpleInfo;
|
||||||
import com.lz.modules.app.enums.FlowApprovalRoleTypeEnums;
|
|
||||||
import com.lz.modules.app.enums.FlowRecordStatusEnums;
|
|
||||||
import com.lz.modules.app.enums.RoleEnums;
|
|
||||||
import com.lz.modules.app.service.DepartmentsService;
|
|
||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.dao.EvaluationStartStaffMapper;
|
|
||||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||||
import com.lz.modules.flow.entity.*;
|
import com.lz.modules.flow.entity.*;
|
||||||
import com.lz.modules.flow.model.*;
|
import com.lz.modules.flow.model.*;
|
||||||
@ -28,22 +19,15 @@ import com.lz.modules.sys.entity.app.ResultDetail;
|
|||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ResultDetailService;
|
import com.lz.modules.sys.service.app.ResultDetailService;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import com.lz.modules.third.entity.ThirdAppConfig;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
|
||||||
import org.apache.commons.collections.map.HashedMap;
|
import org.apache.commons.collections.map.HashedMap;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -839,12 +823,12 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class ThreadInitFlowRecord implements Runnable{
|
public class ThreadInitFlowRecord implements Runnable{
|
||||||
List<StartStartDto> resultRecords;
|
List<StartStartDto> resultStarts;
|
||||||
List<StaffSimpleInfo> noticeStaff;
|
List<StaffSimpleInfo> noticeStaff;
|
||||||
|
|
||||||
public ThreadInitFlowRecord(List<StartStartDto> resultRecords, List<StaffSimpleInfo> noticeStaff){
|
public ThreadInitFlowRecord(List<StartStartDto> resultRecords, List<StaffSimpleInfo> noticeStaff){
|
||||||
|
|
||||||
this.resultRecords = resultRecords;
|
this.resultStarts = resultRecords;
|
||||||
this.noticeStaff = noticeStaff;
|
this.noticeStaff = noticeStaff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -853,12 +837,14 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
String oldNo = Logger.inheritableThreadLocalNo.get();//.threadLocalNo.get();
|
String oldNo = Logger.inheritableThreadLocalNo.get();//.threadLocalNo.get();
|
||||||
String newNo = oldNo + "_initFlowRecord" ;//+ resultRecord.getStaffId() + "_" + resultRecord.getId();
|
String newNo = oldNo + "_initFlowRecord" ;//+ resultRecord.getStaffId() + "_" + resultRecord.getId();
|
||||||
ch.qos.logback.classic.Logger.threadLocalNo.set(newNo);
|
ch.qos.logback.classic.Logger.threadLocalNo.set(newNo);
|
||||||
log.info("开始批量初始化流程,数量{}", resultRecords.size());
|
log.info("开始批量初始化流程,任务数量{}", resultStarts.size());
|
||||||
|
|
||||||
for (StartStartDto startStartDto:resultRecords
|
for (StartStartDto startStartDto: resultStarts
|
||||||
) {
|
) {
|
||||||
|
log.info("初始化任务中绩效数量{}", startStartDto.getResultRecordList().size());
|
||||||
for (ResultRecord resultRecord:startStartDto.getResultRecordList()
|
for (ResultRecord resultRecord:startStartDto.getResultRecordList()
|
||||||
) {
|
) {
|
||||||
|
log.info("初始化绩效{}", resultRecord);
|
||||||
resultRecordService.initFlowRecord(resultRecord, startStartDto.getFlows(), startStartDto.getFlowApprovalRoles());
|
resultRecordService.initFlowRecord(resultRecord, startStartDto.getFlows(), startStartDto.getFlowApprovalRoles());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -104,6 +104,7 @@ public class DingtalkBusiness {
|
|||||||
@Resource
|
@Resource
|
||||||
StaffDao staffDao;
|
StaffDao staffDao;
|
||||||
|
|
||||||
|
static String homeUrl = "https://lzmanagement.ldxinyong.com/digitization";
|
||||||
|
|
||||||
@Value("${dingtalk.appid}")
|
@Value("${dingtalk.appid}")
|
||||||
private String appid;
|
private String appid;
|
||||||
@ -585,6 +586,45 @@ public class DingtalkBusiness {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String sendNoticeMsg(ResultRecord lzResultRecord, List<StaffEntity> staffs) {
|
||||||
|
|
||||||
|
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
||||||
|
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
||||||
|
if(token != null && token.length() > 0){
|
||||||
|
String url = homeUrl;
|
||||||
|
if(url.contains("?")){
|
||||||
|
url += "&halokit=" + System.currentTimeMillis();
|
||||||
|
}else{
|
||||||
|
url += "?halokit=" + System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
url += ("&detail=1&id=" + lzResultRecord.getId());
|
||||||
|
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;
|
||||||
|
logger.info("推送消息个数{}", staffs.size());
|
||||||
|
for (StaffEntity info:
|
||||||
|
staffs) {
|
||||||
|
logger.info("发送消息给{},url:{}", info, url);
|
||||||
|
String content = null;
|
||||||
|
if(!lzResultRecord.getStaffName().equals(info.getName())){
|
||||||
|
content = WorkMsgTypeEnum.URGING.getContent().replace("@", lzResultRecord.getStaffName());
|
||||||
|
}else{
|
||||||
|
content = WorkMsgTypeEnum.URGING.getContent().replace("@", "您");
|
||||||
|
}
|
||||||
|
|
||||||
|
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.URGING.getTitle(),
|
||||||
|
content, WorkMsgTypeEnum.URGING.getBtnText(), url, token);
|
||||||
|
}
|
||||||
|
return "OK";
|
||||||
|
|
||||||
|
}else{
|
||||||
|
return "token无效";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String sendWorkMSG(String appid, Long fromStaffid, long toStaffid, int type) {
|
public String sendWorkMSG(String appid, Long fromStaffid, long toStaffid, int type) {
|
||||||
//获取Token
|
//获取Token
|
||||||
StaffEntity toStaffEntity = staffService.selectStaffById(toStaffid);
|
StaffEntity toStaffEntity = staffService.selectStaffById(toStaffid);
|
||||||
@ -741,13 +781,15 @@ public class DingtalkBusiness {
|
|||||||
return R.error("未授权登录");
|
return R.error("未授权登录");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ThreadSendMessage implements Runnable{
|
public class ThreadSendMessage implements Runnable{
|
||||||
List<StaffSimpleInfo> toStaffids;
|
List<StaffSimpleInfo> toStaffids;
|
||||||
StaffSimpleInfo fromStaff = null;
|
StaffSimpleInfo fromStaff = null;
|
||||||
List<Long> recordIds;
|
List<Long> recordIds;
|
||||||
WorkMsgTypeEnum workMsgTypeEnum;
|
WorkMsgTypeEnum workMsgTypeEnum;
|
||||||
String appid;
|
String appid;
|
||||||
String hostUrl = "https://lzmanagement.ldxinyong.com/digitization";
|
String hostUrl = homeUrl;
|
||||||
public ThreadSendMessage(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
|
public ThreadSendMessage(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
|
||||||
this.fromStaff = fromStaff;
|
this.fromStaff = fromStaff;
|
||||||
this.toStaffids = toStaffids;
|
this.toStaffids = toStaffids;
|
||||||
|
|||||||
@ -322,5 +322,10 @@
|
|||||||
select * from lz_flow_record where is_delete = 0 and flow_index <![CDATA[>=]]> #{flowIndex}
|
select * from lz_flow_record where is_delete = 0 and flow_index <![CDATA[>=]]> #{flowIndex}
|
||||||
and record_id = #{recordId} and status=#{status} order by flow_index asc
|
and record_id = #{recordId} and status=#{status} order by flow_index asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFlowRecordsByRecordIdAndStatus" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||||
|
select * from lz_flow_record where is_delete = 0
|
||||||
|
and record_id = #{recordId} and status=#{status} order by flow_index asc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user