提交修改
This commit is contained in:
commit
77683457e4
@ -16,11 +16,18 @@ public enum WorkMsgTypeEnum {
|
|||||||
PASS(3, "绩效通过", "去查看", "# 绩效通过\n ## 你的绩效已经通过"),
|
PASS(3, "绩效通过", "去查看", "# 绩效通过\n ## 你的绩效已经通过"),
|
||||||
URGING(4, "绩效催办", "去审批", "# 绩效催办\n ## @提醒您审批"),
|
URGING(4, "绩效催办", "去审批", "# 绩效催办\n ## @提醒您审批"),
|
||||||
END(5, "绩效终止", "去查看", "# 绩效终止\n ## @,你的绩效终止"),
|
END(5, "绩效终止", "去查看", "# 绩效终止\n ## @,你的绩效终止"),
|
||||||
|
<<<<<<< HEAD
|
||||||
START_WORK(6, "绩效考评待办事项", "去查看", "# 绩效目标制定\n ## @,你的绩效需要制定目标"),
|
START_WORK(6, "绩效考评待办事项", "去查看", "# 绩效目标制定\n ## @,你的绩效需要制定目标"),
|
||||||
START_SCORE(7, "绩效考评待办事项", "去查看", "# 绩效结果输入\n ## @,你的绩效需要输入结果"),
|
START_SCORE(7, "绩效考评待办事项", "去查看", "# 绩效结果输入\n ## @,你的绩效需要输入结果"),
|
||||||
PROCESS(8, "绩效考评待办事项", "去查看", "# @的绩效\n ## 需您去处理"),
|
PROCESS(8, "绩效考评待办事项", "去查看", "# @的绩效\n ## 需您去处理"),
|
||||||
SKIP(9, "绩效跳过", "跳过", "# @的绩效\n ## 己经跳过"),
|
SKIP(9, "绩效跳过", "跳过", "# @的绩效\n ## 己经跳过"),
|
||||||
TRANSFER(10, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
|
TRANSFER(10, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
|
||||||
|
=======
|
||||||
|
START_WORK(6, "绩效考评待办事项", "制定目标", "\n 绩效目标制定\n \n @,你的绩效需要制定目标"),
|
||||||
|
START_SCORE(7, "绩效考评待办事项", "输入结果", "\n 绩效结果输入\n \n @,你的绩效需要输入结果"),
|
||||||
|
PROCESS(8, "绩效考评待办事项", "目标确认", "\n @的绩效\n \n 需您去目标确认"),
|
||||||
|
SCORE(8, "绩效考评待办事项", "评分", "\n @的绩效\n \n 需您去评分"),
|
||||||
|
>>>>>>> b16c903f3a09f8170eeedcd239fde8acc99f1d2c
|
||||||
// 您的2020年10月绩效考核已经开始,请尽快制定绩效目标
|
// 您的2020年10月绩效考核已经开始,请尽快制定绩效目标
|
||||||
// 吴林的2020年12月绩效考核的目标需要您确认,点击前往确认
|
// 吴林的2020年12月绩效考核的目标需要您确认,点击前往确认
|
||||||
;
|
;
|
||||||
|
|||||||
@ -275,7 +275,7 @@ public class DingTalkUtil {
|
|||||||
thirdMsgSendRecord.setMsgType("action_card");
|
thirdMsgSendRecord.setMsgType("action_card");
|
||||||
thirdMsgSendRecord.setStaffId(staff.getId());
|
thirdMsgSendRecord.setStaffId(staff.getId());
|
||||||
thirdMsgSendRecord.setMsgTitle(singleTitle);
|
thirdMsgSendRecord.setMsgTitle(singleTitle);
|
||||||
thirdMsgSendRecord.setAppId(Long.parseLong(appid));
|
thirdMsgSendRecord.setAppId(appid);
|
||||||
thirdMsgSendRecord.setHeadText(title);
|
thirdMsgSendRecord.setHeadText(title);
|
||||||
thirdMsgSendRecord.setMsgContent(marDown);
|
thirdMsgSendRecord.setMsgContent(marDown);
|
||||||
thirdMsgSendRecord.setMsgUrl(singleUrl);
|
thirdMsgSendRecord.setMsgUrl(singleUrl);
|
||||||
@ -283,7 +283,7 @@ public class DingTalkUtil {
|
|||||||
try{
|
try{
|
||||||
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
|
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
|
||||||
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
|
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
|
||||||
req.setAgentId(thirdMsgSendRecord.getAppId());
|
req.setAgentId(Long.parseLong(thirdMsgSendRecord.getAppId()));
|
||||||
req.setUseridList(staff.getEmployeeId());
|
req.setUseridList(staff.getEmployeeId());
|
||||||
OapiMessageCorpconversationAsyncsendV2Request.Msg obj1 = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
|
OapiMessageCorpconversationAsyncsendV2Request.Msg obj1 = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
|
||||||
obj1.setMsgtype(thirdMsgSendRecord.getMsgType());
|
obj1.setMsgtype(thirdMsgSendRecord.getMsgType());
|
||||||
@ -299,10 +299,10 @@ public class DingTalkUtil {
|
|||||||
//插入数据库
|
//插入数据库
|
||||||
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
||||||
if(json.getIntValue("errcode") == 0){
|
if(json.getIntValue("errcode") == 0){
|
||||||
thirdMsgSendRecord.setTaskId(json.getLong("task_id"));
|
thirdMsgSendRecord.setTaskId(json.getString("task_id"));
|
||||||
thirdMsgSendRecord.setStatus(1);
|
thirdMsgSendRecord.setStatus(1);
|
||||||
}else{
|
}else{
|
||||||
thirdMsgSendRecord.setTaskId(0L);
|
thirdMsgSendRecord.setTaskId("0");
|
||||||
thirdMsgSendRecord.setStatus(6);
|
thirdMsgSendRecord.setStatus(6);
|
||||||
thirdMsgSendRecord.setRemark(json.getString("errmsg"));
|
thirdMsgSendRecord.setRemark(json.getString("errmsg"));
|
||||||
msg = thirdMsgSendRecord.getRemark();
|
msg = thirdMsgSendRecord.getRemark();
|
||||||
@ -319,17 +319,19 @@ public class DingTalkUtil {
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
//发送待办任务
|
//发送待办任务
|
||||||
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, String marDown,
|
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, String title1,
|
||||||
String singleTitle, String singleUrl, String token) {
|
String content1, String title2,
|
||||||
|
String content2, String title3,
|
||||||
|
String content3, String singleUrl, String token, String from) {
|
||||||
String msg = "OK";
|
String msg = "OK";
|
||||||
|
|
||||||
ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord();
|
ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord();
|
||||||
thirdMsgSendRecord.setMsgType("work_msg");
|
thirdMsgSendRecord.setMsgType("work_msg");
|
||||||
thirdMsgSendRecord.setStaffId(staff.getId());
|
thirdMsgSendRecord.setStaffId(staff.getId());
|
||||||
thirdMsgSendRecord.setMsgTitle(singleTitle);
|
thirdMsgSendRecord.setMsgTitle(title1 + "#" + title2 + "#" + title3);
|
||||||
thirdMsgSendRecord.setAppId(Long.parseLong(appid));
|
thirdMsgSendRecord.setAppId(appid);
|
||||||
thirdMsgSendRecord.setHeadText(title);
|
thirdMsgSendRecord.setHeadText(title);
|
||||||
thirdMsgSendRecord.setMsgContent(marDown);
|
thirdMsgSendRecord.setMsgContent(content1 + "#" + content2 + "#" + content3);
|
||||||
thirdMsgSendRecord.setMsgUrl(singleUrl);
|
thirdMsgSendRecord.setMsgUrl(singleUrl);
|
||||||
thirdMsgSendRecord.setStatus(0);
|
thirdMsgSendRecord.setStatus(0);
|
||||||
try{
|
try{
|
||||||
@ -337,13 +339,22 @@ public class DingTalkUtil {
|
|||||||
OapiWorkrecordAddRequest req = new OapiWorkrecordAddRequest();
|
OapiWorkrecordAddRequest req = new OapiWorkrecordAddRequest();
|
||||||
req.setUserid(staff.getEmployeeId());
|
req.setUserid(staff.getEmployeeId());
|
||||||
req.setCreateTime(System.currentTimeMillis());
|
req.setCreateTime(System.currentTimeMillis());
|
||||||
req.setTitle(singleTitle);
|
req.setTitle(title);
|
||||||
req.setUrl(singleUrl);
|
req.setUrl(singleUrl);
|
||||||
|
req.setSourceName(from);
|
||||||
List<OapiWorkrecordAddRequest.FormItemVo> list2 = new ArrayList<OapiWorkrecordAddRequest.FormItemVo>();
|
List<OapiWorkrecordAddRequest.FormItemVo> list2 = new ArrayList<OapiWorkrecordAddRequest.FormItemVo>();
|
||||||
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
||||||
list2.add(obj3);
|
list2.add(obj3);
|
||||||
obj3.setTitle(title);
|
obj3.setTitle(title1);
|
||||||
obj3.setContent(marDown);
|
obj3.setContent(content1);
|
||||||
|
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
||||||
|
list2.add(obj3);
|
||||||
|
obj3.setTitle(title2);
|
||||||
|
obj3.setContent(content2);
|
||||||
|
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
|
||||||
|
list2.add(obj3);
|
||||||
|
obj3.setTitle(title3);
|
||||||
|
obj3.setContent(content3);
|
||||||
req.setFormItemList(list2);
|
req.setFormItemList(list2);
|
||||||
OapiWorkrecordAddResponse rsp = client.execute(req, token);
|
OapiWorkrecordAddResponse rsp = client.execute(req, token);
|
||||||
|
|
||||||
@ -352,15 +363,15 @@ public class DingTalkUtil {
|
|||||||
//插入数据库
|
//插入数据库
|
||||||
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
||||||
if(json.getIntValue("errcode") == 0){
|
if(json.getIntValue("errcode") == 0){
|
||||||
thirdMsgSendRecord.setTaskId(json.getLong("record_id"));
|
thirdMsgSendRecord.setTaskId(json.getString("record_id"));
|
||||||
thirdMsgSendRecord.setStatus(1);
|
thirdMsgSendRecord.setStatus(1);
|
||||||
}else{
|
}else{
|
||||||
thirdMsgSendRecord.setTaskId(0L);
|
thirdMsgSendRecord.setTaskId("0");
|
||||||
thirdMsgSendRecord.setStatus(6);
|
thirdMsgSendRecord.setStatus(6);
|
||||||
thirdMsgSendRecord.setRemark(json.getString("errmsg"));
|
thirdMsgSendRecord.setRemark(json.getString("errmsg"));
|
||||||
msg = thirdMsgSendRecord.getRemark();
|
msg = thirdMsgSendRecord.getRemark();
|
||||||
}
|
}
|
||||||
|
logger.info("发送消息{}", thirdMsgSendRecord);
|
||||||
}catch (ApiException e) {
|
}catch (ApiException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
thirdMsgSendRecord.setStatus(6);
|
thirdMsgSendRecord.setStatus(6);
|
||||||
@ -368,7 +379,7 @@ public class DingTalkUtil {
|
|||||||
msg = thirdMsgSendRecord.getRemark();
|
msg = thirdMsgSendRecord.getRemark();
|
||||||
|
|
||||||
}
|
}
|
||||||
thirdMsgSendRecordService.insert(thirdMsgSendRecord);
|
thirdMsgSendRecordService.insertThirdMsgSendRecord(thirdMsgSendRecord);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -429,6 +429,9 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
//流程已经到了审批节点,那么判断评分是否为或签,如果是那么只需要返回实际评分的那个人即可,否则全部返回
|
//流程已经到了审批节点,那么判断评分是否为或签,如果是那么只需要返回实际评分的那个人即可,否则全部返回
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());//获取当前的流程节点
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());//获取当前的流程节点
|
||||||
|
if(flowRecords.size() == 0){
|
||||||
|
return R.error("绩效流程数据初始化中...,请稍后!");
|
||||||
|
}
|
||||||
if(flowRecords.get(0).getType().intValue() == 1){
|
if(flowRecords.get(0).getType().intValue() == 1){
|
||||||
//或签,这里还有优化。多个评分节点时,针对每个节点是否为或签
|
//或签,这里还有优化。多个评分节点时,针对每个节点是否为或签
|
||||||
isOrScore = true;
|
isOrScore = true;
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package com.lz.modules.app.entity;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.lz.modules.flow.entity.FlowStart;
|
||||||
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -46,10 +48,10 @@ public class StaffSimpleInfo implements Serializable {
|
|||||||
private String employeeId;
|
private String employeeId;
|
||||||
//头像
|
//头像
|
||||||
private String avatar;
|
private String avatar;
|
||||||
//本次发起任务的id
|
//本次发起任务的
|
||||||
private Long startId;
|
private ResultRecord resultRecord;
|
||||||
//本次发起绩效的id
|
//本次发起的任务信息
|
||||||
private Long recordId;
|
private FlowStart flowStart;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,4 +34,6 @@ public interface FlowMapper extends BaseMapper<Flow> {
|
|||||||
|
|
||||||
|
|
||||||
List<Flow> selectByFlowId(@Param("flowId") Long flowId, @Param("startId") Long startId);
|
List<Flow> selectByFlowId(@Param("flowId") Long flowId, @Param("startId") Long startId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -76,7 +76,10 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
|||||||
|
|
||||||
FlowRecord selectFlowRecordByRecordIdMinIdStatus(@Param("resultRecordId") Long resultRecordId, @Param("id") Long id, @Param("status") int status);
|
FlowRecord selectFlowRecordByRecordIdMinIdStatus(@Param("resultRecordId") Long resultRecordId, @Param("id") Long id, @Param("status") int status);
|
||||||
|
|
||||||
int batchUpdateExecution(@Param("recordIds")List<Long> recordIds,@Param("processId") int processId);
|
int batchUpdateSkip(@Param("recordIds")List<Long> recordIds);
|
||||||
|
|
||||||
List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(@Param("id") Long id, @Param("flowProcess") int flowProcess);
|
List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(@Param("id") Long id, @Param("flowProcess") int flowProcess);
|
||||||
|
|
||||||
|
int batchDeleteByRecordIds(@Param("recordIds")List<Long> recordIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,12 +1,16 @@
|
|||||||
package com.lz.modules.flow.model;
|
package com.lz.modules.flow.model;
|
||||||
|
|
||||||
|
import com.lz.modules.flow.entity.Flow;
|
||||||
|
import com.lz.modules.flow.entity.FlowApprovalRole;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@Data
|
@Data
|
||||||
public class StartStartDto {
|
public class StartStartDto {//发起一个考评组对应的返回的数据
|
||||||
private int status;
|
private int status;//返回结果
|
||||||
private List<ResultRecord> resultRecordList = new ArrayList<>();
|
private List<Flow> flows ;
|
||||||
|
private List<FlowApprovalRole> flowApprovalRoles;
|
||||||
|
private List<ResultRecord> resultRecordList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,4 +36,6 @@ public interface FlowService extends IService<Flow> {
|
|||||||
List<Flow> selectByFlowId(Long flowId,Long startId);
|
List<Flow> selectByFlowId(Long flowId,Long startId);
|
||||||
|
|
||||||
FlowChart selectFlowChartByChartId(Long flowId);
|
FlowChart selectFlowChartByChartId(Long flowId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -78,4 +78,6 @@ public class FlowServiceImpl extends ServiceImpl<FlowMapper, Flow> implements Fl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DingtalkBusiness dingtalkBusiness;
|
private DingtalkBusiness dingtalkBusiness;
|
||||||
|
|
||||||
List<ThreadInitFlowRecord> threadInitFlowRecords = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -162,7 +161,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
Map<Long, List<FlowChartRole>> mustRole = new HashMap<>();
|
Map<Long, List<FlowChartRole>> mustRole = new HashMap<>();
|
||||||
Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>();
|
Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>();
|
||||||
List<StaffSimpleInfo> noticeStaff = new ArrayList<>();
|
List<StaffSimpleInfo> noticeStaff = new ArrayList<>();
|
||||||
List<ResultRecord> resultRecords = new ArrayList<>();
|
List<StartStartDto> resultRecords = new ArrayList<>();
|
||||||
for (GroupStaffs groupStaffs:startGroupStaffIds.getGroups()
|
for (GroupStaffs groupStaffs:startGroupStaffIds.getGroups()
|
||||||
) {
|
) {
|
||||||
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(groupStaffs.getStaffIds());
|
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(groupStaffs.getStaffIds());
|
||||||
@ -188,7 +187,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
return R.error(groupStaffs.getEvaluationGroup().getName() + "——初始化考核流程失败");
|
return R.error(groupStaffs.getEvaluationGroup().getName() + "——初始化考核流程失败");
|
||||||
case 0:
|
case 0:
|
||||||
noticeStaff.addAll(staffSimpleInfos);
|
noticeStaff.addAll(staffSimpleInfos);
|
||||||
resultRecords.addAll(startDto.getResultRecordList());
|
resultRecords.add(startDto);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +276,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
Map<Long, List<FlowChartRole>> mustRole = new HashMap<>();
|
Map<Long, List<FlowChartRole>> mustRole = new HashMap<>();
|
||||||
Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>();
|
Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>();
|
||||||
List<StaffSimpleInfo> noticeStaff = new ArrayList<>();
|
List<StaffSimpleInfo> noticeStaff = new ArrayList<>();
|
||||||
List<ResultRecord> resultRecords = new ArrayList<>();
|
List<StartStartDto> resultRecords = new ArrayList<>();
|
||||||
for (int n = 0; n < evaluationGroups.size(); n++
|
for (int n = 0; n < evaluationGroups.size(); n++
|
||||||
) {
|
) {
|
||||||
EvaluationGroup evaluationGroup = evaluationGroups.get(n);
|
EvaluationGroup evaluationGroup = evaluationGroups.get(n);
|
||||||
@ -324,7 +323,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
||||||
case 0:
|
case 0:
|
||||||
noticeStaff.addAll(staffIds);
|
noticeStaff.addAll(staffIds);
|
||||||
resultRecords.addAll(startDto.getResultRecordList());
|
resultRecords.add(startDto);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -380,6 +379,9 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
return startStartDto;
|
return startStartDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<ResultRecord> resultRecords = new ArrayList<>();
|
||||||
|
List<Flow> flows;
|
||||||
|
List<FlowApprovalRole> flowApprovalRoles;
|
||||||
//下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id
|
//下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id
|
||||||
if(!isInsert){
|
if(!isInsert){
|
||||||
evaluationGroup.setCopyId(evaluationGroup.getId());
|
evaluationGroup.setCopyId(evaluationGroup.getId());
|
||||||
@ -451,11 +453,9 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
|
|
||||||
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
||||||
List<ResultDetail> resultDetails = new ArrayList();
|
List<ResultDetail> resultDetails = new ArrayList();
|
||||||
|
|
||||||
//下面初始化参与人员
|
//下面初始化参与人员
|
||||||
for (StaffSimpleInfo staffInfo:staffIds
|
for (StaffSimpleInfo staffInfo:staffIds
|
||||||
) {
|
) {
|
||||||
staffInfo.setStartId(flowStart.getId());
|
|
||||||
|
|
||||||
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
||||||
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
||||||
@ -483,16 +483,16 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
resultRecord.setCurrentApprovalStaffId(staffInfo.getId());
|
resultRecord.setCurrentApprovalStaffId(staffInfo.getId());
|
||||||
//设置当前审批员工姓名 current_approval_staff_name
|
//设置当前审批员工姓名 current_approval_staff_name
|
||||||
resultRecord.setCurrentApprovalStaffName(staffInfo.getName());
|
resultRecord.setCurrentApprovalStaffName(staffInfo.getName());
|
||||||
|
resultRecords.add(resultRecord);
|
||||||
resultRecordService.insertResultRecord(resultRecord);
|
resultRecordService.insertResultRecord(resultRecord);
|
||||||
|
|
||||||
startStartDto.getResultRecordList().add(resultRecord);
|
|
||||||
|
|
||||||
|
|
||||||
//resultRecordService.initFlowRecord(resultRecord.getId());
|
//resultRecordService.initFlowRecord(resultRecord.getId());
|
||||||
|
|
||||||
//下面生成实际的考核流程
|
//下面生成实际的考核流程
|
||||||
staffInfo.setRecordId(resultRecord.getId());
|
staffInfo.setResultRecord(resultRecord);
|
||||||
|
staffInfo.setFlowStart(flowStart);
|
||||||
for (ResultModelDto modelDto:resultModelDtos
|
for (ResultModelDto modelDto:resultModelDtos
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -522,22 +522,35 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
evaluationStartStaffService.saveBatch(evaluationStartStaffs);
|
evaluationStartStaffService.saveBatch(evaluationStartStaffs);
|
||||||
|
startStartDto.setResultRecordList(resultRecords);
|
||||||
|
flows = flowService.selectByFlowId(evaluationGroup.getId(),flowStart.getId());
|
||||||
|
List<Long> flowIds = flows.stream().map(new Function<Flow, Long>() {
|
||||||
|
@Override
|
||||||
|
public Long apply(Flow flow) {
|
||||||
|
return flow.getId();
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
flowApprovalRoles =flowApprovalRoleService.selectFlowApprovalRoleList(flowIds);
|
||||||
|
startStartDto.setFlows(flows);
|
||||||
|
startStartDto.setFlowApprovalRoles(flowApprovalRoles);
|
||||||
startStartDto.setStatus(0);
|
startStartDto.setStatus(0);
|
||||||
return startStartDto;
|
return startStartDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
//下面初始化lz_flow流程表 lz_flow_approval_role流程审批表
|
//下面初始化lz_flow流程表 lz_flow_approval_role流程审批表
|
||||||
List<FlowApprovalRole> flowApprovalRoles = new ArrayList<>();
|
flows = new ArrayList<>();
|
||||||
|
flowApprovalRoles = new ArrayList<>();
|
||||||
int stepIndex = 0;
|
int stepIndex = 0;
|
||||||
for (FlowChartDetailRecord flowChartDetailRecord:flowChartDetailRecords
|
for (FlowChartDetailRecord flowChartDetailRecord:flowChartDetailRecords
|
||||||
) {
|
) {//初始化考评组对应的的flow
|
||||||
Flow flow = new Flow();
|
Flow flow = new Flow();
|
||||||
flow.setFlowId(evaluationGroup.getId());
|
flow.setFlowId(evaluationGroup.getId());
|
||||||
flow.setOpt("+");
|
flow.setOpt("+");
|
||||||
flow.setStartId(flowStart.getId());
|
flow.setStartId(flowStart.getId());
|
||||||
flow.setChartId(flowChartDetailRecord.getChartId());
|
flow.setChartId(flowChartDetailRecord.getChartId());
|
||||||
flow.setOptDesc(chartNameMaps.get(flowChartDetailRecord.getChartId()));
|
flow.setOptDesc(chartNameMaps.get(flowChartDetailRecord.getChartId()));
|
||||||
|
flows.add(flow);
|
||||||
flowService.insertFlow(flow);
|
flowService.insertFlow(flow);
|
||||||
FlowApprovalRole flowApprovalRole = null;
|
FlowApprovalRole flowApprovalRole = null;
|
||||||
List<FlowChartRole> flowChartRoles = null;
|
List<FlowChartRole> flowChartRoles = null;
|
||||||
@ -565,7 +578,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
|
|
||||||
String[] optIds = flowChartDetailRecord.getOptIds().split(",");
|
String[] optIds = flowChartDetailRecord.getOptIds().split(",");
|
||||||
for (String id:optIds
|
for (String id:optIds
|
||||||
) {
|
) {//初始化考评组对应的的FlowApprovalRole
|
||||||
|
|
||||||
flowApprovalRole = new FlowApprovalRole();
|
flowApprovalRole = new FlowApprovalRole();
|
||||||
flowApprovalRole.setFlowId(flow.getId());
|
flowApprovalRole.setFlowId(flow.getId());
|
||||||
@ -638,11 +651,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
List<ResultDetail> resultDetails = new ArrayList<>();
|
List<ResultDetail> resultDetails = new ArrayList<>();
|
||||||
|
|
||||||
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
||||||
List<ResultRecord> resultRecords = new ArrayList<>();
|
|
||||||
//下面初始化参与人员
|
//下面初始化参与人员
|
||||||
for (StaffSimpleInfo staffInfo:staffIds
|
for (StaffSimpleInfo staffInfo:staffIds
|
||||||
) {
|
) {
|
||||||
staffInfo.setStartId(flowStart.getId());
|
|
||||||
|
|
||||||
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
||||||
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
||||||
@ -747,10 +759,13 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
roleJSON += "]";
|
roleJSON += "]";
|
||||||
roleJSON = roleJSON.replace(",]", "]");
|
roleJSON = roleJSON.replace(",]", "]");
|
||||||
resultRecord.setFlowStaffIdRole(roleJSON);
|
resultRecord.setFlowStaffIdRole(roleJSON);
|
||||||
|
resultRecords.add(resultRecord);
|
||||||
resultRecordService.insertResultRecord(resultRecord);
|
resultRecordService.insertResultRecord(resultRecord);
|
||||||
startStartDto.getResultRecordList().add(resultRecord);
|
|
||||||
staffInfo.setRecordId(resultRecord.getId());
|
|
||||||
|
//startStartDto.getResultRecordList().add(resultRecord);
|
||||||
|
staffInfo.setResultRecord(resultRecord);
|
||||||
|
staffInfo.setFlowStart(flowStart);
|
||||||
//下面生成实际的考核流程
|
//下面生成实际的考核流程
|
||||||
|
|
||||||
/*ExecutorService executor = Executors.newFixedThreadPool(10);
|
/*ExecutorService executor = Executors.newFixedThreadPool(10);
|
||||||
@ -783,6 +798,9 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
startStartDto.setResultRecordList(resultRecords);
|
||||||
|
startStartDto.setFlowApprovalRoles(flowApprovalRoles);
|
||||||
|
startStartDto.setFlows(flows);
|
||||||
//如果有数据插入lz_result_detail表
|
//如果有数据插入lz_result_detail表
|
||||||
if(resultDetails.size() > 0){
|
if(resultDetails.size() > 0){
|
||||||
//
|
//
|
||||||
@ -795,6 +813,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
startStartDto.setStatus(5);
|
startStartDto.setStatus(5);
|
||||||
return startStartDto;
|
return startStartDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
startStartDto.setStatus(0);
|
startStartDto.setStatus(0);
|
||||||
return startStartDto;
|
return startStartDto;
|
||||||
}
|
}
|
||||||
@ -808,10 +827,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
return R.ok().put("data",staffEntity);
|
return R.ok().put("data",staffEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initFlowRecordAnsy(List<ResultRecord> resultRecords, List<StaffSimpleInfo> noticeStaff){
|
private void initFlowRecordAnsy(List<StartStartDto> resultRecords, List<StaffSimpleInfo> noticeStaff){
|
||||||
if(resultRecords.size() > 0){
|
if(resultRecords.size() > 0){
|
||||||
ThreadInitFlowRecord threadInitFlowRecord = new ThreadInitFlowRecord(resultRecords, noticeStaff);
|
ThreadInitFlowRecord threadInitFlowRecord = new ThreadInitFlowRecord(resultRecords, noticeStaff);
|
||||||
threadInitFlowRecords.add(threadInitFlowRecord);//防止提前回收
|
|
||||||
Thread thread = new Thread(threadInitFlowRecord);
|
Thread thread = new Thread(threadInitFlowRecord);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
@ -820,29 +839,34 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class ThreadInitFlowRecord implements Runnable{
|
public class ThreadInitFlowRecord implements Runnable{
|
||||||
List<ResultRecord> resultRecords;
|
List<StartStartDto> resultRecords;
|
||||||
List<StaffSimpleInfo> noticeStaff;
|
List<StaffSimpleInfo> noticeStaff;
|
||||||
|
|
||||||
public ThreadInitFlowRecord(List<ResultRecord> resultRecords, List<StaffSimpleInfo> noticeStaff){
|
public ThreadInitFlowRecord(List<StartStartDto> resultRecords, List<StaffSimpleInfo> noticeStaff){
|
||||||
|
|
||||||
this.resultRecords = resultRecords;
|
this.resultRecords = resultRecords;
|
||||||
this.noticeStaff = noticeStaff;
|
this.noticeStaff = noticeStaff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//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("开始批量初始化流程,数量{}", resultRecords.size());
|
||||||
for (ResultRecord resultRecord:resultRecords
|
|
||||||
) {
|
|
||||||
|
|
||||||
resultRecordService.initFlowRecord(resultRecord.getId());
|
for (StartStartDto startStartDto:resultRecords
|
||||||
|
) {
|
||||||
|
for (ResultRecord resultRecord:startStartDto.getResultRecordList()
|
||||||
|
) {
|
||||||
|
resultRecordService.initFlowRecord(resultRecord, startStartDto.getFlows(), startStartDto.getFlowApprovalRoles());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//ch.qos.logback.classic.Logger.threadLocalNo.set(oldNo);
|
|
||||||
|
|
||||||
|
ch.qos.logback.classic.Logger.threadLocalNo.set(oldNo);
|
||||||
dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
|
dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
|
||||||
threadInitFlowRecords.remove(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,9 @@ import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
|||||||
import com.lz.modules.app.service.StaffOccupationService;
|
import com.lz.modules.app.service.StaffOccupationService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.entity.FlowRecord;
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
|
import com.lz.modules.flow.entity.FlowStart;
|
||||||
import com.lz.modules.flow.service.FlowRecordService;
|
import com.lz.modules.flow.service.FlowRecordService;
|
||||||
|
import com.lz.modules.flow.service.FlowStartService;
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
|
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||||
import com.lz.modules.sys.dao.SysUserTokenDao;
|
import com.lz.modules.sys.dao.SysUserTokenDao;
|
||||||
@ -74,6 +76,9 @@ public class DingtalkBusiness {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FlowRecordService flowRecordService;
|
private FlowRecordService flowRecordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FlowStartService flowStartService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
StaffDao staffDao;
|
StaffDao staffDao;
|
||||||
|
|
||||||
@ -212,9 +217,12 @@ public class DingtalkBusiness {
|
|||||||
public String sendWorkMSGWithAsyn(Long resultRecordId , int type) {
|
public String sendWorkMSGWithAsyn(Long resultRecordId , int type) {
|
||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
||||||
if(resultRecord != null){
|
if(resultRecord != null){
|
||||||
|
FlowStart flowStart = flowStartService.selectFlowStartById(resultRecord.getStartId());
|
||||||
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());
|
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());
|
||||||
|
fromStaff.setResultRecord(resultRecord);
|
||||||
|
fromStaff.setFlowStart(flowStart);
|
||||||
List<StaffSimpleInfo> toStaffids;
|
List<StaffSimpleInfo> toStaffids;
|
||||||
if(type == WorkMsgTypeEnum.REJECT.getType()){
|
if(type == WorkMsgTypeEnum.REJECT.getType()){//被拒
|
||||||
toStaffids = new ArrayList<>();
|
toStaffids = new ArrayList<>();
|
||||||
toStaffids.add(fromStaff);
|
toStaffids.add(fromStaff);
|
||||||
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.REJECT.getType());
|
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.REJECT.getType());
|
||||||
@ -228,6 +236,11 @@ public class DingtalkBusiness {
|
|||||||
}
|
}
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
toStaffids = staffService.selectStaffSimpleInfos(ids);
|
toStaffids = staffService.selectStaffSimpleInfos(ids);
|
||||||
|
for (StaffSimpleInfo simpleInfo:toStaffids
|
||||||
|
) {
|
||||||
|
simpleInfo.setResultRecord(resultRecord);
|
||||||
|
simpleInfo.setFlowStart(flowStart);
|
||||||
|
}
|
||||||
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
|
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +357,7 @@ public class DingtalkBusiness {
|
|||||||
StaffSimpleInfo fromStaff = null;
|
StaffSimpleInfo fromStaff = null;
|
||||||
WorkMsgTypeEnum workMsgTypeEnum;
|
WorkMsgTypeEnum workMsgTypeEnum;
|
||||||
String appid;
|
String appid;
|
||||||
String hostUrl = "https://lzmanagement.ldxinyong.com/digitization/dingTalkLogin";
|
String hostUrl = "https://lzmanagement.ldxinyong.com/digitization";
|
||||||
public ThreadSendMessage(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
|
public ThreadSendMessage(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
|
||||||
this.toStaffids = toStaffids;
|
this.toStaffids = toStaffids;
|
||||||
workMsgTypeEnum = typeEnum;
|
workMsgTypeEnum = typeEnum;
|
||||||
@ -354,7 +367,7 @@ public class DingtalkBusiness {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
logger.info("开始批量推送消息,数量{}, appid", toStaffids.size(), appid);
|
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
|
||||||
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
||||||
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
||||||
for (StaffSimpleInfo info:toStaffids
|
for (StaffSimpleInfo info:toStaffids
|
||||||
@ -367,30 +380,62 @@ public class DingtalkBusiness {
|
|||||||
}else{
|
}else{
|
||||||
url += "?halokit=" + System.currentTimeMillis();
|
url += "?halokit=" + System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
url += ("&detail=1&id=" + info.getRecordId());
|
url += ("&detail=1&id=" + info.getResultRecord().getId());
|
||||||
url = URLEncoder.encode(url);
|
url = URLEncoder.encode(url);
|
||||||
|
|
||||||
|
|
||||||
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
|
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
|
||||||
"&container_type=work_platform&app_id=0_" +
|
"&container_type=work_platform&app_id=0_" +
|
||||||
appid + "&redirect_type=jump&redirect_url=" + url;
|
appid + "&redirect_type=jump&redirect_url=" + url;
|
||||||
String content = null;
|
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()){
|
||||||
if(fromStaff == null){
|
//发送制定目标通知
|
||||||
content = workMsgTypeEnum.getContent().replace("@", info.getName());
|
StaffEntity entity = new StaffEntity();
|
||||||
|
entity.setId(info.getId());
|
||||||
|
entity.setEmployeeId(info.getEmployeeId());
|
||||||
|
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
|
||||||
|
"任务内容", "目标制定",
|
||||||
|
"考核名称", info.getFlowStart().getName(),
|
||||||
|
"被考核人", info.getResultRecord().getStaffName(),
|
||||||
|
url, token, "霖梓控股");
|
||||||
|
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()){
|
||||||
|
//发送开始评分通知
|
||||||
|
StaffEntity entity = new StaffEntity();
|
||||||
|
entity.setId(info.getId());
|
||||||
|
entity.setEmployeeId(info.getEmployeeId());
|
||||||
|
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
|
||||||
|
"任务内容", "结果录入",
|
||||||
|
"考核名称", info.getFlowStart().getName(),
|
||||||
|
"被考核人", info.getResultRecord().getStaffName(),
|
||||||
|
url, token, "霖梓控股");
|
||||||
}else{
|
}else{
|
||||||
if(fromStaff.getId() == info.getId()){
|
//流程流转通知
|
||||||
content = workMsgTypeEnum.getContent().replace("@", "您");
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
||||||
|
if(flowRecords.size() == 0){
|
||||||
|
//任务结束
|
||||||
}else{
|
}else{
|
||||||
content = workMsgTypeEnum.getContent().replace("@", fromStaff.getName());
|
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
|
||||||
}
|
@Override
|
||||||
|
public Long apply(FlowRecord flowRecord) {
|
||||||
|
return flowRecord.getApprovalStaffId();
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
|
||||||
|
for (StaffSimpleInfo staffSimpleInfo:staffSimpleInfos
|
||||||
|
) {
|
||||||
|
StaffEntity entity = new StaffEntity();
|
||||||
|
entity.setId(staffSimpleInfo.getId());
|
||||||
|
entity.setEmployeeId(staffSimpleInfo.getEmployeeId());
|
||||||
|
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
|
||||||
|
"任务内容", flowRecords.get(0).getFlowName(),
|
||||||
|
"考核名称", info.getFlowStart().getName(),
|
||||||
|
"被考核人", info.getResultRecord().getStaffName(),
|
||||||
|
url, token, "霖梓控股");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StaffEntity entity = new StaffEntity();
|
|
||||||
entity.setId(info.getId());
|
|
||||||
entity.setEmployeeId(info.getEmployeeId());
|
|
||||||
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
|
|
||||||
content, workMsgTypeEnum.getBtnText(), url, token);
|
|
||||||
}else{
|
}else{
|
||||||
logger.info("ThreadSendMessage token无效"); ;
|
logger.info("ThreadSendMessage token无效"); ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,8 +80,6 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DingtalkBusiness dingtalkBusiness;
|
private DingtalkBusiness dingtalkBusiness;
|
||||||
|
|
||||||
public static final int processId = 1;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -165,7 +163,14 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
//删除副本组
|
//删除副本组
|
||||||
evaluationGroupService.deleteByCopyIds(collect,flowStart.getId());
|
evaluationGroupService.deleteByCopyIds(collect,flowStart.getId());
|
||||||
}
|
}
|
||||||
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
|
List<Long> ids = resultRecordMapper.selectIdsByStartId(flowStart.getId());
|
||||||
|
if(CollectionUtils.isNotEmpty(ids)){
|
||||||
|
log.info("删除resultRecordIds: " + JSON.toJSONString(ids));
|
||||||
|
resultRecordMapper.batchDeleteByResultRecordIds(ids);
|
||||||
|
//删除flowRecord
|
||||||
|
flowRecordMapper.batchDeleteByRecordIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +285,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
Long evaluation = group.getId();
|
Long evaluation = group.getId();
|
||||||
int i = evaluationStartStaffService.updateBatchToScore(req.getStartId(), group.getId());
|
int i = evaluationStartStaffService.updateBatchToScore(req.getStartId(), group.getId());
|
||||||
log.info("更新evaluationStartStaff 数据 为已评分 " + i);
|
log.info("更新evaluationStartStaff 数据 为已评分 " + i);
|
||||||
List<ToScoreDingTalkDto> dtos = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation);
|
List<ResultRecord> dtos = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation);
|
||||||
if(CollectionUtils.isNotEmpty(dtos)){
|
if(CollectionUtils.isNotEmpty(dtos)){
|
||||||
log.info("本次评分更新操作 num: " + dtos.size());
|
log.info("本次评分更新操作 num: " + dtos.size());
|
||||||
dtos.forEach(dto -> {
|
dtos.forEach(dto -> {
|
||||||
@ -299,8 +304,9 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
//钉钉通知评分构建
|
//钉钉通知评分构建
|
||||||
StaffSimpleInfo staffSimpleInfo = new StaffSimpleInfo();
|
StaffSimpleInfo staffSimpleInfo = new StaffSimpleInfo();
|
||||||
staffSimpleInfo.setId(dto.getStaffId());
|
staffSimpleInfo.setId(dto.getStaffId());
|
||||||
staffSimpleInfo.setRecordId(recordId);
|
staffSimpleInfo.setResultRecord(dto);
|
||||||
staffSimpleInfo.setStartId(req.getStartId());
|
FlowStart start = flowStartMapper.selectFlowStartById(req.getStartId());
|
||||||
|
staffSimpleInfo.setFlowStart(start);
|
||||||
toStaffids.add(staffSimpleInfo);
|
toStaffids.add(staffSimpleInfo);
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -317,7 +323,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
|
|
||||||
List<Long> collect = objects.stream().map(o -> Long.valueOf(String.valueOf(o))).collect(toList());
|
List<Long> collect = objects.stream().map(o -> Long.valueOf(String.valueOf(o))).collect(toList());
|
||||||
|
|
||||||
int updateExecution = flowRecordMapper.batchUpdateExecution(collect, processId);
|
int updateExecution = flowRecordMapper.batchUpdateSkip(collect);
|
||||||
log.info("更新flowRecord记录,i:" + updateExecution);
|
log.info("更新flowRecord记录,i:" + updateExecution);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,11 +94,16 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
|||||||
|
|
||||||
int batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
|
int batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
|
||||||
|
|
||||||
List<ToScoreDingTalkDto> selectToScoreList(@Param("startId")Long startId, @Param("evaluationId")Long evaluationId);
|
List<ResultRecord> selectToScoreList(@Param("startId")Long startId, @Param("evaluationId")Long evaluationId);
|
||||||
|
|
||||||
int countAssessNumJoin(@Param("req")AssessDetailReq req);
|
int countAssessNumJoin(@Param("req")AssessDetailReq req);
|
||||||
|
|
||||||
ResultRecord selectLastResultRecordByUserId(@Param("userId") Long userId);
|
ResultRecord selectLastResultRecordByUserId(@Param("userId") Long userId);
|
||||||
|
|
||||||
ResultRecord selectResultRecordByStaffIdAndStartId(@Param("userId") Long userId, @Param("startId") Long startId);
|
ResultRecord selectResultRecordByStaffIdAndStartId(@Param("userId") Long userId, @Param("startId") Long startId);
|
||||||
|
|
||||||
|
List<Long> selectIdsByStartId(@Param("startId")Long startId);
|
||||||
|
|
||||||
|
int batchDeleteByResultRecordIds(@Param("resultRecordIds")List<Long> resultRecordIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -13,6 +13,7 @@ import com.lz.modules.app.req.ResultRecordReq;
|
|||||||
import com.lz.modules.app.resp.OwnResultResp;
|
import com.lz.modules.app.resp.OwnResultResp;
|
||||||
import com.lz.modules.app.utils.t.TwoTuple;
|
import com.lz.modules.app.utils.t.TwoTuple;
|
||||||
import com.lz.modules.flow.entity.Flow;
|
import com.lz.modules.flow.entity.Flow;
|
||||||
|
import com.lz.modules.flow.entity.FlowApprovalRole;
|
||||||
import com.lz.modules.flow.model.StaffRoleDto;
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.performance.req.AssessDetailReq;
|
import com.lz.modules.performance.req.AssessDetailReq;
|
||||||
import com.lz.modules.performance.req.OwnResultReq;
|
import com.lz.modules.performance.req.OwnResultReq;
|
||||||
@ -112,7 +113,9 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
|||||||
|
|
||||||
R initFlowRecord(Long resultRecordId);
|
R initFlowRecord(Long resultRecordId);
|
||||||
|
|
||||||
R newApproval(ApprovalDto approvalDto) throws Exception;
|
R initFlowRecord(ResultRecord resultRecord, List<Flow> flows, List<FlowApprovalRole> flowApprovalRoles);
|
||||||
|
|
||||||
|
R newApproval(ApprovalDto approvalDto) throws Exception;
|
||||||
|
|
||||||
R newResultRecordList(RecordDetailDto recordDetailDto);
|
R newResultRecordList(RecordDetailDto recordDetailDto);
|
||||||
|
|
||||||
|
|||||||
@ -778,6 +778,13 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
flowIds.add(flow.getId());
|
flowIds.add(flow.getId());
|
||||||
}
|
}
|
||||||
List<FlowApprovalRole> flowApprovalRoles =flowApprovalRoleService.selectFlowApprovalRoleList(flowIds);
|
List<FlowApprovalRole> flowApprovalRoles =flowApprovalRoleService.selectFlowApprovalRoleList(flowIds);
|
||||||
|
|
||||||
|
return initFlowRecord(resultRecord, flows, flowApprovalRoles);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R initFlowRecord(ResultRecord resultRecord, List<Flow> flows, List<FlowApprovalRole> flowApprovalRoles) {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (FlowApprovalRole flowApprovalRole : flowApprovalRoles) {
|
for (FlowApprovalRole flowApprovalRole : flowApprovalRoles) {
|
||||||
FlowRecord flowRecord = new FlowRecord();
|
FlowRecord flowRecord = new FlowRecord();
|
||||||
|
|||||||
@ -63,9 +63,9 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
|
|||||||
//发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回
|
//发送状态:0新建,1已发送,2处理中,3已送达,4未读,5已读,6发送失败,7撤回
|
||||||
private Integer status;
|
private Integer status;
|
||||||
//应用ID
|
//应用ID
|
||||||
private Long appId;
|
private String appId;
|
||||||
//钉钉返回的任务id
|
//钉钉返回的任务id
|
||||||
private Long taskId;
|
private String taskId;
|
||||||
//备注,一些说明
|
//备注,一些说明
|
||||||
private String remark;
|
private String remark;
|
||||||
/**
|
/**
|
||||||
@ -417,14 +417,14 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
|
|||||||
* 应用ID
|
* 应用ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Long getAppId() {
|
public String getAppId() {
|
||||||
return appId;
|
return appId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 应用ID
|
* 应用ID
|
||||||
* @param appId
|
* @param appId
|
||||||
*/
|
*/
|
||||||
public void setAppId(Long appId) {
|
public void setAppId(String appId) {
|
||||||
this.appId = appId;
|
this.appId = appId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,14 +432,14 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
|
|||||||
* 钉钉返回的任务id
|
* 钉钉返回的任务id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Long getTaskId() {
|
public String getTaskId() {
|
||||||
return taskId;
|
return taskId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 钉钉返回的任务id
|
* 钉钉返回的任务id
|
||||||
* @param taskId
|
* @param taskId
|
||||||
*/
|
*/
|
||||||
public void setTaskId(Long taskId) {
|
public void setTaskId(String taskId) {
|
||||||
this.taskId = taskId;
|
this.taskId = taskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -580,8 +580,8 @@
|
|||||||
)
|
)
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectToScoreList" resultType="com.lz.modules.performance.dto.ToScoreDingTalkDto">
|
<select id="selectToScoreList" resultType="ResultRecord">
|
||||||
select id,staff_id from lz_result_record where is_delete = 0
|
select * from lz_result_record where is_delete = 0
|
||||||
and start_id = #{startId}
|
and start_id = #{startId}
|
||||||
and flow_process = 2
|
and flow_process = 2
|
||||||
and evaluation_id = #{evaluationId}
|
and evaluation_id = #{evaluationId}
|
||||||
@ -594,5 +594,23 @@
|
|||||||
<select id="selectResultRecordByStaffIdAndStartId" resultType="ResultRecord" >
|
<select id="selectResultRecordByStaffIdAndStartId" resultType="ResultRecord" >
|
||||||
select * from lz_result_record where staff_id=#{userId} and is_delete = 0 and start_id = #{startId} order by id desc limit 1
|
select * from lz_result_record where staff_id=#{userId} and is_delete = 0 and start_id = #{startId} order by id desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectIdsByStartId" resultType="long">
|
||||||
|
select id from lz_result_record where
|
||||||
|
is_delete = 0
|
||||||
|
and start_id = #{startId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="batchDeleteByResultRecordIds">
|
||||||
|
update lz_result_record set is_delete = 1
|
||||||
|
,gmt_modified = now()
|
||||||
|
where
|
||||||
|
is_delete = 0
|
||||||
|
and id in (
|
||||||
|
<foreach collection="resultRecordIds" item="id" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -103,5 +103,7 @@
|
|||||||
select * from lz_flow where flow_id = #{flowId} and is_delete = 0 and start_id = #{startId}
|
select * from lz_flow where flow_id = #{flowId} and is_delete = 0 and start_id = #{startId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -266,23 +266,34 @@
|
|||||||
select * from lz_flow_record where is_delete = 0 and record_id = #{resultRecordId} and id > #{id} and status = #{status} order by id asc limit 1
|
select * from lz_flow_record where is_delete = 0 and record_id = #{resultRecordId} and id > #{id} and status = #{status} order by id asc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="batchUpdateExecution">
|
<update id="batchUpdateSkip">
|
||||||
UPDATE lz_flow_record
|
UPDATE lz_flow_record
|
||||||
SET status = 4
|
SET status = 4
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where is_delete = 0 and status !=4 and flow_process = 2 and process_id = #{processId}
|
where is_delete = 0 and status !=4 and flow_process = 2
|
||||||
<if test="recordIds !=null and recordIds.size()!=0">
|
and record_id in (
|
||||||
and record_id in (
|
<foreach collection="recordIds" item="record_id" separator=",">
|
||||||
<foreach collection="recordIds" item="record_id" separator=",">
|
#{record_id}
|
||||||
#{record_id}
|
</foreach>
|
||||||
</foreach>
|
)
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectFlowRecordByRecordIdFlowProcess" resultType="com.lz.modules.flow.entity.FlowRecord">
|
<select id="selectFlowRecordByRecordIdFlowProcess" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||||
select * from lz_flow_record where is_delete = 0 and record_id = #{id} and flow_process = #{flowProcess}
|
select * from lz_flow_record where is_delete = 0 and record_id = #{id} and flow_process = #{flowProcess}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="batchDeleteByRecordIds">
|
||||||
|
UPDATE lz_flow_record
|
||||||
|
SET is_delete = 1
|
||||||
|
,gmt_modified = now()
|
||||||
|
where is_delete = 0
|
||||||
|
and record_id in (
|
||||||
|
<foreach collection="recordIds" item="record_id" separator=",">
|
||||||
|
#{record_id}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user