初始化流程线程增加一些日志

This commit is contained in:
wulin 2020-12-02 10:11:09 +08:00
parent b2a48efa49
commit 2bf88f1fe1

View File

@ -2,22 +2,13 @@ package com.lz.modules.flow.service.impl;
import ch.qos.logback.classic.Logger;
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.CheckStaffType;
import com.lz.common.emun.WorkMsgTypeEnum;
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.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.flow.dao.EvaluationStartStaffMapper;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.*;
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.service.app.ResultDetailService;
import com.lz.modules.sys.service.app.ResultRecordService;
import com.lz.modules.third.entity.ThirdAppConfig;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
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.stream.Collectors;
@ -839,12 +823,12 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
}
public class ThreadInitFlowRecord implements Runnable{
List<StartStartDto> resultRecords;
List<StartStartDto> resultStarts;
List<StaffSimpleInfo> noticeStaff;
public ThreadInitFlowRecord(List<StartStartDto> resultRecords, List<StaffSimpleInfo> noticeStaff){
this.resultRecords = resultRecords;
this.resultStarts = resultRecords;
this.noticeStaff = noticeStaff;
}
@ -853,13 +837,14 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
String oldNo = Logger.inheritableThreadLocalNo.get();//.threadLocalNo.get();
String newNo = oldNo + "_initFlowRecord" ;//+ resultRecord.getStaffId() + "_" + resultRecord.getId();
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);
log.info("初始化任务中绩效数量{}", startStartDto.getResultRecordList().size());
for (ResultRecord resultRecord:startStartDto.getResultRecordList()
) {
log.info("初始化绩效{}", resultRecord);
resultRecordService.initFlowRecord(resultRecord, startStartDto.getFlows(), startStartDto.getFlowApprovalRoles());
}