...
|
...
|
@@ -46,6 +46,7 @@ import org.springframework.integration.context.Orderable; |
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.CollationElementIterator;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneOffset;
|
|
|
import java.util.Arrays;
|
...
|
...
|
@@ -388,10 +389,7 @@ public class StoreSellerServiceImpl implements IStoredSellerService { |
|
|
OrdersPayMapper ordersPayMapper;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 增加orderPay记录
|
|
|
* @param uids
|
|
|
*/
|
|
|
|
|
|
public void orderPay(List<Long> orderCodes){
|
|
|
|
|
|
// 查询卖家正在上架中的商品 & 支付方式是11 & orderspay中没有记录
|
...
|
...
|
@@ -431,6 +429,56 @@ public class StoreSellerServiceImpl implements IStoredSellerService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void compensate(List<Integer> uids){
|
|
|
|
|
|
if (CollectionUtils.isEmpty(uids)){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 超级
|
|
|
List<StoredSeller> storedSellerList = storedSellerMapper.selectByUidList(uids);
|
|
|
if (CollectionUtils.isEmpty(storedSellerList)){
|
|
|
return;
|
|
|
}
|
|
|
List<StoredSeller> filterStoredList = storedSellerList.stream().filter(x->x.getEntryType()==EntrySellerType.COMMON.getCode() && x.getValidStatus()==1).collect(Collectors.toList());
|
|
|
|
|
|
List<SellerWalletCompensate> sellerWalletCompensates = sellerWalletMapper.selectByCompensate(filterStoredList.stream().map(StoredSeller::getUid).collect(Collectors.toList()));
|
|
|
|
|
|
for (SellerWalletCompensate s : sellerWalletCompensates){
|
|
|
|
|
|
double compensate = YHMath.sub(s.getEarnestMoney().doubleValue(), s.getLockAmount().doubleValue());
|
|
|
|
|
|
if (compensate<0){
|
|
|
scriptLogger.info("[{}] no need manual handle1 data {}", s.getUid(), s);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (compensate<0){
|
|
|
scriptLogger.info("[{}] need manual handle1 data {}", s.getUid(), s);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (YHMath.sub(s.getAvailableAmount().doubleValue(), compensate) < 0){
|
|
|
scriptLogger.info("[{}] need manual handle2 data {}", s.getUid(), s);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
BigDecimal earnestMoney = new BigDecimal(compensate);
|
|
|
earnestMoney = earnestMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(s.getUid())
|
|
|
.earnestMoney(earnestMoney)
|
|
|
.type(SellerWalletDetail.Type.PUBLISH.getValue()).build();
|
|
|
merchantOrderPaymentService.useEarnest(s.getUid(), earnestMoney, moai);
|
|
|
scriptLogger.info("[{}] compensate lock money {} success", s.getUid(), s);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 将原来的超级卖家降级
|
|
|
*/
|
...
|
...
|
|