package cn.com.goldenwater.dcproj.controller.plansd; import cn.com.goldenwater.dcproj.model.BisInspPlandpRl; import cn.com.goldenwater.dcproj.param.BisInspPlandpRlParam; import cn.com.goldenwater.dcproj.service.BisInspPlandpRlService; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; 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.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.RestController; import java.util.List; /** * @author hjp * @date 2022-8-9 */ @Api(value = "年度计划参建单位信息管理",tags="年度计划参建单位信息管理") @RestController @RequestMapping("/bis/insp/plan/dprl") public class BisInspPlandpRlController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspPlandpRlService bisInspPlandpRlService; @ApiOperation(value = "添加年度计划参建单位信息") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspPlandpRl", value = "BisInspPlandpRl", required = true) @RequestBody BisInspPlandpRl bisInspPlandpRl) { bisInspPlandpRl.setPersId(getCurrentPersId()); if (StringUtils.isBlank(bisInspPlandpRl.getId())){ bisInspPlandpRlService.insert(bisInspPlandpRl); }else { bisInspPlandpRlService.update(bisInspPlandpRl); } return buildSuccessResponse(bisInspPlandpRl); } @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 = bisInspPlandpRlService.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) { BisInspPlandpRl bisInspPlandpRl = bisInspPlandpRlService.get(id); return buildSuccessResponse(bisInspPlandpRl); } @ApiOperation(value = "获取年度计划参建单位信息数据") @RequestMapping(value = "/findList", method = RequestMethod.POST) public BaseResponse> findList(@RequestBody BisInspPlandpRlParam param) { return buildSuccessResponse(bisInspPlandpRlService.findList(param)); } }