b2c509346063d6b2e6011aed9cfb20244fff6163.svn-base 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package cn.com.goldenwater.dcproj.controller.fjqa;
  2. import cn.com.goldenwater.dcproj.model.BisInspQaScore1;
  3. import cn.com.goldenwater.dcproj.service.BisInspQaScore1Service;
  4. import cn.com.goldenwater.core.web.BaseController;
  5. import cn.com.goldenwater.core.web.BaseResponse;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.apache.commons.lang3.StringUtils;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RequestMethod;
  17. import org.springframework.web.bind.annotation.RequestParam;
  18. import org.springframework.web.bind.annotation.RestController;
  19. /**
  20. * @author hjp
  21. * @date 2022-7-28
  22. */
  23. @Api(value = "福建工程质量监督-分数说明管理", tags = "福建工程质量监督-分数说明管理")
  24. @RestController
  25. @RequestMapping("/bis/insp/fjqa/score1")
  26. public class BisInspQaScore1Controller extends BaseController {
  27. private Logger logger = LoggerFactory.getLogger(getClass());
  28. @Autowired
  29. private BisInspQaScore1Service bisInspQaScore1Service;
  30. @ApiOperation(value = "添加/修改福建工程质量监督-分数说明")
  31. @RequestMapping(value = "", method = RequestMethod.POST)
  32. public BaseResponse<BisInspQaScore1> insert(@ApiParam(name = "bisInspQaScore1", value = "BisInspQaScore1", required = true) @RequestBody BisInspQaScore1 bisInspQaScore1) {
  33. int ret = 0;
  34. if (StringUtils.isBlank(bisInspQaScore1.getId())) {
  35. ret = bisInspQaScore1Service.insert(bisInspQaScore1);
  36. } else {
  37. ret = bisInspQaScore1Service.update(bisInspQaScore1);
  38. }
  39. return buildSuccessResponse(bisInspQaScore1);
  40. }
  41. @ApiOperation(value = "根据ID删除福建工程质量监督-分数说明")
  42. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  43. public BaseResponse<?> delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  44. int ret = bisInspQaScore1Service.delete(id);
  45. return buildSuccessResponse();
  46. }
  47. @ApiOperation(value = "根据scoreName和caseId获取福建工程质量监督-分数说明(单表)")
  48. @RequestMapping(value = "/get", method = RequestMethod.GET)
  49. public BaseResponse<BisInspQaScore1> get(@ApiParam(name = "caseId", value = "caseId", required = true) @RequestParam String caseId, @ApiParam(name = "scoreName", value = "scoreName", required = true) @RequestParam String scoreName) {
  50. BisInspQaScore1 bisInspQaScore1 = bisInspQaScore1Service.getByCaseScore(caseId, scoreName);
  51. return buildSuccessResponse(bisInspQaScore1);
  52. }
  53. }