|
|
|
|
@ -400,49 +400,51 @@ public class BsEfficiencyTaskController extends BladeController { |
|
|
|
|
reportParam.setEmployeeNameExact(bsEfficiencyTask.getEmployeeNameExact()); |
|
|
|
|
reportParam.setYearMonth(bsEfficiencyTask.getYearMonth()); |
|
|
|
|
List<BsEfficiencyTaskReportVO> reports = bsEfficiencyTaskReportService.selectBsEfficiencyTaskReportList(reportParam); |
|
|
|
|
List<BsEfficiencyTaskParamEntity> firstParams = bsEfficiencyTaskParamService.list(new LambdaQueryWrapper<BsEfficiencyTaskParamEntity>().eq(BsEfficiencyTaskParamEntity::getReportId, reports.get(0).getId())); |
|
|
|
|
List<LinkedHashMap<String, Object>> tableColumnList = new ArrayList<>(); |
|
|
|
|
LinkedHashMap<String, String> headMap = new LinkedHashMap<>(); |
|
|
|
|
headMap.put(this.EMPLOYEE_CODE, "employeeCode"); |
|
|
|
|
headMap.put(this.EMPLOYEE_NAME, "employeeName"); |
|
|
|
|
int num = 1; |
|
|
|
|
for (BsEfficiencyTaskParamEntity param : firstParams) { |
|
|
|
|
headMap.put(param.getParamName(), "temp" + num); |
|
|
|
|
num++; |
|
|
|
|
} |
|
|
|
|
headMap.put(this.TOTAL_SCORE, "totalScore"); |
|
|
|
|
for (Map.Entry<String, String> entry : headMap.entrySet()) { |
|
|
|
|
LinkedHashMap<String, Object> tableColumn = new LinkedHashMap<>(); |
|
|
|
|
tableColumn.put("label", entry.getKey()); |
|
|
|
|
tableColumn.put("prop", entry.getValue()); |
|
|
|
|
tableColumnList.add(tableColumn); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> table = new HashMap<>(); |
|
|
|
|
table.put("tableColumn", tableColumnList); |
|
|
|
|
List<LinkedHashMap<String, Object>> tableDataList = new ArrayList(); |
|
|
|
|
for (BsEfficiencyTaskReportEntity report : reports) { |
|
|
|
|
List<BsEfficiencyTaskParamEntity> params = bsEfficiencyTaskParamService.list(new LambdaQueryWrapper<BsEfficiencyTaskParamEntity>().eq(BsEfficiencyTaskParamEntity::getReportId, report.getId())); |
|
|
|
|
LinkedHashMap<String, Object> tableData = new LinkedHashMap<>(); |
|
|
|
|
for (BsEfficiencyTaskParamEntity param : params) { |
|
|
|
|
for (Map.Entry<String, String> entry : headMap.entrySet()) { |
|
|
|
|
if (param.getParamName().equals(entry.getKey())) { |
|
|
|
|
tableData.put(entry.getValue(), param.getParamValue()); |
|
|
|
|
if (!CollectionUtils.isEmpty(reports)) { |
|
|
|
|
List<BsEfficiencyTaskParamEntity> firstParams = bsEfficiencyTaskParamService.list(new LambdaQueryWrapper<BsEfficiencyTaskParamEntity>().eq(BsEfficiencyTaskParamEntity::getReportId, reports.get(0).getId())); |
|
|
|
|
List<LinkedHashMap<String, Object>> tableColumnList = new ArrayList<>(); |
|
|
|
|
LinkedHashMap<String, String> headMap = new LinkedHashMap<>(); |
|
|
|
|
headMap.put(this.EMPLOYEE_CODE, "employeeCode"); |
|
|
|
|
headMap.put(this.EMPLOYEE_NAME, "employeeName"); |
|
|
|
|
int num = 1; |
|
|
|
|
for (BsEfficiencyTaskParamEntity param : firstParams) { |
|
|
|
|
headMap.put(param.getParamName(), "temp" + num); |
|
|
|
|
num++; |
|
|
|
|
} |
|
|
|
|
headMap.put(this.TOTAL_SCORE, "totalScore"); |
|
|
|
|
for (Map.Entry<String, String> entry : headMap.entrySet()) { |
|
|
|
|
LinkedHashMap<String, Object> tableColumn = new LinkedHashMap<>(); |
|
|
|
|
tableColumn.put("label", entry.getKey()); |
|
|
|
|
tableColumn.put("prop", entry.getValue()); |
|
|
|
|
tableColumnList.add(tableColumn); |
|
|
|
|
} |
|
|
|
|
Map<String, Object> table = new HashMap<>(); |
|
|
|
|
table.put("tableColumn", tableColumnList); |
|
|
|
|
List<LinkedHashMap<String, Object>> tableDataList = new ArrayList(); |
|
|
|
|
for (BsEfficiencyTaskReportEntity report : reports) { |
|
|
|
|
List<BsEfficiencyTaskParamEntity> params = bsEfficiencyTaskParamService.list(new LambdaQueryWrapper<BsEfficiencyTaskParamEntity>().eq(BsEfficiencyTaskParamEntity::getReportId, report.getId())); |
|
|
|
|
LinkedHashMap<String, Object> tableData = new LinkedHashMap<>(); |
|
|
|
|
for (BsEfficiencyTaskParamEntity param : params) { |
|
|
|
|
for (Map.Entry<String, String> entry : headMap.entrySet()) { |
|
|
|
|
if (param.getParamName().equals(entry.getKey())) { |
|
|
|
|
tableData.put(entry.getValue(), param.getParamValue()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
tableData.put(headMap.get(this.EMPLOYEE_CODE), report.getEmployeeCode()); |
|
|
|
|
tableData.put(headMap.get(this.EMPLOYEE_NAME), report.getEmployeeName()); |
|
|
|
|
tableData.put(headMap.get(this.TOTAL_SCORE), report.getTotalScore()); |
|
|
|
|
R<UserInfo> userInfoResult = userClient.userInfoByCode((String) tableData.get("employeeCode")); |
|
|
|
|
if (userInfoResult.getData() == null || userInfoResult.getData().getUser() == null || !userInfoResult.getData().getUser().getRealName().equals(tableData.get("employeeName"))) { |
|
|
|
|
tableData.put("isSysUser", "0"); |
|
|
|
|
} else { |
|
|
|
|
tableData.put("isSysUser", "1"); |
|
|
|
|
} |
|
|
|
|
tableDataList.add(tableData); |
|
|
|
|
} |
|
|
|
|
tableData.put(headMap.get(this.EMPLOYEE_CODE), report.getEmployeeCode()); |
|
|
|
|
tableData.put(headMap.get(this.EMPLOYEE_NAME), report.getEmployeeName()); |
|
|
|
|
tableData.put(headMap.get(this.TOTAL_SCORE), report.getTotalScore()); |
|
|
|
|
R<UserInfo> userInfoResult = userClient.userInfoByCode((String) tableData.get("employeeCode")); |
|
|
|
|
if (userInfoResult.getData() == null || userInfoResult.getData().getUser() == null || !userInfoResult.getData().getUser().getRealName().equals(tableData.get("employeeName"))) { |
|
|
|
|
tableData.put("isSysUser", "0"); |
|
|
|
|
} else { |
|
|
|
|
tableData.put("isSysUser", "1"); |
|
|
|
|
} |
|
|
|
|
tableDataList.add(tableData); |
|
|
|
|
table.put("tableDataList", tableDataList); |
|
|
|
|
task.setTable(table); |
|
|
|
|
} |
|
|
|
|
table.put("tableDataList", tableDataList); |
|
|
|
|
task.setTable(table); |
|
|
|
|
return R.data(task); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|