|
@@ -4,12 +4,15 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.entity.Goods;
|
|
|
import com.ym.mec.biz.dal.entity.GoodsCategory;
|
|
|
+import com.ym.mec.biz.dal.page.GoodsQuery;
|
|
|
import com.ym.mec.biz.dal.page.GoodsQueryInfo;
|
|
|
import com.ym.mec.biz.service.GoodsCategoryService;
|
|
|
import com.ym.mec.biz.service.GoodsService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
-import io.swagger.annotations.*;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
@@ -54,20 +57,12 @@ public class GoodsController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "通过科目编号、商品分类 查询商品(教材、辅件)列表")
|
|
|
@GetMapping("/queryGoodsBySubId")
|
|
|
- @ApiImplicitParams({ @ApiImplicitParam(name = "subjectId", value = "科目编号", required = true, dataType = "Integer"),
|
|
|
- @ApiImplicitParam(name = "organId", value = "分部编号", required = true, dataType = "Integer"),
|
|
|
- @ApiImplicitParam(name = "type", value = "INSTRUMENT 乐器, ACCESSORIES 教辅", required = true, dataType = "String")})
|
|
|
- public Object findGoodsBySubId(Integer subjectId,String type,Integer organId){
|
|
|
- if(organId == null){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- throw new BizException("请先登录");
|
|
|
- }
|
|
|
- organId = sysUser.getOrganId();
|
|
|
- if(organId == null){
|
|
|
- throw new BizException("学员分部异常,请联系管理员");
|
|
|
- }
|
|
|
+ public Object findGoodsBySubId(GoodsQuery goodsQuery){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null){
|
|
|
+ throw new BizException("请先登录");
|
|
|
}
|
|
|
- return succeed(goodsService.findGoodsBySubId(subjectId,type,organId));
|
|
|
+ goodsQuery.setStudentShowOrganId(sysUser.getOrganId());
|
|
|
+ return succeed(goodsService.findGoodsBySubId(goodsQuery));
|
|
|
}
|
|
|
}
|