Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-10-27 12:07:28 +08:00
commit 056020f0fc
3 changed files with 48 additions and 37 deletions

View File

@ -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;
}
}

View File

@ -0,0 +1,8 @@
package com.lz.modules.app.dto;
import lombok.Data;
@Data
public class RecordListDto {
private Long loginUserId;
}

View File

@ -68,6 +68,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
private ResultRecordMapper resultRecordMapper;
private static EmployeesDto employeesDto;
@Autowired
@ -765,8 +767,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
List<FlowApprovalRole> flowApprovalRoles =flowApprovalRoleService.selectFlowApprovalRoleList(flowIds);
int i = 0;
DepartmentsStaffRelateEntity relateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(resultRecord.getStaffId());
Map<String, String> map = departmentsService.selectUserAllDepartmentInFo(relateEntity.getDepartmentId());
List<FlowRecord> flowRecords = new ArrayList<>();
for (FlowApprovalRole flowApprovalRole : flowApprovalRoles) {
FlowRecord flowRecord = new FlowRecord();
@ -777,15 +777,15 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
} 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);
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 1);
} else if (FlowApprovalRoleTypeEnums.TWO_SUPPER.getType().equals(flowApprovalRole.getType())) {
staffEntity = getDepartmentStaff(map,2);
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 2);
} else if (FlowApprovalRoleTypeEnums.THREE_SUPPER.getType().equals(flowApprovalRole.getType())) {
staffEntity = getDepartmentStaff(map,3);
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 3);
} else if (FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())) {
staffEntity = getDepartmentStaff(map,4);
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 4);
} else if (FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())) {
staffEntity = getDepartmentStaff(map,5);
staffEntity = getDepartmentStaff(resultRecord.getStaffId(), 5);
}
flowRecord.setApprovalStaffName(staffEntity.getName());
flowRecord.setApprovalStaffId(staffEntity.getId());
@ -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();