|
@@ -38,8 +38,8 @@ public class GoodsController extends BaseController {
|
|
|
@GetMapping("/get/{id}")
|
|
|
public Object get(@ApiParam(value = "商品(教材、辅件)编号", required = true) @PathVariable("id") Integer id){
|
|
|
Goods goods = goodsService.get(id);
|
|
|
- if(Objects.nonNull(goods.getGoodsCategoryId())){
|
|
|
- GoodsCategory goodsCategory = goodsCategoryService.get(goods.getGoodsCategoryId());
|
|
|
+ GoodsCategory goodsCategory = goodsCategoryService.get(goods.getGoodsCategoryId());
|
|
|
+ if(Objects.nonNull(goodsCategory)){
|
|
|
goods.setGoodsCategoryName(goodsCategory.getName());
|
|
|
}
|
|
|
return succeed(goods);
|