Authored by caoyan

寄存

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