DcSpecController.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package com.gqy.web.controller.document;
  2. import com.gqy.common.core.controller.BaseController;
  3. import com.gqy.common.core.domain.AjaxResult;
  4. import com.gqy.common.core.page.TableDataInfo;
  5. import com.gqy.common.enums.BusinessType;
  6. import com.gqy.document.domain.DcSpec;
  7. import com.gqy.document.service.IDcSpecService;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.security.access.prepost.PreAuthorize;
  10. import org.springframework.web.bind.annotation.*;
  11. import java.util.HashMap;
  12. import java.util.List;
  13. import java.util.Map;
  14. /**
  15. * 产品规格Controller
  16. */
  17. @RestController
  18. @RequestMapping("/spec")
  19. public class DcSpecController extends BaseController {
  20. @Autowired
  21. private IDcSpecService iDcSpecService;
  22. /**
  23. * 查询产品规格列表
  24. */
  25. @GetMapping("/list")
  26. public TableDataInfo list(@RequestParam Map<String, Object> maps) {
  27. startPage();
  28. List<Map<String, Object>> list = iDcSpecService.selectDcPsParamAndSpec(maps);
  29. return getDataTable(list);
  30. }
  31. /**
  32. * 获取产品规格详细信息
  33. */
  34. @GetMapping(value = "/{psId}")
  35. public AjaxResult getInfo(@PathVariable("psId") Integer psId) {
  36. return success(iDcSpecService.selectDcSpecById(psId));
  37. }
  38. /**
  39. * 新增产品规格
  40. */
  41. @PostMapping(value = "/add")
  42. public AjaxResult add(@RequestBody Map dcSpec) {
  43. return toAjax(iDcSpecService.insertDcSpecParam(dcSpec));
  44. }
  45. /**
  46. * 修改产品规格
  47. */
  48. @PostMapping("/update")
  49. public AjaxResult update(@RequestBody Map maps) {
  50. return toAjax(iDcSpecService.updateDcSpecMaps(maps));
  51. }
  52. @GetMapping(value = "/delete/{psId}")
  53. public AjaxResult del(@PathVariable("psId") Integer psId) {
  54. return success(iDcSpecService.deleteDcPsParam(psId));
  55. }
  56. /**
  57. * 查询产品规格为全部
  58. * @return
  59. */
  60. @GetMapping(value = "/getDcSpecList")
  61. public List<Map<String, Object>> getDcSpecList(){
  62. Map maps = new HashMap();
  63. maps.put("ps_category","全部");
  64. maps.put("ps_p_id",0);
  65. List<Map<String, Object>> list = iDcSpecService.selectDcPsParamAndSpec(maps);
  66. return list;
  67. }
  68. }