d0205f8cf5a2d6654ac3461c10b1e3958def11f1.svn-base 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package cn.com.goldenwater.dcproj.controller.ducha;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.constValue.SplitValue;
  5. import cn.com.goldenwater.dcproj.model.BisInspScheme;
  6. import cn.com.goldenwater.dcproj.service.BisInspSchemeService;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. import java.util.Date;
  15. import java.util.List;
  16. import java.util.UUID;
  17. /**
  18. * @author lune
  19. * @date 2019-2-18
  20. */
  21. @Api(value = "督查工作方案", tags = "02督查工作方案")
  22. @RestController
  23. @RequestMapping("/dc/insp/scheme")
  24. public class BisInspSchemeController extends BaseController {
  25. private Logger logger = LoggerFactory.getLogger(getClass());
  26. @Autowired
  27. private BisInspSchemeService bisInspSchemeService;
  28. @ApiOperation(value = "添加督查工作方案", notes = "参数字段说明:{\n\r" +
  29. " \"schmTitle\":\"方案标题\",\n\r" +
  30. " \"schmContent\":\"方案内容\",\n\r" +
  31. " \"schmSttm\":\"方案开始时间\",\n\r" +
  32. " \"schmEnttm\":\"方案结束时间\",\n\r" +
  33. " \"fileList(上传文件列表) \":[\n\r" +
  34. " {\n\r" +
  35. " \"id \":\"文件主键\",\n\r" +
  36. " }\n\r" +
  37. " ]\n\r" +
  38. " };\n\r" +
  39. "返回结构说明:{\n\r" +
  40. " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
  41. " \"code\":\"错误代码\",\n\r" +
  42. " \"data(数据信息)\":\"null\",\n\r" +
  43. " }")
  44. @RequestMapping(value = "", method = RequestMethod.POST)
  45. public BaseResponse<String> insert(@ApiParam(name = "bisInspScheme", value = "BisInspScheme", required = true) @RequestBody BisInspScheme bisInspScheme) {
  46. String uuid = UUID.randomUUID().toString().replace(SplitValue.HENG_SPLIT, "");
  47. bisInspScheme.setSchmId(uuid);
  48. bisInspScheme.setSchmIntm(new Date());
  49. int ret = bisInspSchemeService.insert(bisInspScheme);
  50. return buildSuccessResponse(uuid);
  51. }
  52. @ApiOperation(value = "根据机构id获取督查方案列表")
  53. @RequestMapping(value = "/getDCFAListByOrgId", method = RequestMethod.GET)
  54. public BaseResponse<List<BisInspScheme>> getDCFAListByOrgId(@RequestParam("id") String id) {
  55. List<BisInspScheme> list = bisInspSchemeService.getDCFAListByOrgId(id);
  56. return buildSuccessResponse(list);
  57. }
  58. @ApiOperation(value = "根据督查类型获取督查方案列表", notes = "参数字段说明:{\n\r" +
  59. " \"type\":\"督查类型(1小水库2农村饮水工程3水毁修复情况4 172工程)\",\n\r" +
  60. " };\n\r" +
  61. "返回结构说明:{\n\r" +
  62. " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
  63. " \"code\":\"错误代码\",\n\r" +
  64. " \"message\":\"描述信息\",\n\r" +
  65. " \"throwable\":\"异常信息\",\n\r" +
  66. " \"data(数据信息)\":[\n\r" +
  67. " {\n\r" +
  68. " \"guid\":\"机构id\",\n\r" +
  69. " \"schmId\":\"督导方案id\",\n\r" +
  70. " \"schmTitle\":\"督导方案标题\",\n\r" +
  71. " \"schmContent\":\"督导方案内容\",\n\r" +
  72. " \"schmMkps\":\"方案制作人id\",\n\r" +
  73. " \"schmSttm\":\"方案开始时间\",\n\r" +
  74. " \"schmEnttm\":\"方案结束时间\",\n\r" +
  75. " \"schmIntm\":\"方案录入时间\",\n\r" +
  76. " \"schmUptm\":\"方案最后修改时间\",\n\r" +
  77. " \"schmNote\":\"备注\",\n\r" +
  78. " }\n\r" +
  79. " ]\n\r" +
  80. " }")
  81. @RequestMapping(value = "/getDCFAListByType", method = RequestMethod.GET)
  82. public BaseResponse<List<BisInspScheme>> getDCFAListByType(@RequestParam("type") String type) {
  83. List<BisInspScheme> list = bisInspSchemeService.getDCFAListByType(type);
  84. return buildSuccessResponse(list);
  85. }
  86. }