...
|
...
|
@@ -392,55 +392,43 @@ public class StoreSellerServiceImpl implements IStoredSellerService { |
|
|
* 增加orderPay记录
|
|
|
* @param uids
|
|
|
*/
|
|
|
public void orderPay(List<Integer> uids){
|
|
|
public void orderPay(List<Long> orderCodes){
|
|
|
|
|
|
// 查询卖家正在上架中的商品 & 支付方式是11 & orderspay中没有记录
|
|
|
|
|
|
for (Integer uid : uids){
|
|
|
scriptLogger.info("[{}] start orderPay....", uid);
|
|
|
List<SellerOrderGoods> sellerOrderGoodsList = sellerOrderGoodsMapper.selectByUidAndStatus(uid, SkupStatus.CAN_SELL.getCode());
|
|
|
// 过滤出 支付方式是11的
|
|
|
List<SellerOrder> sellerOrders = sellerOrderMapper.selectByOrderCodes(orderCodes);
|
|
|
List<SellerOrder> walletSellerOrders = sellerOrders.stream().filter(x->Objects.nonNull(x.getPayment()) && x.getPayment()==11).collect(Collectors.toList());
|
|
|
|
|
|
if (CollectionUtils.isEmpty(sellerOrderGoodsList)){
|
|
|
scriptLogger.info("[{}] no need orderPay....can sell goods not exist", uid);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 过滤出 支付方式是11的
|
|
|
List<SellerOrder> sellerOrders = sellerOrderMapper.selectBySkups(sellerOrderGoodsList.stream().map(SellerOrderGoods::getId).collect(Collectors.toList()));
|
|
|
List<SellerOrder> walletSellerOrders = sellerOrders.stream().filter(x->x.getPayment()==11).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isEmpty(walletSellerOrders)){
|
|
|
scriptLogger.info("no need orderPay....can sell goods not wallet");
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(walletSellerOrders)){
|
|
|
scriptLogger.info("[{}] no need orderPay....can sell goods not wallet", uid);
|
|
|
continue;
|
|
|
}
|
|
|
int now = DateUtil.getCurrentTimeSecond();
|
|
|
|
|
|
int now = DateUtil.getCurrentTimeSecond();
|
|
|
for (SellerOrder sellerOrder : walletSellerOrders) {
|
|
|
|
|
|
for (SellerOrder sellerOrder : walletSellerOrders){
|
|
|
scriptLogger.info("[{}] startorderPay [{}]", sellerOrder.getUid(), sellerOrder.getOrderCode());
|
|
|
|
|
|
OrdersPay ordersPaydb = ordersPayMapper.selectOrdersPay(sellerOrder.getOrderCode(), uid);
|
|
|
if (ordersPaydb != null){
|
|
|
scriptLogger.info("[{}] no need orderPay [{}]", uid, sellerOrder.getOrderCode());
|
|
|
continue;
|
|
|
}
|
|
|
OrdersPay ordersPay = new OrdersPay();
|
|
|
ordersPay.setPayOrderCode(String.valueOf(sellerOrder.getOrderCode()));
|
|
|
ordersPay.setAmount(sellerOrder.getEarnestMoney());
|
|
|
ordersPay.setOrderCode(sellerOrder.getOrderCode());
|
|
|
ordersPay.setUid(uid);
|
|
|
ordersPay.setPayment(11);
|
|
|
ordersPay.setCreateTime(now);
|
|
|
ordersPay.setSerialNo(String.valueOf(sellerOrder.getOrderCode()));
|
|
|
ordersPayMapper.insertSelective(ordersPay);
|
|
|
scriptLogger.info("[{}] do orderPay [{}]", uid, sellerOrder.getOrderCode());
|
|
|
OrdersPay ordersPaydb = ordersPayMapper.selectOrdersPay(sellerOrder.getOrderCode(), sellerOrder.getUid());
|
|
|
if (ordersPaydb != null) {
|
|
|
scriptLogger.info("[{}] no need orderPay [{}]", sellerOrder.getUid(), sellerOrder.getOrderCode());
|
|
|
continue;
|
|
|
}
|
|
|
scriptLogger.info("[{}] end process orderPay....", uid);
|
|
|
OrdersPay ordersPay = new OrdersPay();
|
|
|
ordersPay.setPayOrderCode(String.valueOf(sellerOrder.getOrderCode()));
|
|
|
ordersPay.setAmount(sellerOrder.getEarnestMoney());
|
|
|
ordersPay.setOrderCode(sellerOrder.getOrderCode());
|
|
|
ordersPay.setUid(sellerOrder.getUid());
|
|
|
ordersPay.setPayment(11);
|
|
|
ordersPay.setCreateTime(now);
|
|
|
ordersPay.setSerialNo(String.valueOf(sellerOrder.getOrderCode()));
|
|
|
ordersPayMapper.insertSelective(ordersPay);
|
|
|
scriptLogger.info("[{}] do orderPay [{}]", sellerOrder.getUid(), sellerOrder.getOrderCode());
|
|
|
|
|
|
scriptLogger.info("==================================================");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|