Authored by Lixiaodi

增加单个skup隐藏状态修改接口

... ... @@ -63,4 +63,6 @@ public interface StoragePriceMapper {
int updateSkupHideStatus(@Param("uid") Integer uid, @Param("status") int status);
List<StoragePrice> selectLeastPricesByProductId(@Param("productId") Integer productId);
int updateOneSkupHideStatus(@Param("skup") Integer skup, @Param("status") int status);
}
\ No newline at end of file
... ...
... ... @@ -154,6 +154,10 @@
update storage_price set is_hide = #{status}, update_time = unix_timestamp()
where seller_uid = #{uid} and status in(0,1,100)
</update>
<update id="updateOneSkupHideStatus">
update storage_price set is_hide = #{status}, update_time = unix_timestamp()
where skup = #{skup} and status in(0,1,100)
</update>
<select id="selectBatchLeastPrice" resultMap="BaseResultMap">
select storage_id , min(price) as price from storage_price where
... ...
... ... @@ -311,6 +311,24 @@ public class ProductController {
return new ApiResponse(200, "隐藏用户商品成功!", Boolean.TRUE);
}
@RequestMapping(params = "method=ufo.product.hideSellerSkup")
public ApiResponse hideSellerSkup(
@RequestParam(value = "skup", required = true) Integer skup) {
LOG.info("in method=ufo.product.hideSellerSkup skup={}", skup);
productService.changeOneSkupHideStatus(skup, 1);// status:1 隐藏商品
LOG.info("hideSellerSkup success skup = {}", skup);
return new ApiResponse(200, "隐藏用户商品成功!", Boolean.TRUE);
}
@RequestMapping(params = "method=ufo.product.showSellerSkup")
public ApiResponse showSellerSkup(
@RequestParam(value = "uid", required = true) Integer skup) {
LOG.info("in method=ufo.product.showSellerSkup uid={}", skup);
productService.changeOneSkupHideStatus(skup, 0);// status:0 展示商品
LOG.info("showSellerSkup success skup = {}", skup);
return new ApiResponse(200, "隐藏用户商品成功!", Boolean.TRUE);
}
@Autowired
private ControllerCacheAop cacheAop;
private ExecutorService executors = Executors.newFixedThreadPool(1);
... ...
... ... @@ -93,4 +93,6 @@ public interface ProductService {
boolean queryProductLimitInfo(Integer productId, Integer userId);
void addSales(Integer skup);
void changeOneSkupHideStatus(Integer skup, int status);
}
... ...
... ... @@ -815,6 +815,13 @@ public class ProductServiceImpl implements ProductService {
}
@Override
public void changeOneSkupHideStatus(Integer skup, int status) {
LOGGER.info("开始:Skup隐藏展示状态修改,skup={} , toStatus={}", skup, status);
int count = storagePriceMapper.updateOneSkupHideStatus(skup, status);
LOGGER.info("完成:Skup隐藏展示状态修改,skup={} , toStatus={}, exeCount={}", skup, status, count);
}
@Override
public List<SaleCategoryBo> querySaleCategory() {
// 查数据库List
List<SaleCategory> dbData = saleCategoryMapper.selectValid();
... ... @@ -1140,4 +1147,5 @@ public class ProductServiceImpl implements ProductService {
return true;
}
}
}
... ...