|
@@ -21,20 +21,29 @@ class QuarterlyAction {
|
|
|
private lateinit var quarterlyPlanService: QuarterlyPlanService
|
|
|
|
|
|
@ApiOperation("添加季度计划")
|
|
|
- @ApiImplicitParams(ApiImplicitParam(name = "name", value = "名称", paramType = "query"),
|
|
|
- ApiImplicitParam(name = "content", value = "计划内容", paramType = "query"),
|
|
|
- ApiImplicitParam(name = "year", value = "年份", paramType = "query"),
|
|
|
- ApiImplicitParam(name = "quarter", value = "季度", paramType = "query"))
|
|
|
+ @ApiImplicitParams(
|
|
|
+ ApiImplicitParam(name = "name", value = "名称", paramType = "query"),
|
|
|
+ ApiImplicitParam(name = "content", value = "计划内容", paramType = "query"),
|
|
|
+ ApiImplicitParam(name = "year", value = "年份", paramType = "query"),
|
|
|
+ ApiImplicitParam(name = "quarter", value = "季度", paramType = "query"),
|
|
|
+ ApiImplicitParam(name = "departmentId", value = "部门Id", paramType = "query")
|
|
|
+ )
|
|
|
@PostMapping("add")
|
|
|
- fun add(name: String, content: String, year: Int, quarter: Int): Reply<Any> {
|
|
|
- val result = quarterlyPlanService.add(name, content, year, quarter)
|
|
|
+ fun add(
|
|
|
+ name: String, content: String, year: Int, quarter: Int,
|
|
|
+ @RequestParam(required = false) departmentId: Long?
|
|
|
+ ): Reply<Any> {
|
|
|
+ val result = quarterlyPlanService.add(name, content, year, quarter, departmentId)
|
|
|
return Reply(result)
|
|
|
}
|
|
|
|
|
|
@ApiOperation("更新季度计划")
|
|
|
@PostMapping("update")
|
|
|
- fun update(id: Long, name: String, content: String, year: Int, quarter: Int, status: Int): Reply<Any> {
|
|
|
- val result = quarterlyPlanService.update(id, name, content, year, quarter, status)
|
|
|
+ fun update(
|
|
|
+ id: Long, name: String, content: String, year: Int, quarter: Int, status: Int,
|
|
|
+ @RequestParam(required = false) departmentId: Long?
|
|
|
+ ): Reply<Any> {
|
|
|
+ val result = quarterlyPlanService.update(id, name, content, year, quarter, status, departmentId)
|
|
|
return Reply(result)
|
|
|
}
|
|
|
|
|
@@ -48,9 +57,10 @@ class QuarterlyAction {
|
|
|
@ApiOperation("获取季度计划")
|
|
|
@ApiImplicitParam(name = "year", value = "year", paramType = "query")
|
|
|
@GetMapping("list")
|
|
|
- fun list(@RequestParam(required = false) year: Int? = null): Reply<List<QuarterlyPlan>> {
|
|
|
+ fun list(@RequestParam(required = false) year: Int? = null,
|
|
|
+ @RequestParam(required = false) departmentId: Long?): Reply<List<QuarterlyPlan>> {
|
|
|
val y: Int = year ?: DateUtils.year(Date())
|
|
|
- val result = quarterlyPlanService.list(y)
|
|
|
+ val result = quarterlyPlanService.list(y,departmentId)
|
|
|
return Reply.ok(result)
|
|
|
}
|
|
|
|