优惠券接口修改
This commit is contained in:
@@ -73,6 +73,14 @@ public class PmsProductController {
|
||||
return new CommonResult().pageSuccess(productList);
|
||||
}
|
||||
|
||||
@ApiOperation("根据商品名称或货号模糊查询")
|
||||
@RequestMapping(value = "/simpleList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object getList(String keyword) {
|
||||
List<PmsProduct> productList = productService.list(keyword);
|
||||
return new CommonResult().success(productList);
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改审核状态")
|
||||
@RequestMapping(value = "/update/verifyStatus",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
|
||||
@@ -46,11 +46,28 @@ public interface PmsProductService {
|
||||
@Transactional
|
||||
int updateVerifyStatus(List<Long> ids, Integer verifyStatus, String detail);
|
||||
|
||||
/**
|
||||
* 批量修改商品上架状态
|
||||
*/
|
||||
int updatePublishStatus(List<Long> ids, Integer publishStatus);
|
||||
|
||||
/**
|
||||
* 批量修改商品推荐状态
|
||||
*/
|
||||
int updateRecommendStatus(List<Long> ids, Integer recommendStatus);
|
||||
|
||||
/**
|
||||
* 批量修改新品状态
|
||||
*/
|
||||
int updateNewStatus(List<Long> ids, Integer newStatus);
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
int updateDeleteStatus(List<Long> ids, Integer deleteStatus);
|
||||
|
||||
/**
|
||||
* 根据商品名称或者货号模糊查询
|
||||
*/
|
||||
List<PmsProduct> list(String keyword);
|
||||
}
|
||||
|
||||
@@ -248,6 +248,18 @@ public class PmsProductServiceImpl implements PmsProductService {
|
||||
return productMapper.updateByExampleSelective(record, example);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmsProduct> list(String keyword) {
|
||||
PmsProductExample productExample = new PmsProductExample();
|
||||
PmsProductExample.Criteria criteria = productExample.createCriteria();
|
||||
criteria.andDeleteStatusEqualTo(0);
|
||||
if(!StringUtils.isEmpty(keyword)){
|
||||
criteria.andNameLike("%" + keyword + "%");
|
||||
productExample.or().andDeleteStatusEqualTo(0).andProductSnLike("%" + keyword + "%");
|
||||
}
|
||||
return productMapper.selectByExample(productExample);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 旧版创建
|
||||
*/
|
||||
|
||||
@@ -12,8 +12,12 @@
|
||||
c.*,
|
||||
cpr.id cpr_id,
|
||||
cpr.product_id cpr_product_id,
|
||||
cpr.product_name cpr_product_name,
|
||||
cpr.product_sn cpr_product_sn,
|
||||
cpcr.id cpcr_id,
|
||||
cpcr.product_category_id cpcr_product_category_id
|
||||
cpcr.product_category_id cpcr_product_category_id,
|
||||
cpcr.product_category_name cpcr_product_category_name,
|
||||
cpcr.parent_category_name cpcr_parent_category_name
|
||||
FROM
|
||||
sms_coupon c
|
||||
LEFT JOIN sms_coupon_product_relation cpr ON c.id = cpr.coupon_id
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.macro.mall.dao.SmsCouponProductCategoryRelationDao">
|
||||
<insert id="insertList">
|
||||
INSERT INTO sms_coupon_product_category_relation (product_category_id,coupon_id) VALUES
|
||||
INSERT INTO sms_coupon_product_category_relation (product_category_id,product_category_name,parent_category_name,coupon_id) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.productCategoryId,jdbcType=BIGINT},
|
||||
#{item.couponId,jdbcType=INTEGER})
|
||||
#{item.productCategoryName,jdbcType=VARCHAR},
|
||||
#{item.parentCategoryName,jdbcType=VARCHAR},
|
||||
#{item.couponId,jdbcType=BIGINT})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -2,9 +2,11 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.macro.mall.dao.SmsCouponProductRelationDao">
|
||||
<insert id="insertList">
|
||||
INSERT INTO sms_coupon_product_relation (product_id,coupon_id) VALUES
|
||||
INSERT INTO sms_coupon_product_relation (product_id,product_name,product_sn,coupon_id) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.productId,jdbcType=BIGINT},
|
||||
#{item.productName,jdbcType=VARCHAR},
|
||||
#{item.productSn,jdbcType=VARCHAR},
|
||||
#{item.couponId,jdbcType=INTEGER})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
Reference in New Issue
Block a user