|
@@ -10,16 +10,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.ims.common.utils.StringUtils;
|
|
|
import com.ims.eval.config.CustomException;
|
|
|
import com.ims.eval.entity.DeptAssessmentDeclaration;
|
|
|
+import com.ims.eval.entity.DeptAssessmentDeclarationComplete;
|
|
|
import com.ims.eval.entity.DeptAssessmentDeclarationContent;
|
|
|
import com.ims.eval.entity.EvaluationDept;
|
|
|
import com.ims.eval.entity.dto.request.EmployeeDTO;
|
|
|
import com.ims.eval.entity.dto.request.SummaryInformationDTO;
|
|
|
import com.ims.eval.entity.dto.request.UserDTO;
|
|
|
import com.ims.eval.entity.dto.result.R;
|
|
|
-import com.ims.eval.service.IDeptAssessmentDeclarationContentService;
|
|
|
-import com.ims.eval.service.IDeptAssessmentDeclarationService;
|
|
|
-import com.ims.eval.service.IEvaluationDeptService;
|
|
|
-import com.ims.eval.service.IUserService;
|
|
|
+import com.ims.eval.service.*;
|
|
|
import com.ims.eval.util.ExcelUtil;
|
|
|
import com.ims.eval.util.ExcelUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -53,6 +51,9 @@ public class DeptAssessmentDeclarationController {
|
|
|
private IDeptAssessmentDeclarationContentService deptAssessmentDeclarationContentService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private IDeptAssessmentDeclarationCompleteService deptAssessmentDeclarationCompleteService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private IEvaluationDeptService evaluationDeptService;
|
|
|
|
|
|
@Autowired
|
|
@@ -206,18 +207,22 @@ public class DeptAssessmentDeclarationController {
|
|
|
*/
|
|
|
@GetMapping(value = "/details/{id}")
|
|
|
public R details(@PathVariable("id") String id) {
|
|
|
- List<DeptAssessmentDeclarationContent> list = deptAssessmentDeclarationContentService.detailsList(id);
|
|
|
- return R.ok().data(list);
|
|
|
+ Map<String, List<Object>> map = new HashMap<>();
|
|
|
+ List<DeptAssessmentDeclarationContent> contentList = deptAssessmentDeclarationContentService.detailsList(id);
|
|
|
+ map.put("ygydkhxs", Collections.singletonList(contentList));
|
|
|
+ List<DeptAssessmentDeclarationComplete> completeList = deptAssessmentDeclarationCompleteService.detailsList(id);
|
|
|
+ map.put("byzygzwcqk", Collections.singletonList(completeList));
|
|
|
+ return R.ok().data(map);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 详情-修改/新增
|
|
|
+ * 左侧详情-修改/新增
|
|
|
*
|
|
|
* @param deptAssessmentDeclarationContentList 修改内容
|
|
|
* @return 结果
|
|
|
*/
|
|
|
- @PostMapping(value = "/update")
|
|
|
- public R update(@RequestBody List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList) {
|
|
|
+ @PostMapping(value = "/updateContent")
|
|
|
+ public R updateContent(@RequestBody List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList) {
|
|
|
try {
|
|
|
boolean b = deptAssessmentDeclarationContentService.saveOrUpdateBatch(deptAssessmentDeclarationContentList);
|
|
|
if (b) {
|
|
@@ -231,13 +236,33 @@ public class DeptAssessmentDeclarationController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 详情-批量删除
|
|
|
+ * 右侧详情-修改/新增
|
|
|
+ *
|
|
|
+ * @param deptAssessmentDeclarationCompleteList 修改内容
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/updateComplete")
|
|
|
+ public R updateComplete(@RequestBody List<DeptAssessmentDeclarationComplete> deptAssessmentDeclarationCompleteList) {
|
|
|
+ try {
|
|
|
+ boolean b = deptAssessmentDeclarationCompleteService.saveOrUpdateBatch(deptAssessmentDeclarationCompleteList);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error("新增/修改失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e) {
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 左侧详情-批量删除
|
|
|
*
|
|
|
* @param ids 主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
- @GetMapping(value = "/delete/{ids}")
|
|
|
- public R delete(@PathVariable String ids) {
|
|
|
+ @GetMapping(value = "/deleteContent/{ids}")
|
|
|
+ public R deleteContent(@PathVariable String ids) {
|
|
|
try {
|
|
|
String[] strings = ids.split(",");
|
|
|
boolean b = deptAssessmentDeclarationContentService.removeByIds(Arrays.asList(strings));
|
|
@@ -252,6 +277,27 @@ public class DeptAssessmentDeclarationController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 右侧详情-批量删除
|
|
|
+ *
|
|
|
+ * @param ids 主键
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/deleteComplete/{ids}")
|
|
|
+ public R deleteComplete(@PathVariable String ids) {
|
|
|
+ try {
|
|
|
+ String[] strings = ids.split(",");
|
|
|
+ boolean b = deptAssessmentDeclarationCompleteService.removeByIds(Arrays.asList(strings));
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error("删除失败!");
|
|
|
+ }
|
|
|
+ } catch (CustomException e) {
|
|
|
+ return R.customError(e.getMessage()).data("失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 导入
|
|
|
*
|
|
|
* @param file 文件
|
|
@@ -387,18 +433,32 @@ public class DeptAssessmentDeclarationController {
|
|
|
/**
|
|
|
* 统计汇总数据
|
|
|
*
|
|
|
- * @param annual 年度
|
|
|
- * @param month 月份
|
|
|
+ * @param startTime 开始时间
|
|
|
+ * @param endTime 结束时间
|
|
|
+ * @param deptId 部门主键
|
|
|
+ * @param employeeId 人员主键
|
|
|
*/
|
|
|
- @GetMapping(value = "/statisticalSummary/{annual}/{month}")
|
|
|
- public R statisticalSummary(@PathVariable("annual") Integer annual, @PathVariable("month") Integer month) {
|
|
|
+ @GetMapping(value = "/statisticalSummary")
|
|
|
+ public R statisticalSummary(@RequestParam(value = "startTime") String startTime,
|
|
|
+ @RequestParam(value = "endTime") String endTime,
|
|
|
+ @RequestParam(value = "deptId") String deptId,
|
|
|
+ @RequestParam(value = "employeeId") String employeeId) {
|
|
|
List<SummaryInformationDTO> summaryInformationDTOList = new ArrayList<>();
|
|
|
+ String[] startTimeArr = new String[2];
|
|
|
+ String[] endTimeArr = new String[2];
|
|
|
+ if (startTime.length() > 0) {
|
|
|
+ startTimeArr = startTime.split("-");
|
|
|
+ }
|
|
|
+ if (endTime.length() > 0) {
|
|
|
+ endTimeArr = endTime.split("-");
|
|
|
+ }
|
|
|
QueryWrapper<DeptAssessmentDeclaration> qw = new QueryWrapper<>();
|
|
|
- if (null != annual) {
|
|
|
- qw.lambda().eq(DeptAssessmentDeclaration::getAnnual, annual);
|
|
|
+ if (StringUtils.isNotEmpty(startTimeArr) && StringUtils.isNotEmpty(endTimeArr)) {
|
|
|
+ qw.lambda().between(DeptAssessmentDeclaration::getAnnual, Integer.parseInt(startTimeArr[0]), Integer.parseInt(endTimeArr[0]));
|
|
|
+ qw.lambda().between(DeptAssessmentDeclaration::getDeclarationMonth, Integer.parseInt(startTimeArr[1]), Integer.parseInt(endTimeArr[1]));
|
|
|
}
|
|
|
- if (null != month) {
|
|
|
- qw.lambda().eq(DeptAssessmentDeclaration::getDeclarationMonth, month);
|
|
|
+ if (StringUtils.isNotEmpty(deptId)) {
|
|
|
+ qw.lambda().eq(DeptAssessmentDeclaration::getDeptId, deptId);
|
|
|
}
|
|
|
List<DeptAssessmentDeclaration> deptAssessmentDeclarationList = deptAssessmentDeclarationService.list(qw);
|
|
|
for (DeptAssessmentDeclaration deptAssessmentDeclaration : deptAssessmentDeclarationList) {
|
|
@@ -409,16 +469,31 @@ public class DeptAssessmentDeclarationController {
|
|
|
EvaluationDept evaluationDept = evaluationDeptService.getOne(qwDept);
|
|
|
List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList = deptAssessmentDeclarationContentService.detailsList(deptAssessmentDeclaration.getId());
|
|
|
for (DeptAssessmentDeclarationContent deptAssessmentDeclarationContent : deptAssessmentDeclarationContentList) {
|
|
|
- SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
|
|
|
- summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
|
|
|
- summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
|
|
|
- summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
|
|
|
- summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
|
|
|
- summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
|
|
|
- if (null != evaluationDept) {
|
|
|
- summaryInformationDTO.setSerialNumber(evaluationDept.getSerialNumber());
|
|
|
+ if (StringUtils.isNotEmpty(employeeId)) {
|
|
|
+ if (employeeId.equals(deptAssessmentDeclarationContent.getEmployeeId())) {
|
|
|
+ SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
|
|
|
+ summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
|
|
|
+ summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
|
|
|
+ summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
|
|
|
+ summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
|
|
|
+ summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
|
|
|
+ if (null != evaluationDept) {
|
|
|
+ summaryInformationDTO.setSerialNumber(evaluationDept.getSerialNumber());
|
|
|
+ }
|
|
|
+ summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
|
|
|
+ summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
|
|
|
+ summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
|
|
|
+ summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
|
|
|
+ summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
|
|
|
+ summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
|
|
|
+ if (null != evaluationDept) {
|
|
|
+ summaryInformationDTO.setSerialNumber(evaluationDept.getSerialNumber());
|
|
|
+ }
|
|
|
+ summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
}
|
|
|
- summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
}
|
|
|
}
|
|
|
List<SummaryInformationDTO> list = new ArrayList<>();
|
|
@@ -436,25 +511,40 @@ public class DeptAssessmentDeclarationController {
|
|
|
/**
|
|
|
* 生成统计汇总报表
|
|
|
*
|
|
|
- * @param annual 年度
|
|
|
- * @param month 月份
|
|
|
- * @param response response
|
|
|
+ * @param startTime 开始时间
|
|
|
+ * @param endTime 结束时间
|
|
|
+ * @param deptId 部门主键
|
|
|
+ * @param employeeId 人员主键
|
|
|
+ * @param response response
|
|
|
* @throws Exception 异常
|
|
|
*/
|
|
|
- @GetMapping(value = "/generateStatisticalSummaryReports/{annual}/{month}")
|
|
|
- public void generateStatisticalSummaryReports(@PathVariable("annual") Integer annual, @PathVariable("month") Integer month, HttpServletResponse response) throws Exception {
|
|
|
+ @GetMapping(value = "/generateStatisticalSummaryReports")
|
|
|
+ public void generateStatisticalSummaryReports(@RequestParam(value = "startTime") String startTime,
|
|
|
+ @RequestParam(value = "endTime") String endTime,
|
|
|
+ @RequestParam(value = "deptId") String deptId,
|
|
|
+ @RequestParam(value = "employeeId") String employeeId,
|
|
|
+ HttpServletResponse response) throws Exception {
|
|
|
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
response.setHeader("Content-disposition", "attachment; filename=".concat(URLEncoder.encode("绩效结果考核申报汇总表.xlsx", "UTF-8")));
|
|
|
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
|
response.setHeader("Pragma", "no-cache");
|
|
|
response.setDateHeader("Expires", 0);
|
|
|
List<SummaryInformationDTO> summaryInformationDTOList = new ArrayList<>();
|
|
|
+ String[] startTimeArr = new String[2];
|
|
|
+ String[] endTimeArr = new String[2];
|
|
|
+ if (startTime.length() > 0) {
|
|
|
+ startTimeArr = startTime.split("-");
|
|
|
+ }
|
|
|
+ if (endTime.length() > 0) {
|
|
|
+ endTimeArr = endTime.split("-");
|
|
|
+ }
|
|
|
QueryWrapper<DeptAssessmentDeclaration> qw = new QueryWrapper<>();
|
|
|
- if (null != annual) {
|
|
|
- qw.lambda().eq(DeptAssessmentDeclaration::getAnnual, annual);
|
|
|
+ if (StringUtils.isNotEmpty(startTimeArr) && StringUtils.isNotEmpty(endTimeArr)) {
|
|
|
+ qw.lambda().between(DeptAssessmentDeclaration::getAnnual, Integer.parseInt(startTimeArr[0]), Integer.parseInt(endTimeArr[0]));
|
|
|
+ qw.lambda().between(DeptAssessmentDeclaration::getDeclarationMonth, Integer.parseInt(startTimeArr[1]), Integer.parseInt(endTimeArr[1]));
|
|
|
}
|
|
|
- if (null != month) {
|
|
|
- qw.lambda().eq(DeptAssessmentDeclaration::getDeclarationMonth, month);
|
|
|
+ if (StringUtils.isNotEmpty(deptId)) {
|
|
|
+ qw.lambda().eq(DeptAssessmentDeclaration::getDeptId, deptId);
|
|
|
}
|
|
|
List<DeptAssessmentDeclaration> deptAssessmentDeclarationList = deptAssessmentDeclarationService.list(qw);
|
|
|
for (DeptAssessmentDeclaration deptAssessmentDeclaration : deptAssessmentDeclarationList) {
|
|
@@ -465,16 +555,31 @@ public class DeptAssessmentDeclarationController {
|
|
|
EvaluationDept evaluationDept = evaluationDeptService.getOne(qwDept);
|
|
|
List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList = deptAssessmentDeclarationContentService.detailsList(deptAssessmentDeclaration.getId());
|
|
|
for (DeptAssessmentDeclarationContent deptAssessmentDeclarationContent : deptAssessmentDeclarationContentList) {
|
|
|
- SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
|
|
|
- summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
|
|
|
- summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
|
|
|
- summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
|
|
|
- summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
|
|
|
- summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
|
|
|
- if (null != evaluationDept) {
|
|
|
- summaryInformationDTO.setSerialNumber(evaluationDept.getSerialNumber());
|
|
|
+ if (StringUtils.isNotEmpty(employeeId)) {
|
|
|
+ if (employeeId.equals(deptAssessmentDeclarationContent.getEmployeeId())) {
|
|
|
+ SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
|
|
|
+ summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
|
|
|
+ summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
|
|
|
+ summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
|
|
|
+ summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
|
|
|
+ summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
|
|
|
+ if (null != evaluationDept) {
|
|
|
+ summaryInformationDTO.setSerialNumber(evaluationDept.getSerialNumber());
|
|
|
+ }
|
|
|
+ summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ SummaryInformationDTO summaryInformationDTO = new SummaryInformationDTO();
|
|
|
+ summaryInformationDTO.setEmployeeNo(deptAssessmentDeclarationContent.getEmployeeNo());
|
|
|
+ summaryInformationDTO.setEmployeeName(deptAssessmentDeclarationContent.getEmployeeName());
|
|
|
+ summaryInformationDTO.setSuggestedValue(deptAssessmentDeclarationContent.getSuggestedValue());
|
|
|
+ summaryInformationDTO.setReportingDepartment(deptAssessmentDeclaration.getDeptName());
|
|
|
+ summaryInformationDTO.setDeclarationLevel(deptAssessmentDeclaration.getRatingGrade());
|
|
|
+ if (null != evaluationDept) {
|
|
|
+ summaryInformationDTO.setSerialNumber(evaluationDept.getSerialNumber());
|
|
|
+ }
|
|
|
+ summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
}
|
|
|
- summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
}
|
|
|
}
|
|
|
List<SummaryInformationDTO> list = new ArrayList<>();
|
|
@@ -486,7 +591,7 @@ public class DeptAssessmentDeclarationController {
|
|
|
list.addAll(value);
|
|
|
});
|
|
|
list.sort(Comparator.comparing(SummaryInformationDTO::getSerialNumber, Comparator.nullsLast(Integer::compareTo)));
|
|
|
- ExcelUtils.createCollectExcel(list, annual, month, response.getOutputStream());
|
|
|
+ ExcelUtils.createCollectExcel(list, startTimeArr[0], startTimeArr[1], endTimeArr[0], endTimeArr[1], response.getOutputStream());
|
|
|
}
|
|
|
|
|
|
/**
|