Authored by chenchao

add throw error code when wallet left not enough

@@ -216,7 +216,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi @@ -216,7 +216,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
216 //发布支付超时取消消息 216 //发布支付超时取消消息
217 pushAutoCancelEvent(context); 217 pushAutoCancelEvent(context);
218 218
219 -  
220 // 发消息 219 // 发消息
221 GoodsInfo goodsInfo = context.getSoldProduct(); 220 GoodsInfo goodsInfo = context.getSoldProduct();
222 OrderSubmitResp resp = OrderSubmitResp.builder().orderCode(orderCode).productId(goodsInfo.getProductId()).build(); 221 OrderSubmitResp resp = OrderSubmitResp.builder().orderCode(orderCode).productId(goodsInfo.getProductId()).build();
@@ -235,13 +234,11 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi @@ -235,13 +234,11 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
235 if(isEntryShop){ 234 if(isEntryShop){
236 log.info("in publishPrd use batchPublishPrds, req {}", req); 235 log.info("in publishPrd use batchPublishPrds, req {}", req);
237 resp = batchPublishPrds(context, req); 236 resp = batchPublishPrds(context, req);
238 -  
239 }else{ 237 }else{
240 log.info("in publishPrd use publishSinglePrd, req {}", req); 238 log.info("in publishPrd use publishSinglePrd, req {}", req);
241 resp = publishSinglePrd(req, context); 239 resp = publishSinglePrd(req, context);
242 cacheCleaner.cleanList(req.getUid(), TabType.SELL.getValue()); 240 cacheCleaner.cleanList(req.getUid(), TabType.SELL.getValue());
243 } 241 }
244 -  
245 return resp; 242 return resp;
246 } 243 }
247 244
@@ -263,8 +260,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi @@ -263,8 +260,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
263 int uid = req.getUid(); 260 int uid = req.getUid();
264 SellerOrderComputeResult socr = ctx.getSellerOrderComputeResult(); 261 SellerOrderComputeResult socr = ctx.getSellerOrderComputeResult();
265 BigDecimal singleEarestMoney = socr.getEarnestMoney().getEarnestMoney(); 262 BigDecimal singleEarestMoney = socr.getEarnestMoney().getEarnestMoney();
266 - BigDecimal mEarestMoney = BigDecimalHelper.halfUp(new BigDecimal(num).multiply(singleEarestMoney));  
267 - 263 + BigDecimal mEarestMoney = sellerOrderPrepareProcessor.checkNGetMergeEarnestMoney(uid, singleEarestMoney, num, ctx.getSalePrice());
268 SellerWalletDetail.Type swdType = SellerWalletDetail.Type.PUBLISH; 264 SellerWalletDetail.Type swdType = SellerWalletDetail.Type.PUBLISH;
269 MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(uid) 265 MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(uid)
270 .storageId(ctx.getStorageId()).earnestMoney(mEarestMoney) 266 .storageId(ctx.getStorageId()).earnestMoney(mEarestMoney)