4a250dd475db583902e3bdfe535c7ffa745ac21d.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package cn.com.goldenwater.dcproj.controller.ststn;
  2. import cn.com.goldenwater.dcproj.model.AttStstnBase;
  3. import cn.com.goldenwater.dcproj.model.AttWtgtBase;
  4. import cn.com.goldenwater.dcproj.param.AttStstnBaseParam;
  5. import cn.com.goldenwater.dcproj.service.AttStstnBaseService;
  6. import cn.com.goldenwater.core.web.BaseController;
  7. import cn.com.goldenwater.core.web.BaseResponse;
  8. import cn.com.goldenwater.id.util.UuidUtil;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import io.swagger.annotations.ApiParam;
  12. import org.slf4j.Logger;
  13. import org.slf4j.LoggerFactory;
  14. import org.apache.commons.lang3.StringUtils;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.util.Assert;
  17. import org.springframework.web.bind.annotation.PathVariable;
  18. import org.springframework.web.bind.annotation.RequestBody;
  19. import org.springframework.web.bind.annotation.RequestMapping;
  20. import org.springframework.web.bind.annotation.RequestMethod;
  21. import org.springframework.web.bind.annotation.RequestParam;
  22. import org.springframework.web.bind.annotation.RestController;
  23. import java.util.List;
  24. /**
  25. * @author lhc
  26. * @date 2021-7-13
  27. */
  28. @Api(value = "福建标准化工地-工程信息管理",tags="福建标准化工地-工程信息管理")
  29. @RestController
  30. @RequestMapping("/att/ststn/base")
  31. public class AttStstnBaseController extends BaseController {
  32. private Logger logger = LoggerFactory.getLogger(getClass());
  33. @Autowired
  34. private AttStstnBaseService attStstnBaseService;
  35. @ApiOperation(value = "修改福建标准化工地-工程信息")
  36. @RequestMapping(value = "", method = RequestMethod.POST)
  37. public BaseResponse<AttStstnBase> insert(@ApiParam(name = "attStstnBase", value = "AttStstnBase", required = true) @RequestBody AttStstnBase attStstnBase) {
  38. int ret = 0;
  39. if(StringUtils.isBlank(attStstnBase.getId())){
  40. ret = attStstnBaseService.insert(attStstnBase);
  41. } else {
  42. ret = attStstnBaseService.update(attStstnBase);
  43. }
  44. return buildSuccessResponse(attStstnBase);
  45. }
  46. @ApiOperation(value = "根据ID删除福建标准化工地-工程信息")
  47. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  48. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  49. int ret = attStstnBaseService.delete(id);
  50. return buildSuccessResponse();
  51. }
  52. @ApiOperation(value = "根据ID获取福建标准化工地-工程信息(单表)")
  53. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  54. public BaseResponse<AttStstnBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  55. AttStstnBase attStstnBase = attStstnBaseService.get(id);
  56. return buildSuccessResponse(attStstnBase);
  57. }
  58. @ApiOperation(value = "根据 objId 获取取水许可管理基本信息(单表)")
  59. @RequestMapping(value = "/getObjId/{objId}", method = RequestMethod.GET)
  60. public BaseResponse<AttStstnBase> getObjId(@ApiParam(name = "objId", value = "objId", required = true) @PathVariable String objId) {
  61. AttStstnBase attStstnBase = attStstnBaseService.getObjId(objId);
  62. return buildSuccessResponse(attStstnBase);
  63. }
  64. }