|
@@ -11,11 +11,13 @@ import com.qs.mp.admin.domain.GoodsSku;
|
|
|
import com.qs.mp.admin.domain.param.CouponParam;
|
|
|
import com.qs.mp.admin.domain.param.GoodsParam;
|
|
|
import com.qs.mp.admin.domain.vo.GoodsListVO;
|
|
|
+import com.qs.mp.admin.domain.vo.GoodsVO;
|
|
|
import com.qs.mp.admin.service.IGoodsCategoryService;
|
|
|
import com.qs.mp.admin.service.IGoodsService;
|
|
|
import com.qs.mp.admin.service.IGoodsSkuService;
|
|
|
import com.qs.mp.channel.domain.Channel;
|
|
|
import com.qs.mp.channel.domain.param.ChannelParam;
|
|
|
+import com.qs.mp.channel.domain.vo.ChannelOperDataVO;
|
|
|
import com.qs.mp.channel.domain.vo.ChannelVO;
|
|
|
import com.qs.mp.channel.service.IChannelService;
|
|
|
import com.qs.mp.channel.service.IChannelUserRelService;
|
|
@@ -27,6 +29,7 @@ import com.qs.mp.common.enums.CouponStatusEnum;
|
|
|
import com.qs.mp.common.enums.ErrorCodeEnum;
|
|
|
import com.qs.mp.system.domain.SysUser;
|
|
|
import com.qs.mp.system.service.ISysUserService;
|
|
|
+import com.qs.mp.utils.SecurityUtils;
|
|
|
import com.qs.mp.web.controller.common.BaseApiController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -38,6 +41,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -88,6 +92,36 @@ public class GoodsMgrController extends BaseApiController {
|
|
|
res.setRows(goodsListVOList);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取商品详情信息
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/detail")
|
|
|
+ public AjaxResult getSiteDetail(@RequestBody JSONObject jsonObject) {
|
|
|
+ String goodsId = jsonObject.getString("goodsId");
|
|
|
+ if (StringUtils.isBlank(goodsId)){
|
|
|
+ return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
+ }
|
|
|
+ Goods goods = goodsService.getById(goodsId);
|
|
|
+ if(null == goods || StringUtils.isBlank(goods.getGoodsId())) {
|
|
|
+ return error(ErrorCodeEnum.ERROR_CODE_1001);
|
|
|
+ }
|
|
|
+ GoodsVO goodsVo = new GoodsVO();
|
|
|
+ BeanUtils.copyProperties(goods, goodsVo);
|
|
|
+ // 查询SKU列表
|
|
|
+ List<GoodsSku> skuList = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<GoodsSku> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(GoodsSku::getGoodsId, goods.getGoodsId());
|
|
|
+ queryWrapper.orderByDesc(GoodsSku::getCreatedTime);
|
|
|
+ skuList = goodsSkuService.list(queryWrapper);
|
|
|
+ if(null != skuList && skuList.size() > 0) {
|
|
|
+ goodsVo.setSkuList(skuList);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(goodsVo);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -136,7 +170,7 @@ public class GoodsMgrController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 编辑子渠道信息
|
|
|
+ * 编辑商品信息
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|