修改子线程

This commit is contained in:
wulin 2020-11-18 14:46:58 +08:00
parent 5b5e4caf6a
commit 4603665d8b

View File

@ -194,8 +194,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
} }
initFlowRecordAnsy(resultRecords); initFlowRecordAnsy(resultRecords, noticeStaff);
dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
return R.ok("发起成功").put("data", flowStart); return R.ok("发起成功").put("data", flowStart);
} }
@ -328,8 +328,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
break; break;
} }
} }
initFlowRecordAnsy(resultRecords); initFlowRecordAnsy(resultRecords, noticeStaff);
dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType()); //dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
return R.ok("发起成功").put("data", flowStart); return R.ok("发起成功").put("data", flowStart);
} }
//isInsert表示是否中途加人 //isInsert表示是否中途加人
@ -808,9 +808,9 @@ 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){ private void initFlowRecordAnsy(List<ResultRecord> resultRecords, List<StaffSimpleInfo> noticeStaff){
if(resultRecords.size() > 0){ if(resultRecords.size() > 0){
ThreadInitFlowRecord threadInitFlowRecord = new ThreadInitFlowRecord(resultRecords); ThreadInitFlowRecord threadInitFlowRecord = new ThreadInitFlowRecord(resultRecords, noticeStaff);
Thread thread = new Thread(threadInitFlowRecord); Thread thread = new Thread(threadInitFlowRecord);
thread.start(); thread.start();
threads.add(thread); threads.add(thread);
@ -820,10 +820,11 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
public class ThreadInitFlowRecord implements Runnable{ public class ThreadInitFlowRecord implements Runnable{
List<ResultRecord> resultRecords; List<ResultRecord> resultRecords;
List<StaffSimpleInfo> noticeStaff;
public ThreadInitFlowRecord(List<ResultRecord> resultRecords){ public ThreadInitFlowRecord(List<ResultRecord> resultRecords, List<StaffSimpleInfo> noticeStaff){
this.resultRecords = resultRecords; this.resultRecords = resultRecords;
this.noticeStaff = noticeStaff;
} }
@Override @Override
@ -839,6 +840,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
} }
ch.qos.logback.classic.Logger.threadLocalNo.set(oldNo); ch.qos.logback.classic.Logger.threadLocalNo.set(oldNo);
dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
//threads.remove(this); //threads.remove(this);
} }
} }