e58ff644de1bb87cde4c2ed1977139086e2fcb0d.svn-base 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package cn.com.goldenwater.dcproj.controller.ststn;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspStstnPb;
  5. import cn.com.goldenwater.dcproj.service.BisInspStstnPbService;
  6. import cn.com.goldenwater.dcproj.utils.StringUtils;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.util.Assert;
  14. import org.springframework.web.bind.annotation.PathVariable;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RequestMethod;
  18. import org.springframework.web.bind.annotation.RestController;
  19. /**
  20. * 标准化示范工地评分细则 党建进工地
  21. * @author lxf
  22. * @date 2023年6月12日
  23. */
  24. @Api(value = "福建省标准化示范工地-党建进工地管理",tags="福建省标准化示范工地-党建进工地管理")
  25. @RestController
  26. @RequestMapping("/bis/insp/ststn/pb")
  27. public class BisInspStstnPbController extends BaseController {
  28. private Logger logger = LoggerFactory.getLogger(getClass());
  29. @Autowired
  30. private BisInspStstnPbService bisInspStstnPbService;
  31. @ApiOperation(value = "添加福建省标准化示范工地-党建进工地填报信息")
  32. @RequestMapping(value = "", method = RequestMethod.POST)
  33. public BaseResponse<BisInspStstnPb> insert(@ApiParam(name = "bisInspStstnPb", value = "BisInspStstnPb", required = true) @RequestBody BisInspStstnPb bisInspStstnPb) {
  34. bisInspStstnPb.setPersId(getCurrentPersId());
  35. if(StringUtils.isBlank(bisInspStstnPb.getId())) {
  36. bisInspStstnPbService.insert(bisInspStstnPb);
  37. }
  38. else{
  39. bisInspStstnPbService.update(bisInspStstnPb);
  40. }
  41. return buildSuccessResponse(bisInspStstnPb);
  42. }
  43. @ApiOperation(value = "根据ID删除建省标准化示范工地-党建进工地填报信息")
  44. @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
  45. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  46. int ret = bisInspStstnPbService.delete(id);
  47. return buildSuccessResponse();
  48. }
  49. @ApiOperation(value = "更新建省标准化示范工地-党建进工地信息")
  50. @RequestMapping(value = "/update", method = RequestMethod.POST)
  51. public BaseResponse<BisInspStstnPb> update(@ApiParam(name = "bisInspStstnPb", value = "BisInspStstnPb", required = true) @RequestBody BisInspStstnPb bisInspStstnPb) {
  52. Assert.notNull(bisInspStstnPb.getId(), "主键id为必填参数");
  53. int ret = bisInspStstnPbService.update(bisInspStstnPb);
  54. return buildSuccessResponse(bisInspStstnPb);
  55. }
  56. /**
  57. * 根据登记表 rgstrId 获取 党建进工地的 打分信息
  58. * @param id
  59. * @return
  60. */
  61. @ApiOperation(value = "根据ID获取建省标准化示范工地-党建进工地信息(单表)")
  62. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  63. public BaseResponse<BisInspStstnPb> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  64. BisInspStstnPb bisInspStstnPb = bisInspStstnPbService.get(id);
  65. return buildSuccessResponse(bisInspStstnPb);
  66. }
  67. }