123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- package com.kmall.admin.controller;
- import java.util.Date;
- import java.util.List;
- import java.util.Map;
- import com.kmall.admin.service.GoodsBatchService;
- import com.kmall.common.utils.PageUtils;
- import com.kmall.common.utils.Query;
- import com.kmall.common.utils.R;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.*;
- import com.kmall.admin.entity.GoodsBatchEntity;
- /**
- * 批次(多)— SKU(多)Controller
- *
- * @author emato
- * @email admin@qhdswl.com
- * @date 2020-06-13 09:58:15
- */
- @Controller
- @RequestMapping("goodsbatch")
- public class GoodsBatchController {
- @Autowired
- private GoodsBatchService goodsBatchService;
- /**
- * 查看列表
- */
- @RequestMapping("/list")
- // @RequiresPermissions("goodsbatch:list")
- @ResponseBody
- public R list(@RequestParam Map<String, Object> params) {
- //查询列表数据
- Query query = new Query(params);
- List<GoodsBatchEntity> goodsBatchList = goodsBatchService.queryList(query);
- int total = goodsBatchService.queryTotal(query);
- PageUtils pageUtil = new PageUtils(goodsBatchList, total, query.getLimit(), query.getPage());
- return R.ok().put("page", pageUtil);
- }
- /**
- * 查看信息
- */
- @RequestMapping("/info/{id}")
- // @RequiresPermissions("goodsbatch:info")
- @ResponseBody
- public R info(@PathVariable("id") Integer id) {
- GoodsBatchEntity goodsBatch = goodsBatchService.queryObject(id);
- return R.ok().put("goodsBatch", goodsBatch);
- }
- /**
- * 保存
- */
- @RequestMapping("/save")
- // @RequiresPermissions("goodsbatch:save")
- @ResponseBody
- public R save(@RequestBody GoodsBatchEntity goodsBatch) {
- goodsBatchService.save(goodsBatch);
- return R.ok();
- }
- /**
- * 修改
- */
- @RequestMapping("/update")
- // @RequiresPermissions("goodsbatch:update")
- @ResponseBody
- public R update(@RequestBody GoodsBatchEntity goodsBatch) {
- goodsBatchService.update(goodsBatch);
- return R.ok();
- }
- /**
- * 删除
- */
- @RequestMapping("/delete")
- // @RequiresPermissions("goodsbatch:delete")
- @ResponseBody
- public R delete(@RequestBody Integer[]ids) {
- goodsBatchService.deleteBatch(ids);
- return R.ok();
- }
- /**
- * 查看所有列表
- */
- @RequestMapping("/queryAll")
- @ResponseBody
- public R queryAll(@RequestParam Map<String, Object> params) {
- List<GoodsBatchEntity> list = goodsBatchService.queryList(params);
- return R.ok().put("list", list);
- }
- }
|