90280ced6ed58dc587740babcd437fd873edaaff.svn-base 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package cn.com.goldenwater.dcproj.controller.tac;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.TacPawpBstocmTsopbfpSctn;
  5. import cn.com.goldenwater.dcproj.param.TacPawpBstocmTsopbfpSctnParam;
  6. import cn.com.goldenwater.dcproj.service.TacPawpBstocmTsopbfpSctnService;
  7. import cn.com.goldenwater.id.util.UuidUtil;
  8. import com.github.pagehelper.PageInfo;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import io.swagger.annotations.ApiParam;
  12. import org.apache.commons.lang3.StringUtils;
  13. import org.slf4j.Logger;
  14. import org.slf4j.LoggerFactory;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.web.bind.annotation.*;
  17. import java.util.Date;
  18. /**
  19. * @author lune
  20. * @date 2019-6-19
  21. */
  22. @Api(value = "TAC 专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表管理", tags = "TAC 专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表管理")
  23. @RestController
  24. @RequestMapping("/tac/pawp/bstocm/tsopbfp/sctn")
  25. public class TacPawpBstocmTsopbfpSctnController extends BaseController {
  26. private Logger logger = LoggerFactory.getLogger(getClass());
  27. @Autowired
  28. private TacPawpBstocmTsopbfpSctnService tacPawpBstocmTsopbfpSctnService;
  29. @ApiOperation(value = "添加/修改专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表")
  30. @RequestMapping(value = "", method = RequestMethod.POST)
  31. public BaseResponse<TacPawpBstocmTsopbfpSctn> insert(@ApiParam(name = "tacPawpBstocmTsopbfpSctn", value = "TacPawpBstocmTsopbfpSctn", required = true) @RequestBody TacPawpBstocmTsopbfpSctn tacPawpBstocmTsopbfpSctn) {
  32. if (StringUtils.isNotBlank(tacPawpBstocmTsopbfpSctn.getId())) {
  33. tacPawpBstocmTsopbfpSctn.setUptm(new Date());
  34. tacPawpBstocmTsopbfpSctnService.update(tacPawpBstocmTsopbfpSctn);
  35. } else {
  36. String uuid = UuidUtil.uuid(); // 生成uuid
  37. tacPawpBstocmTsopbfpSctn.setId(uuid);
  38. tacPawpBstocmTsopbfpSctn.setIntm(new Date());
  39. int ret = tacPawpBstocmTsopbfpSctnService.insert(tacPawpBstocmTsopbfpSctn);
  40. }
  41. return buildSuccessResponse(tacPawpBstocmTsopbfpSctn);
  42. }
  43. @ApiOperation(value = "根据ID删除专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表")
  44. @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
  45. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  46. int ret = tacPawpBstocmTsopbfpSctnService.delete(id);
  47. return buildSuccessResponse();
  48. }
  49. @ApiOperation(value = "根据ID获取专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表(单表)")
  50. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  51. public BaseResponse<TacPawpBstocmTsopbfpSctn> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  52. TacPawpBstocmTsopbfpSctn tacPawpBstocmTsopbfpSctn = tacPawpBstocmTsopbfpSctnService.get(id);
  53. return buildSuccessResponse(tacPawpBstocmTsopbfpSctn);
  54. }
  55. @ApiOperation(value = "获取专业稽察工作底稿-附件2建设管理基本情况表-2.招标投标制-标段列表(分页列表)")
  56. @RequestMapping(value = "/page", method = RequestMethod.POST)
  57. public BaseResponse<PageInfo<TacPawpBstocmTsopbfpSctn>> page(@ApiParam(name = "TacPawpBstocmTsopbfpSctnParam", value = "TacPawpBstocmTsopbfpSctnParam", required = true) @RequestBody TacPawpBstocmTsopbfpSctnParam param) {
  58. PageInfo<TacPawpBstocmTsopbfpSctn> tacPawpBstocmTsopbfpSctnPageInfo = tacPawpBstocmTsopbfpSctnService.findPageInfo(param);
  59. return buildSuccessResponse(tacPawpBstocmTsopbfpSctnPageInfo);
  60. }
  61. }