Authored by caoyan

寄存

@@ -120,6 +120,7 @@ import com.yoho.ufo.util.ImagesHelper; @@ -120,6 +120,7 @@ import com.yoho.ufo.util.ImagesHelper;
120 import com.yoho.ufo.util.MobileHelper; 120 import com.yoho.ufo.util.MobileHelper;
121 import com.yoho.ufo.util.OrderVideoUrlUtil; 121 import com.yoho.ufo.util.OrderVideoUrlUtil;
122 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo; 122 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
  123 +import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
123 import com.yohobuy.ufo.model.order.common.EnumExpressType; 124 import com.yohobuy.ufo.model.order.common.EnumExpressType;
124 import com.yohobuy.ufo.model.order.common.EnumQualityCheckStatus; 125 import com.yohobuy.ufo.model.order.common.EnumQualityCheckStatus;
125 import com.yohobuy.ufo.model.order.common.EnumQualityCheckType; 126 import com.yohobuy.ufo.model.order.common.EnumQualityCheckType;
@@ -1353,8 +1354,23 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon @@ -1353,8 +1354,23 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
1353 record.setOutType(0); 1354 record.setOutType(0);
1354 1355
1355 storageDepositMapper.insert(record); 1356 storageDepositMapper.insert(record);
  1357 +
  1358 + //清缓存
  1359 + asyncCallClearCache(buyerOrder.getUid(), storagePrice.getProductId(), storagePrice.getStorageId());
1356 } 1360 }
1357 1361
  1362 + private JSONObject asyncCallClearCache(Integer ownerUid, Integer productId, Integer storageId) {
  1363 + String args = "ufo-gateway.clearUserDepositCache";
  1364 + LOGGER.info("asyncCallClearCache call ufo-gateway enter storageId is {}, interface is {}", storageId, args);
  1365 + DepositDetailBo bo = new DepositDetailBo();
  1366 + bo.setOwnerUid(ownerUid);
  1367 + bo.setProductId(productId);
  1368 + bo.setStorageId(storageId);
  1369 + JSONObject jsonObject = serviceCaller.asyncCall(args, bo, JSONObject.class).get(5, TimeUnit.SECONDS);
  1370 + LOGGER.info("asyncCallClearCache call ufo-gateway storageId is {}, interface is {},result is {}", storageId, args, jsonObject);
  1371 + return jsonObject;
  1372 + }
  1373 +
1358 private static String generateDepositCode() { 1374 private static String generateDepositCode() {
1359 //生成寄存码:当前时间戳后9位 1375 //生成寄存码:当前时间戳后9位
1360 String currentSeconds = String.valueOf(DateUtil.getCurrentTimeSeconds()); 1376 String currentSeconds = String.valueOf(DateUtil.getCurrentTimeSeconds());
@@ -230,7 +230,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{ @@ -230,7 +230,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{
230 for(StorageDeposit item : depositList) { 230 for(StorageDeposit item : depositList) {
231 //调用前台接口设置订单状态为已完成 231 //调用前台接口设置订单状态为已完成
232 JSONObject param = new JSONObject(); 232 JSONObject param = new JSONObject();
233 - param.put("uid", userHelper.getUserId()); 233 + param.put("uid", item.getOwnerUid());
234 param.put("orderCode", item.getOrderCode()); 234 param.put("orderCode", item.getOrderCode());
235 LOGGER.info("start send mq, topic is {}, param is {}", "buyerOrder.autoConfirm", param); 235 LOGGER.info("start send mq, topic is {}, param is {}", "buyerOrder.autoConfirm", param);
236 yhProducer.send("buyerOrder.autoConfirm", param, null); 236 yhProducer.send("buyerOrder.autoConfirm", param, null);