|
|
@@ -1,28 +1,14 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
-
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.web.dal.entity.Goods;
|
|
|
import com.ym.mec.web.dal.page.GoodsQueryInfo;
|
|
|
import com.ym.mec.web.service.GoodsService;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
|
|
|
@RequestMapping("goods")
|
|
|
@Api(tags = "商品(教材、辅件)服务")
|
|
|
@@ -61,18 +47,19 @@ public class GoodsController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询商品(教材、辅件)列表")
|
|
|
- @PostMapping("/queryPage")
|
|
|
- public Object queryPage(@RequestBody GoodsQueryInfo queryInfo){
|
|
|
+ @GetMapping("/queryPage")
|
|
|
+ public Object queryPage(@RequestBody(required = false) GoodsQueryInfo queryInfo){
|
|
|
+ if(queryInfo == null){
|
|
|
+ queryInfo = new GoodsQueryInfo();
|
|
|
+ }
|
|
|
return succeed(goodsService.queryPage(queryInfo));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "通过科目编号、商品分类 查询商品(教材、辅件)列表")
|
|
|
- @PostMapping("/queryGoodsBySubId")
|
|
|
+ @GetMapping("/queryGoodsBySubId")
|
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "subjectId", value = "科目编号", required = true, dataType = "Integer"),
|
|
|
@ApiImplicitParam(name = "goodsCategoryId", value = "商品分类", required = true, dataType = "Integer")})
|
|
|
- public Object findGoodsBySubId(@RequestBody HashMap<String, Integer> param){
|
|
|
- Integer subjectId = param.get("subjectId");
|
|
|
- Integer goodsCategoryId = param.get("goodsCategoryId");
|
|
|
+ public Object findGoodsBySubId(@RequestAttribute Integer subjectId,@RequestAttribute Integer goodsCategoryId){
|
|
|
return succeed(goodsService.findGoodsBySubId(subjectId,goodsCategoryId));
|
|
|
}
|
|
|
}
|