[UPDATE]:更新
This commit is contained in:
parent
ec12480ded
commit
f451d2fdcb
|
@ -1,104 +0,0 @@
|
|||
package com.tcctlo.law.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.tcctlo.common.annotation.Anonymous;
|
||||
import com.tcctlo.law.entity.Goods;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.tcctlo.common.annotation.Log;
|
||||
import com.tcctlo.common.core.controller.BaseController;
|
||||
import com.tcctlo.common.core.domain.AjaxResult;
|
||||
import com.tcctlo.common.enums.BusinessType;
|
||||
import com.tcctlo.law.service.IGoodsService;
|
||||
import com.tcctlo.common.utils.poi.ExcelUtil;
|
||||
import com.tcctlo.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 商品管理Controller
|
||||
*
|
||||
* @author coco
|
||||
* @date 2025-01-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/tcctlo-law-office/goods")
|
||||
public class GoodsController extends BaseController {
|
||||
@Autowired
|
||||
private IGoodsService goodsService;
|
||||
|
||||
/**
|
||||
* 模拟案件转移给其他律师
|
||||
* @param map 原承办律师与要转移的律师数据集
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/hello")
|
||||
public void test(@RequestBody Map<String, Object> map) {
|
||||
System.out.println(map);
|
||||
System.out.println("test");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tcctlo-law-office:goods:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Goods goods) {
|
||||
startPage();
|
||||
List<Goods> list = goodsService.selectGoodsList(goods);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出商品管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tcctlo-law-office:goods:export')")
|
||||
@Log(title = "商品管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Goods goods) {
|
||||
List<Goods> list = goodsService.selectGoodsList(goods);
|
||||
ExcelUtil<Goods> util = new ExcelUtil<Goods>(Goods.class);
|
||||
util.exportExcel(response, list, "商品管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tcctlo-law-office:goods:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(goodsService.selectGoodsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tcctlo-law-office:goods:add')")
|
||||
@Log(title = "商品管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Goods goods) {
|
||||
return toAjax(goodsService.insertGoods(goods));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tcctlo-law-office:goods:edit')")
|
||||
@Log(title = "商品管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Goods goods) {
|
||||
return toAjax(goodsService.updateGoods(goods));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tcctlo-law-office:goods:remove')")
|
||||
@Log(title = "商品管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(goodsService.deleteGoodsByIds(ids));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue