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.BisInspWtuntRgstrSteel; import cn.com.goldenwater.dcproj.model.BisInspWtuntRgstrSteelReo; import cn.com.goldenwater.dcproj.model.BisInspWtuntRgstrVo; import cn.com.goldenwater.dcproj.param.BisInspWtuntRgstrSteelParam; import cn.com.goldenwater.dcproj.param.BisInspWtuntRgstrSteelReoParam; import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrService; import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrSteelReoService; import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrSteelService; 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.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") public class BisInspWtuntRgstrSteelController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspWtuntRgstrSteelService bisInspWtuntRgstrSteelService; @Autowired private BisInspWtuntRgstrService bisInspWtuntRgstrService; @Autowired private BisInspWtuntRgstrSteelReoService bisInspWtuntRgstrSteelReoService; @ApiOperation(value = "添加/修改2020年度用水单位节约用水情况检查表(钢铁)") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspWtuntRgstrVo", value = "BisInspWtuntRgstrVo", required = true) @RequestBody BisInspWtuntRgstrVo bisInspWtuntRgstrVo) { bisInspWtuntRgstrSteelService.insertSteel(bisInspWtuntRgstrVo); return buildSuccessResponse(bisInspWtuntRgstrVo); } @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 = bisInspWtuntRgstrSteelService.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) { BisInspWtuntRgstrSteel bisInspWtuntRgstrSteel = bisInspWtuntRgstrSteelService.get(id); return buildSuccessResponse(bisInspWtuntRgstrSteel); } @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表(钢铁)(列表所有)") @RequestMapping(value = "/list", method = RequestMethod.POST) public BaseResponse> list(@ApiParam(name = "bisInspWtuntRgstrSteelParam", value = "bisInspWtuntRgstrSteelParam", required = true) @RequestBody BisInspWtuntRgstrSteelParam bisInspWtuntRgstrSteelParam) { List bisInspWtuntRgstrSteelList = bisInspWtuntRgstrSteelService.findList(bisInspWtuntRgstrSteelParam); return buildSuccessResponse(bisInspWtuntRgstrSteelList); } @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表(钢铁)(列表--分页)") @RequestMapping(value = "/page", method = RequestMethod.POST) public BaseResponse> page(@ApiParam(name = "bisInspWtuntRgstrSteelParam", value = "bisInspWtuntRgstrSteelParam", required = true) @RequestBody BisInspWtuntRgstrSteelParam bisInspWtuntRgstrSteelParam) { PageInfo bisInspWtuntRgstrSteelList = bisInspWtuntRgstrSteelService.findPageInfo(bisInspWtuntRgstrSteelParam); return buildSuccessResponse(bisInspWtuntRgstrSteelList); } @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表(钢铁)") @RequestMapping(value = "/getBy/{rgstrId}", method = RequestMethod.POST) public BaseResponse getBy(@ApiParam(name = "rgstrId", value = "rgstrId", required = true) @PathVariable String rgstrId) { BisInspWtuntRgstrVo vo = new BisInspWtuntRgstrVo(); BisInspWtuntRgstrSteelParam steelParam = new BisInspWtuntRgstrSteelParam(); steelParam.setRgstrId(rgstrId); BisInspWtuntRgstrSteel steel = bisInspWtuntRgstrSteelService.getBy(steelParam); vo.setBisInspWtuntRgstrSteel(steel); BisInspWtuntRgstrSteelReoParam steelReoParam = new BisInspWtuntRgstrSteelReoParam(); steelReoParam.setRgstrId(rgstrId); List reo = bisInspWtuntRgstrSteelReoService.findList(steelReoParam); vo.setBisInspWtuntRgstrSteelReo(reo); return buildSuccessResponse(vo); } }