| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- package cn.com.goldenwater.dcproj.controller.svwtqh;
- import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
- import cn.com.goldenwater.dcproj.dto.BisInspSvwtqhDto;
- import cn.com.goldenwater.dcproj.model.BisInspSvwtqh;
- import cn.com.goldenwater.dcproj.param.BisInspSvwtqhParam;
- import cn.com.goldenwater.dcproj.param.TypeParam;
- import cn.com.goldenwater.dcproj.service.BisInspSvwtqhService;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- import cn.com.goldenwater.id.util.UuidUtil;
- 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.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.util.Assert;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import javax.servlet.http.HttpServletResponse;
- import java.util.List;
- /**
- * @author lhc
- * @date 2021-6-23
- */
- @Api(value = "青海-县域节水型社会达标建设监督管理",tags="青海-县域节水型社会达标建设监督管理")
- @RestController
- @RequestMapping("/bis/insp/svwtqh")
- public class BisInspSvwtqhController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspSvwtqhService bisInspSvwtqhService;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @ApiOperation(value = "修改青海-县域节水型社会达标建设监督")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<BisInspSvwtqh> insert(@ApiParam(name = "bisInspSvwtqh", value = "BisInspSvwtqh", required = true) @RequestBody BisInspSvwtqh bisInspSvwtqh) {
- if(StringUtils.isNotBlank(bisInspSvwtqh.getRgstrId())&&StringUtils.isBlank(bisInspSvwtqh.getId())){
- bisInspSvwtqh.setId(bisInspSvwtqh.getRgstrId());
- }
- if(StringUtils.isBlank(bisInspSvwtqh.getId())){
- throw new CheckException("缺少登记表编码");
- }
- bisInspSvwtqhService.update(bisInspSvwtqh);
- return buildSuccessResponse(bisInspSvwtqh);
- }
- @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 = bisInspSvwtqhService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取青海-县域节水型社会达标建设监督(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisInspSvwtqh> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisInspSvwtqh bisInspSvwtqh = bisInspSvwtqhService.get(id);
- return buildSuccessResponse(bisInspSvwtqh);
- }
- @ApiOperation(value = "获取督查对象")
- @RequestMapping(value = "/findPage", method = RequestMethod.POST)
- public BaseResponse<PageInfo<BisInspSvwtqhDto>>findPage(@RequestBody TypeParam param, HttpServletResponse response) {
- param.setProvince(olBisInspOrgService.getProvince(getCurrentOrgId()));
- param.setpType(BisInspEnum.WTGOV.getValue());
- param.setPresId(getCurrentPersId());
- if (StringUtils.isBlank(param.getAdCode())) {
- param.setAdCodes(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
- }
- PageInfo<BisInspSvwtqhDto> pageInfo = bisInspSvwtqhService.findObjPageByType(param, response);
- return buildSuccessResponse(pageInfo);
- }
- }
|