|
@@ -10,6 +10,7 @@ import com.ims.eval.entity.EvaluationDeptBusinessContent;
|
|
|
import com.ims.eval.entity.EvaluationDeptBusinessPlan;
|
|
|
import com.ims.eval.entity.custom.Path;
|
|
|
import com.ims.eval.entity.dto.request.DeptDTO;
|
|
|
+import com.ims.eval.entity.dto.request.EvaluationDeptBusinessPlanDTO;
|
|
|
import com.ims.eval.entity.dto.response.MyuserResDTO;
|
|
|
import com.ims.eval.entity.dto.result.R;
|
|
|
import com.ims.eval.feign.RemoteServiceBuilder;
|
|
@@ -322,6 +323,7 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
int startRows = 1;
|
|
|
//获取输入流
|
|
|
InputStream is = file.getInputStream();
|
|
|
+ EvaluationDeptBusinessPlan evaluationDeptBusinessPlan = evaluationDeptBusinessPlanService.getById(id);
|
|
|
List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = new ArrayList<>();
|
|
|
//Excel导入导出的单元类
|
|
|
List<String[]> strings = ExcelUtil.readData(fileType, startRows, true, is);
|
|
@@ -329,8 +331,13 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
for (String[] str : strings) {
|
|
|
EvaluationDeptBusinessContent evaluationDeptBusinessContent = new EvaluationDeptBusinessContent();
|
|
|
evaluationDeptBusinessContent.setBusinessPlanId(id);
|
|
|
- evaluationDeptBusinessContent.setDeptId(str[0]);
|
|
|
- evaluationDeptBusinessContent.setDeptName(str[1]);
|
|
|
+ if (null == evaluationDeptBusinessPlan.getDeptId() && null == evaluationDeptBusinessPlan.getDeptName()) {
|
|
|
+ evaluationDeptBusinessContent.setDeptId(str[0]);
|
|
|
+ evaluationDeptBusinessContent.setDeptName(str[1]);
|
|
|
+ } else {
|
|
|
+ evaluationDeptBusinessContent.setDeptId(evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ evaluationDeptBusinessContent.setDeptName(evaluationDeptBusinessPlan.getDeptName());
|
|
|
+ }
|
|
|
evaluationDeptBusinessContent.setSerialNumber(Integer.valueOf(str[2]));
|
|
|
evaluationDeptBusinessContent.setTargetName(str[3]);
|
|
|
evaluationDeptBusinessContent.setTargetValue(str[4]);
|
|
@@ -384,28 +391,98 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
@GetMapping(value = "/generateReport/{id}")
|
|
|
public R generateReport(@PathVariable("id") String id) throws Exception {
|
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
|
- EvaluationDeptBusinessPlan evaluationDeptBusinessPlan = evaluationDeptBusinessPlanService.getById(id);
|
|
|
List<DeptDTO> deptList = new ArrayList<>();
|
|
|
- DeptDTO dept = new DeptDTO();
|
|
|
- dept.setDeptId(evaluationDeptBusinessPlan.getDeptId());
|
|
|
- dept.setDeptName(evaluationDeptBusinessPlan.getDeptName());
|
|
|
- List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(id, evaluationDeptBusinessPlan.getDeptId());
|
|
|
- if (evaluationDeptBusinessContentList.size() > 0) {
|
|
|
- dept.setEvaluationDeptBusinessContent(evaluationDeptBusinessContentList.get(0));
|
|
|
- if (evaluationDeptBusinessContentList.size() > 1) {
|
|
|
- evaluationDeptBusinessContentList.remove(0);
|
|
|
- dept.setList(evaluationDeptBusinessContentList);
|
|
|
+ String fileName;
|
|
|
+ EvaluationDeptBusinessPlan evaluationDeptBusinessPlan = evaluationDeptBusinessPlanService.getById(id);
|
|
|
+ if (null == evaluationDeptBusinessPlan.getDeptId() && null == evaluationDeptBusinessPlan.getDeptName()) {
|
|
|
+ QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
|
|
|
+ qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
|
|
|
+ List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
|
|
|
+ for (EvaluationDept evaluationDept : evaluationDeptList) {
|
|
|
+ DeptDTO dept = new DeptDTO();
|
|
|
+ dept.setDeptId(evaluationDept.getDeptId());
|
|
|
+ dept.setDeptName(evaluationDept.getDeptName());
|
|
|
+ List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(id, evaluationDept.getDeptId());
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 0) {
|
|
|
+ dept.setEvaluationDeptBusinessContent(evaluationDeptBusinessContentList.get(0));
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 1) {
|
|
|
+ evaluationDeptBusinessContentList.remove(0);
|
|
|
+ dept.setList(evaluationDeptBusinessContentList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ deptList.add(dept);
|
|
|
}
|
|
|
+ fileName = evaluationDeptBusinessPlan.getAppraisalYear() + "年度经营业绩指标计划.doc";
|
|
|
+ } else {
|
|
|
+ DeptDTO dept = new DeptDTO();
|
|
|
+ dept.setDeptId(evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ dept.setDeptName(evaluationDeptBusinessPlan.getDeptName());
|
|
|
+ List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(id, evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 0) {
|
|
|
+ dept.setEvaluationDeptBusinessContent(evaluationDeptBusinessContentList.get(0));
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 1) {
|
|
|
+ evaluationDeptBusinessContentList.remove(0);
|
|
|
+ dept.setList(evaluationDeptBusinessContentList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ deptList.add(dept);
|
|
|
+ fileName = evaluationDeptBusinessPlan.getDeptName() + evaluationDeptBusinessPlan.getAppraisalYear() + "年度经营业绩指标计划.doc";
|
|
|
}
|
|
|
- deptList.add(dept);
|
|
|
dataMap.put("appraisalYear", evaluationDeptBusinessPlan.getAppraisalYear());
|
|
|
dataMap.put("list", deptList);
|
|
|
- String fileName = evaluationDeptBusinessPlan.getDeptName() + evaluationDeptBusinessPlan.getAppraisalYear() + "年度经营业绩指标计划.doc";
|
|
|
WordUtil.generateWord(dataMap, "template_dbkp_zbjh.ftl", Path.getStatementPath(), fileName);
|
|
|
return R.ok().data(fileName);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 统计汇总数据
|
|
|
+ *
|
|
|
+ * @param year 年度
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/statisticalSummary")
|
|
|
+ public R statisticalSummary(@RequestParam(value = "year") String year) {
|
|
|
+ List<EvaluationDeptBusinessPlanDTO> dtoList = new ArrayList<>();
|
|
|
+ List<EvaluationDeptBusinessPlan> evaluationDeptBusinessPlanList = evaluationDeptBusinessPlanService.selectEvaluationDeptBusinessPlanByYear(year);
|
|
|
+ if ("2023".equals(year)) {
|
|
|
+ QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
|
|
|
+ qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
|
|
|
+ List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
|
|
|
+ for (EvaluationDept evaluationDept : evaluationDeptList) {
|
|
|
+ if (evaluationDeptBusinessPlanList.size() > 0) {
|
|
|
+ List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(evaluationDeptBusinessPlanList.get(0).getId(), evaluationDept.getDeptId());
|
|
|
+ for (EvaluationDeptBusinessContent evaluationDeptBusinessContent : evaluationDeptBusinessContentList) {
|
|
|
+ EvaluationDeptBusinessPlanDTO dto = new EvaluationDeptBusinessPlanDTO();
|
|
|
+ dto.setDeptName(evaluationDept.getDeptName());
|
|
|
+ dto.setSerialNumber(evaluationDeptBusinessContent.getSerialNumber());
|
|
|
+ dto.setTargetName(evaluationDeptBusinessContent.getTargetName());
|
|
|
+ dto.setTargetValue(evaluationDeptBusinessContent.getTargetValue());
|
|
|
+ dto.setBaseScore(evaluationDeptBusinessContent.getBaseScore());
|
|
|
+ dto.setEvaluationCriteria(evaluationDeptBusinessContent.getEvaluationCriteria());
|
|
|
+ dtoList.add(dto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (EvaluationDeptBusinessPlan evaluationDeptBusinessPlan : evaluationDeptBusinessPlanList) {
|
|
|
+ List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(evaluationDeptBusinessPlan.getId(), evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ for (EvaluationDeptBusinessContent evaluationDeptBusinessContent : evaluationDeptBusinessContentList) {
|
|
|
+ EvaluationDeptBusinessPlanDTO dto = new EvaluationDeptBusinessPlanDTO();
|
|
|
+ dto.setDeptName(evaluationDeptBusinessPlan.getDeptName());
|
|
|
+ dto.setSerialNumber(evaluationDeptBusinessContent.getSerialNumber());
|
|
|
+ dto.setTargetName(evaluationDeptBusinessContent.getTargetName());
|
|
|
+ dto.setTargetValue(evaluationDeptBusinessContent.getTargetValue());
|
|
|
+ dto.setBaseScore(evaluationDeptBusinessContent.getBaseScore());
|
|
|
+ dto.setEvaluationCriteria(evaluationDeptBusinessContent.getEvaluationCriteria());
|
|
|
+ dtoList.add(dto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.ok().data(dtoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 生成汇总报表
|
|
|
*
|
|
|
* @return 结果
|
|
@@ -415,19 +492,42 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
|
List<EvaluationDeptBusinessPlan> evaluationDeptBusinessPlanList = evaluationDeptBusinessPlanService.selectEvaluationDeptBusinessPlanByYear(year);
|
|
|
List<DeptDTO> deptList = new ArrayList<>();
|
|
|
- for (EvaluationDeptBusinessPlan evaluationDeptBusinessPlan : evaluationDeptBusinessPlanList) {
|
|
|
- DeptDTO dept = new DeptDTO();
|
|
|
- dept.setDeptId(evaluationDeptBusinessPlan.getDeptId());
|
|
|
- dept.setDeptName(evaluationDeptBusinessPlan.getDeptName());
|
|
|
- List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(evaluationDeptBusinessPlan.getId(), evaluationDeptBusinessPlan.getDeptId());
|
|
|
- if (evaluationDeptBusinessContentList.size() > 0) {
|
|
|
- dept.setEvaluationDeptBusinessContent(evaluationDeptBusinessContentList.get(0));
|
|
|
- if (evaluationDeptBusinessContentList.size() > 1) {
|
|
|
- evaluationDeptBusinessContentList.remove(0);
|
|
|
- dept.setList(evaluationDeptBusinessContentList);
|
|
|
+ if ("2023".equals(year)) {
|
|
|
+ QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
|
|
|
+ qw.lambda().orderByAsc(EvaluationDept::getSerialNumber);
|
|
|
+ List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
|
|
|
+ for (EvaluationDept evaluationDept : evaluationDeptList) {
|
|
|
+ if (evaluationDeptBusinessPlanList.size() > 0) {
|
|
|
+ DeptDTO dept = new DeptDTO();
|
|
|
+ dept.setDeptId(evaluationDept.getDeptId());
|
|
|
+ dept.setDeptName(evaluationDept.getDeptName());
|
|
|
+ List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(evaluationDeptBusinessPlanList.get(0).getId(), evaluationDept.getDeptId());
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 0) {
|
|
|
+ dept.setEvaluationDeptBusinessContent(evaluationDeptBusinessContentList.get(0));
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 1) {
|
|
|
+ evaluationDeptBusinessContentList.remove(0);
|
|
|
+ dept.setList(evaluationDeptBusinessContentList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ deptList.add(dept);
|
|
|
}
|
|
|
}
|
|
|
- deptList.add(dept);
|
|
|
+ } else {
|
|
|
+ for (EvaluationDeptBusinessPlan evaluationDeptBusinessPlan : evaluationDeptBusinessPlanList) {
|
|
|
+ DeptDTO dept = new DeptDTO();
|
|
|
+ dept.setDeptId(evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ dept.setDeptName(evaluationDeptBusinessPlan.getDeptName());
|
|
|
+ List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(evaluationDeptBusinessPlan.getId(), evaluationDeptBusinessPlan.getDeptId());
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 0) {
|
|
|
+ dept.setEvaluationDeptBusinessContent(evaluationDeptBusinessContentList.get(0));
|
|
|
+ if (evaluationDeptBusinessContentList.size() > 1) {
|
|
|
+ evaluationDeptBusinessContentList.remove(0);
|
|
|
+ dept.setList(evaluationDeptBusinessContentList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ deptList.add(dept);
|
|
|
+ }
|
|
|
}
|
|
|
dataMap.put("appraisalYear", year);
|
|
|
dataMap.put("list", deptList);
|