提交 67f8dea4 作者: xiaowang

修复,商品名称查询

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