提交修改
This commit is contained in:
parent
104f818e4a
commit
73619c25c1
@ -19,7 +19,6 @@ 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.mchange.lang.IntegerUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -89,40 +88,30 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
private DingtalkBusiness dingtalkBusiness;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public FlowStart selectFlowStartById(Long id) {
|
||||
return flowStartMapper.selectFlowStartById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertFlowStart(FlowStart flowStart) {
|
||||
return flowStartMapper.insertFlowStart(flowStart);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateFlowStartById(FlowStart flowStart) {
|
||||
return flowStartMapper.updateFlowStartById(flowStart);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverFlowStartById(FlowStart flowStart) {
|
||||
return flowStartMapper.updateCoverFlowStartById(flowStart);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteFlowStartById(Long id) {
|
||||
return flowStartMapper.deleteFlowStartById(id);
|
||||
@ -248,7 +237,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
//查询拷贝后的
|
||||
|
||||
|
||||
|
||||
Map<String, String> maps = ids1.stream().collect(Collectors.toMap(e -> e, e -> e));
|
||||
|
||||
//求差集发起,但是历史记录怎么搞
|
||||
@ -358,6 +346,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
//dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
|
||||
return R.ok("发起成功").put("data", flowStart);
|
||||
}
|
||||
|
||||
//isInsert表示是否中途加人
|
||||
private StartStartDto start(EvaluationGroup evaluationGroup, FlowStart flowStart,
|
||||
Map<String, List<StaffEntity>> staffManages, List<StaffSimpleInfo> staffIds,
|
||||
@ -514,7 +503,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
resultRecordService.insertResultRecord(resultRecord);
|
||||
|
||||
|
||||
|
||||
//resultRecordService.initFlowRecord(resultRecord.getId());
|
||||
|
||||
//下面生成实际的考核流程
|
||||
@ -708,8 +696,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
resultRecord.setFlowProcess(0);//设置为目标制定
|
||||
|
||||
|
||||
|
||||
|
||||
//下面初始化flow_staff_id_role字段,步骤为0的
|
||||
String roleJSON = "[";
|
||||
for (int i = 0; i < flowApprovalRoles.size(); i++) {
|
||||
@ -880,25 +866,31 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
String oldNo = Logger.inheritableThreadLocalNo.get();//.threadLocalNo.get();
|
||||
String newNo = oldNo + "_initFlowRecord" ;//+ resultRecord.getStaffId() + "_" + resultRecord.getId();
|
||||
ch.qos.logback.classic.Logger.threadLocalNo.set(newNo);
|
||||
try {
|
||||
log.info("开始批量初始化流程,任务数量{}", resultStarts.size());
|
||||
|
||||
for (StartStartDto startStartDto: resultStarts
|
||||
) {
|
||||
String oldNo = Logger.inheritableThreadLocalNo.get();
|
||||
for (StartStartDto startStartDto : resultStarts) {
|
||||
try {
|
||||
oldNo = Logger.inheritableThreadLocalNo.get();
|
||||
String newNo = oldNo + "_initFlowRecord_" + startStartDto.getResultRecordList().get(0).getStartId();
|
||||
Logger.threadLocalNo.set(newNo);
|
||||
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());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("发出异常", e);
|
||||
} finally {
|
||||
Logger.threadLocalNo.set(oldNo);
|
||||
}
|
||||
|
||||
|
||||
ch.qos.logback.classic.Logger.threadLocalNo.set(oldNo);
|
||||
}
|
||||
Logger.threadLocalNo.set(oldNo);
|
||||
dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
|
||||
} catch (Exception e) {
|
||||
log.error("异常", e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -796,6 +796,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
|
||||
@Override
|
||||
public R initFlowRecord(ResultRecord resultRecord, List<Flow> flows, List<FlowApprovalRole> flowApprovalRoles) {
|
||||
log.info("员工id :" + resultRecord.getStaffId() + " ,员工名称 " + resultRecord.getStaffName());
|
||||
int i = 0;
|
||||
for (FlowApprovalRole flowApprovalRole : flowApprovalRoles) {
|
||||
FlowRecord flowRecord = new FlowRecord();
|
||||
@ -817,14 +818,17 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
approvalStaff = getDepartmentStaff(resultRecord.getStaffId(), 5);
|
||||
}
|
||||
if (approvalStaff != null && StringUtil.isNotBlank(approvalStaff.getName())) {
|
||||
log.info("插入xxx");
|
||||
insertFlowRecord(flowRecord, approvalStaff, flows, flowApprovalRole, resultRecord, i, null);
|
||||
} else {
|
||||
List<StaffRole> staffRoles = staffRoleService.selectAllStaffRoleByDepartmentLevel(Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName(), RoleEnums.CHILD_PM.getName()}));
|
||||
for (StaffRole staffRole : staffRoles) {
|
||||
approvalStaff = staffService.selectStaffById(staffRole.getStaffId());
|
||||
if (staffRole.getDepartmentId() == 0) { //如果是管理所有部门
|
||||
log.info("如果是管理所有部门------");
|
||||
insertFlowRecord(flowRecord, approvalStaff, flows, flowApprovalRole, resultRecord, i, 1);
|
||||
} else {
|
||||
log.info("222222222------");
|
||||
DepartmentsStaffRelateEntity relateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(resultRecord.getStaffId());
|
||||
Map<String, String> map = departmentsService.selectUserAllDepartmentIds(relateEntity.getDepartmentId());
|
||||
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||
@ -837,6 +841,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
}
|
||||
if (flag) { //如果管理员是管理特定部门
|
||||
log.info("如果管理员是管理特定部门===========");
|
||||
insertFlowRecord(flowRecord, approvalStaff, flows, flowApprovalRole, resultRecord, i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user