You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
3.3 KiB

2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
  1. package com.spring.modules.code.controller;
  2. import com.spring.common.utils.R;
  3. import com.spring.modules.code.vo.CodeConditionDetailVo;
  4. import com.spring.modules.code.vo.CodeItemDefVo;
  5. import com.spring.modules.code.entity.CodeItemValue;
  6. import com.spring.modules.code.service.CodeItemValueService;
  7. import com.spring.modules.code.vo.CodeItemValueVo;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.*;
  10. import java.util.ArrayList;
  11. import java.util.List;
  12. import java.util.Objects;
  13. @RestController
  14. @RequestMapping("/code/value")
  15. public class CodeItemValueController {
  16. @Autowired
  17. private CodeItemValueService codeItemValueService;
  18. @PostMapping("/list")
  19. public R searchCodeItemValueList(@RequestBody CodeItemDefVo codeItemDefVo) {
  20. CodeItemDefVo codeItemDef = codeItemValueService.searchCodeItemValueList(codeItemDefVo);
  21. return Objects.requireNonNull(Objects.requireNonNull(R.ok().put("rows1", codeItemDef.getItemValues())).put("rows2", codeItemDef.getConditionHeaders())).put("rows3",codeItemDefVo.getConditionDetails());
  22. }
  23. @PostMapping("/list/item")
  24. public R searchCodeItemValueListItem(@RequestBody CodeItemValue codeItemValue) {
  25. List<CodeItemValueVo> list = codeItemValueService.searchCodeItemValueListItem(codeItemValue);
  26. return R.ok().put("rows", list);
  27. }
  28. @PostMapping("/save")
  29. public R saveCodeItemValue(@RequestBody CodeItemValue codeItemValue) {
  30. codeItemValueService.saveCodeItemValue(codeItemValue);
  31. return R.ok().put("msg", "保存成功");
  32. }
  33. @PostMapping("/save/batch")
  34. public R saveCodeItemValueBatch(@RequestBody List<CodeItemValue> codeItemValueList) {
  35. codeItemValueService.saveCodeItemValueBatch(codeItemValueList);
  36. return R.ok().put("msg", "保存成功");
  37. }
  38. @PostMapping("/remove")
  39. public R removeCodeItemValue(@RequestBody CodeItemValue codeItemValue) {
  40. codeItemValueService.removeCodeItemValue(codeItemValue);
  41. return R.ok().put("msg", "删除成功");
  42. }
  43. @PostMapping("/remove/batch")
  44. public R removeCodeItemValueBatch(@RequestBody List<CodeItemValue> codeItemValueList) {
  45. codeItemValueService.removeCodeItemValueBatch(codeItemValueList);
  46. return R.ok().put("msg", "删除成功");
  47. }
  48. @PostMapping("/edit")
  49. public R updateCodeItemValue(@RequestBody CodeItemValue codeItemValue) {
  50. codeItemValueService.updateCodeItemValue(codeItemValue);
  51. return R.ok().put("msg", "保存成功");
  52. }
  53. @PostMapping("/edit/batch")
  54. public R updateCodeItemValueBatch(@RequestBody List<CodeItemValue> codeItemValueList) {
  55. codeItemValueService.updateCodeItemValueBatch(codeItemValueList);
  56. return R.ok().put("msg", "保存成功");
  57. }
  58. @PostMapping("/generation/list")
  59. public R searchCodeItemValueGenerationList(@RequestBody List<CodeItemDefVo> codeItemDefVoList) {
  60. List<CodeItemValueVo> list = codeItemValueService.searchCodeItemValueGenerationList(codeItemDefVoList);
  61. return R.ok().put("rows", list);
  62. }
  63. @PostMapping("/detail")
  64. public R queryCodeItemValueDetail(@RequestBody CodeItemValue codeItemValue) {
  65. List<CodeConditionDetailVo> list = codeItemValueService.queryCodeItemValueDetail(codeItemValue);
  66. return R.ok().put("rows", list);
  67. }
  68. }