优化转交部分
This commit is contained in:
parent
d92debad3e
commit
f04c129042
@ -52,6 +52,8 @@ public class StaffSimpleInfo implements Serializable {
|
|||||||
private ResultRecord resultRecord;
|
private ResultRecord resultRecord;
|
||||||
//本次发起的任务信息
|
//本次发起的任务信息
|
||||||
private FlowStart flowStart;
|
private FlowStart flowStart;
|
||||||
|
//当前操作的流程id
|
||||||
|
private Long flowRecordId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,4 +31,6 @@ public interface FlowChangeMapper extends BaseMapper<FlowChange> {
|
|||||||
|
|
||||||
|
|
||||||
FlowChange selectFlowChangeByRecordIdAndToIdAndType(@Param("recordId") Long recordId, @Param("toStaffId") Long toStaffId, @Param("type") int type);
|
FlowChange selectFlowChangeByRecordIdAndToIdAndType(@Param("recordId") Long recordId, @Param("toStaffId") Long toStaffId, @Param("type") int type);
|
||||||
|
|
||||||
|
FlowChange selectFlowChangeByFlowRecordIdAndType(@Param("flowRecordId") Long flowRecordId, @Param("type") int type);
|
||||||
}
|
}
|
||||||
@ -35,4 +35,6 @@ public interface FlowChangeService extends IService<FlowChange> {
|
|||||||
void saveChange(ApprovalDto approvalDto, FlowRecord flowRecord, int i);
|
void saveChange(ApprovalDto approvalDto, FlowRecord flowRecord, int i);
|
||||||
|
|
||||||
FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type);
|
FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type);
|
||||||
|
|
||||||
|
FlowChange selectFlowChangeByFlowRecordIdAndType(Long flowRecordId, int i);
|
||||||
}
|
}
|
||||||
@ -84,5 +84,10 @@ public class FlowChangeServiceImpl extends ServiceImpl<FlowChangeMapper, FlowCha
|
|||||||
return flowChangeMapper.selectFlowChangeByRecordIdAndToIdAndType(recordId, toStaffId, type);
|
return flowChangeMapper.selectFlowChangeByRecordIdAndToIdAndType(recordId, toStaffId, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FlowChange selectFlowChangeByFlowRecordIdAndType(Long flowRecordId, int type){
|
||||||
|
return flowChangeMapper.selectFlowChangeByFlowRecordIdAndType(flowRecordId, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -235,34 +235,27 @@ public class DingtalkBusiness {
|
|||||||
|
|
||||||
public String sendWorkMSGWithAsyn(Long resultRecordId ,Long flowRecordId, int type) {
|
public String sendWorkMSGWithAsyn(Long resultRecordId ,Long flowRecordId, int type) {
|
||||||
|
|
||||||
|
//流程跳转专用
|
||||||
return null;
|
|
||||||
}
|
|
||||||
//流程流转发送消息
|
|
||||||
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());
|
FlowStart flowStart = flowStartService.selectFlowStartById(resultRecord.getStartId());
|
||||||
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());//查询来自那里
|
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());//查询来自那里
|
||||||
fromStaff.setResultRecord(resultRecord);
|
fromStaff.setResultRecord(resultRecord);
|
||||||
fromStaff.setFlowStart(flowStart);
|
fromStaff.setFlowStart(flowStart);
|
||||||
List<StaffSimpleInfo> toStaffids = new ArrayList<>();
|
fromStaff.setFlowRecordId(flowRecordId);
|
||||||
toStaffids.add(fromStaff);
|
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
|
|
||||||
if(type == WorkMsgTypeEnum.REJECT.getType()){//被拒
|
if(type == WorkMsgTypeEnum.REJECT.getType()){//被拒
|
||||||
|
sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.REJECT.getType());
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.REJECT.getType());
|
|
||||||
}else if(type == WorkMsgTypeEnum.URGING.getType()){//被拒
|
}else if(type == WorkMsgTypeEnum.URGING.getType()){//被拒
|
||||||
|
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.URGING.getType());
|
sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.URGING.getType());
|
||||||
}else if(type == WorkMsgTypeEnum.SKIP.getType()){//被拒
|
}else if(type == WorkMsgTypeEnum.SKIP.getType()){//被拒
|
||||||
|
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.SKIP.getType());
|
sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.SKIP.getType());
|
||||||
}else if(type == WorkMsgTypeEnum.TRANSFER.getType()){//被拒
|
}else if(type == WorkMsgTypeEnum.TRANSFER.getType()){//被拒
|
||||||
|
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.TRANSFER.getType());
|
sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.TRANSFER.getType());
|
||||||
}else{
|
}else{
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
|
sendWorkMSGWithAsyn(fromStaff, null, WorkMsgTypeEnum.PROCESS.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -270,10 +263,15 @@ public class DingtalkBusiness {
|
|||||||
}
|
}
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
//流程流转发送消息
|
||||||
|
public String sendWorkMSGWithAsyn(Long resultRecordId , int type) {
|
||||||
|
return sendWorkMSGWithAsyn(resultRecordId, 0L, type);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, int type) {
|
public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, int type) {
|
||||||
if(toStaffids.size() > 0){
|
if(toStaffids != null && toStaffids.size() > 0){
|
||||||
if (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0) {
|
if (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0) {
|
||||||
//查询第三方id
|
//查询第三方id
|
||||||
List<Long> ids = toStaffids.stream().map(new Function<StaffSimpleInfo, Long>() {
|
List<Long> ids = toStaffids.stream().map(new Function<StaffSimpleInfo, Long>() {
|
||||||
@ -292,7 +290,7 @@ public class DingtalkBusiness {
|
|||||||
}
|
}
|
||||||
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
|
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
|
||||||
|
|
||||||
ThreadSendMessage threadSendMessage = new ThreadSendMessage(toStaffids, workMsgTypeEnum, appid);
|
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
|
||||||
Thread thread = new Thread(threadSendMessage);
|
Thread thread = new Thread(threadSendMessage);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
@ -374,12 +372,13 @@ public class DingtalkBusiness {
|
|||||||
|
|
||||||
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 = "https://lzmanagement.ldxinyong.com/digitization";
|
||||||
public ThreadSendMessage(List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
|
public ThreadSendMessage(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
|
||||||
|
this.fromStaff = fromStaff;
|
||||||
this.toStaffids = toStaffids;
|
this.toStaffids = toStaffids;
|
||||||
workMsgTypeEnum = typeEnum;
|
workMsgTypeEnum = typeEnum;
|
||||||
this.appid = appid;
|
this.appid = appid;
|
||||||
@ -421,53 +420,37 @@ public class DingtalkBusiness {
|
|||||||
|
|
||||||
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
||||||
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
||||||
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.CLEARN.getType()){
|
if(token != null && token.length() > 0){
|
||||||
//绩效催办
|
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.CLEARN.getType()){
|
||||||
logger.info("绩效清空");
|
//绩效催办
|
||||||
|
logger.info("绩效清空");
|
||||||
|
|
||||||
|
|
||||||
List<ThirdMsgSendRecord> threadSendMessages
|
List<ThirdMsgSendRecord> threadSendMessages
|
||||||
= thirdMsgSendRecordService.selectThirdMsgSendRecordsByRecordIds(recordIds, 1, 1);
|
= thirdMsgSendRecordService.selectThirdMsgSendRecordsByRecordIds(recordIds, 1, 1);
|
||||||
logger.info("需要删除的条数为{}", threadSendMessages.size());
|
logger.info("需要删除的条数为{}", threadSendMessages.size());
|
||||||
for (ThirdMsgSendRecord thirdMsgSendRecord:threadSendMessages
|
for (ThirdMsgSendRecord thirdMsgSendRecord:threadSendMessages
|
||||||
) {
|
) {
|
||||||
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
|
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
|
||||||
for (StaffSimpleInfo info:toStaffids
|
|
||||||
) {
|
if(toStaffids == null){//流程流转走的代码
|
||||||
if(token != null && token.length() > 0){
|
|
||||||
//下面防止第二次发送消息时钉钉不推送
|
|
||||||
String url = hostUrl;
|
String url = hostUrl;
|
||||||
if(url.contains("?")){
|
if(url.contains("?")){
|
||||||
url += "&halokit=" + System.currentTimeMillis();
|
url += "&halokit=" + System.currentTimeMillis();
|
||||||
}else{
|
}else{
|
||||||
url += "?halokit=" + System.currentTimeMillis();
|
url += "?halokit=" + System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
url += ("&detail=1&id=" + info.getResultRecord().getId());
|
url += ("&detail=1&id=" + fromStaff.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;
|
||||||
|
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.URGING.getType()){
|
||||||
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()){
|
|
||||||
//发送制定目标通知
|
|
||||||
logger.info("目标制定");
|
|
||||||
sendNotic(info.getId(), info.getEmployeeId(),
|
|
||||||
"目标制定", info.getFlowStart().getName(),
|
|
||||||
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
|
||||||
|
|
||||||
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()){
|
|
||||||
//发送开始评分通知
|
|
||||||
logger.info("结果录入");
|
|
||||||
sendNotic(info.getId(), info.getEmployeeId(),
|
|
||||||
"结果录入", info.getFlowStart().getName(),
|
|
||||||
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
|
||||||
|
|
||||||
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.URGING.getType()){
|
|
||||||
//绩效催办
|
//绩效催办
|
||||||
logger.info("绩效催办");
|
logger.info("绩效催办");
|
||||||
}else {
|
}else {
|
||||||
@ -477,62 +460,59 @@ public class DingtalkBusiness {
|
|||||||
//转交
|
//转交
|
||||||
//并发转交会有问题
|
//并发转交会有问题
|
||||||
logger.info("转交待办任务处理");
|
logger.info("转交待办任务处理");
|
||||||
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
|
FlowChange flowChange = flowChangeService.selectFlowChangeByFlowRecordIdAndType(
|
||||||
info.getId(), 0);
|
fromStaff.getFlowRecordId(),
|
||||||
ThirdMsgSendRecord thirdMsgSendRecord =
|
0);
|
||||||
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
if(flowChange != null){
|
||||||
info.getResultRecord().getId(), flowChange.getApprovalId(), 1, 1);
|
ThirdMsgSendRecord thirdMsgSendRecord =
|
||||||
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
||||||
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
fromStaff.getResultRecord().getId(), flowChange.getApprovalId(), 1, 1);
|
||||||
}
|
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
||||||
FlowRecord flowRecord = flowRecordService.selectFlowRecordById(flowChange.getFlowRecordId());
|
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
||||||
if(flowRecord != null && flowRecord.getStatus().intValue() == 2){
|
}
|
||||||
logger.info("转交存在且为当前要处理的节点");
|
FlowRecord flowRecord = flowRecordService.selectFlowRecordById(flowChange.getFlowRecordId());
|
||||||
StaffSimpleInfo staffSimpleInfo = staffService.selectStaffSimpleInfo(flowRecord.getApprovalStaffId());
|
if(flowRecord != null && flowRecord.getStatus().intValue() == 2){
|
||||||
//List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
logger.info("转交存在且为当前要处理的节点");
|
||||||
//发送待办任务到新指定人员,转交过来一定会有数据
|
StaffSimpleInfo staffSimpleInfo = staffService.selectStaffSimpleInfo(flowRecord.getApprovalStaffId());
|
||||||
sendNotic(info.getId(), staffSimpleInfo.getEmployeeId(),
|
//List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
||||||
flowRecord.getFlowName(), info.getFlowStart().getName(),
|
//发送待办任务到新指定人员,转交过来一定会有数据
|
||||||
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
sendNotic(staffSimpleInfo.getId(), staffSimpleInfo.getEmployeeId(),
|
||||||
|
flowRecord.getFlowName(), fromStaff.getFlowStart().getName(),
|
||||||
|
fromStaff.getResultRecord().getStaffName(), token, url, fromStaff.getResultRecord().getId());
|
||||||
|
}else{
|
||||||
|
logger.info("转交不存在,或者当前非处理节点无需发送");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
logger.info("转交不存在,或者当前非处理节点无需发送");
|
logger.info("流转变更记录不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.SKIP.getType()){//跳过
|
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.SKIP.getType()){//跳过
|
||||||
//跳过
|
//跳过
|
||||||
logger.info("跳过待办任务处理");
|
logger.info("跳过待办任务处理");
|
||||||
|
|
||||||
|
|
||||||
List<FlowRecord> flowRecords =
|
List<FlowRecord> flowRecords =
|
||||||
flowRecordService.selectSkipFlowRecordsById(info.getResultRecord().getId());//取消所有跳过的人
|
flowRecordService.selectSkipFlowRecordsById(fromStaff.getResultRecord().getId());//取消所有跳过的人
|
||||||
logger.info("查询到可能需要更新待办任务数量{}", flowRecords.size());
|
logger.info("查询到可能需要更新待办任务数量{}", flowRecords.size());
|
||||||
if(flowRecords.size() > 0){
|
if(flowRecords.size() > 0){
|
||||||
//if(flowRecords.get(0).getType().intValue() == 1){
|
//或签
|
||||||
//或签
|
logger.info("或签,需要更新该节点下所有人员的待办任务");
|
||||||
logger.info("或签,需要更新该节点下所有人员的待办任务");
|
for (FlowRecord flowRecord:flowRecords
|
||||||
for (FlowRecord flowRecord:flowRecords
|
) {
|
||||||
) {
|
logger.info("更新非直接跳关人员的待办任务,人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
|
||||||
//if(flowRecord.getApprovalStaffId().longValue() != info.getId()){
|
flowRecord.getApprovalStaffName());
|
||||||
logger.info("更新非直接跳关人员的待办任务,人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
|
ThirdMsgSendRecord thirdMsgSendRecord =
|
||||||
flowRecord.getApprovalStaffName());
|
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
||||||
ThirdMsgSendRecord thirdMsgSendRecord =
|
fromStaff.getResultRecord().getId(),
|
||||||
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
flowRecord.getApprovalStaffId(), 1, 1);
|
||||||
info.getResultRecord().getId(),
|
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
||||||
flowRecord.getApprovalStaffId(), 1, 1);
|
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
||||||
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
}else{
|
||||||
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
logger.info("无需更新");
|
||||||
}else{
|
|
||||||
logger.info("无需更新");
|
|
||||||
}
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(fromStaff.getResultRecord().getId(), 2);
|
||||||
if(flowRecords.size() > 0){//给下一步骤需要处理的人发送待办任务
|
if(flowRecords.size() > 0){//给下一步骤需要处理的人发送待办任务
|
||||||
if(flowRecords.get(0).getFlowProcess().intValue() != 2){//执行中的不发送待办
|
if(flowRecords.get(0).getFlowProcess().intValue() != 2){//执行中的不发送待办
|
||||||
logger.info("非执行中的节点发送待办任务{}", flowRecords.get(0).getFlowName());
|
logger.info("非执行中的节点发送待办任务{}", flowRecords.get(0).getFlowName());
|
||||||
@ -546,21 +526,21 @@ public class DingtalkBusiness {
|
|||||||
for (StaffSimpleInfo staffSimpleInfo:staffSimpleInfos
|
for (StaffSimpleInfo staffSimpleInfo:staffSimpleInfos
|
||||||
) {
|
) {
|
||||||
sendNotic(staffSimpleInfo.getId(), staffSimpleInfo.getEmployeeId(),
|
sendNotic(staffSimpleInfo.getId(), staffSimpleInfo.getEmployeeId(),
|
||||||
flowRecords.get(0).getFlowName(), info.getFlowStart().getName(),
|
flowRecords.get(0).getFlowName(), fromStaff.getFlowStart().getName(),
|
||||||
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
fromStaff.getResultRecord().getStaffName(), token, url, fromStaff.getResultRecord().getId());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//取消上一步骤发送的待办任务
|
//取消上一步骤发送的待办任务
|
||||||
if(flowRecords.size() == 0){//任务结束了
|
if(flowRecords.size() == 0){//任务结束了
|
||||||
flowRecords = flowRecordService.selectLastFlowRecordsById(info.getResultRecord().getId());
|
flowRecords = flowRecordService.selectLastFlowRecordsById(fromStaff.getResultRecord().getId());
|
||||||
}else{
|
}else{
|
||||||
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.REJECT.getType()){//被拒
|
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.REJECT.getType()){//被拒
|
||||||
flowRecords = flowRecordService.selectLastFlowRecordsByIdAndFlowIndex(info.getResultRecord().getId()
|
flowRecords = flowRecordService.selectLastFlowRecordsByIdAndFlowIndex(fromStaff.getResultRecord().getId()
|
||||||
, flowRecords.get(0).getFlowIndex().intValue() + 1);//获取下一步的数据
|
, flowRecords.get(0).getFlowIndex().intValue() + 1);//获取下一步的数据
|
||||||
}else{
|
}else{
|
||||||
flowRecords = flowRecordService.selectLastFlowRecordsByIdAndFlowIndex(info.getResultRecord().getId()
|
flowRecords = flowRecordService.selectLastFlowRecordsByIdAndFlowIndex(fromStaff.getResultRecord().getId()
|
||||||
, flowRecords.get(0).getFlowIndex().intValue() - 1);//获取上一步的数据
|
, flowRecords.get(0).getFlowIndex().intValue() - 1);//获取上一步的数据
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -577,7 +557,7 @@ public class DingtalkBusiness {
|
|||||||
flowRecord.getApprovalStaffName());
|
flowRecord.getApprovalStaffName());
|
||||||
ThirdMsgSendRecord thirdMsgSendRecord =
|
ThirdMsgSendRecord thirdMsgSendRecord =
|
||||||
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
||||||
info.getResultRecord().getId(),
|
fromStaff.getResultRecord().getId(),
|
||||||
flowRecord.getApprovalStaffId(), 1, 1);
|
flowRecord.getApprovalStaffId(), 1, 1);
|
||||||
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
||||||
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
||||||
@ -589,10 +569,48 @@ public class DingtalkBusiness {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
logger.info("ThreadSendMessage token无效"); ;
|
|
||||||
|
}else{//批量推送给指定人员
|
||||||
|
for (StaffSimpleInfo info:toStaffids
|
||||||
|
) {
|
||||||
|
|
||||||
|
//下面防止第二次发送消息时钉钉不推送
|
||||||
|
String url = hostUrl;
|
||||||
|
if (url.contains("?")) {
|
||||||
|
url += "&halokit=" + System.currentTimeMillis();
|
||||||
|
} else {
|
||||||
|
url += "?halokit=" + System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
url += ("&detail=1&id=" + info.getResultRecord().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;
|
||||||
|
|
||||||
|
if (workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()) {
|
||||||
|
//发送制定目标通知
|
||||||
|
logger.info("目标制定");
|
||||||
|
sendNotic(info.getId(), info.getEmployeeId(),
|
||||||
|
"目标制定", info.getFlowStart().getName(),
|
||||||
|
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
||||||
|
|
||||||
|
} else if (workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()) {
|
||||||
|
//发送开始评分通知
|
||||||
|
logger.info("结果录入");
|
||||||
|
sendNotic(info.getId(), info.getEmployeeId(),
|
||||||
|
"结果录入", info.getFlowStart().getName(),
|
||||||
|
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.info("未定义消息类型");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
logger.info("ThreadSendMessage token无效"); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,5 +103,9 @@
|
|||||||
select * from lz_flow_change where record_id=#{recordId} and to_approval_id = #{toStaffId} and type = #{type} and is_delete = 0 limit 1
|
select * from lz_flow_change where record_id=#{recordId} and to_approval_id = #{toStaffId} and type = #{type} and is_delete = 0 limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFlowChangeByFlowRecordIdAndType" resultType="FlowChange" >
|
||||||
|
select * from lz_flow_change where flow_record_id=#{flowRecordId} and type = #{type} and is_delete = 0 order by id desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user