|
@@ -13,6 +13,7 @@ import com.ims.eval.entity.DeptAssessmentDeclaration;
|
|
|
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;
|
|
@@ -33,6 +34,8 @@ import java.net.URLEncoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
* 绩效结果考核申报
|
|
@@ -67,7 +70,7 @@ public class DeptAssessmentDeclarationController {
|
|
|
* @param pageNum 当前记录起始索引
|
|
|
* @param pageSize 每页显示记录数
|
|
|
* @param orderNumber 单号
|
|
|
- * @param deptId 部门主键
|
|
|
+ * @param deptName 部门名称
|
|
|
* @param annual 年度
|
|
|
* @param declarationMonth 申报月份
|
|
|
* @return 结果
|
|
@@ -77,10 +80,10 @@ public class DeptAssessmentDeclarationController {
|
|
|
@RequestParam(value = "pageNum") Integer pageNum,
|
|
|
@RequestParam(value = "pageSize") Integer pageSize,
|
|
|
@RequestParam(value = "orderNumber", required = false) String orderNumber,
|
|
|
- @RequestParam(value = "deptId", required = false) String deptId,
|
|
|
+ @RequestParam(value = "deptName", required = false) String deptName,
|
|
|
@RequestParam(value = "annual", required = false) String annual,
|
|
|
@RequestParam(value = "declarationMonth", required = false) String declarationMonth) {
|
|
|
- IPage<DeptAssessmentDeclaration> list = deptAssessmentDeclarationService.listPage(pageNum, pageSize, orderNumber, deptId, annual, declarationMonth);
|
|
|
+ IPage<DeptAssessmentDeclaration> list = deptAssessmentDeclarationService.listPage(pageNum, pageSize, orderNumber, deptName, annual, declarationMonth);
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
@@ -230,15 +233,16 @@ public class DeptAssessmentDeclarationController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- * 详情-删除
|
|
|
+ * 详情-批量删除
|
|
|
*
|
|
|
- * @param id 主键
|
|
|
+ * @param ids 主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
- @GetMapping(value = "/delete/{id}")
|
|
|
- public R delete(@PathVariable String id) {
|
|
|
+ @GetMapping(value = "/delete/{ids}")
|
|
|
+ public R delete(@PathVariable String ids) {
|
|
|
try {
|
|
|
- boolean b = deptAssessmentDeclarationContentService.removeById(id);
|
|
|
+ String[] strings = ids.split(",");
|
|
|
+ boolean b = deptAssessmentDeclarationContentService.removeByIds(Arrays.asList(strings));
|
|
|
if (b) {
|
|
|
return R.ok().data(b);
|
|
|
} else {
|
|
@@ -275,17 +279,14 @@ public class DeptAssessmentDeclarationController {
|
|
|
DeptAssessmentDeclarationContent deptAssessmentDeclarationContent = new DeptAssessmentDeclarationContent();
|
|
|
deptAssessmentDeclarationContent.setAssessmentDeclarationId(id);
|
|
|
deptAssessmentDeclarationContent.setEmployeeNo(str[0]);
|
|
|
- DeptAssessmentDeclaration deptAssessmentDeclaration = deptAssessmentDeclarationService.getById(id);
|
|
|
- if (ObjectUtil.isNotNull(deptAssessmentDeclaration)) {
|
|
|
- JSONObject jsonArr = userService.pageList(1, 1000, deptAssessmentDeclaration.getDeptId(), "", "", "", "", "", request);
|
|
|
- JSONObject jsonArr1 = (JSONObject) jsonArr.get("data");
|
|
|
- JSONArray array = JSONUtil.parseArray(jsonArr1.get("records"));
|
|
|
- List<UserDTO> userList = JSONUtil.toList(array, UserDTO.class);
|
|
|
- UserDTO user = userList.stream().filter(item -> item.getNo().equals(str[0])).findFirst().orElse(null);
|
|
|
- if (ObjectUtil.isNotNull(user)) {
|
|
|
- deptAssessmentDeclarationContent.setEmployeeId(user.getId());
|
|
|
- deptAssessmentDeclarationContent.setEmployeeName(user.getName());
|
|
|
- }
|
|
|
+ JSONObject jsonArr = userService.pageList(1, 1000, "", "", "", "", "", "", request);
|
|
|
+ JSONObject jsonArr1 = (JSONObject) jsonArr.get("data");
|
|
|
+ JSONArray array = JSONUtil.parseArray(jsonArr1.get("records"));
|
|
|
+ List<UserDTO> userList = JSONUtil.toList(array, UserDTO.class);
|
|
|
+ UserDTO user = userList.stream().filter(item -> item.getNo().equals(str[0])).findFirst().orElse(null);
|
|
|
+ if (ObjectUtil.isNotNull(user)) {
|
|
|
+ deptAssessmentDeclarationContent.setEmployeeId(user.getId());
|
|
|
+ deptAssessmentDeclarationContent.setEmployeeName(user.getName());
|
|
|
}
|
|
|
deptAssessmentDeclarationContent.setSuggestedValue(str[2]);
|
|
|
deptAssessmentDeclarationContent.setSerialNumber(Convert.toInt(str[3]));
|
|
@@ -296,6 +297,9 @@ public class DeptAssessmentDeclarationController {
|
|
|
if (StringUtils.isNotEmpty(deptAssessmentDeclarationContent.getEmployeeNo())) {
|
|
|
qw.lambda().like(DeptAssessmentDeclarationContent::getEmployeeNo, deptAssessmentDeclarationContent.getEmployeeNo());
|
|
|
}
|
|
|
+ if (StringUtils.isNotEmpty(deptAssessmentDeclarationContent.getEmployeeId())) {
|
|
|
+ qw.lambda().like(DeptAssessmentDeclarationContent::getEmployeeId, deptAssessmentDeclarationContent.getEmployeeId());
|
|
|
+ }
|
|
|
List<DeptAssessmentDeclarationContent> objList = deptAssessmentDeclarationContentService.list(qw);
|
|
|
if (objList.size() == 1) {
|
|
|
deptAssessmentDeclarationContent.setId(objList.get(0).getId());
|
|
@@ -380,6 +384,93 @@ public class DeptAssessmentDeclarationController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ * 统计汇总数据
|
|
|
+ *
|
|
|
+ * @param annual 年度
|
|
|
+ * @param month 月份
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/statisticalSummary/{annual}/{month}")
|
|
|
+ public R statisticalSummary(@PathVariable("annual") String annual, @PathVariable("month") String month) {
|
|
|
+ List<SummaryInformationDTO> summaryInformationDTOList = new ArrayList<>();
|
|
|
+ QueryWrapper<DeptAssessmentDeclaration> qw = new QueryWrapper<>();
|
|
|
+ if (StringUtils.isNotEmpty(annual)) {
|
|
|
+ qw.lambda().like(DeptAssessmentDeclaration::getAnnual, annual);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(month)) {
|
|
|
+ qw.lambda().like(DeptAssessmentDeclaration::getDeclarationMonth, month);
|
|
|
+ }
|
|
|
+ List<DeptAssessmentDeclaration> deptAssessmentDeclarationList = deptAssessmentDeclarationService.list(qw);
|
|
|
+ for (DeptAssessmentDeclaration deptAssessmentDeclaration : deptAssessmentDeclarationList) {
|
|
|
+ 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());
|
|
|
+ summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<SummaryInformationDTO> list = new ArrayList<>();
|
|
|
+ Map<String, List<SummaryInformationDTO>> map = summaryInformationDTOList.stream().collect(Collectors.groupingBy(SummaryInformationDTO::getEmployeeNo));
|
|
|
+ map.forEach((key, value) -> {
|
|
|
+ for (SummaryInformationDTO summaryInformationDTO : value) {
|
|
|
+ summaryInformationDTO.setDeclarationsNumber(String.valueOf(value.size()));
|
|
|
+ }
|
|
|
+ list.addAll(value);
|
|
|
+ });
|
|
|
+ return R.ok().data(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 生成统计汇总报表
|
|
|
+ *
|
|
|
+ * @param annual 年度
|
|
|
+ * @param month 月份
|
|
|
+ * @param response response
|
|
|
+ * @throws Exception 异常
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/generateStatisticalSummaryReports/{annual}/{month}")
|
|
|
+ public void generateStatisticalSummaryReports(@PathVariable("annual") String annual, @PathVariable("month") String month, 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<>();
|
|
|
+ QueryWrapper<DeptAssessmentDeclaration> qw = new QueryWrapper<>();
|
|
|
+ if (StringUtils.isNotEmpty(annual)) {
|
|
|
+ qw.lambda().like(DeptAssessmentDeclaration::getAnnual, annual);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(month)) {
|
|
|
+ qw.lambda().like(DeptAssessmentDeclaration::getDeclarationMonth, month);
|
|
|
+ }
|
|
|
+ List<DeptAssessmentDeclaration> deptAssessmentDeclarationList = deptAssessmentDeclarationService.list(qw);
|
|
|
+ for (DeptAssessmentDeclaration deptAssessmentDeclaration : deptAssessmentDeclarationList) {
|
|
|
+ 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());
|
|
|
+ summaryInformationDTOList.add(summaryInformationDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<SummaryInformationDTO> list = new ArrayList<>();
|
|
|
+ Map<String, List<SummaryInformationDTO>> map = summaryInformationDTOList.stream().collect(Collectors.groupingBy(SummaryInformationDTO::getEmployeeNo));
|
|
|
+ map.forEach((key, value) -> {
|
|
|
+ for (SummaryInformationDTO summaryInformationDTO : value) {
|
|
|
+ summaryInformationDTO.setDeclarationsNumber(String.valueOf(value.size()));
|
|
|
+ }
|
|
|
+ list.addAll(value);
|
|
|
+ });
|
|
|
+ ExcelUtils.createCollectExcel(list, annual, month, response.getOutputStream());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
* 参与考核人数
|
|
|
*
|
|
|
* @param id 主键
|