|
@@ -0,0 +1,91 @@
|
|
|
+package com.fs.his.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
+import com.fs.todo.domain.FsTodoItems;
|
|
|
+import com.fs.todo.param.QueryTodoItemsParam;
|
|
|
+import com.fs.todo.service.FsTodoItemsService;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Api("待办")
|
|
|
+@RestController
|
|
|
+@RequestMapping(value="/todoItems")
|
|
|
+public class FsTodoItemsController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FsTodoItemsService fsTodoItemsService;
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("查看待办列表")
|
|
|
+ @PostMapping("/listPage")
|
|
|
+ public R listPage(@RequestBody QueryTodoItemsParam param)
|
|
|
+ {
|
|
|
+ PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
+ List<FsTodoItems> fsTodoItems = fsTodoItemsService.listPage(param);
|
|
|
+ PageInfo<FsTodoItems> listPageInfo=new PageInfo<>(fsTodoItems);
|
|
|
+ return R.ok().put("data",listPageInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查看详情")
|
|
|
+ @PostMapping("/findById")
|
|
|
+ public R findById(@RequestBody QueryTodoItemsParam param)
|
|
|
+ {
|
|
|
+ if(ObjectUtils.isNull(param.getId())){
|
|
|
+ throw new IllegalArgumentException("待办事项id不能为空!");
|
|
|
+ }
|
|
|
+ FsTodoItems byId = fsTodoItemsService.getById(param.getId());
|
|
|
+ return R.ok().put("data",byId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("更新待办事项状态")
|
|
|
+ @PostMapping("/updateStatusById")
|
|
|
+ public R updateStatusById(@RequestBody QueryTodoItemsParam param)
|
|
|
+ {
|
|
|
+ if(ObjectUtils.isNull(param.getId())){
|
|
|
+ throw new IllegalArgumentException("待办事项id不能为空!");
|
|
|
+ }
|
|
|
+ fsTodoItemsService.updateStatus(param.getId(),param.getStatus());
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ @ApiOperation("更新待办事项")
|
|
|
+ @PostMapping("/updateById")
|
|
|
+ public R updateById(@RequestBody FsTodoItems param)
|
|
|
+ {
|
|
|
+ if(ObjectUtils.isNull(param.getId())){
|
|
|
+ throw new IllegalArgumentException("待办事项id不能为空!");
|
|
|
+ }
|
|
|
+ fsTodoItemsService.updateById(param);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("删除待办事项")
|
|
|
+ @PostMapping("/removeById")
|
|
|
+ public R removeById(@RequestBody QueryTodoItemsParam param){
|
|
|
+ fsTodoItemsService.removeById(param.getId());
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("添加待办事项")
|
|
|
+ @PostMapping("/add")
|
|
|
+ public R addTodoItems(@RequestBody FsTodoItems param){
|
|
|
+ param.setCreateTime(LocalDateTime.now());
|
|
|
+ param.setUpdateTime(LocalDateTime.now());
|
|
|
+ param.setCreatorId(getUserId());
|
|
|
+ fsTodoItemsService.save(param);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|