package cn.com.goldenwater.dcproj.controller.wtunt; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.BisInspWtuntRgstrSteelReo; import cn.com.goldenwater.dcproj.param.BisInspWtuntRgstrSteelReoParam; import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrSteelReoService; import cn.com.goldenwater.id.util.UuidUtil; 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 lune * @date 2020-8-17 */ @Api(value = "BIS 2020年度用水单位节约用水情况检查表-主要产品产量管理",tags="BIS 2020年度用水单位节约用水情况检查表-主要产品产量管理") @RestController @RequestMapping("/bis/insp/wtunt/rgstr/steel/reo") public class BisInspWtuntRgstrSteelReoController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspWtuntRgstrSteelReoService bisInspWtuntRgstrSteelReoService; @ApiOperation(value = "添加/修改2020年度用水单位节约用水情况检查表-主要产品产量") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspWtuntRgstrSteelReo", value = "BisInspWtuntRgstrSteelReo", required = true) @RequestBody BisInspWtuntRgstrSteelReo bisInspWtuntRgstrSteelReo) { if(StringUtils.isBlank(bisInspWtuntRgstrSteelReo.getId())) { // 生成uuid String uuid = UuidUtil.uuid(); bisInspWtuntRgstrSteelReo.setId(uuid); bisInspWtuntRgstrSteelReoService.insert(bisInspWtuntRgstrSteelReo); }else{ bisInspWtuntRgstrSteelReoService.update(bisInspWtuntRgstrSteelReo); } return buildSuccessResponse(bisInspWtuntRgstrSteelReo); } @ApiOperation(value = "根据ID删除2020年度用水单位节约用水情况检查表-主要产品产量") @RequestMapping(value = "/del/{id}", method = RequestMethod.GET) public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { int ret = bisInspWtuntRgstrSteelReoService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "根据ID获取2020年度用水单位节约用水情况检查表-主要产品产量(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { BisInspWtuntRgstrSteelReo bisInspWtuntRgstrSteelReo = bisInspWtuntRgstrSteelReoService.get(id); return buildSuccessResponse(bisInspWtuntRgstrSteelReo); } @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表-主要产品产量(列表所有)") @RequestMapping(value = "/list", method = RequestMethod.POST) public BaseResponse> list(@ApiParam(name = "bisInspWtuntRgstrSteelReoParam", value = "bisInspWtuntRgstrSteelReoParam", required = true) @RequestBody BisInspWtuntRgstrSteelReoParam bisInspWtuntRgstrSteelReoParam) { List bisInspWtuntRgstrSteelReoList = bisInspWtuntRgstrSteelReoService.findList(bisInspWtuntRgstrSteelReoParam); return buildSuccessResponse(bisInspWtuntRgstrSteelReoList); } @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表-主要产品产量(列表--分页)") @RequestMapping(value = "/page", method = RequestMethod.POST) public BaseResponse> page(@ApiParam(name = "bisInspWtuntRgstrSteelReoParam", value = "bisInspWtuntRgstrSteelReoParam", required = true) @RequestBody BisInspWtuntRgstrSteelReoParam bisInspWtuntRgstrSteelReoParam) { PageInfo bisInspWtuntRgstrSteelReoList = bisInspWtuntRgstrSteelReoService.findPageInfo(bisInspWtuntRgstrSteelReoParam); return buildSuccessResponse(bisInspWtuntRgstrSteelReoList); } @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表-主要产品产量") @RequestMapping(value = "/getBy/{rgstrId}", method = RequestMethod.POST) public BaseResponse getBy(@ApiParam(name = "rgstrId", value = "rgstrId", required = true) @PathVariable String rgstrId) { BisInspWtuntRgstrSteelReoParam steelReoParam = new BisInspWtuntRgstrSteelReoParam(); steelReoParam.setRgstrId(rgstrId); return buildSuccessResponse(bisInspWtuntRgstrSteelReoService.getBy(steelReoParam)); } }