FlowMainPushController.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package com.idea.oa.flow2.controller;
  2. import com.github.pagehelper.PageInfo;
  3. import com.idea.oa.flow2.model.FlowMainPush;
  4. import com.idea.oa.flow2.service.FlowMainPushService;
  5. import com.rockstar.common.base.BaseController;
  6. import com.rockstar.common.domain.AjaxResult;
  7. import com.rockstar.frame.model.extend.DateTrans;
  8. import com.rockstar.frame.model.extend.TableSplitResult;
  9. import com.rockstar.frame.model.extend.Tablepar;
  10. import io.swagger.annotations.Api;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.stereotype.Controller;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.ResponseBody;
  17. import java.util.Date;
  18. /**
  19. * Created by zt on 2023
  20. */
  21. @Controller
  22. @RequestMapping(value = "FlowMainPushController")
  23. @Api(value="申请流程/流程推送待审核_主申请审核表")
  24. public class FlowMainPushController extends BaseController {
  25. //主表
  26. @Autowired
  27. private FlowMainPushService modelService;
  28. @PostMapping(value = "list",produces = {"application/json;charset=UTF-8"})
  29. @ResponseBody
  30. public Object list(Tablepar tablepar, FlowMainPush model, DateTrans dt){
  31. PageInfo<FlowMainPush> page= modelService.list(tablepar,model,dt);
  32. TableSplitResult<FlowMainPush> result=new TableSplitResult<FlowMainPush>(page.getPageNum(), page.getTotal(), page.getList());
  33. return result;
  34. }
  35. @PostMapping(value = "listAll",produces = {"application/json;charset=UTF-8"})
  36. @ResponseBody
  37. public Object listAll(FlowMainPush model, DateTrans dt){
  38. return modelService.listAll(model,dt);
  39. }
  40. @PostMapping(value = "add",produces = {"application/json;charset=UTF-8"})
  41. @ResponseBody
  42. public AjaxResult add(FlowMainPush record){
  43. record.setCreatedAt(new Date());
  44. int result = modelService.insert(record);
  45. return result(result);
  46. }
  47. @PostMapping(value = "remove/{id}",produces = {"application/json;charset=UTF-8"})
  48. @ResponseBody
  49. public AjaxResult remove(@PathVariable("id") String id){
  50. int result = modelService.deleteByPrimaryKey(id);
  51. return result(result);
  52. }
  53. @PostMapping(value = "edit",produces = {"application/json;charset=UTF-8"})
  54. @ResponseBody
  55. public AjaxResult editSave(FlowMainPush model){
  56. int result = modelService.updateByPrimaryKeySelective(model);
  57. return result(result);
  58. }
  59. @PostMapping(value = "getById",produces = {"application/json;charset=UTF-8"})
  60. @ResponseBody
  61. public FlowMainPush getById(String id) {
  62. return modelService.selectByPrimaryKey(id);
  63. }
  64. }