25dad9f51d2e106251e526175efdc714957c15db.svn-base 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package cn.com.goldenwater.dcproj.controller.villqh;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
  5. import cn.com.goldenwater.dcproj.model.AttCwsBase;
  6. import cn.com.goldenwater.dcproj.model.BisInspVillqhFee;
  7. import cn.com.goldenwater.dcproj.param.CwsParam;
  8. import cn.com.goldenwater.dcproj.service.BisInspVillqhFeeService;
  9. import cn.com.goldenwater.target.CheckException;
  10. import cn.com.goldenwater.util.common.InspPblmUtils;
  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.web.bind.annotation.*;
  20. /**
  21. * @author lhc
  22. * @date 2021-2-1
  23. */
  24. @Api(value = "农饮(青海)-工程暗访情况管理", tags = "农饮(青海)-工程暗访情况管理")
  25. @RestController
  26. @RequestMapping("/bis/insp/villqh/fee")
  27. public class BisInspVillqhFeeController extends BaseController {
  28. private Logger logger = LoggerFactory.getLogger(getClass());
  29. @Autowired
  30. private BisInspVillqhFeeService bisInspVillqhFeeService;
  31. @ApiOperation(value = "修改农饮(青海)-工程暗访情况")
  32. @RequestMapping(value = "", method = RequestMethod.POST)
  33. public BaseResponse<BisInspVillqhFee> insert(@ApiParam(name = "bisInspVillqhFee", value = "BisInspVillqhFee", required = true)
  34. @RequestBody BisInspVillqhFee bisInspVillqhFee) {
  35. int ret = 0;
  36. if (StringUtils.isBlank(bisInspVillqhFee.getId())) {
  37. throw new CheckException("缺少编码");
  38. }
  39. ret = bisInspVillqhFeeService.update(bisInspVillqhFee);
  40. return buildSuccessResponse(bisInspVillqhFee);
  41. }
  42. @ApiOperation(value = "根据ID删除农饮(青海)-工程暗访情况")
  43. @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
  44. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  45. int ret = bisInspVillqhFeeService.delete(id);
  46. return buildSuccessResponse();
  47. }
  48. @ApiOperation(value = "根据ID获取农饮(青海)-工程暗访情况(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<BisInspVillqhFee> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. BisInspVillqhFee bisInspVillqhFee = bisInspVillqhFeeService.get(id);
  52. return buildSuccessResponse(bisInspVillqhFee);
  53. }
  54. @ApiOperation(value = "获取未被督查的供水工程(添加供水工程列表)")
  55. @RequestMapping(value = "/pageNotDC", method = RequestMethod.POST)
  56. public BaseResponse<PageInfo<AttCwsBase>> pageNotDC(@ApiParam(name = "cwsParam", value = "cwsParam", required = true)
  57. @RequestBody CwsParam cwsParam) {
  58. if (StringUtils.isNotBlank(cwsParam.getAdCode())) {
  59. cwsParam.setAdCode(InspPblmUtils.getAddVCD(cwsParam.getAdCode()));
  60. }
  61. cwsParam.setType(BisInspEnum.VILLQH.getValue());
  62. PageInfo<AttCwsBase> bisNewCountryFeeList = bisInspVillqhFeeService.pageNotDC(cwsParam);
  63. return buildSuccessResponse(bisNewCountryFeeList);
  64. }
  65. @ApiOperation(value = "添加/修改农村供水工程水费收缴及水质保障情况表")
  66. @RequestMapping(value = "/addBatch", method = RequestMethod.POST)
  67. public BaseResponse addBatch(@ApiParam(name = "cwsParam", value = "cwsParam", required = true)
  68. @RequestBody CwsParam cwsParam) {
  69. if (StringUtils.isBlank(cwsParam.getCwsIds())) {
  70. throw new CheckException("缺少工程编码");
  71. }
  72. bisInspVillqhFeeService.addBatch(cwsParam);
  73. return buildSuccessResponse("添加成功");
  74. }
  75. }