12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- package com.gqy.web.controller.document;
- import com.gqy.common.core.controller.BaseController;
- import com.gqy.common.core.domain.AjaxResult;
- import com.gqy.common.core.page.TableDataInfo;
- import com.gqy.common.enums.BusinessType;
- import com.gqy.document.domain.DcSpec;
- import com.gqy.document.service.IDcSpecService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.web.bind.annotation.*;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * 产品规格Controller
- */
- @RestController
- @RequestMapping("/spec")
- public class DcSpecController extends BaseController {
- @Autowired
- private IDcSpecService iDcSpecService;
- /**
- * 查询产品规格列表
- */
- @GetMapping("/list")
- public TableDataInfo list(@RequestParam Map<String, Object> maps) {
- startPage();
- List<Map<String, Object>> list = iDcSpecService.selectDcPsParamAndSpec(maps);
- return getDataTable(list);
- }
- /**
- * 获取产品规格详细信息
- */
- @GetMapping(value = "/{psId}")
- public AjaxResult getInfo(@PathVariable("psId") Integer psId) {
- return success(iDcSpecService.selectDcSpecById(psId));
- }
- /**
- * 新增产品规格
- */
- @PostMapping(value = "/add")
- public AjaxResult add(@RequestBody Map dcSpec) {
- return toAjax(iDcSpecService.insertDcSpecParam(dcSpec));
- }
- /**
- * 修改产品规格
- */
- @PostMapping("/update")
- public AjaxResult update(@RequestBody Map maps) {
- return toAjax(iDcSpecService.updateDcSpecMaps(maps));
- }
- @GetMapping(value = "/delete/{psId}")
- public AjaxResult del(@PathVariable("psId") Integer psId) {
- return success(iDcSpecService.deleteDcPsParam(psId));
- }
- /**
- * 查询产品规格为全部
- * @return
- */
- @GetMapping(value = "/getDcSpecList")
- public List<Map<String, Object>> getDcSpecList(){
- Map maps = new HashMap();
- maps.put("ps_category","全部");
- maps.put("ps_p_id",0);
- List<Map<String, Object>> list = iDcSpecService.selectDcPsParamAndSpec(maps);
- return list;
- }
- }
|