|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
/**
|
|
|
* 卖家服务(竞价提醒)
|
|
|
*
|
|
|
* 卖家出售(发布或变价) 出更低价格的推送或者短信
|
|
|
* Created by chao.chen on 2018/12/4.
|
|
|
*/
|
|
|
@Service
|
|
|
public class SellerService {
|
|
|
|
|
|
private final Logger logger = LoggerUtils.getSellerOrderLogger();
|
|
|
|
|
|
/**
|
|
|
* 需要考虑的是发布和变价是个不间断的操作,若高并发必影响调用者处理速度
|
|
|
* 还好,我已经把这个定义成非核心功能,可以异步实现
|
|
|
* @param whoReducePrice
|
|
|
* @param lowerSalePrice
|
|
|
* @param storageId
|
|
|
*/
|
|
|
public void lowerPriceFired(Integer whoReducePrice, BigDecimal lowerSalePrice, Integer storageId){
|
|
|
logger.info("in lowerPriceFired, uid whoReducePrice {} lowerSalePrice {} storageId {}",
|
|
|
whoReducePrice, lowerSalePrice, storageId);
|
|
|
|
|
|
//TODO finish blow step
|
|
|
// step 1: 找到所有出售中 & 指定storageId的skup &不是whoReducePrice这个uid & 价格高于lowerSalePrice(seller_order_goods表)集合 --> one sq1
|
|
|
// step 2:消息或短信 给所有的用户(多么贴心,也许以后可以干掉毒,然后收费^v^)
|
|
|
// step 2.1 超过多少数量 使用多线程并行处理
|
|
|
}
|
|
|
} |
...
|
...
|
|