| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- package cn.com.goldenwater.dcproj.controller.wtgov;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
- import cn.com.goldenwater.dcproj.dto.BisInspWtgovRgstrDto;
- import cn.com.goldenwater.dcproj.model.BisInspWtgovRgstr;
- import cn.com.goldenwater.dcproj.param.TypeParam;
- import cn.com.goldenwater.dcproj.service.BisInspWtgovRgstrService;
- import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- 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-5-11
- */
- @Api(value = "青海水行政执法管理", tags = "青海水行政执法管理")
- @RestController
- @RequestMapping("/bis/insp/wtgov")
- public class BisInspWtgovRgstrController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspWtgovRgstrService bisInspWtgovRgstrService;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @ApiOperation(value = "修改青海水行政执法")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<BisInspWtgovRgstr> insert(@ApiParam(name = "bisInspWtgovRgstr", value = "BisInspWtgovRgstr", required = true)
- @RequestBody BisInspWtgovRgstr bisInspWtgovRgstr) {
- if (StringUtils.isNotBlank(bisInspWtgovRgstr.getRgstrId()) &&
- StringUtils.isBlank(bisInspWtgovRgstr.getId())) {
- // rgstrId 不为 空 时,传给ID
- bisInspWtgovRgstr.setId(bisInspWtgovRgstr.getRgstrId());
- }
- if (StringUtils.isBlank(bisInspWtgovRgstr.getId())) {
- throw new CheckException("缺少登记表编码");
- }
- bisInspWtgovRgstrService.update(bisInspWtgovRgstr);
- return buildSuccessResponse(bisInspWtgovRgstr);
- }
- @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 = bisInspWtgovRgstrService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取青海水行政执法(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisInspWtgovRgstr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisInspWtgovRgstr bisInspWtgovRgstr = bisInspWtgovRgstrService.get(id);
- return buildSuccessResponse(bisInspWtgovRgstr);
- }
- @ApiOperation(value = "获取督查对象")
- @RequestMapping(value = "/findPage", method = RequestMethod.POST)
- public BaseResponse<PageInfo<BisInspWtgovRgstrDto>> findPage(@RequestBody TypeParam param, HttpServletResponse response) {
- param.setpType(BisInspEnum.WTGOV.getValue());
- param.setPresId(getCurrentPersId());
- if (StringUtils.isBlank(param.getAdCode())) {
- param.setAdCodes(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
- }
- PageInfo<BisInspWtgovRgstrDto> pageInfo = bisInspWtgovRgstrService.findObjPageByType(param, response);
- return buildSuccessResponse(pageInfo);
- }
- }
|