Authored by chenchao

skup type tag

... ... @@ -18,7 +18,7 @@ public interface IStoredSellerService {
* @param uidList
* @return
*/
public List<StoredSeller> batchGetStoredSeller(List<Integer> uidList);
List<StoredSeller> batchGetStoredSeller(List<Integer> uidList);
boolean isStoredSeller(Integer uid);
... ...
... ... @@ -375,20 +375,7 @@ public class BuyerOrderCancelService {
.loadSeller(sellerUid, sellerIsSuper, null, null)
.loadLogger(logger)
.refund();
/*
try {
prb = payRefundService.refund(refundReqOfSeller, bleb);
}catch (Exception ex){
if (!sellerIsSuper) {
BillLogEvent sellerBillLogEvent = bleb.tradeStatus(BillTradeStatus.FAIL.getCode())
.buildSellerBo();
EventBusPublisher.publishEvent(sellerBillLogEvent);
}
String content = "用户" + sellerUid + "退保证金订单"+ orderCode +"失败";
SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent("buyerPaidOrder.selfCancel", "cancel", content);
EventBusPublisher.publishEvent(smsAlarmEvent);
}
*/
logger.info("in BuyerCancelAfterProcessTask call after payRefundService.refund seller, buyerUid {}, orderCode {}, skup {} refundReqOfSeller {}",
buyerUid, orderCode, skup, refundReqOfSeller );
return prb;
... ... @@ -419,11 +406,6 @@ public class BuyerOrderCancelService {
void refundLeftOrderAmount(BuyerPenaltyCalResult bpcr, BuyerOrder buyerOrder){
Integer sellerUid = buyerOrder.getSellerUid();
BigDecimal leftBuyerMoney = bpcr.getLeftAmount();
/*
PaymentRequest rprOfBuyer = PaymentRequest.builder().uid(buyerUid)
.orderCode(orderCode).refundAmount(leftBuyerMoney.doubleValue())
.buildSellerBo();
*/
BillLogEvent.BillLogEventBuilder blebOfBuyer = BillLogEvent.builder()
.buyerUid(buyerUid).sellerUid(sellerUid).orderCode(orderCode)
.payType(buyerOrder.getPayment()).refundCase(RefundCase.BUYER_GOODS_MONEY)
... ... @@ -438,16 +420,6 @@ public class BuyerOrderCancelService {
.loadRefundAction(payRefundService::refund)
.loadTargetOrderStatus(targetOrderStatus)
.refund();
/*
try {
payRefundService.refund(rprOfBuyer, blebOfBuyer);
}catch (Exception ex){
BillLogEvent buyerBillLogEvent = blebOfBuyer.tradeStatus(BillTradeStatus.FAIL.getCode()).buildSellerBo();
EventBusPublisher.publishEvent(buyerBillLogEvent);
String content = "用户" + buyerUid + "订单"+ orderCode +"退货款失败";
SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent("buyerPaidOrder.selfCancel", "cancel", content);
EventBusPublisher.publishEvent(smsAlarmEvent);
}*/
logger.info("in BuyerCancelAfterProcessTask call after payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundAmount {}",
buyerUid, orderCode, skup, leftBuyerMoney );
}
... ...
... ... @@ -338,10 +338,8 @@ public class SellerOrderCancelService {
if (payQueryBo != null && payQueryBo.isPayStatus()){
logger.info("in seller timeout cancel failed, confirm paid. uid is {}, orderCode is {}", uid, orderCode);
PayConfirmEvent event = new PayConfirmEvent(sellerOrder.getUid(), sellerOrder.getOrderCode(), sellerOrder.getPayment());
EventBusPublisher.publishEvent(event);
return result;
}
}
... ... @@ -717,87 +715,7 @@ public class SellerOrderCancelService {
logger.info("in cancel offShelveCancelCase {}", skup);
SkupStatus expectSkupStatus = SkupStatus.CAN_SELL;
final SellerOrderStatus targetSellerOrderStatus = SellerOrderStatus.YOHO_CANCEL_SELL;
/*
if (skup <= 0){
logger.warn("in offShelveCancelCase ,skup is illegal, skup {}", skup);
return;
}
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
Integer skupStatus;
if (psog == null || (skupStatus = psog.getStatus() )== null){
logger.warn("in offShelveCancelCase, SellerOrderGoods or it's status illegal, skup {}", skup);
return;
}
boolean earnestMoneyPaidFlag = expectSkupStatus.getCode() == skupStatus;
if (!earnestMoneyPaidFlag){
logger.warn("in offShelveCancelCase, SellerOrderGoods status illegal, skup {}, status {}", skup, skupStatus);
return;
}
SellerOrderGoods targetGoods = new SellerOrderGoods();
targetGoods.setId(skup);
targetGoods.setStatus(targetSellerOrderStatus.getSkupStatus().getCode());
targetGoods.setExceptStatus(skupStatus);
//利用数据库做并发控制
int result = sellerOrderGoodsMapper.updateStatusBySkpu(targetGoods);
if (result == 0) {
logger.warn("in offShelveCancelCase, update status fail, skup {}, skupStatus {}", skup, skupStatus);
return;
}
SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(skup);
Integer sellerUid = sellerOrder.getUid();
final Long orderCode = sellerOrder.getOrderCode();
//update
SellerOrder tso = new SellerOrder();
tso.setOrderCode(orderCode);
tso.setExceptStatus(sellerOrder.getStatus());
tso.setStatus(targetSellerOrderStatus.getCode());
tso.setUid(sellerUid);
tso.setUpdateTime(DateUtil.getCurrentTimeSecond());
sellerOrderMapper.updateByOrderCode(tso);
//
cacheCleaner.cleanList(sellerUid, TabType.SELL.getValue());
cacheCleaner.cleanSellerDetail(psog);
double earnestMoney = sellerOrder.getEarnestMoney().doubleValue();
Integer sop = sellerOrder.getPayment() == null ? 0 : sellerOrder.getPayment();
boolean sellerIsSuper = sellerService.isSuperEntrySeller(sellerUid);
//不是超级卖家 ,上架商品用钱包支付保证金
MerchantOrderAttachInfo moai = null;
if(!sellerIsSuper && PaymentHelper.isWallet(sop)){
moai = MerchantOrderAttachInfo.builder().uid(sellerUid)
.orderCode(orderCode).skup(skup).earnestMoney(sellerOrder.getEarnestMoney())
.type(SellerWalletDetail.Type.SYSTEM_OFF.getValue()).buildSellerBo();
}
BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
.sellerUid(sellerUid).orderCode(orderCode)
.payType(sellerOrder.getPayment())
.refundCase(RefundCase.SELLER_EARNEST_MONEY)
.skup(skup);
PaymentRequest refundReq = PaymentRequest.builder().uid(sellerUid)
.orderCode(orderCode)
.refundCase(RefundCase.SELLER_EARNEST_MONEY)
.payment(sop)
.refundAmount(earnestMoney)
.isSuper(sellerIsSuper)
.refundattch(moai)
.buildSellerBo();
boolean refundEarnMoneyFlag = new RefundEarnestMoneyHandler()
.loadRefundAction(payRefundService::refund)
.loadBillLogEventBuilder(bleb)
.loadPaymentRequest(refundReq)
.loadSeller(sellerUid, sellerIsSuper, orderCode, targetSellerOrderStatus)
.loadLogger(logger)
.refund();
*/
CancelStatusNode csn = new CancelStatusNode();
csn.skup = skup;
csn.expectSkupStatus = expectSkupStatus;
... ...
... ... @@ -167,6 +167,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
@Autowired
private MetaConfigService metaConfigService;
@Autowired
private SellerService sellerService;
private static final int MAX_DEAL = 10;
public SoldPrdComputeBo computePublishPrd(SellerOrderComputeReq req) {
... ... @@ -274,6 +277,14 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
* @throws GatewayException
*/
public OrderSubmitResp publishPrd(SellerOrderSubmitReq req) throws GatewayException {
int uid = req.getUid();
SellerWrapper sellerWrapper = sellerService.getFullDimensionSeller(uid);
SellerBo sellerBo = sellerWrapper.buildSellerBo();
if (sellerBo.isLargeSettlementSuper()){
log.warn("publishPrd user is overseas ,uid {}", uid);
throw new UfoServiceException(400, "海外卖家暂时不支持出售");
}
SellerOrderContext context = sellerOrderPrepareProcessor.buildPublishCtx(req);
boolean isEntryShop = context.isEntryShop();
OrderSubmitResp resp ;
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.tools.common.beans.ApiResponse;
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
import com.yohobuy.ufo.model.order.bo.SellerBo;
import com.yohobuy.ufo.model.order.common.EntrySellerDepositType;
import com.yohobuy.ufo.model.order.common.EntrySellerType;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
... ... @@ -92,6 +93,9 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi
@Autowired
IInviteService inviteService;
@Autowired
private SellerService sellerService;
/**
* 充值保证金
... ... @@ -243,6 +247,13 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi
@Override
public void quitStoredSellerAndReturnDeposit(Integer uid){
logger.info("StoredSellerServiceImpl quitStoredSeller enter uid is {} ",uid);
SellerWrapper sellerWrapper = sellerService.getFullDimensionSeller(uid);
SellerBo sellerBo = sellerWrapper.buildSellerBo();
if (sellerBo.isLargeSettlementSuper()){
logger.warn("quitStoredSellerAndReturnDeposit user is overseas ,uid {}", uid);
throw new UfoServiceException(400, "海外卖家暂时不支持退出");
}
sellerWrapper.getStoredSeller();
if(!storedSellerService.isStoredSeller(uid)){
logger.error("StoredSellerServiceImpl quitStoredSeller store seller isEntrySeller false,uid is {} ",uid);
... ...
... ... @@ -35,9 +35,8 @@ public class SellerAuthCheckService {
public void checkAuth(SellerBo sellerBo, SellerFuncEnum sellerFunc){
int uid = sellerBo.getUid();
EntrySellerType est;
est=sellerBo.getEntrySellerType();
boolean isNormalSuper = SellerHelper.isNormalSuper(est);
EntrySellerType est = sellerBo.getEntrySellerType();
boolean isNormalSuper = sellerBo.isNormalSuper();
if (isNormalSuper){
SellerLevelFuncBo slfb = sellerBo.getSellerLevelFunc();
List<Integer> funcIdList = slfb.getFuncIdList();
... ...
... ... @@ -139,9 +139,7 @@ public class SingleGoodsChangePricePrepareProcessor {
priceComputePrepareProcessor.checkIncome(storageId, computeResult.getIncome());
SellerBo sellerBo = sellerService.getSellerWithAuth(uid);
SellerFuncEnum sellerFuncEnum = SellerFuncEnum.SINGLE_CHANGE_PRICE;
if (sellerBo.isNormalSuper()){
sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);
}
sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);
int num = req.getNum();
//作为入驻商户 检查钱包
BigDecimal targetEM = computeResult.getEarnestMoney().getEarnestMoney();
... ...
... ... @@ -152,9 +152,7 @@ public class PriceComputePrepareProcessor {
//check seller type and wallet
SellerFuncEnum sellerFuncEnum = SellerFuncEnum.BATCH_PUBLISH;
SellerBo sellerBo = sellerService.getSellerWithAuth(uid);
if (sellerBo.isNormalSuper()){
sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);
}
sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);
if (sellerBo.isCommonEntry()){
checkNGetMergeEarnestMoney(uid, computeResult.getEarnestMoney().getEarnestMoney(),
num, salePrice, false);
... ...
... ... @@ -88,7 +88,8 @@ public class SellerHelper {
public static boolean isSuper(EntrySellerType est){
boolean result = Objects.equals(est, EntrySellerType.SPECIAL_SUPER)
|| isNormalSuper(est);
|| isNormalSuper(est)
|| isLargeSettlement(est);
return result;
}
... ...