|
@@ -11,6 +11,9 @@ import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* 部门目标责任表 前端控制器
|
|
* 部门目标责任表 前端控制器
|
|
@@ -58,7 +61,7 @@ public class DeptResponsibilityController {
|
|
@RequestParam(value = "year", required = false) String year,
|
|
@RequestParam(value = "year", required = false) String year,
|
|
@RequestParam(value = "month", required = false) String month) {
|
|
@RequestParam(value = "month", required = false) String month) {
|
|
IPage<DeptResponsibility> list = deptResponsibilityService.list(pageNum, pageSize, id, cycleUnit, checkCycle, beginDate, endDate, stage, createBy, year, month);
|
|
IPage<DeptResponsibility> list = deptResponsibilityService.list(pageNum, pageSize, id, cycleUnit, checkCycle, beginDate, endDate, stage, createBy, year, month);
|
|
- return R.ok().data(null);
|
|
|
|
|
|
+ return R.ok().data(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -90,23 +93,26 @@ public class DeptResponsibilityController {
|
|
/**
|
|
/**
|
|
* 生成目标责任书
|
|
* 生成目标责任书
|
|
*
|
|
*
|
|
- * @param orgEvalRuleId 组织拷屏id
|
|
|
|
- * @param date 日期(预留指定生成某个月的目标责任书)
|
|
|
|
|
|
+ * @param orgEvalRuleIds 组织拷屏ids
|
|
|
|
+ * @param date 日期(预留指定生成某个月的目标责任书)
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
//@ImsPreAuth("eval:deptResponsibility:edit")
|
|
//@ImsPreAuth("eval:deptResponsibility:edit")
|
|
@PostMapping(value = "/generate")
|
|
@PostMapping(value = "/generate")
|
|
@ApiOperation(value = "生成部门责任书", notes = "生成部门责任书")
|
|
@ApiOperation(value = "生成部门责任书", notes = "生成部门责任书")
|
|
- public R generateResponsibility(@RequestParam(value = "orgEvalRuleId", required = true) String orgEvalRuleId,
|
|
|
|
|
|
+ public R generateResponsibility(@RequestParam(value = "orgEvalRuleIds", required = true) String orgEvalRuleIds,
|
|
@RequestParam(value = "date", required = false) String date) {
|
|
@RequestParam(value = "date", required = false) String date) {
|
|
|
|
|
|
try {
|
|
try {
|
|
- boolean b = deptResponsibilityService.generateResponsibility(orgEvalRuleId,date);
|
|
|
|
- if (b) {
|
|
|
|
- return R.ok().data(b);
|
|
|
|
- } else {
|
|
|
|
- return R.error().data("保存失败!");
|
|
|
|
|
|
+ List<String> orgEvalRuleIdList = Arrays.asList(orgEvalRuleIds.split(","));
|
|
|
|
+ boolean b = false;
|
|
|
|
+ for (String id : orgEvalRuleIdList) {
|
|
|
|
+ b = deptResponsibilityService.generateResponsibility(id, date);
|
|
|
|
+ if (!b) {
|
|
|
|
+ return R.error().data("保存失败!");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ return R.ok().data(b);
|
|
} catch (CustomException e) {
|
|
} catch (CustomException e) {
|
|
return R.customError(e.getMessage()).data("失败!");
|
|
return R.customError(e.getMessage()).data("失败!");
|
|
}
|
|
}
|