package cn.com.goldenwater.dcproj.controller.ststn; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.BisInspStstnPb; import cn.com.goldenwater.dcproj.service.BisInspStstnPbService; import cn.com.goldenwater.dcproj.utils.StringUtils; 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.util.Assert; 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; /** * 标准化示范工地评分细则 党建进工地 * @author lxf * @date 2023年6月12日 */ @Api(value = "福建省标准化示范工地-党建进工地管理",tags="福建省标准化示范工地-党建进工地管理") @RestController @RequestMapping("/bis/insp/ststn/pb") public class BisInspStstnPbController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspStstnPbService bisInspStstnPbService; @ApiOperation(value = "添加福建省标准化示范工地-党建进工地填报信息") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspStstnPb", value = "BisInspStstnPb", required = true) @RequestBody BisInspStstnPb bisInspStstnPb) { bisInspStstnPb.setPersId(getCurrentPersId()); if(StringUtils.isBlank(bisInspStstnPb.getId())) { bisInspStstnPbService.insert(bisInspStstnPb); } else{ bisInspStstnPbService.update(bisInspStstnPb); } return buildSuccessResponse(bisInspStstnPb); } @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 = bisInspStstnPbService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "更新建省标准化示范工地-党建进工地信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "bisInspStstnPb", value = "BisInspStstnPb", required = true) @RequestBody BisInspStstnPb bisInspStstnPb) { Assert.notNull(bisInspStstnPb.getId(), "主键id为必填参数"); int ret = bisInspStstnPbService.update(bisInspStstnPb); return buildSuccessResponse(bisInspStstnPb); } /** * 根据登记表 rgstrId 获取 党建进工地的 打分信息 * @param id * @return */ @ApiOperation(value = "根据ID获取建省标准化示范工地-党建进工地信息(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { BisInspStstnPb bisInspStstnPb = bisInspStstnPbService.get(id); return buildSuccessResponse(bisInspStstnPb); } }