StoreMngChangeController.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package com.kmall.admin.controller;
  2. import java.util.List;
  3. import java.util.Map;
  4. import com.kmall.admin.entity.StoreMngChangeEntity;
  5. import com.kmall.admin.service.StoreMngChangeService;
  6. import com.kmall.common.utils.PageUtils;
  7. import com.kmall.common.utils.Query;
  8. import com.kmall.common.utils.R;
  9. import org.apache.shiro.authz.annotation.RequiresPermissions;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.stereotype.Controller;
  12. import org.springframework.web.bind.annotation.*;
  13. /**
  14. * 门店库存变化表Controller
  15. *
  16. * @author emato
  17. * @email admin@qhdswl.com
  18. * @date 2019-03-11 10:29:49
  19. */
  20. @Controller
  21. @RequestMapping("storemngchange")
  22. public class StoreMngChangeController {
  23. @Autowired
  24. private StoreMngChangeService storeMngChangeService;
  25. /**
  26. * 查看列表
  27. */
  28. @RequestMapping("/list")
  29. @RequiresPermissions("storemngchange:list")
  30. @ResponseBody
  31. public R list(@RequestParam Map<String, Object> params) {
  32. //查询列表数据
  33. Query query = new Query(params);
  34. List<StoreMngChangeEntity> storeMngChangeList = storeMngChangeService.queryList(query);
  35. int total = storeMngChangeService.queryTotal(query);
  36. PageUtils pageUtil = new PageUtils(storeMngChangeList, total, query.getLimit(), query.getPage());
  37. return R.ok().put("page", pageUtil);
  38. }
  39. /**
  40. * 查看信息
  41. */
  42. @RequestMapping("/info/{id}")
  43. @RequiresPermissions("storemngchange:info")
  44. @ResponseBody
  45. public R info(@PathVariable("id") Integer id) {
  46. StoreMngChangeEntity storeMngChange = storeMngChangeService.queryObject(id);
  47. return R.ok().put("storeMngChange", storeMngChange);
  48. }
  49. /**
  50. * 保存
  51. */
  52. @RequestMapping("/save")
  53. @RequiresPermissions("storemngchange:save")
  54. @ResponseBody
  55. public R save(@RequestBody StoreMngChangeEntity storeMngChange) {
  56. storeMngChangeService.save(storeMngChange);
  57. return R.ok();
  58. }
  59. /**
  60. * 修改
  61. */
  62. @RequestMapping("/update")
  63. @RequiresPermissions("storemngchange:update")
  64. @ResponseBody
  65. public R update(@RequestBody StoreMngChangeEntity storeMngChange) {
  66. storeMngChangeService.update(storeMngChange);
  67. return R.ok();
  68. }
  69. /**
  70. * 删除
  71. */
  72. @RequestMapping("/delete")
  73. @RequiresPermissions("storemngchange:delete")
  74. @ResponseBody
  75. public R delete(@RequestBody Integer[]ids) {
  76. storeMngChangeService.deleteBatch(ids);
  77. return R.ok();
  78. }
  79. /**
  80. * 查看所有列表
  81. */
  82. @RequestMapping("/queryAll")
  83. @ResponseBody
  84. public R queryAll(@RequestParam Map<String, Object> params) {
  85. List<StoreMngChangeEntity> list = storeMngChangeService.queryList(params);
  86. return R.ok().put("list", list);
  87. }
  88. }