提交 67f8dea4 作者: xiaowang

修复,商品名称查询

上级 56f7a706
...@@ -37,12 +37,14 @@ public interface WebDeviceDao { ...@@ -37,12 +37,14 @@ public interface WebDeviceDao {
int countListWareInfoPage( int countListWareInfoPage(
@Param("categoryIds") List<Integer> categoryIds, @Param("categoryIds") List<Integer> categoryIds,
@Param("userIds") List<Integer> userIds, @Param("userIds") List<Integer> userIds,
@Param("type") Integer type); @Param("type") Integer type,
@Param("goodsName")String goodsName);
List<GoodsInfo> listWareInfoPage( List<GoodsInfo> listWareInfoPage(
@Param("param") WareInfoQO param, @Param("param") WareInfoQO param,
@Param("userIds") List<Integer> userIds, @Param("userIds") List<Integer> userIds,
@Param("type") Integer type); @Param("type") Integer type,
@Param("goodsName")String goodsName);
WareInfoDO getWareInfoById(Integer id); WareInfoDO getWareInfoById(Integer id);
......
...@@ -23,6 +23,9 @@ public class WareInfoQO implements Serializable { ...@@ -23,6 +23,9 @@ public class WareInfoQO implements Serializable {
@ApiModelProperty(name = "districtId", value = "地域id", example = "440000") @ApiModelProperty(name = "districtId", value = "地域id", example = "440000")
private Integer provinceId; private Integer provinceId;
@ApiModelProperty(name = "goodsName", value = "商品名称", example = "6")
private String goodsName;
@ApiModelProperty(name = "categoryId", value = "分类id") @ApiModelProperty(name = "categoryId", value = "分类id")
private List<Integer> categoryId; private List<Integer> categoryId;
......
...@@ -25,7 +25,7 @@ public class ProductSpecVO implements Serializable { ...@@ -25,7 +25,7 @@ public class ProductSpecVO implements Serializable {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Integer id; private Integer id;
@ApiModelProperty(value = "productSkuId") @ApiModelProperty(value = "产品id")
@NotNull(message = "修改时productSkuId不能为空", groups = {Create.class}) @NotNull(message = "修改时productSkuId不能为空", groups = {Create.class})
private Integer productSkuId; private Integer productSkuId;
......
...@@ -520,8 +520,10 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -520,8 +520,10 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
// 删除所有的随后在新增 // 删除所有的随后在新增
productDao.removeProductSpecCPQ(productSpecCPQVO); productDao.removeProductSpecCPQ(productSpecCPQVO);
productSkuService.insertSpecPrice(productSpecCPQVO); productSkuService.insertSpecPrice(productSpecCPQVO);
ProductSpecDO productSpecDO = new ProductSpecDO(d);
productSpecDO.setId(productSpecCPQVO.getProductSpecId());
// ②在修改自定义的数据 // ②在修改自定义的数据
productDao.updateProductSpec(new ProductSpecDO(d)); productDao.updateProductSpec(productSpecDO);
} }
// 【2】删除多余的自定义规格 // 【2】删除多余的自定义规格
if (!CollectionUtils.isEmpty(goodsSpecVO.getDelProductSpecId())) { if (!CollectionUtils.isEmpty(goodsSpecVO.getDelProductSpecId())) {
......
...@@ -179,14 +179,14 @@ public class WebDeviceServiceImpl implements WebDeviceService { ...@@ -179,14 +179,14 @@ public class WebDeviceServiceImpl implements WebDeviceService {
userIds = Collections.singletonList(-1); userIds = Collections.singletonList(-1);
} }
} }
int count = webDeviceDao.countListWareInfoPage(param.getCategoryId(), userIds, param.getType()); int count = webDeviceDao.countListWareInfoPage(param.getCategoryId(), userIds, param.getType(),param.getGoodsName());
if (count == 0) { if (count == 0) {
return ResultBody.success( return ResultBody.success(
PageResult.buildPage(param.getPageNo(), param.getPageSize(), count)); PageResult.buildPage(param.getPageNo(), param.getPageSize(), count));
} }
int pageNo = param.getPageNo(); int pageNo = param.getPageNo();
param.buildCurrentPage(); param.buildCurrentPage();
List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType()); List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType(),param.getGoodsName());
List<LeaseGoodsInfoDTO> pageList = List<LeaseGoodsInfoDTO> pageList =
list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList()); list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList());
if (StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))) { if (StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))) {
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<mapper namespace="com.mmc.pms.dao.ProductDao"> <mapper namespace="com.mmc.pms.dao.ProductDao">
<insert id="insertProductSku" parameterType="com.mmc.pms.entity.ProductDO" <insert id="insertProductSku" parameterType="com.mmc.pms.entity.ProductDO"
useGeneratedKeys="true" keyProperty="id"> useGeneratedKeys="true" keyProperty="id">
insert into product (product_name, model, brand_info_id, customize) insert into product (product_name, model, brand_info_id, customize,`type`)
values (#{productName}, #{model}, #{brandInfoId}, #{customize}) values (#{productName}, #{model}, #{brandInfoId}, #{customize},#{type})
</insert> </insert>
<insert id="insertProductSpec" keyProperty="id" useGeneratedKeys="true" <insert id="insertProductSpec" keyProperty="id" useGeneratedKeys="true"
parameterType="com.mmc.pms.entity.ProductSpecDO"> parameterType="com.mmc.pms.entity.ProductSpecDO">
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
</select> </select>
<select id="countSpecName" resultType="java.lang.Integer"> <select id="countSpecName" resultType="java.lang.Integer">
select count(*) from product_spec select count(*) from product_spec
where spec_name = #{specName} and is_deleted = 0 and product_id = #{productId} where spec_name = #{specName} and is_deleted = 0 and product_id = #{productSkuId}
<if test="id !=null and id !=''"> <if test="id !=null and id !=''">
and id <![CDATA[<>]]> #{id} and id <![CDATA[<>]]> #{id}
</if> </if>
......
...@@ -169,6 +169,9 @@ ...@@ -169,6 +169,9 @@
#{user} #{user}
</foreach> </foreach>
</if> </if>
<if test="goodsName != null and goodsName != ''">
and gi.goods_name like CONCAT('%',#{goodsName},'%')
</if>
</where> </where>
</select> </select>
...@@ -193,6 +196,9 @@ ...@@ -193,6 +196,9 @@
#{user} #{user}
</foreach> </foreach>
</if> </if>
<if test="goodsName != null and goodsName != ''">
and gi.goods_name like CONCAT('%',#{goodsName},'%')
</if>
</where> </where>
order by gi.create_time asc order by gi.create_time asc
limit #{param.pageNo},#{param.pageSize} limit #{param.pageNo},#{param.pageSize}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论