Authored by chenchao

skup type tag

@@ -18,7 +18,7 @@ public interface IStoredSellerService { @@ -18,7 +18,7 @@ public interface IStoredSellerService {
18 * @param uidList 18 * @param uidList
19 * @return 19 * @return
20 */ 20 */
21 - public List<StoredSeller> batchGetStoredSeller(List<Integer> uidList); 21 + List<StoredSeller> batchGetStoredSeller(List<Integer> uidList);
22 22
23 boolean isStoredSeller(Integer uid); 23 boolean isStoredSeller(Integer uid);
24 24
@@ -375,20 +375,7 @@ public class BuyerOrderCancelService { @@ -375,20 +375,7 @@ public class BuyerOrderCancelService {
375 .loadSeller(sellerUid, sellerIsSuper, null, null) 375 .loadSeller(sellerUid, sellerIsSuper, null, null)
376 .loadLogger(logger) 376 .loadLogger(logger)
377 .refund(); 377 .refund();
378 - /*  
379 - try {  
380 - prb = payRefundService.refund(refundReqOfSeller, bleb);  
381 - }catch (Exception ex){  
382 - if (!sellerIsSuper) {  
383 - BillLogEvent sellerBillLogEvent = bleb.tradeStatus(BillTradeStatus.FAIL.getCode())  
384 - .buildSellerBo();  
385 - EventBusPublisher.publishEvent(sellerBillLogEvent);  
386 - }  
387 - String content = "用户" + sellerUid + "退保证金订单"+ orderCode +"失败";  
388 - SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent("buyerPaidOrder.selfCancel", "cancel", content);  
389 - EventBusPublisher.publishEvent(smsAlarmEvent);  
390 - }  
391 - */ 378 +
392 logger.info("in BuyerCancelAfterProcessTask call after payRefundService.refund seller, buyerUid {}, orderCode {}, skup {} refundReqOfSeller {}", 379 logger.info("in BuyerCancelAfterProcessTask call after payRefundService.refund seller, buyerUid {}, orderCode {}, skup {} refundReqOfSeller {}",
393 buyerUid, orderCode, skup, refundReqOfSeller ); 380 buyerUid, orderCode, skup, refundReqOfSeller );
394 return prb; 381 return prb;
@@ -419,11 +406,6 @@ public class BuyerOrderCancelService { @@ -419,11 +406,6 @@ public class BuyerOrderCancelService {
419 void refundLeftOrderAmount(BuyerPenaltyCalResult bpcr, BuyerOrder buyerOrder){ 406 void refundLeftOrderAmount(BuyerPenaltyCalResult bpcr, BuyerOrder buyerOrder){
420 Integer sellerUid = buyerOrder.getSellerUid(); 407 Integer sellerUid = buyerOrder.getSellerUid();
421 BigDecimal leftBuyerMoney = bpcr.getLeftAmount(); 408 BigDecimal leftBuyerMoney = bpcr.getLeftAmount();
422 - /*  
423 - PaymentRequest rprOfBuyer = PaymentRequest.builder().uid(buyerUid)  
424 - .orderCode(orderCode).refundAmount(leftBuyerMoney.doubleValue())  
425 - .buildSellerBo();  
426 - */  
427 BillLogEvent.BillLogEventBuilder blebOfBuyer = BillLogEvent.builder() 409 BillLogEvent.BillLogEventBuilder blebOfBuyer = BillLogEvent.builder()
428 .buyerUid(buyerUid).sellerUid(sellerUid).orderCode(orderCode) 410 .buyerUid(buyerUid).sellerUid(sellerUid).orderCode(orderCode)
429 .payType(buyerOrder.getPayment()).refundCase(RefundCase.BUYER_GOODS_MONEY) 411 .payType(buyerOrder.getPayment()).refundCase(RefundCase.BUYER_GOODS_MONEY)
@@ -438,16 +420,6 @@ public class BuyerOrderCancelService { @@ -438,16 +420,6 @@ public class BuyerOrderCancelService {
438 .loadRefundAction(payRefundService::refund) 420 .loadRefundAction(payRefundService::refund)
439 .loadTargetOrderStatus(targetOrderStatus) 421 .loadTargetOrderStatus(targetOrderStatus)
440 .refund(); 422 .refund();
441 - /*  
442 - try {  
443 - payRefundService.refund(rprOfBuyer, blebOfBuyer);  
444 - }catch (Exception ex){  
445 - BillLogEvent buyerBillLogEvent = blebOfBuyer.tradeStatus(BillTradeStatus.FAIL.getCode()).buildSellerBo();  
446 - EventBusPublisher.publishEvent(buyerBillLogEvent);  
447 - String content = "用户" + buyerUid + "订单"+ orderCode +"退货款失败";  
448 - SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent("buyerPaidOrder.selfCancel", "cancel", content);  
449 - EventBusPublisher.publishEvent(smsAlarmEvent);  
450 - }*/  
451 logger.info("in BuyerCancelAfterProcessTask call after payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundAmount {}", 423 logger.info("in BuyerCancelAfterProcessTask call after payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundAmount {}",
452 buyerUid, orderCode, skup, leftBuyerMoney ); 424 buyerUid, orderCode, skup, leftBuyerMoney );
453 } 425 }
@@ -338,10 +338,8 @@ public class SellerOrderCancelService { @@ -338,10 +338,8 @@ public class SellerOrderCancelService {
338 338
339 if (payQueryBo != null && payQueryBo.isPayStatus()){ 339 if (payQueryBo != null && payQueryBo.isPayStatus()){
340 logger.info("in seller timeout cancel failed, confirm paid. uid is {}, orderCode is {}", uid, orderCode); 340 logger.info("in seller timeout cancel failed, confirm paid. uid is {}, orderCode is {}", uid, orderCode);
341 -  
342 PayConfirmEvent event = new PayConfirmEvent(sellerOrder.getUid(), sellerOrder.getOrderCode(), sellerOrder.getPayment()); 341 PayConfirmEvent event = new PayConfirmEvent(sellerOrder.getUid(), sellerOrder.getOrderCode(), sellerOrder.getPayment());
343 EventBusPublisher.publishEvent(event); 342 EventBusPublisher.publishEvent(event);
344 -  
345 return result; 343 return result;
346 } 344 }
347 } 345 }
@@ -717,87 +715,7 @@ public class SellerOrderCancelService { @@ -717,87 +715,7 @@ public class SellerOrderCancelService {
717 logger.info("in cancel offShelveCancelCase {}", skup); 715 logger.info("in cancel offShelveCancelCase {}", skup);
718 SkupStatus expectSkupStatus = SkupStatus.CAN_SELL; 716 SkupStatus expectSkupStatus = SkupStatus.CAN_SELL;
719 final SellerOrderStatus targetSellerOrderStatus = SellerOrderStatus.YOHO_CANCEL_SELL; 717 final SellerOrderStatus targetSellerOrderStatus = SellerOrderStatus.YOHO_CANCEL_SELL;
720 - /*  
721 - if (skup <= 0){  
722 - logger.warn("in offShelveCancelCase ,skup is illegal, skup {}", skup);  
723 - return;  
724 - }  
725 - SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);  
726 - Integer skupStatus;  
727 - if (psog == null || (skupStatus = psog.getStatus() )== null){  
728 - logger.warn("in offShelveCancelCase, SellerOrderGoods or it's status illegal, skup {}", skup);  
729 - return;  
730 - }  
731 718
732 -  
733 - boolean earnestMoneyPaidFlag = expectSkupStatus.getCode() == skupStatus;  
734 - if (!earnestMoneyPaidFlag){  
735 - logger.warn("in offShelveCancelCase, SellerOrderGoods status illegal, skup {}, status {}", skup, skupStatus);  
736 - return;  
737 - }  
738 -  
739 -  
740 - SellerOrderGoods targetGoods = new SellerOrderGoods();  
741 - targetGoods.setId(skup);  
742 - targetGoods.setStatus(targetSellerOrderStatus.getSkupStatus().getCode());  
743 - targetGoods.setExceptStatus(skupStatus);  
744 - //利用数据库做并发控制  
745 - int result = sellerOrderGoodsMapper.updateStatusBySkpu(targetGoods);  
746 -  
747 - if (result == 0) {  
748 - logger.warn("in offShelveCancelCase, update status fail, skup {}, skupStatus {}", skup, skupStatus);  
749 - return;  
750 - }  
751 - SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(skup);  
752 - Integer sellerUid = sellerOrder.getUid();  
753 - final Long orderCode = sellerOrder.getOrderCode();  
754 - //update  
755 - SellerOrder tso = new SellerOrder();  
756 - tso.setOrderCode(orderCode);  
757 - tso.setExceptStatus(sellerOrder.getStatus());  
758 - tso.setStatus(targetSellerOrderStatus.getCode());  
759 - tso.setUid(sellerUid);  
760 - tso.setUpdateTime(DateUtil.getCurrentTimeSecond());  
761 - sellerOrderMapper.updateByOrderCode(tso);  
762 - //  
763 - cacheCleaner.cleanList(sellerUid, TabType.SELL.getValue());  
764 - cacheCleaner.cleanSellerDetail(psog);  
765 - double earnestMoney = sellerOrder.getEarnestMoney().doubleValue();  
766 -  
767 - Integer sop = sellerOrder.getPayment() == null ? 0 : sellerOrder.getPayment();  
768 -  
769 - boolean sellerIsSuper = sellerService.isSuperEntrySeller(sellerUid);  
770 -  
771 - //不是超级卖家 ,上架商品用钱包支付保证金  
772 - MerchantOrderAttachInfo moai = null;  
773 - if(!sellerIsSuper && PaymentHelper.isWallet(sop)){  
774 - moai = MerchantOrderAttachInfo.builder().uid(sellerUid)  
775 - .orderCode(orderCode).skup(skup).earnestMoney(sellerOrder.getEarnestMoney())  
776 - .type(SellerWalletDetail.Type.SYSTEM_OFF.getValue()).buildSellerBo();  
777 - }  
778 -  
779 - BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()  
780 - .sellerUid(sellerUid).orderCode(orderCode)  
781 - .payType(sellerOrder.getPayment())  
782 - .refundCase(RefundCase.SELLER_EARNEST_MONEY)  
783 - .skup(skup);  
784 - PaymentRequest refundReq = PaymentRequest.builder().uid(sellerUid)  
785 - .orderCode(orderCode)  
786 - .refundCase(RefundCase.SELLER_EARNEST_MONEY)  
787 - .payment(sop)  
788 - .refundAmount(earnestMoney)  
789 - .isSuper(sellerIsSuper)  
790 - .refundattch(moai)  
791 - .buildSellerBo();  
792 -  
793 - boolean refundEarnMoneyFlag = new RefundEarnestMoneyHandler()  
794 - .loadRefundAction(payRefundService::refund)  
795 - .loadBillLogEventBuilder(bleb)  
796 - .loadPaymentRequest(refundReq)  
797 - .loadSeller(sellerUid, sellerIsSuper, orderCode, targetSellerOrderStatus)  
798 - .loadLogger(logger)  
799 - .refund();  
800 - */  
801 CancelStatusNode csn = new CancelStatusNode(); 719 CancelStatusNode csn = new CancelStatusNode();
802 csn.skup = skup; 720 csn.skup = skup;
803 csn.expectSkupStatus = expectSkupStatus; 721 csn.expectSkupStatus = expectSkupStatus;
@@ -167,6 +167,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic @@ -167,6 +167,9 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
167 @Autowired 167 @Autowired
168 private MetaConfigService metaConfigService; 168 private MetaConfigService metaConfigService;
169 169
  170 + @Autowired
  171 + private SellerService sellerService;
  172 +
170 private static final int MAX_DEAL = 10; 173 private static final int MAX_DEAL = 10;
171 174
172 public SoldPrdComputeBo computePublishPrd(SellerOrderComputeReq req) { 175 public SoldPrdComputeBo computePublishPrd(SellerOrderComputeReq req) {
@@ -274,6 +277,14 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic @@ -274,6 +277,14 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
274 * @throws GatewayException 277 * @throws GatewayException
275 */ 278 */
276 public OrderSubmitResp publishPrd(SellerOrderSubmitReq req) throws GatewayException { 279 public OrderSubmitResp publishPrd(SellerOrderSubmitReq req) throws GatewayException {
  280 + int uid = req.getUid();
  281 + SellerWrapper sellerWrapper = sellerService.getFullDimensionSeller(uid);
  282 + SellerBo sellerBo = sellerWrapper.buildSellerBo();
  283 + if (sellerBo.isLargeSettlementSuper()){
  284 + log.warn("publishPrd user is overseas ,uid {}", uid);
  285 + throw new UfoServiceException(400, "海外卖家暂时不支持出售");
  286 + }
  287 +
277 SellerOrderContext context = sellerOrderPrepareProcessor.buildPublishCtx(req); 288 SellerOrderContext context = sellerOrderPrepareProcessor.buildPublishCtx(req);
278 boolean isEntryShop = context.isEntryShop(); 289 boolean isEntryShop = context.isEntryShop();
279 OrderSubmitResp resp ; 290 OrderSubmitResp resp ;
@@ -5,6 +5,7 @@ import com.yoho.error.ServiceError; @@ -5,6 +5,7 @@ import com.yoho.error.ServiceError;
5 import com.yoho.error.exception.ServiceException; 5 import com.yoho.error.exception.ServiceException;
6 import com.yoho.tools.common.beans.ApiResponse; 6 import com.yoho.tools.common.beans.ApiResponse;
7 import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum; 7 import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
  8 +import com.yohobuy.ufo.model.order.bo.SellerBo;
8 import com.yohobuy.ufo.model.order.common.EntrySellerDepositType; 9 import com.yohobuy.ufo.model.order.common.EntrySellerDepositType;
9 import com.yohobuy.ufo.model.order.common.EntrySellerType; 10 import com.yohobuy.ufo.model.order.common.EntrySellerType;
10 import com.yohobuy.ufo.model.order.common.OrderCodeType; 11 import com.yohobuy.ufo.model.order.common.OrderCodeType;
@@ -92,6 +93,9 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi @@ -92,6 +93,9 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi
92 @Autowired 93 @Autowired
93 IInviteService inviteService; 94 IInviteService inviteService;
94 95
  96 + @Autowired
  97 + private SellerService sellerService;
  98 +
95 99
96 /** 100 /**
97 * 充值保证金 101 * 充值保证金
@@ -243,6 +247,13 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi @@ -243,6 +247,13 @@ public class StoredSellerDepositServiceImpl implements IStoredSellerDepositServi
243 @Override 247 @Override
244 public void quitStoredSellerAndReturnDeposit(Integer uid){ 248 public void quitStoredSellerAndReturnDeposit(Integer uid){
245 logger.info("StoredSellerServiceImpl quitStoredSeller enter uid is {} ",uid); 249 logger.info("StoredSellerServiceImpl quitStoredSeller enter uid is {} ",uid);
  250 + SellerWrapper sellerWrapper = sellerService.getFullDimensionSeller(uid);
  251 + SellerBo sellerBo = sellerWrapper.buildSellerBo();
  252 + if (sellerBo.isLargeSettlementSuper()){
  253 + logger.warn("quitStoredSellerAndReturnDeposit user is overseas ,uid {}", uid);
  254 + throw new UfoServiceException(400, "海外卖家暂时不支持退出");
  255 + }
  256 + sellerWrapper.getStoredSeller();
246 257
247 if(!storedSellerService.isStoredSeller(uid)){ 258 if(!storedSellerService.isStoredSeller(uid)){
248 logger.error("StoredSellerServiceImpl quitStoredSeller store seller isEntrySeller false,uid is {} ",uid); 259 logger.error("StoredSellerServiceImpl quitStoredSeller store seller isEntrySeller false,uid is {} ",uid);
@@ -35,9 +35,8 @@ public class SellerAuthCheckService { @@ -35,9 +35,8 @@ public class SellerAuthCheckService {
35 35
36 public void checkAuth(SellerBo sellerBo, SellerFuncEnum sellerFunc){ 36 public void checkAuth(SellerBo sellerBo, SellerFuncEnum sellerFunc){
37 int uid = sellerBo.getUid(); 37 int uid = sellerBo.getUid();
38 - EntrySellerType est;  
39 - est=sellerBo.getEntrySellerType();  
40 - boolean isNormalSuper = SellerHelper.isNormalSuper(est); 38 + EntrySellerType est = sellerBo.getEntrySellerType();
  39 + boolean isNormalSuper = sellerBo.isNormalSuper();
41 if (isNormalSuper){ 40 if (isNormalSuper){
42 SellerLevelFuncBo slfb = sellerBo.getSellerLevelFunc(); 41 SellerLevelFuncBo slfb = sellerBo.getSellerLevelFunc();
43 List<Integer> funcIdList = slfb.getFuncIdList(); 42 List<Integer> funcIdList = slfb.getFuncIdList();
@@ -139,9 +139,7 @@ public class SingleGoodsChangePricePrepareProcessor { @@ -139,9 +139,7 @@ public class SingleGoodsChangePricePrepareProcessor {
139 priceComputePrepareProcessor.checkIncome(storageId, computeResult.getIncome()); 139 priceComputePrepareProcessor.checkIncome(storageId, computeResult.getIncome());
140 SellerBo sellerBo = sellerService.getSellerWithAuth(uid); 140 SellerBo sellerBo = sellerService.getSellerWithAuth(uid);
141 SellerFuncEnum sellerFuncEnum = SellerFuncEnum.SINGLE_CHANGE_PRICE; 141 SellerFuncEnum sellerFuncEnum = SellerFuncEnum.SINGLE_CHANGE_PRICE;
142 - if (sellerBo.isNormalSuper()){  
143 - sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);  
144 - } 142 + sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);
145 int num = req.getNum(); 143 int num = req.getNum();
146 //作为入驻商户 检查钱包 144 //作为入驻商户 检查钱包
147 BigDecimal targetEM = computeResult.getEarnestMoney().getEarnestMoney(); 145 BigDecimal targetEM = computeResult.getEarnestMoney().getEarnestMoney();
@@ -152,9 +152,7 @@ public class PriceComputePrepareProcessor { @@ -152,9 +152,7 @@ public class PriceComputePrepareProcessor {
152 //check seller type and wallet 152 //check seller type and wallet
153 SellerFuncEnum sellerFuncEnum = SellerFuncEnum.BATCH_PUBLISH; 153 SellerFuncEnum sellerFuncEnum = SellerFuncEnum.BATCH_PUBLISH;
154 SellerBo sellerBo = sellerService.getSellerWithAuth(uid); 154 SellerBo sellerBo = sellerService.getSellerWithAuth(uid);
155 - if (sellerBo.isNormalSuper()){  
156 - sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);  
157 - } 155 + sellerAuthCheckService.checkAuth(sellerBo, sellerFuncEnum);
158 if (sellerBo.isCommonEntry()){ 156 if (sellerBo.isCommonEntry()){
159 checkNGetMergeEarnestMoney(uid, computeResult.getEarnestMoney().getEarnestMoney(), 157 checkNGetMergeEarnestMoney(uid, computeResult.getEarnestMoney().getEarnestMoney(),
160 num, salePrice, false); 158 num, salePrice, false);
@@ -88,7 +88,8 @@ public class SellerHelper { @@ -88,7 +88,8 @@ public class SellerHelper {
88 88
89 public static boolean isSuper(EntrySellerType est){ 89 public static boolean isSuper(EntrySellerType est){
90 boolean result = Objects.equals(est, EntrySellerType.SPECIAL_SUPER) 90 boolean result = Objects.equals(est, EntrySellerType.SPECIAL_SUPER)
91 - || isNormalSuper(est); 91 + || isNormalSuper(est)
  92 + || isLargeSettlement(est);
92 return result; 93 return result;
93 } 94 }
94 95