package cn.com.goldenwater.dcproj.controller.villqh; 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.BisInspVillqhFee; import cn.com.goldenwater.dcproj.param.CwsParam; import cn.com.goldenwater.dcproj.service.BisInspVillqhFeeService; 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.*; /** * @author lhc * @date 2021-2-1 */ @Api(value = "农饮(青海)-工程暗访情况管理", tags = "农饮(青海)-工程暗访情况管理") @RestController @RequestMapping("/bis/insp/villqh/fee") public class BisInspVillqhFeeController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspVillqhFeeService bisInspVillqhFeeService; @ApiOperation(value = "修改农饮(青海)-工程暗访情况") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspVillqhFee", value = "BisInspVillqhFee", required = true) @RequestBody BisInspVillqhFee bisInspVillqhFee) { int ret = 0; if (StringUtils.isBlank(bisInspVillqhFee.getId())) { throw new CheckException("缺少编码"); } ret = bisInspVillqhFeeService.update(bisInspVillqhFee); return buildSuccessResponse(bisInspVillqhFee); } @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 = bisInspVillqhFeeService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "根据ID获取农饮(青海)-工程暗访情况(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { BisInspVillqhFee bisInspVillqhFee = bisInspVillqhFeeService.get(id); return buildSuccessResponse(bisInspVillqhFee); } @ApiOperation(value = "获取未被督查的供水工程(添加供水工程列表)") @RequestMapping(value = "/pageNotDC", method = RequestMethod.POST) public BaseResponse> 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.VILLQH.getValue()); PageInfo bisNewCountryFeeList = bisInspVillqhFeeService.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) { if (StringUtils.isBlank(cwsParam.getCwsIds())) { throw new CheckException("缺少工程编码"); } bisInspVillqhFeeService.addBatch(cwsParam); return buildSuccessResponse("添加成功"); } }