3ffd1fbb7fab25f80cb8a76d961ee0de8c5e810d.svn-base 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. package cn.com.goldenwater.dcproj.controller.plan;
  2. import cn.com.goldenwater.dcproj.model.BisInspMtprggd;
  3. import cn.com.goldenwater.dcproj.param.BisInspMtprggdParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspMtprggdService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
  8. import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
  9. import cn.com.goldenwater.id.util.UuidUtil;
  10. import cn.com.goldenwater.util.common.SqlUtils;
  11. import com.github.pagehelper.PageInfo;
  12. import io.swagger.annotations.Api;
  13. import io.swagger.annotations.ApiOperation;
  14. import io.swagger.annotations.ApiParam;
  15. import org.apache.commons.lang3.StringUtils;
  16. import org.slf4j.Logger;
  17. import org.slf4j.LoggerFactory;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.util.Assert;
  20. import org.springframework.web.bind.annotation.PathVariable;
  21. import org.springframework.web.bind.annotation.RequestBody;
  22. import org.springframework.web.bind.annotation.RequestMapping;
  23. import org.springframework.web.bind.annotation.RequestMethod;
  24. import org.springframework.web.bind.annotation.RequestParam;
  25. import org.springframework.web.bind.annotation.RestController;
  26. import javax.servlet.http.HttpServletResponse;
  27. import java.util.Date;
  28. import java.util.List;
  29. import java.util.Map;
  30. /**
  31. * @author lhc
  32. * @date 2022-3-17
  33. */
  34. @Api(value = "广东月进度计划管理", tags = "广东月进度计划管理")
  35. @RestController
  36. @RequestMapping("/bis/insp/mtprggd")
  37. public class BisInspMtprggdController extends BaseController {
  38. private Logger logger = LoggerFactory.getLogger(getClass());
  39. @Autowired
  40. private BisInspMtprggdService bisInspMtprggdService;
  41. @Autowired
  42. private OlBisInspOrgService olBisInspOrgService;
  43. @ApiOperation(value = "添加广东月进度计划")
  44. @RequestMapping(value = "/", method = RequestMethod.POST)
  45. public BaseResponse<BisInspMtprggd> insert(@ApiParam(name = "bisInspMtprggd", value = "BisInspMtprggd", required = true) @RequestBody BisInspMtprggd bisInspMtprggd) {
  46. bisInspMtprggd.setPersId(getCurrentPersId());
  47. if (StringUtils.isBlank(bisInspMtprggd.getId())) {
  48. //设置机构id,省份数据id,人员id
  49. bisInspMtprggd.setAdCode(olBisInspOrgService.getProvince(getCurrentOrgId()));
  50. bisInspMtprggdService.insert(bisInspMtprggd);
  51. } else {
  52. bisInspMtprggdService.update(bisInspMtprggd);
  53. }
  54. return buildSuccessResponse(bisInspMtprggd);
  55. }
  56. @ApiOperation(value = "根据ID删除广东月进度计划")
  57. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  58. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  59. int ret = bisInspMtprggdService.delete(id);
  60. return buildSuccessResponse();
  61. }
  62. @ApiOperation(value = "更新广东月进度计划信息")
  63. @RequestMapping(value = "/update", method = RequestMethod.POST)
  64. public BaseResponse<BisInspMtprggd> update(@ApiParam(name = "bisInspMtprggd", value = "BisInspMtprggd", required = true) @RequestBody BisInspMtprggd bisInspMtprggd) {
  65. Assert.notNull(bisInspMtprggd.getId(), "主键id为必填参数");
  66. int ret = bisInspMtprggdService.update(bisInspMtprggd);
  67. return buildSuccessResponse(bisInspMtprggd);
  68. }
  69. @ApiOperation(value = "根据ID获取广东月进度计划(单表)")
  70. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  71. public BaseResponse<BisInspMtprggd> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  72. BisInspMtprggd bisInspMtprggd = bisInspMtprggdService.get(id);
  73. return buildSuccessResponse(bisInspMtprggd);
  74. }
  75. @ApiOperation(value = "获取列表数据")
  76. @RequestMapping(value = "/page", method = RequestMethod.POST)
  77. public BaseResponse<PageInfo> findPcPage(@RequestBody BisInspMtprggdParam bisInspMtprggdParam) {
  78. bisInspMtprggdParam.setAdCode(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
  79. PageInfo<BisInspMtprggd> pageInfo = bisInspMtprggdService.findPageInfo(bisInspMtprggdParam);
  80. return buildSuccessResponse(pageInfo);
  81. }
  82. @ApiOperation(value = "获取列表数据")
  83. @RequestMapping(value = "/getMonthRefrom", method = RequestMethod.POST)
  84. public BaseResponse<List<Map<String,String>>> getMonthRefrom(@RequestBody Map<String,String> parmas) {
  85. parmas.put("adCode",AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
  86. List<Map<String,String>> list = bisInspMtprggdService.getMonthRefrom(parmas);
  87. return buildSuccessResponse(list);
  88. }
  89. @ApiOperation(value = "导出检查表")
  90. @RequestMapping(value = "/export", method = RequestMethod.POST)
  91. public void export(HttpServletResponse response, @RequestBody Map<String,String> parmas) {
  92. parmas.put("adCode",AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
  93. bisInspMtprggdService.export(response, parmas);
  94. }
  95. @ApiOperation(value = "导出月进度检查表")
  96. @RequestMapping(value = "/exportMonth", method = RequestMethod.POST)
  97. public void exportMonth(HttpServletResponse response, @RequestBody BisInspMtprggdParam bisInspMtprggdParam) {
  98. bisInspMtprggdParam.setAdCode(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
  99. bisInspMtprggdService.exportMonth(response, bisInspMtprggdParam,null,null);
  100. }
  101. }