| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- package cn.com.goldenwater.dcproj.controller.wiuqh;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.dto.BisInspWiuqhRgstrDto;
- import cn.com.goldenwater.dcproj.model.BisInspWiuqhRgstr;
- import cn.com.goldenwater.dcproj.param.TypeParam;
- import cn.com.goldenwater.dcproj.service.BisInspWiuqhRgstrService;
- import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
- import cn.com.goldenwater.target.CheckException;
- import com.github.pagehelper.PageInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import javax.servlet.http.HttpServletResponse;
- /**
- * @author lhc
- * @date 2021-2-3
- */
- @Api(value = "青海-取水许可-登记表管理", tags = "青海-取水许可-登记表管理")
- @RestController
- @RequestMapping("/bis/insp/wiuqh")
- public class BisInspWiuqhRgstrController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspWiuqhRgstrService bisInspWiuqhRgstrService;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @ApiOperation(value = "修改青海-取水许可-登记表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<BisInspWiuqhRgstr> insert(@ApiParam(name = "bisInspWiuqhRgstr", value = "BisInspWiuqhRgstr", required = true)
- @RequestBody BisInspWiuqhRgstr bisInspWiuqhRgstr) {
- if (StringUtils.isNotBlank(bisInspWiuqhRgstr.getRgstrId()) &&
- StringUtils.isBlank(bisInspWiuqhRgstr.getId())) {
- // rgstrId 不为 空 时,传给ID
- bisInspWiuqhRgstr.setId(bisInspWiuqhRgstr.getRgstrId());
- }
- if (StringUtils.isBlank(bisInspWiuqhRgstr.getId())) {
- throw new CheckException("缺少登记表编码");
- }
- bisInspWiuqhRgstrService.update(bisInspWiuqhRgstr);
- return buildSuccessResponse(bisInspWiuqhRgstr);
- }
- @ApiOperation(value = "根据ID删除青海-取水许可-登记表")
- @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = bisInspWiuqhRgstrService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取青海-取水许可-登记表(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisInspWiuqhRgstr> get(@ApiParam(name = "id", value = "id", required = true)
- @PathVariable String id) {
- BisInspWiuqhRgstr bisInspWiuqhRgstr = bisInspWiuqhRgstrService.get(id);
- return buildSuccessResponse(bisInspWiuqhRgstr);
- }
- @ApiOperation(value = "获取督查对象")
- @RequestMapping(value = "/findPage", method = RequestMethod.POST)
- public BaseResponse<PageInfo<BisInspWiuqhRgstrDto>> findPage(@RequestBody TypeParam param, HttpServletResponse response) {
- param.setProvince(olBisInspOrgService.getProvince(getCurrentOrgId()));
- PageInfo<BisInspWiuqhRgstrDto> pageInfo = bisInspWiuqhRgstrService.listOfPage(param, response);
- return buildSuccessResponse(pageInfo);
- }
- }
|