70aa9cf869aa0a20dadd51edab0e40fc20d9f568.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package cn.com.goldenwater.dcproj.controller.qymten;
  2. import cn.com.goldenwater.dcproj.model.BisInspQymtenMsr;
  3. import cn.com.goldenwater.dcproj.param.BisInspQymtenMsrParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspQymtenMsrService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import cn.com.goldenwater.id.util.UuidUtil;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import io.swagger.annotations.ApiParam;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import org.apache.commons.lang3.StringUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.util.Assert;
  16. import org.springframework.web.bind.annotation.PathVariable;
  17. import org.springframework.web.bind.annotation.RequestBody;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RequestMethod;
  20. import org.springframework.web.bind.annotation.RequestParam;
  21. import org.springframework.web.bind.annotation.RestController;
  22. import java.util.List;
  23. /**
  24. * @author lhc
  25. * @date 2021-7-19
  26. */
  27. @Api(value = "总体质量管理措施管理",tags="总体质量管理措施管理")
  28. @RestController
  29. @RequestMapping("/bis/insp/qymten/msr")
  30. public class BisInspQymtenMsrController extends BaseController {
  31. private Logger logger = LoggerFactory.getLogger(getClass());
  32. @Autowired
  33. private BisInspQymtenMsrService bisInspQymtenMsrService;
  34. @ApiOperation(value = "修改总体质量管理措施")
  35. @RequestMapping(value = "", method = RequestMethod.POST)
  36. public BaseResponse<BisInspQymtenMsr> insert(@ApiParam(name = "bisInspQymtenMsr", value = "BisInspQymtenMsr", required = true) @RequestBody BisInspQymtenMsr bisInspQymtenMsr) {
  37. bisInspQymtenMsr.setPersId(getCurrentPersId());
  38. int ret = 0;
  39. if(StringUtils.isBlank(bisInspQymtenMsr.getId())){
  40. ret = bisInspQymtenMsrService.insert(bisInspQymtenMsr);
  41. } else {
  42. ret = bisInspQymtenMsrService.update(bisInspQymtenMsr);
  43. }
  44. return buildSuccessResponse(bisInspQymtenMsr);
  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 = bisInspQymtenMsrService.delete(id);
  50. return buildSuccessResponse();
  51. }
  52. @ApiOperation(value = "根据登记表ID获取总体质量管理措施(单表)")
  53. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  54. public BaseResponse<BisInspQymtenMsr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  55. BisInspQymtenMsr bisInspQymtenMsr = bisInspQymtenMsrService.get(id);
  56. return buildSuccessResponse(bisInspQymtenMsr);
  57. }
  58. }