package cn.com.goldenwater.dcproj.controller.tacplan; import cn.com.goldenwater.dcproj.model.TacProvincePlanExamine; import cn.com.goldenwater.dcproj.param.TacProvincePlanExamineParam; import cn.com.goldenwater.dcproj.service.TacProvincePlanExamineService; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.id.util.UuidUtil; import io.micrometer.core.instrument.util.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.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * @author * @date 2021-1-28 */ @Api(value = "工程阶段审定管理",tags="工程阶段审定管理") @RestController @RequestMapping("/tac/province/examine") public class TacProvincePlanExamineController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private TacProvincePlanExamineService tacProvincePlanExamineService; @ApiOperation(value = "添加工程阶段审定") @RequestMapping(value = "/add", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "tacProvincePlanExamine", value = "TacProvincePlanExamine", required = true) @RequestBody TacProvincePlanExamine tacProvincePlanExamine) { if(StringUtils.isBlank(tacProvincePlanExamine.getRgstrId())){ return buildFailResponse("工程参数不能为空"); } if(StringUtils.isBlank(tacProvincePlanExamine.getPlanProcessId())){ return buildFailResponse("阶段参数不能为空"); } int ret = tacProvincePlanExamineService.insert(tacProvincePlanExamine); return buildSuccessResponse(tacProvincePlanExamine); } @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 = tacProvincePlanExamineService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "更新工程阶段审定信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "tacProvincePlanExamine", value = "TacProvincePlanExamine", required = true) @RequestBody TacProvincePlanExamine tacProvincePlanExamine) { Assert.notNull(tacProvincePlanExamine.getId(), "主键id为必填参数"); int ret = tacProvincePlanExamineService.update(tacProvincePlanExamine); return buildSuccessResponse(tacProvincePlanExamine); } @ApiOperation(value = "根据ID获取工程阶段审定(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { TacProvincePlanExamine tacProvincePlanExamine = tacProvincePlanExamineService.get(id); return buildSuccessResponse(tacProvincePlanExamine); } @ApiOperation(value = "根据ID获取工程阶段审定(单表)") @RequestMapping(value = "/getBy", method = RequestMethod.POST) public BaseResponse getBy(@ApiParam(name = "tacProvincePlanExamineParam", value = "TacProvincePlanExamineParam", required = true) @RequestBody TacProvincePlanExamineParam tacProvincePlanExamineParam) { if(StringUtils.isBlank(tacProvincePlanExamineParam.getRgstrId())){ return buildFailResponse("工程参数不能为空"); } if(StringUtils.isBlank(tacProvincePlanExamineParam.getPlanProcessId())){ return buildFailResponse("阶段参数不能为空"); } TacProvincePlanExamine tacProvincePlanExamine = tacProvincePlanExamineService.getBy(tacProvincePlanExamineParam); return buildSuccessResponse(tacProvincePlanExamine); } }