| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package cn.com.goldenwater.dcproj.controller.tac;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.TacPawpBstocmTsopbfpSctn;
- import cn.com.goldenwater.dcproj.param.TacPawpBstocmTsopbfpSctnParam;
- import cn.com.goldenwater.dcproj.service.TacPawpBstocmTsopbfpSctnService;
- 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.Date;
- /**
- * @author lune
- * @date 2019-6-19
- */
- @Api(value = "TAC 专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表管理", tags = "TAC 专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表管理")
- @RestController
- @RequestMapping("/tac/pawp/bstocm/tsopbfp/sctn")
- public class TacPawpBstocmTsopbfpSctnController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private TacPawpBstocmTsopbfpSctnService tacPawpBstocmTsopbfpSctnService;
- @ApiOperation(value = "添加/修改专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<TacPawpBstocmTsopbfpSctn> insert(@ApiParam(name = "tacPawpBstocmTsopbfpSctn", value = "TacPawpBstocmTsopbfpSctn", required = true) @RequestBody TacPawpBstocmTsopbfpSctn tacPawpBstocmTsopbfpSctn) {
- if (StringUtils.isNotBlank(tacPawpBstocmTsopbfpSctn.getId())) {
- tacPawpBstocmTsopbfpSctn.setUptm(new Date());
- tacPawpBstocmTsopbfpSctnService.update(tacPawpBstocmTsopbfpSctn);
- } else {
- String uuid = UuidUtil.uuid(); // 生成uuid
- tacPawpBstocmTsopbfpSctn.setId(uuid);
- tacPawpBstocmTsopbfpSctn.setIntm(new Date());
- int ret = tacPawpBstocmTsopbfpSctnService.insert(tacPawpBstocmTsopbfpSctn);
- }
- return buildSuccessResponse(tacPawpBstocmTsopbfpSctn);
- }
- @ApiOperation(value = "根据ID删除专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表")
- @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = tacPawpBstocmTsopbfpSctnService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<TacPawpBstocmTsopbfpSctn> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- TacPawpBstocmTsopbfpSctn tacPawpBstocmTsopbfpSctn = tacPawpBstocmTsopbfpSctnService.get(id);
- return buildSuccessResponse(tacPawpBstocmTsopbfpSctn);
- }
- @ApiOperation(value = "获取专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表(分页列表)")
- @RequestMapping(value = "/page", method = RequestMethod.POST)
- public BaseResponse<PageInfo<TacPawpBstocmTsopbfpSctn>> page(@ApiParam(name = "TacPawpBstocmTsopbfpSctnParam", value = "TacPawpBstocmTsopbfpSctnParam", required = true) @RequestBody TacPawpBstocmTsopbfpSctnParam param) {
- PageInfo<TacPawpBstocmTsopbfpSctn> tacPawpBstocmTsopbfpSctnPageInfo = tacPawpBstocmTsopbfpSctnService.findPageInfo(param);
- return buildSuccessResponse(tacPawpBstocmTsopbfpSctnPageInfo);
- }
- }
|