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

2.1优化后台兼容

parent ee0439cd
...@@ -71,7 +71,6 @@ public class GoodsEditDTO { ...@@ -71,7 +71,6 @@ public class GoodsEditDTO {
private String returnReason; private String returnReason;
@ApiModelProperty("商品备注") @ApiModelProperty("商品备注")
@NotBlank(message = MallResponseError.NULL_PARAM_ERROR)
private String note; private String note;
@ApiModelProperty("溯源信息") @ApiModelProperty("溯源信息")
......
...@@ -84,7 +84,6 @@ public class GoodsSpuDTO { ...@@ -84,7 +84,6 @@ public class GoodsSpuDTO {
private String returnReason; private String returnReason;
@ApiModelProperty("商品备注") @ApiModelProperty("商品备注")
@NotBlank(message = MallResponseError.NULL_PARAM_ERROR)
private String note; private String note;
@ApiModelProperty("溯源信息") @ApiModelProperty("溯源信息")
......
...@@ -4,11 +4,9 @@ import com.fzm.mall.server.front.asset.model.vo.good.GoodSkuVO; ...@@ -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.asset.model.vo.good.GoodSpuVO;
import com.fzm.mall.server.front.goods.model.GoodSku; import com.fzm.mall.server.front.goods.model.GoodSku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 com.fzm.mall.server.front.goods.model.vo.SkuVo;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List; import java.util.List;
...@@ -20,6 +18,7 @@ import java.util.List; ...@@ -20,6 +18,7 @@ import java.util.List;
* @author tdz * @author tdz
* @since 2021-03-02 * @since 2021-03-02
*/ */
@Mapper
public interface GoodSkuMapper extends BaseMapper<GoodSku> { public interface GoodSkuMapper extends BaseMapper<GoodSku> {
/** /**
* 通过币种查询编号 * 通过币种查询编号
...@@ -83,4 +82,6 @@ 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}") @Select("select name from goods_spu where goods_id = #{goodsId}")
String getGoodsName(@Param("goodsId") String goodsId); String getGoodsName(@Param("goodsId") String goodsId);
SaleHotVo count(String goodsId);
} }
...@@ -33,4 +33,10 @@ public class SaleHotVo { ...@@ -33,4 +33,10 @@ public class SaleHotVo {
@ApiModelProperty(value = "子类目id") @ApiModelProperty(value = "子类目id")
private String categoryId; 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; ...@@ -2,6 +2,7 @@ package com.fzm.mall.server.front.goods.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; 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.Category;
import com.fzm.mall.server.front.goods.model.OprationFloorGoods; import com.fzm.mall.server.front.goods.model.OprationFloorGoods;
import com.fzm.mall.server.front.goods.mapper.OprationFloorGoodsMapper; import com.fzm.mall.server.front.goods.mapper.OprationFloorGoodsMapper;
...@@ -33,6 +34,9 @@ public class OprationFloorGoodsServiceImpl extends ServiceImpl<OprationFloorGood ...@@ -33,6 +34,9 @@ public class OprationFloorGoodsServiceImpl extends ServiceImpl<OprationFloorGood
private OprationFloorGoodsMapper oprationFloorGoodsMapper; private OprationFloorGoodsMapper oprationFloorGoodsMapper;
@Autowired @Autowired
private GoodSkuMapper goodSkuMapper;
@Autowired
private ICategoryService categoryService; private ICategoryService categoryService;
@Override @Override
...@@ -49,6 +53,10 @@ public class OprationFloorGoodsServiceImpl extends ServiceImpl<OprationFloorGood ...@@ -49,6 +53,10 @@ public class OprationFloorGoodsServiceImpl extends ServiceImpl<OprationFloorGood
if(category!=null){ if(category!=null){
i.setCategoryName(category.getName()); i.setCategoryName(category.getName());
} }
SaleHotVo countResult = goodSkuMapper.count(i.getGoodsId());
i.setStockCount(countResult.getStockCount());
i.setCirculationCount(countResult.getCirculationCount());
} }
} }
return list; return list;
......
...@@ -2,4 +2,9 @@ ...@@ -2,4 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <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> </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