| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- package cn.com.goldenwater.dcproj.controller;
- 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.model.AttCwsBase;
- import cn.com.goldenwater.dcproj.model.BisInspVill2021Cws;
- import cn.com.goldenwater.dcproj.param.BisInspVill2021CwsParam;
- import cn.com.goldenwater.dcproj.param.CwsParam;
- import cn.com.goldenwater.dcproj.service.BisInspVill2021CwsService;
- import cn.com.goldenwater.dcproj.utils.Builder;
- import cn.com.goldenwater.target.CheckException;
- import cn.com.goldenwater.util.common.InspPblmUtils;
- 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 java.util.List;
- /**
- * @author lhc
- * @date 2021-6-16
- */
- @Api(value = "097 2021农饮-工程管理", tags = "097 2021农饮-工程管理")
- @RestController
- @RequestMapping("/bis/insp/vill2021/cws")
- public class BisInspVill2021CwsController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspVill2021CwsService bisInspVill2021CwsService;
- @ApiOperation(value = "修改097 2021农饮-工程")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<BisInspVill2021Cws> insert(@ApiParam(name = "bisInspVill2021Cws", value = "BisInspVill2021Cws", required = true) @RequestBody BisInspVill2021Cws bisInspVill2021Cws) {
- int ret = 0;
- if (StringUtils.isBlank(bisInspVill2021Cws.getId())) {
- ret = bisInspVill2021CwsService.insert(bisInspVill2021Cws);
- } else {
- ret = bisInspVill2021CwsService.update(bisInspVill2021Cws);
- }
- return buildSuccessResponse(bisInspVill2021Cws);
- }
- @ApiOperation(value = "根据ID删除097 2021农饮-工程")
- @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisInspVill2021Cws bisInspVill2021Cws = bisInspVill2021CwsService.get(id);
- int ret = bisInspVill2021CwsService.delete(id);
- return buildSuccessResponse(bisInspVill2021Cws);
- }
- @ApiOperation(value = "根据ID获取097 2021农饮-工程(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisInspVill2021Cws> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisInspVill2021Cws bisInspVill2021Cws = bisInspVill2021CwsService.get(id);
- return buildSuccessResponse(bisInspVill2021Cws);
- }
- @ApiOperation(value = "获取未被督查的供水工程(添加供水工程列表)")
- @RequestMapping(value = "/pageNotDC", method = RequestMethod.POST)
- public BaseResponse<PageInfo<AttCwsBase>> pageNotDC(@ApiParam(name = "cwsParam", value = "cwsParam", required = true)
- @RequestBody CwsParam cwsParam) {
- if (StringUtils.isNotBlank(cwsParam.getAdCode())) {
- cwsParam.setAdCode(InspPblmUtils.getAddVCD(cwsParam.getAdCode()));
- }
- cwsParam.setType(BisInspEnum.VILL2021.getValue());
- PageInfo<AttCwsBase> bisNewCountryFeeList = bisInspVill2021CwsService.pageNotDC(cwsParam);
- return buildSuccessResponse(bisNewCountryFeeList);
- }
- @ApiOperation(value = "添加/修改农村供水工程水费收缴及水质保障情况表")
- @RequestMapping(value = "/addBatch", method = RequestMethod.POST)
- public BaseResponse addBatch(@ApiParam(name = "cwsParam", value = "cwsParam", required = true)
- @RequestBody CwsParam cwsParam) {
- cwsParam.setPersId(getCurrentPersId());
- if (StringUtils.isBlank(cwsParam.getCwsIds())) {
- throw new CheckException("缺少工程编码");
- }
- bisInspVill2021CwsService.addBatch(cwsParam);
- return buildSuccessResponse("添加成功");
- }
- @ApiOperation(value = "列表--分页")
- @RequestMapping(value = "/list/{rgstId}", method = RequestMethod.GET)
- public BaseResponse<List<BisInspVill2021Cws>> list(@PathVariable String rgstId) {
- return buildSuccessResponse(bisInspVill2021CwsService.findList(Builder
- .of(BisInspVill2021CwsParam::new)
- .with(BisInspVill2021CwsParam::setRgstrId, rgstId)
- .build()));
- }
- }
|