Authored by TANLING

Merge branch 'hotfix_0407_skupnotexist2' into test6.9.24

# Conflicts:
#	order/src/main/java/com/yohoufo/order/service/impl/StoreSellerServiceImpl.java
... ... @@ -95,9 +95,9 @@ public class OrderHelpController {
@IgnoreSignature
@IgnoreSession
@RequestMapping(value = "/orderPay")
public ApiResponse orderPay(@RequestParam(value = "uids") List<Integer> uids){
public ApiResponse orderPay(@RequestParam(value = "orderCodes") List<Long> orderCodes){
storedSellerService.orderPay(uids);
storedSellerService.orderPay(orderCodes);
return new ApiResponse.ApiResponseBuilder()
.code(200)
.message("插入订单的付款记录")
... ...
... ... @@ -17,7 +17,7 @@ public interface IStoredSellerService {
* 增加orderPay记录
* @param uids
*/
public void orderPay(List<Integer> uids);
public void orderPay(List<Long> orderCodes);
boolean isStoredSeller(Integer uid);
... ...
... ... @@ -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("==================================================");
}
}
/**
... ...