|
@@ -14,12 +14,13 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
- * 部门业绩指标计划
|
|
|
+ * 本部部门业绩指标计划
|
|
|
*
|
|
|
* @author hlf
|
|
|
* @date 2023/4/26 14:15
|
|
@@ -33,16 +34,10 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
private IEvaluationDeptBusinessPlanService evaluationDeptBusinessPlanService;
|
|
|
|
|
|
@Autowired
|
|
|
- private IEvaluationDeptService evaluationDeptService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IEvaluationDeptIndicatorService evaluationDeptIndicatorService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IEvaluationDeptIndicatorItemService evaluationDeptIndicatorItemService;
|
|
|
+ private IEvaluationDeptPlanContentService evaluationDeptPlanContentService;
|
|
|
|
|
|
@Autowired
|
|
|
- private IEvaluationDeptPlanContentService evaluationDeptPlanContentService;
|
|
|
+ private HttpServletRequest request;
|
|
|
|
|
|
/**
|
|
|
* 部门考评业务列表信息(分页)
|
|
@@ -52,6 +47,7 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
* @param responsibilityCode 业务编码
|
|
|
* @param des 业务简述
|
|
|
* @param appraisalYear 月度
|
|
|
+ * @param stage 流程状态
|
|
|
* @return 结果
|
|
|
*/
|
|
|
//@ImsPreAuth("eval:evaluationDeptBusinessPlan:view")
|
|
@@ -61,8 +57,9 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
@RequestParam(value = "pageSize") Integer pageSize,
|
|
|
@RequestParam(value = "responsibilityCode", required = false) String responsibilityCode,
|
|
|
@RequestParam(value = "des", required = false) String des,
|
|
|
- @RequestParam(value = "appraisalYear", required = false) String appraisalYear) {
|
|
|
- IPage<EvaluationDeptBusinessPlan> list = evaluationDeptBusinessPlanService.listPage(pageNum, pageSize, responsibilityCode, des, appraisalYear);
|
|
|
+ @RequestParam(value = "appraisalYear", required = false) String appraisalYear,
|
|
|
+ @RequestParam(value = "stage", required = false) String stage) {
|
|
|
+ IPage<EvaluationDeptBusinessPlan> list = evaluationDeptBusinessPlanService.listPage(pageNum, pageSize, responsibilityCode, des, appraisalYear, stage);
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
@@ -92,48 +89,8 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
*/
|
|
|
//@ImsPreAuth("eval:evaluationDeptBusinessPlan:edit")
|
|
|
@PostMapping(value = "/save")
|
|
|
- @ApiOperation(value = "新增", notes = "新增")
|
|
|
public R addAll(@RequestBody EvaluationDeptBusinessPlan deptBusinessPlan) {
|
|
|
try {
|
|
|
- String businessPlanId = Convert.toStr(IdUtil.getSnowflake(1, 1).nextId());
|
|
|
- deptBusinessPlan.setId(businessPlanId);
|
|
|
- deptBusinessPlan.setResponsibilityCode("bmkp_" + deptBusinessPlan.getAppraisalYear() + RandomUtil.randomString(6));
|
|
|
- deptBusinessPlan.setBusinessClass("年度考评");
|
|
|
- deptBusinessPlan.setDocumentStatus("有效");
|
|
|
- deptBusinessPlan.setStage("流程未启动");
|
|
|
- QueryWrapper<EvaluationDept> qw = new QueryWrapper<>();
|
|
|
- if (StringUtils.isNotEmpty(deptBusinessPlan.getAppraisalYear())) {
|
|
|
- qw.lambda().eq(EvaluationDept::getAnnual, deptBusinessPlan.getAppraisalYear());
|
|
|
- }
|
|
|
- List<EvaluationDept> evaluationDeptList = evaluationDeptService.list(qw);
|
|
|
- StringBuilder deptIds = new StringBuilder();
|
|
|
- StringBuilder deptNames = new StringBuilder();
|
|
|
- for (int i = 0; i < evaluationDeptList.size(); i++) {
|
|
|
- EvaluationDept evaluationDept = evaluationDeptList.get(i);
|
|
|
- List<EvaluationDeptIndicatorItem> evaluationDeptIndicatorItemList = evaluationDeptIndicatorItemService.selectEvaluationDeptIndicatorItemListByEvaluationDeptId(evaluationDept.getDeptId());
|
|
|
- for (EvaluationDeptIndicatorItem evaluationDeptIndicatorItem : evaluationDeptIndicatorItemList) {
|
|
|
- EvaluationDeptIndicator evaluationDeptIndicator = evaluationDeptIndicatorService.getById(evaluationDeptIndicatorItem.getEvaluationDeptIndicatorId());
|
|
|
- EvaluationDeptPlanContent evaluationDeptPlanContent = new EvaluationDeptPlanContent();
|
|
|
- evaluationDeptPlanContent.setBusinessPlanId(businessPlanId);
|
|
|
- evaluationDeptPlanContent.setDeptId(evaluationDept.getDeptId());
|
|
|
- evaluationDeptPlanContent.setDeptName(evaluationDept.getDeptName());
|
|
|
- evaluationDeptPlanContent.setIndicatorId(evaluationDeptIndicator.getId());
|
|
|
- evaluationDeptPlanContent.setIndicatorName(evaluationDeptIndicator.getIndicatorName());
|
|
|
- evaluationDeptPlanContent.setIndicatorItemId(evaluationDeptIndicatorItem.getId());
|
|
|
- evaluationDeptPlanContent.setIndicatorItemName(evaluationDeptIndicatorItem.getIndicatorItemName());
|
|
|
- evaluationDeptPlanContent.setAuditStatus("审批未开始");
|
|
|
- evaluationDeptPlanContentService.save(evaluationDeptPlanContent);
|
|
|
- }
|
|
|
- if (i == evaluationDeptList.size() - 1) {
|
|
|
- deptIds.append(evaluationDept.getDeptId());
|
|
|
- deptNames.append(evaluationDept.getDeptName());
|
|
|
- } else {
|
|
|
- deptIds.append(evaluationDept.getDeptId()).append(",");
|
|
|
- deptNames.append(evaluationDept.getDeptName()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- deptBusinessPlan.setDeptId(deptIds.toString());
|
|
|
- deptBusinessPlan.setDeptName(deptNames.toString());
|
|
|
boolean b = evaluationDeptBusinessPlanService.save(deptBusinessPlan);
|
|
|
if (b) {
|
|
|
return R.ok().data(b);
|
|
@@ -153,7 +110,6 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
*/
|
|
|
//@ImsPreAuth("eval:evaluationDeptBusinessPlan:remove")
|
|
|
@PostMapping(value = "/removeAll/{ids}")
|
|
|
- @ApiOperation(value = "批量删除", notes = "批量删除")
|
|
|
public R deleteAll(@PathVariable("ids") String ids) {
|
|
|
String[] strings = ids.split(",");
|
|
|
boolean b = evaluationDeptBusinessPlanService.removeByIds(Arrays.asList(strings));
|
|
@@ -171,29 +127,24 @@ public class DepartmentalPerformanceIndicatorPlanController {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
//@ImsPreAuth("eval:evaluationDeptBusinessPlan:view")
|
|
|
- @GetMapping(value = "details")
|
|
|
- public R details(@RequestParam(value = "id", required = false) String id) {
|
|
|
- QueryWrapper<EvaluationDeptPlanContent> qw = new QueryWrapper<>();
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- qw.lambda().eq(EvaluationDeptPlanContent::getBusinessPlanId, id);
|
|
|
- }
|
|
|
- List<EvaluationDeptPlanContent> list = evaluationDeptPlanContentService.list(qw);
|
|
|
+ @GetMapping(value = "/details/{id}")
|
|
|
+ public R details(@PathVariable("id") String id) {
|
|
|
+ List<EvaluationDeptPlanContent> list = evaluationDeptPlanContentService.detailsList(id, "指标计划", request);
|
|
|
return R.ok().data(list);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 详情里指标内容修改
|
|
|
*
|
|
|
- * @param evaluationDeptPlanContent
|
|
|
+ * @param evaluationDeptPlanContentList
|
|
|
* @return
|
|
|
*/
|
|
|
|
|
|
//@ImsPreAuth("eval:evaluationDeptBusinessPlan:edit")
|
|
|
@PostMapping(value = "/update")
|
|
|
- @ApiOperation(value = "修改", notes = "修改")
|
|
|
- public R update(@RequestBody EvaluationDeptPlanContent evaluationDeptPlanContent) {
|
|
|
+ public R update(@RequestBody List<EvaluationDeptPlanContent> evaluationDeptPlanContentList) {
|
|
|
try {
|
|
|
- boolean b = evaluationDeptPlanContentService.updateById(evaluationDeptPlanContent);
|
|
|
+ boolean b = evaluationDeptPlanContentService.saveOrUpdateBatch(evaluationDeptPlanContentList);
|
|
|
if (b) {
|
|
|
return R.ok().data(b);
|
|
|
} else {
|