提交修改
This commit is contained in:
parent
1880e48eab
commit
39a5398c99
@ -4,6 +4,7 @@ import com.lz.common.emun.WorkMsgTypeEnum;
|
||||
import com.lz.common.utils.*;
|
||||
import com.lz.modules.app.dto.ApprovalDto;
|
||||
import com.lz.modules.app.dto.DepartmentsDto;
|
||||
import com.lz.modules.app.dto.RecordListDto;
|
||||
import com.lz.modules.app.dto.StaffDepartmentDto;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
@ -662,4 +663,17 @@ public class ResultRecordController extends AbstractController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
// http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordList
|
||||
@RequestMapping("/new/resultRecordList")
|
||||
public R newResultRecordList(RecordListDto recordListDto) {
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
8
src/main/java/com/lz/modules/app/dto/RecordListDto.java
Normal file
8
src/main/java/com/lz/modules/app/dto/RecordListDto.java
Normal file
@ -0,0 +1,8 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RecordListDto {
|
||||
private Long loginUserId;
|
||||
}
|
||||
@ -68,6 +68,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
private ResultRecordMapper resultRecordMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
private static EmployeesDto employeesDto;
|
||||
|
||||
@Autowired
|
||||
@ -764,47 +766,45 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
flowIds.add(flow.getId());
|
||||
}
|
||||
List<FlowApprovalRole> flowApprovalRoles =flowApprovalRoleService.selectFlowApprovalRoleList(flowIds);
|
||||
int i = 0 ;
|
||||
DepartmentsStaffRelateEntity relateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(resultRecord.getStaffId());
|
||||
Map<String, String> map = departmentsService.selectUserAllDepartmentInFo(relateEntity.getDepartmentId());
|
||||
int i = 0;
|
||||
List<FlowRecord> flowRecords = new ArrayList<>();
|
||||
for(FlowApprovalRole flowApprovalRole:flowApprovalRoles){
|
||||
for (FlowApprovalRole flowApprovalRole : flowApprovalRoles) {
|
||||
FlowRecord flowRecord = new FlowRecord();
|
||||
flowRecord.setRecordId(resultRecord.getId());
|
||||
StaffEntity staffEntity = new StaffEntity();
|
||||
if(FlowApprovalRoleTypeEnums.ME.getType().equals(flowApprovalRole.getType())){
|
||||
staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||
}else if(FlowApprovalRoleTypeEnums.STAFF.getType().equals(flowApprovalRole.getType())){
|
||||
if (FlowApprovalRoleTypeEnums.ME.getType().equals(flowApprovalRole.getType())) {
|
||||
staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||
} else if (FlowApprovalRoleTypeEnums.STAFF.getType().equals(flowApprovalRole.getType())) {
|
||||
staffEntity = staffService.selectStaffById(flowApprovalRole.getApprovalId());
|
||||
}else if(FlowApprovalRoleTypeEnums.ONE_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||
staffEntity = getDepartmentStaff(map,1);
|
||||
}else if(FlowApprovalRoleTypeEnums.TWO_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||
staffEntity = getDepartmentStaff(map,2);
|
||||
}else if(FlowApprovalRoleTypeEnums.THREE_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||
staffEntity = getDepartmentStaff(map,3);
|
||||
}else if(FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||
staffEntity = getDepartmentStaff(map,4);
|
||||
}else if(FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||
staffEntity = getDepartmentStaff(map,5);
|
||||
} else if (FlowApprovalRoleTypeEnums.ONE_SUPPER.getType().equals(flowApprovalRole.getType())) {
|
||||
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 1);
|
||||
} else if (FlowApprovalRoleTypeEnums.TWO_SUPPER.getType().equals(flowApprovalRole.getType())) {
|
||||
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 2);
|
||||
} else if (FlowApprovalRoleTypeEnums.THREE_SUPPER.getType().equals(flowApprovalRole.getType())) {
|
||||
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 3);
|
||||
} else if (FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())) {
|
||||
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 4);
|
||||
} else if (FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())) {
|
||||
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 5);
|
||||
}
|
||||
flowRecord.setApprovalStaffName(staffEntity.getName());
|
||||
flowRecord.setApprovalStaffId(staffEntity.getId());
|
||||
flowRecord.setFlowName(getFlow(flows,flowApprovalRole.getFlowId()).getOptDesc());
|
||||
flowRecord.setFlowName(getFlow(flows, flowApprovalRole.getFlowId()).getOptDesc());
|
||||
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||
flowRecord.setFlowId(flowApprovalRole.getFlowId());
|
||||
String staffRole = StaffRoles.getStaffRole(staffEntity.getId(), StringUtil.strToLongs(flowApprovalRole.getRoleId()));
|
||||
if(i == 0 ){
|
||||
if (i == 0) {
|
||||
flowRecord.setStatus(FlowRecordStatusEnums.CURRENT_FLOW_STATUS.getStatus());
|
||||
resultRecord.setFlowStaffIdRole(staffRole);
|
||||
FlowChart flowChart = flowService.selectFlowChartByChartId(flowRecord.getFlowId());
|
||||
resultRecord.setFlowProcess(flowChart.getFlowProcess());
|
||||
}else{
|
||||
} else {
|
||||
flowRecord.setStatus(FlowRecordStatusEnums.UN_TO_STATUS.getStatus());
|
||||
}
|
||||
flowRecord.setFlowStaffIdRole(staffRole);
|
||||
flowRecord.setFlowIndex(flowApprovalRole.getStepIndex());
|
||||
flowRecord.setType(flowApprovalRole.getStepType()); //步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)
|
||||
i ++;
|
||||
i++;
|
||||
flowRecords.add(flowRecord);
|
||||
}
|
||||
flowRecordService.insertFlowRecords(flowRecords);
|
||||
@ -849,7 +849,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private R transfer(ApprovalDto approvalDto) {
|
||||
return null;
|
||||
}
|
||||
@ -1000,21 +999,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public StaffEntity getDepartmentStaff(Map<String, String> map, int level) {
|
||||
for (int i = 1; i < 6; i++) {
|
||||
String deparment = map.get("dd" + i );
|
||||
if (StringUtil.isNotBlank(deparment)) {
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectDepartmentByDepartmentId(deparment);
|
||||
if (departmentsStaffRelateEntity != null) {
|
||||
StaffEntity staffEntity = staffService.selectStaffById(departmentsStaffRelateEntity.getStaffId());
|
||||
if (level == i) {
|
||||
return staffEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
public StaffEntity getDepartmentStaff(Long staffId, int level) {
|
||||
DepartManagers departManagers = staffService.findLeader( staffId, level);
|
||||
List<StaffEntity> staffEntities = departManagers.getManagers();
|
||||
if(CollectionUtils.isNotEmpty(staffEntities)){
|
||||
return staffEntities.get(0);
|
||||
}
|
||||
return new StaffEntity();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user