Prechádzať zdrojové kódy

业绩指标计划、业绩指标考评新需求修改

hlf 1 rok pred
rodič
commit
751608a84f

+ 53 - 12
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentalPerformanceIndicatorAssessmentController.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.common.utils.StringUtils;
 import com.ims.eval.config.CustomException;
-import com.ims.eval.entity.EvaluationDept;
 import com.ims.eval.entity.EvaluationDeptBusinessAssessment;
 import com.ims.eval.entity.EvaluationDeptBusinessContent;
 import com.ims.eval.entity.custom.Path;
@@ -98,21 +97,63 @@ public class DepartmentalPerformanceIndicatorAssessmentController {
 		Map<String, Object> dataMap = new HashMap<>();
 		EvaluationDeptBusinessAssessment evaluationDeptBusinessAssessment = evaluationDeptBusinessAssessmentService.getById(id);
 		List<DeptDTO> deptList = new ArrayList<>();
-		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(evaluationDeptBusinessAssessment.getDeptId());
+		dept.setDeptName(evaluationDeptBusinessAssessment.getDeptName());
+		List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(id, evaluationDeptBusinessAssessment.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", evaluationDeptBusinessAssessment.getAppraisalYear());
+		dataMap.put("list", deptList);
+		String fileName = evaluationDeptBusinessAssessment.getDeptName() + evaluationDeptBusinessAssessment.getAppraisalYear() + "年度经营业绩完成情况.doc";
+		WordUtil.generateWord(dataMap, "template_dbkp_wcqk.ftl", Path.getStatementPath(), fileName);
+		return R.ok().data(fileName);
+	}
+
+	/**
+	 * 统计汇总数据
+	 *
+	 * @param year 年度
+	 */
+	@GetMapping(value = "/statisticalSummary")
+	public R statisticalSummary(@RequestParam(value = "year") String year) {
+
+		return R.ok().data(true);
+	}
+
+	/**
+	 * 生成汇总报表
+	 *
+	 * @return 结果
+	 */
+	@GetMapping(value = "/summaryReport/{year}")
+	public R summaryReport(@PathVariable("year") String year) throws Exception {
+		Map<String, Object> dataMap = new HashMap<>();
+		List<EvaluationDeptBusinessAssessment> evaluationDeptBusinessAssessmentList = evaluationDeptBusinessAssessmentService.selectEvaluationDeptBusinessAssessmentByYear(year);
+		List<DeptDTO> deptList = new ArrayList<>();
+		for (EvaluationDeptBusinessAssessment evaluationDeptBusinessAssessment : evaluationDeptBusinessAssessmentList) {
 			DeptDTO dept = new DeptDTO();
-			dept.setDeptId(evaluationDept.getDeptId());
-			dept.setDeptName(evaluationDept.getDeptName());
-			List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(id, evaluationDept.getDeptId());
-			dept.setList(evaluationDeptBusinessContentList);
+			dept.setDeptId(evaluationDeptBusinessAssessment.getDeptId());
+			dept.setDeptName(evaluationDeptBusinessAssessment.getDeptName());
+			List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(evaluationDeptBusinessAssessment.getId(), evaluationDeptBusinessAssessment.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", evaluationDeptBusinessAssessment.getAppraisalYear());
+		dataMap.put("appraisalYear", year);
 		dataMap.put("list", deptList);
-		String fileName = evaluationDeptBusinessAssessment.getAppraisalYear() + "年度经营业绩完成情况.doc";
+		String fileName = year + "年度经营业绩完成情况.doc";
 		WordUtil.generateWord(dataMap, "template_dbkp_wcqk.ftl", Path.getStatementPath(), fileName);
 		return R.ok().data(fileName);
 	}

+ 43 - 22
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DepartmentalPerformanceIndicatorPlanController.java

@@ -1,6 +1,5 @@
 package com.ims.eval.controller;
 
-import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -100,13 +99,14 @@ public class DepartmentalPerformanceIndicatorPlanController {
 	@PostMapping(value = "/save")
 	public R addAll(@RequestBody EvaluationDeptBusinessPlan evaluationDeptBusinessPlan) {
 		try {
-			QueryWrapper<EvaluationDeptBusinessPlan> qw = new QueryWrapper<>();
-			if (StringUtils.isNotEmpty(evaluationDeptBusinessPlan.getAppraisalYear())) {
-				qw.lambda().eq(EvaluationDeptBusinessPlan::getAppraisalYear, evaluationDeptBusinessPlan.getAppraisalYear());
-			}
-			EvaluationDeptBusinessPlan businessPlan = evaluationDeptBusinessPlanService.getOne(qw);
-			if (ObjectUtil.isNotNull(businessPlan)) {
-				return R.error(evaluationDeptBusinessPlan.getAppraisalYear() + "年度业绩指标计划已存在!");
+			QueryWrapper<EvaluationDeptBusinessPlan> qw1 = new QueryWrapper<>();
+			qw1.lambda().eq(EvaluationDeptBusinessPlan::getAppraisalYear, evaluationDeptBusinessPlan.getAppraisalYear());
+			int x = evaluationDeptBusinessPlanService.count(qw1);
+			QueryWrapper<EvaluationDept> qw2 = new QueryWrapper<>();
+			qw2.lambda().eq(EvaluationDept::getYjzbjhType, "1");
+			int count = evaluationDeptService.count(qw2);
+			if (x >= count) {
+				return R.error(evaluationDeptBusinessPlan.getAppraisalYear() + "年度业绩指标已下达完成!");
 			}
 			boolean b = evaluationDeptBusinessPlanService.save(evaluationDeptBusinessPlan);
 			if (b) {
@@ -286,17 +286,13 @@ public class DepartmentalPerformanceIndicatorPlanController {
 				dept.setDeptName(evaluationDept.getDeptName());
 				deptList.add(dept);
 			} else {
-
 				String code = request.getHeader("code");
 				JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
 				MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
-
 				user.getDeptOrg().getType();
-
 				if ("150".equals(user.getDeptOrg().getType())) {
 					deptId = user.getDeptOrg().getParentId();
 				}
-
 				if (deptId.equals(evaluationDept.getDeptId())) {
 					DeptDTO dept = new DeptDTO();
 					dept.setDeptId(evaluationDept.getDeptId());
@@ -390,15 +386,40 @@ public class DepartmentalPerformanceIndicatorPlanController {
 		Map<String, Object> dataMap = new HashMap<>();
 		EvaluationDeptBusinessPlan evaluationDeptBusinessPlan = evaluationDeptBusinessPlanService.getById(id);
 		List<DeptDTO> deptList = new ArrayList<>();
-		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(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);
+		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);
+	}
+
+	/**
+	 * 生成汇总报表
+	 *
+	 * @return 结果
+	 */
+	@GetMapping(value = "/summaryReport/{year}")
+	public R summaryReport(@PathVariable("year") String year) throws Exception {
+		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(evaluationDept.getDeptId());
-			dept.setDeptName(evaluationDept.getDeptName());
-			List<EvaluationDeptBusinessContent> evaluationDeptBusinessContentList = evaluationDeptBusinessContentService.selectEvaluationDeptBusinessContentListByBusinessPlanId(id, evaluationDept.getDeptId());
+			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) {
@@ -408,9 +429,9 @@ public class DepartmentalPerformanceIndicatorPlanController {
 			}
 			deptList.add(dept);
 		}
-		dataMap.put("appraisalYear", evaluationDeptBusinessPlan.getAppraisalYear());
+		dataMap.put("appraisalYear", year);
 		dataMap.put("list", deptList);
-		String fileName = evaluationDeptBusinessPlan.getAppraisalYear() + "年度经营业绩指标计划.doc";
+		String fileName = year + "年度经营业绩指标计划.doc";
 		WordUtil.generateWord(dataMap, "template_dbkp_zbjh.ftl", Path.getStatementPath(), fileName);
 		return R.ok().data(fileName);
 	}

+ 9 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/dao/EvaluationDeptBusinessAssessmentMapper.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ims.eval.entity.EvaluationDeptBusinessAssessment;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @author hlf
  * @date 2023/5/6 17:11
@@ -13,6 +15,12 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface EvaluationDeptBusinessAssessmentMapper extends BaseMapper<EvaluationDeptBusinessAssessment> {
 
-	IPage<EvaluationDeptBusinessAssessment> selectListPage(Page<EvaluationDeptBusinessAssessment> page, @Param("responsibilityCode") String responsibilityCode, @Param("des") String des, @Param("appraisalYear") String appraisalYear, @Param("stage") String stage);
+	IPage<EvaluationDeptBusinessAssessment> selectListPage(Page<EvaluationDeptBusinessAssessment> page,
+														   @Param("deptId") String deptId,
+														   @Param("responsibilityCode") String responsibilityCode,
+														   @Param("des") String des,
+														   @Param("appraisalYear") String appraisalYear,
+														   @Param("stage") String stage);
 
+    List<EvaluationDeptBusinessAssessment> selectEvaluationDeptBusinessAssessmentByYear(String year);
 }

+ 9 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/dao/EvaluationDeptBusinessPlanMapper.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ims.eval.entity.EvaluationDeptBusinessPlan;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * @author hlf
  * @date 2023/4/27 10:34
@@ -13,6 +15,12 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface EvaluationDeptBusinessPlanMapper extends BaseMapper<EvaluationDeptBusinessPlan> {
 
-	IPage<EvaluationDeptBusinessPlan> selectListPage(Page<EvaluationDeptBusinessPlan> page, @Param("responsibilityCode") String responsibilityCode, @Param("des") String des, @Param("appraisalYear") String appraisalYear, @Param("stage") String stage);
+	IPage<EvaluationDeptBusinessPlan> selectListPage(Page<EvaluationDeptBusinessPlan> page,
+													 @Param("deptId") String deptId,
+													 @Param("responsibilityCode") String responsibilityCode,
+													 @Param("des") String des,
+													 @Param("appraisalYear") String appraisalYear,
+													 @Param("stage") String stage);
 
+	List<EvaluationDeptBusinessPlan> selectEvaluationDeptBusinessPlanByYear(String year);
 }

+ 9 - 30
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluationDeptBusinessAssessment.java

@@ -58,36 +58,6 @@ public class EvaluationDeptBusinessAssessment extends Model {
 	private String des;
 
 	/**
-	 * 复审人
-	 */
-	private String reviewPeople;
-
-	/**
-	 * 复审时间
-	 */
-	private String reviewPeopleTime;
-
-	/**
-	 * 复审意见
-	 */
-	private String reviewOpinion;
-
-	/**
-	 * 终审人
-	 */
-	private String finalReviewPeople;
-
-	/**
-	 * 终审时间
-	 */
-	private String finalReviewPeopleTime;
-
-	/**
-	 * 终审意见
-	 */
-	private String finalReviewOpinion;
-
-	/**
 	 * 流程实例ID
 	 */
 	private String instId;
@@ -122,4 +92,13 @@ public class EvaluationDeptBusinessAssessment extends Model {
 	 */
 	private String remark;
 
+	/**
+	 * 考评部门主键
+	 */
+	private String deptId;
+
+	/**
+	 * 考评部门名称
+	 */
+	private String deptName;
 }

+ 7 - 34
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluationDeptBusinessPlan.java

@@ -1,6 +1,5 @@
 package com.ims.eval.entity;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -59,36 +58,6 @@ public class EvaluationDeptBusinessPlan extends Model {
 	private String des;
 
 	/**
-	 * 复审人
-	 */
-	private String reviewPeople;
-
-	/**
-	 * 复审时间
-	 */
-	private String reviewPeopleTime;
-
-	/**
-	 * 复审意见
-	 */
-	private String reviewOpinion;
-
-	/**
-	 * 终审人
-	 */
-	private String finalReviewPeople;
-
-	/**
-	 * 终审时间
-	 */
-	private String finalReviewPeopleTime;
-
-	/**
-	 * 终审意见
-	 */
-	private String finalReviewOpinion;
-
-	/**
 	 * 流程实例ID
 	 */
 	private String instId;
@@ -124,8 +93,12 @@ public class EvaluationDeptBusinessPlan extends Model {
 	private String remark;
 
 	/**
-	 * 部门json数据
+	 * 考评部门主键
+	 */
+	private String deptId;
+
+	/**
+	 * 考评部门名称
 	 */
-	@TableField(exist = false)
-	private String deptData;
+	private String deptName;
 }

+ 2 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationDeptBusinessAssessmentService.java

@@ -19,4 +19,6 @@ public interface IEvaluationDeptBusinessAssessmentService extends IService<Evalu
 	boolean editState(String id, String state, String instId);
 
 	List<EvaluationDeptBusinessAssessment> list(String appraisalYear);
+
+    List<EvaluationDeptBusinessAssessment> selectEvaluationDeptBusinessAssessmentByYear(String year);
 }

+ 2 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationDeptBusinessPlanService.java

@@ -23,4 +23,6 @@ public interface IEvaluationDeptBusinessPlanService extends IService<EvaluationD
 	boolean removeByIds(List<String> ids);
 
 	boolean updateById(EvaluationDeptBusinessPlan evaluationDeptBusinessPlan);
+
+	List<EvaluationDeptBusinessPlan> selectEvaluationDeptBusinessPlanByYear(String year);
 }

+ 9 - 8
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptBusinessAssessmentServiceImpl.java

@@ -40,19 +40,15 @@ public class EvaluationDeptBusinessAssessmentServiceImpl extends ServiceImpl<Eva
 		//构造分页构造器
 		Page<EvaluationDeptBusinessAssessment> page = new Page<>(pageNum, pageSize);
 		IPage<EvaluationDeptBusinessAssessment> list = null;
-
 		String code = request.getHeader("code");
 		JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
-
 		user.getDeptOrg().getType();
-
-		if("150".equals(user.getDeptOrg().getType())){
+		if ("150".equals(user.getDeptOrg().getType())) {
 			deptId = user.getDeptOrg().getParentId();
 		}
-
 		if ("23031009".equals(deptId)) {//组织人事部
-			list = baseMapper.selectListPage(page, responsibilityCode, des, appraisalYear, stage);
+			list = baseMapper.selectListPage(page, "", responsibilityCode, des, appraisalYear, stage);
 		} else {
 			QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
 			qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
@@ -60,7 +56,7 @@ public class EvaluationDeptBusinessAssessmentServiceImpl extends ServiceImpl<Eva
 			String finalDeptId = deptId;
 			EvaluationDept evaluationDept = evaluationDeptList.stream().filter(item -> item.getDeptId().equals(finalDeptId)).findFirst().orElse(null);
 			if (evaluationDept != null) {
-				list = baseMapper.selectListPage(page, responsibilityCode, des, appraisalYear, stage);
+				list = baseMapper.selectListPage(page, finalDeptId, responsibilityCode, des, appraisalYear, stage);
 			}
 		}
 		return list;
@@ -70,7 +66,7 @@ public class EvaluationDeptBusinessAssessmentServiceImpl extends ServiceImpl<Eva
 	public boolean editState(String id, String state, String instId) {
 		EvaluationDeptBusinessAssessment evaluationDeptBusinessAssessment = baseMapper.selectById(id);
 		if (StringUtils.isNotEmpty(state)) {
-			if ("组织人事部领导审核".equals(state)){
+			if ("组织人事部领导审核".equals(state)) {
 				state = "流程已结束";
 			}
 			evaluationDeptBusinessAssessment.setStage(state);
@@ -87,4 +83,9 @@ public class EvaluationDeptBusinessAssessmentServiceImpl extends ServiceImpl<Eva
 		wrapper.lambda().eq(EvaluationDeptBusinessAssessment::getAppraisalYear, appraisalYear);
 		return baseMapper.selectList(wrapper);
 	}
+
+	@Override
+	public List<EvaluationDeptBusinessAssessment> selectEvaluationDeptBusinessAssessmentByYear(String year) {
+		return baseMapper.selectEvaluationDeptBusinessAssessmentByYear(year);
+	}
 }

+ 52 - 22
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationDeptBusinessPlanServiceImpl.java

@@ -23,6 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -53,21 +55,15 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
 		//构造分页构造器
 		Page<EvaluationDeptBusinessPlan> page = new Page<>(pageNum, pageSize);
 		IPage<EvaluationDeptBusinessPlan> list = null;
-
 		String code = request.getHeader("code");
 		JSONObject json = remoteServiceBuilder.getGatewayUrl().getSysUser(code);
 		MyuserResDTO user = JSONObject.parseObject(json.getJSONObject("data").toJSONString(), MyuserResDTO.class);
-
 		user.getDeptOrg().getType();
-
-		if("150".equals(user.getDeptOrg().getType())){
+		if ("150".equals(user.getDeptOrg().getType())) {
 			deptId = user.getDeptOrg().getParentId();
 		}
-
-
-
 		if ("23031009".equals(deptId)) {//组织人事部
-			list = baseMapper.selectListPage(page, responsibilityCode, des, appraisalYear, stage);
+			list = baseMapper.selectListPage(page, "", responsibilityCode, des, appraisalYear, stage);
 		} else {
 			QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
 			qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
@@ -75,7 +71,7 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
 			String finalDeptId = deptId;
 			EvaluationDept evaluationDept = evaluationDeptList.stream().filter(item -> item.getDeptId().equals(finalDeptId)).findFirst().orElse(null);
 			if (evaluationDept != null) {
-				list = baseMapper.selectListPage(page, responsibilityCode, des, appraisalYear, stage);
+				list = baseMapper.selectListPage(page, finalDeptId, responsibilityCode, des, appraisalYear, stage);
 			}
 		}
 		return list;
@@ -83,12 +79,34 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
 
 	@Override
 	public boolean save(EvaluationDeptBusinessPlan evaluationDeptBusinessPlan) {
-		evaluationDeptBusinessPlan.setId(Convert.toStr(IdUtil.getSnowflake(1, 1).nextId()));
-		evaluationDeptBusinessPlan.setResponsibilityCode("YJZB_GDDL_BMKP_" + evaluationDeptBusinessPlan.getAppraisalYear());
-		evaluationDeptBusinessPlan.setDocumentStatus("有效");
-		evaluationDeptBusinessPlan.setStage("流程未启动");
-		evaluationDeptBusinessPlan.setCreateTime(DateUtil.date());
-		return super.save(evaluationDeptBusinessPlan);
+		List<EvaluationDeptBusinessPlan> list = new ArrayList<>();
+		QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
+		qw.lambda().eq(EvaluationDept::getYjzbjhType, "1");
+		List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
+		for (EvaluationDept dept : evaluationDeptList) {
+			QueryWrapper<EvaluationDeptBusinessPlan> qw1 = new QueryWrapper<>();
+			qw1.lambda().eq(EvaluationDeptBusinessPlan::getAppraisalYear, evaluationDeptBusinessPlan.getAppraisalYear());
+			qw1.lambda().eq(EvaluationDeptBusinessPlan::getDeptId, evaluationDeptBusinessPlan.getDeptId());
+			EvaluationDeptBusinessPlan businessPlan = super.getOne(qw1);
+			if (null == businessPlan) {
+				EvaluationDeptBusinessPlan plan = new EvaluationDeptBusinessPlan();
+				plan.setId(Convert.toStr(IdUtil.getSnowflake(1, 1).nextId()));
+				plan.setResponsibilityCode("ZBJH_" + dept.getDeptId() + "_" + evaluationDeptBusinessPlan.getAppraisalYear() + getThreePipelineNumbers());
+				plan.setAppraisalYear(evaluationDeptBusinessPlan.getAppraisalYear());
+				plan.setEvaluationCategory("BMKP");
+				plan.setBusinessClass("NDKP");
+				plan.setDocumentStatus("有效");
+				plan.setStage("流程未启动");
+				plan.setDes(dept.getDeptName() + evaluationDeptBusinessPlan.getAppraisalYear() + "年度业绩指标计划申报");
+				plan.setCreateTime(DateUtil.date());
+				plan.setCreateBy(evaluationDeptBusinessPlan.getCreateBy());
+				plan.setCreateName(evaluationDeptBusinessPlan.getCreateName());
+				plan.setDeptId(dept.getDeptId());
+				plan.setDeptName(dept.getDeptName());
+				list.add(plan);
+			}
+		}
+		return super.saveBatch(list);
 	}
 
 	@Override
@@ -99,21 +117,17 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
 				state = "流程已结束";
 				EvaluationDeptBusinessAssessment evaluationDeptBusinessAssessment = new EvaluationDeptBusinessAssessment();
 				evaluationDeptBusinessAssessment.setId(evaluationDeptBusinessPlan.getId());
-				evaluationDeptBusinessAssessment.setResponsibilityCode(evaluationDeptBusinessPlan.getResponsibilityCode());
+				evaluationDeptBusinessAssessment.setResponsibilityCode("ZBKP_" + evaluationDeptBusinessPlan.getDeptId() + "_" + evaluationDeptBusinessPlan.getAppraisalYear() + getThreePipelineNumbers());
 				evaluationDeptBusinessAssessment.setAppraisalYear(evaluationDeptBusinessPlan.getAppraisalYear());
 				evaluationDeptBusinessAssessment.setEvaluationCategory(evaluationDeptBusinessPlan.getEvaluationCategory());
 				evaluationDeptBusinessAssessment.setBusinessClass(evaluationDeptBusinessPlan.getBusinessClass());
 				evaluationDeptBusinessAssessment.setDocumentStatus(evaluationDeptBusinessPlan.getDocumentStatus());
 				evaluationDeptBusinessAssessment.setStage("流程未启动");
 				evaluationDeptBusinessAssessment.setDes(evaluationDeptBusinessPlan.getDes());
-				evaluationDeptBusinessAssessment.setReviewPeople(evaluationDeptBusinessPlan.getReviewPeople());
-				evaluationDeptBusinessAssessment.setReviewPeopleTime(evaluationDeptBusinessPlan.getReviewPeopleTime());
-				evaluationDeptBusinessAssessment.setReviewOpinion(evaluationDeptBusinessPlan.getReviewOpinion());
-				evaluationDeptBusinessAssessment.setFinalReviewPeople(evaluationDeptBusinessPlan.getFinalReviewPeople());
-				evaluationDeptBusinessAssessment.setFinalReviewPeopleTime(evaluationDeptBusinessPlan.getFinalReviewPeopleTime());
-				evaluationDeptBusinessAssessment.setFinalReviewOpinion(evaluationDeptBusinessPlan.getFinalReviewOpinion());
 				evaluationDeptBusinessAssessment.setCreateTime(DateUtil.date());
 				evaluationDeptBusinessAssessment.setRemark(evaluationDeptBusinessPlan.getRemark());
+				evaluationDeptBusinessAssessment.setDeptId(evaluationDeptBusinessPlan.getDeptId());
+				evaluationDeptBusinessAssessment.setDeptName(evaluationDeptBusinessPlan.getDeptName());
 				evaluationDeptBusinessAssessmentService.save(evaluationDeptBusinessAssessment);
 			}
 			evaluationDeptBusinessPlan.setStage(state);
@@ -148,4 +162,20 @@ public class EvaluationDeptBusinessPlanServiceImpl extends ServiceImpl<Evaluatio
 		evaluationDeptBusinessAssessmentService.updateById(evaluationDeptBusinessAssessment);
 		return super.updateById(evaluationDeptBusinessPlan);
 	}
+
+	@Override
+	public List<EvaluationDeptBusinessPlan> selectEvaluationDeptBusinessPlanByYear(String year) {
+		return baseMapper.selectEvaluationDeptBusinessPlanByYear(year);
+	}
+
+	/**
+	 * @return 获取三位流水号
+	 */
+	public String getThreePipelineNumbers() {
+		String code = "";
+		int num = super.count() + 1;
+		DecimalFormat def = new DecimalFormat("000");
+		code += def.format(num);
+		return code;
+	}
 }

+ 22 - 19
ims-service/ims-eval/src/main/resources/mappers/EvaluationDeptBusinessAssessmentMapper.xml

@@ -12,12 +12,6 @@
         <result column="document_status" property="documentStatus"/>
         <result column="stage" property="stage"/>
         <result column="des" property="des"/>
-        <result column="review_people" property="reviewPeople"/>
-        <result column="review_people_time" property="reviewPeopleTime"/>
-        <result column="review_opinion" property="reviewOpinion"/>
-        <result column="final_review_people" property="finalReviewPeople"/>
-        <result column="final_review_people_time" property="finalReviewPeopleTime"/>
-        <result column="final_review_opinion" property="finalReviewOpinion"/>
         <result column="inst_id" property="instId"/>
         <result column="create_time" property="createTime"/>
         <result column="create_by" property="createBy"/>
@@ -25,6 +19,8 @@
         <result column="update_time" property="updateTime"/>
         <result column="update_by" property="updateBy"/>
         <result column="remark" property="remark"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="dept_name" property="deptName"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
@@ -37,39 +33,46 @@
                document_status,
                stage,
                des,
-               review_people,
-               review_people_time,
-               review_opinion,
-               final_review_people,
-               final_review_people_time,
-               final_review_opinion,
                inst_id,
                create_time,
                create_by,
                create_name,
                update_time,
                update_by,
-               remark
+               remark,
+               dept_id,
+               dept_name
         from evaluation_dept_business_assessment
     </sql>
 
     <select id="selectListPage" resultType="com.ims.eval.entity.EvaluationDeptBusinessAssessment">
-        <include refid="selectEvaluationDeptBusinessAssessmentVo"/>
+        select * from evaluation_dept_business_assessment edba
+        left join evaluation_dept ed on edba.dept_id = ed.dept_id
         <where>
+            <if test="deptId != null and deptId != ''">
+                AND edba.dept_id = #{deptId}
+            </if>
             <if test="responsibilityCode != null and responsibilityCode != ''">
-                AND responsibility_code like CONCAT('%',#{responsibilityCode},'%')
+                AND edba.responsibility_code like CONCAT('%',#{responsibilityCode},'%')
             </if>
             <if test="des != null and des != ''">
-                AND des like CONCAT('%',#{des},'%')
+                AND edba.des like CONCAT('%',#{des},'%')
             </if>
             <if test="appraisalYear != null and appraisalYear != ''">
-                AND appraisal_year = #{appraisalYear}
+                AND edba.appraisal_year = #{appraisalYear}
             </if>
             <if test="stage != null and stage != ''">
-                AND stage = #{stage}
+                AND edba.stage = #{stage}
             </if>
         </where>
-        order by create_time desc
+        order by ed.serial_number asc
+    </select>
+
+    <select id="selectEvaluationDeptBusinessAssessmentByYear" resultType="com.ims.eval.entity.EvaluationDeptBusinessAssessment">
+        select * from evaluation_dept_business_assessment edba
+        left join evaluation_dept ed on edba.dept_id = ed.dept_id
+        where edba.appraisal_year = #{year}
+        order by ed.serial_number asc
     </select>
 
 </mapper>

+ 22 - 19
ims-service/ims-eval/src/main/resources/mappers/EvaluationDeptBusinessPlanMapper.xml

@@ -12,12 +12,6 @@
         <result column="document_status" property="documentStatus"/>
         <result column="stage" property="stage"/>
         <result column="des" property="des"/>
-        <result column="review_people" property="reviewPeople"/>
-        <result column="review_people_time" property="reviewPeopleTime"/>
-        <result column="review_opinion" property="reviewOpinion"/>
-        <result column="final_review_people" property="finalReviewPeople"/>
-        <result column="final_review_people_time" property="finalReviewPeopleTime"/>
-        <result column="final_review_opinion" property="finalReviewOpinion"/>
         <result column="inst_id" property="instId"/>
         <result column="create_time" property="createTime"/>
         <result column="create_by" property="createBy"/>
@@ -25,6 +19,8 @@
         <result column="update_time" property="updateTime"/>
         <result column="update_by" property="updateBy"/>
         <result column="remark" property="remark"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="dept_name" property="deptName"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
@@ -37,39 +33,46 @@
                document_status,
                stage,
                des,
-               review_people,
-               review_people_time,
-               review_opinion,
-               final_review_people,
-               final_review_people_time,
-               final_review_opinion,
                inst_id,
                create_time,
                create_by,
                create_name,
                update_time,
                update_by,
-               remark
+               remark,
+               dept_id,
+               dept_name
         from evaluation_dept_business_plan
     </sql>
 
     <select id="selectListPage" resultType="com.ims.eval.entity.EvaluationDeptBusinessPlan">
-        <include refid="selectEvaluationDeptBusinessPlanVo"/>
+        select * from evaluation_dept_business_plan edbp
+        left join evaluation_dept ed on edbp.dept_id = ed.dept_id
         <where>
+            <if test="deptId != null and deptId != ''">
+                AND edbp.dept_id = #{deptId}
+            </if>
             <if test="responsibilityCode != null and responsibilityCode != ''">
-                AND responsibility_code like CONCAT('%',#{responsibilityCode},'%')
+                AND edbp.responsibility_code like CONCAT('%',#{responsibilityCode},'%')
             </if>
             <if test="des != null and des != ''">
-                AND des like CONCAT('%',#{des},'%')
+                AND edbp.des like CONCAT('%',#{des},'%')
             </if>
             <if test="appraisalYear != null and appraisalYear != ''">
-                AND appraisal_year = #{appraisalYear}
+                AND edbp.appraisal_year = #{appraisalYear}
             </if>
             <if test="stage != null and stage != ''">
-                AND stage = #{stage}
+                AND edbp.stage = #{stage}
             </if>
         </where>
-        order by create_time desc
+        order by ed.serial_number asc
+    </select>
+
+    <select id="selectEvaluationDeptBusinessPlanByYear" resultType="com.ims.eval.entity.EvaluationDeptBusinessPlan">
+        select * from evaluation_dept_business_plan edbp
+        left join evaluation_dept ed on edbp.dept_id = ed.dept_id
+        where edbp.appraisal_year = #{year}
+        order by ed.serial_number asc
     </select>
 
 </mapper>