Commit 29ca2c66 authored by wlx@33.cn's avatar wlx@33.cn

2.1优化后台兼容

parent ee0439cd
......@@ -71,7 +71,6 @@ public class GoodsEditDTO {
private String returnReason;
@ApiModelProperty("商品备注")
@NotBlank(message = MallResponseError.NULL_PARAM_ERROR)
private String note;
@ApiModelProperty("溯源信息")
......
......@@ -84,7 +84,6 @@ public class GoodsSpuDTO {
private String returnReason;
@ApiModelProperty("商品备注")
@NotBlank(message = MallResponseError.NULL_PARAM_ERROR)
private String note;
@ApiModelProperty("溯源信息")
......
......@@ -4,11 +4,9 @@ import com.fzm.mall.server.front.asset.model.vo.good.GoodSkuVO;
import com.fzm.mall.server.front.asset.model.vo.good.GoodSpuVO;
import com.fzm.mall.server.front.goods.model.GoodSku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzm.mall.server.front.goods.model.vo.SaleHotVo;
import com.fzm.mall.server.front.goods.model.vo.SkuVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.*;
import java.util.List;
......@@ -20,6 +18,7 @@ import java.util.List;
* @author tdz
* @since 2021-03-02
*/
@Mapper
public interface GoodSkuMapper extends BaseMapper<GoodSku> {
/**
* 通过币种查询编号
......@@ -83,4 +82,6 @@ public interface GoodSkuMapper extends BaseMapper<GoodSku> {
@Select("select name from goods_spu where goods_id = #{goodsId}")
String getGoodsName(@Param("goodsId") String goodsId);
SaleHotVo count(String goodsId);
}
......@@ -33,4 +33,10 @@ public class SaleHotVo {
@ApiModelProperty(value = "子类目id")
private String categoryId;
@ApiModelProperty(value = "商品库存总量")
private Integer stockCount;
@ApiModelProperty(value = "商品发行量总量")
private Integer circulationCount;
}
......@@ -2,6 +2,7 @@ package com.fzm.mall.server.front.goods.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.fzm.mall.server.front.goods.mapper.GoodSkuMapper;
import com.fzm.mall.server.front.goods.model.Category;
import com.fzm.mall.server.front.goods.model.OprationFloorGoods;
import com.fzm.mall.server.front.goods.mapper.OprationFloorGoodsMapper;
......@@ -33,6 +34,9 @@ public class OprationFloorGoodsServiceImpl extends ServiceImpl<OprationFloorGood
private OprationFloorGoodsMapper oprationFloorGoodsMapper;
@Autowired
private GoodSkuMapper goodSkuMapper;
@Autowired
private ICategoryService categoryService;
@Override
......@@ -49,6 +53,10 @@ public class OprationFloorGoodsServiceImpl extends ServiceImpl<OprationFloorGood
if(category!=null){
i.setCategoryName(category.getName());
}
SaleHotVo countResult = goodSkuMapper.count(i.getGoodsId());
i.setStockCount(countResult.getStockCount());
i.setCirculationCount(countResult.getCirculationCount());
}
}
return list;
......
......@@ -2,4 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fzm.mall.server.front.goods.mapper.GoodSkuMapper">
<select id="count" resultType="com.fzm.mall.server.front.goods.model.vo.SaleHotVo">
select sum(stock) as stockCount, sum(circulation) as circulationCount
from goods_sku
where goods_id = #{goodsId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment