...
|
...
|
@@ -16,8 +16,10 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.core.common.utils.DateUtil;
|
|
|
import com.yoho.core.config.ConfigReader;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.message.sdk.common.model.SendMessageRspBo;
|
|
|
import com.yoho.message.sdk.service.ufo.IUFOSendService;
|
|
|
import com.yoho.ufo.dal.ChannelSkuCompareMapper;
|
|
|
import com.yoho.ufo.dal.GoodsMapper;
|
|
|
import com.yoho.ufo.dal.ProductMapper;
|
...
|
...
|
@@ -25,6 +27,7 @@ import com.yoho.ufo.dal.StorageMapper; |
|
|
import com.yoho.ufo.dal.StoragePriceMapper;
|
|
|
import com.yoho.ufo.dal.UfoSizeMapper;
|
|
|
import com.yoho.ufo.dal.model.Goods;
|
|
|
import com.yoho.ufo.dal.model.HiddenSkup;
|
|
|
import com.yoho.ufo.dal.model.Product;
|
|
|
import com.yoho.ufo.dal.model.Storage;
|
|
|
import com.yoho.ufo.dal.model.StoragePrice;
|
...
|
...
|
@@ -65,6 +68,12 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
|
|
@Autowired
|
|
|
private GoodsMapper goodsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
@Autowired
|
|
|
private IUFOSendService ufoSendService;
|
|
|
|
|
|
private static final int CHANNEL_SKU_COMPARE_ABNORMAL = 1;
|
|
|
|
|
|
private static final int CHANNEL_SKU_COMPARE_NORMAL = 0;
|
...
|
...
|
@@ -198,6 +207,41 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
|
|
LOGGER.info("synChannelSkuCompare end");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void noticeSellerHiddenSkup() {
|
|
|
List<HiddenSkup> list = storagePriceMapper.selectHiddenSkup();
|
|
|
List<Integer> uidList = list.stream().map(HiddenSkup::getSellerUid).collect(Collectors.toList());
|
|
|
if(CollectionUtils.isEmpty(uidList)) {
|
|
|
return;
|
|
|
}
|
|
|
//去除不需要PUSH的uid
|
|
|
List<Integer> noPushUidList = getNoPushUidList();
|
|
|
uidList.removeAll(noPushUidList);
|
|
|
|
|
|
Map<Integer, Integer> sellerUidSkupNumMap = list.stream().collect(Collectors.toMap(HiddenSkup::getSellerUid, HiddenSkup::getSkupNum));
|
|
|
//PUSH消息
|
|
|
for(Integer uid : uidList) {
|
|
|
SendMessageRspBo bo = ufoSendService.sendAdjustPrice(String.valueOf(uid), sellerUidSkupNumMap.get(uid));
|
|
|
LOGGER.info("push uid is {}, skupNum is {}, result is {}", uid, sellerUidSkupNumMap.get(uid), bo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private List<Integer> getNoPushUidList(){
|
|
|
String noPushUidStr = configReader.getString("ufo.hiddenSkup.noPushUid", "");
|
|
|
LOGGER.info("noPushUid is {}", noPushUidStr);
|
|
|
if(StringUtils.isEmpty(noPushUidStr)) {
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
|
|
|
|
String[] noPushUidArray = noPushUidStr.split(",");
|
|
|
List<Integer> noPushUidList = Lists.newArrayList();
|
|
|
for(int i=0; i < noPushUidArray.length; i++) {
|
|
|
noPushUidList.add(Integer.parseInt(noPushUidArray[i]));
|
|
|
}
|
|
|
|
|
|
return noPushUidList;
|
|
|
}
|
|
|
|
|
|
private void dealSynChannelSkuCompareData(ChannelSkuCompareReq req) {
|
|
|
List<ChannelSkuCompare> cscList = channelSkuCompareMapper.selectByCondition(req);
|
|
|
List<Integer> productIdList = CollectionUtil.map(cscList, ChannelSkuCompare::getProductId);
|
...
|
...
|
|