...
|
...
|
@@ -22,6 +22,7 @@ import org.apache.commons.collections.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.elasticsearch.common.collect.Maps;
|
|
|
import org.elasticsearch.common.collect.Sets;
|
|
|
import org.elasticsearch.common.netty.util.internal.StringUtil;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
...
|
...
|
@@ -149,6 +150,8 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes; |
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.constants.DepositOrderStatusEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.DepositOutTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.DepositSourceEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.DepositTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.ExpressCompanyEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.IdentifyCenterEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.RegionEnum;
|
...
|
...
|
@@ -936,6 +939,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
|
|
|
|
private List<BuyerOrderResp> convertAppraiseToBuyerOrderResp(List<AppraiseOrder> list, JSONObject jsonObject){
|
|
|
List<BuyerOrderResp> respList = Lists.newArrayList();
|
|
|
Set<String> parentOrderSet = Sets.newHashSet();
|
|
|
List<String> orderCodeList = list.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList());
|
|
|
List<ExpressRecord> expressList = expressRecordMapper.selectByOrderCodeListAndType(orderCodeList, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
|
|
|
Map<String, ExpressRecord> expressMap = expressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
|
...
|
...
|
@@ -956,9 +960,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
|
resp.setProductCode(goodsMap.get(item.getOrderCode()).getProductCode());
|
|
|
resp.setSizeName(storageMap.get(item.getOrderCode()).getSizeName());
|
|
|
|
|
|
if(StringUtils.isNotEmpty(item.getParentOrderCode())) {
|
|
|
parentOrderSet.add(item.getParentOrderCode());
|
|
|
}
|
|
|
|
|
|
respList.add(resp);
|
|
|
}
|
|
|
|
|
|
jsonObject.put("parentOrderNum", parentOrderSet.size());
|
|
|
|
|
|
return respList;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1665,10 +1675,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
|
UserHelper userHelper = new UserHelper();
|
|
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
|
|
|
|
|
//如果是寄存商品
|
|
|
//如果是购买寄存商品
|
|
|
if(buyerOrder.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {
|
|
|
saveStorageDeposit(buyerOrder);
|
|
|
}
|
|
|
|
|
|
//如果是现货寄存商品
|
|
|
AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
|
|
|
if(null != appraiseOrder && appraiseOrder.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {//现货寄存
|
|
|
saveAppraiseStorageDeposit(appraiseOrder);
|
|
|
}
|
|
|
|
|
|
String args = "orderAppraise.judgeCenterPass";
|
|
|
LOGGER.info("judgeCenterPass begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
|
...
|
...
|
@@ -1678,6 +1694,42 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
private void saveAppraiseStorageDeposit(AppraiseOrder appraiseOrder) {
|
|
|
StorageDeposit record = new StorageDeposit();
|
|
|
|
|
|
StorageDeposit deposit = storageDepositMapper.selectByOrderCode(appraiseOrder.getOrderCode());
|
|
|
if(null != deposit) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
AppraiseOrderGoods goods = appraiseOrderGoodsMapper.selectByOrderCode(Long.parseLong(appraiseOrder.getOrderCode()));
|
|
|
AppraiseOrderStorage storage = appraiseOrderStorageMapper.selectByOrderCodes(Lists.newArrayList(appraiseOrder.getOrderCode())).get(0);
|
|
|
|
|
|
record.setProductId(goods.getProductId());
|
|
|
record.setGoodsId(goods.getId());
|
|
|
record.setStorageId(storage.getStorageId());
|
|
|
record.setDepositCode(generateDepositCode());
|
|
|
record.setOwnerUid(appraiseOrder.getUid());
|
|
|
record.setOrderCode(appraiseOrder.getOrderCode());
|
|
|
record.setSkup(0);
|
|
|
record.setStatus(StorageDepositStatusEnum.WAITING_IN.getCode());
|
|
|
record.setOrderStatus(DepositOrderStatusEnum.ORDER_STATUS_DOWN.getCode());
|
|
|
record.setUpdateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
record.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
record.setDepositStartTime(DateUtil.getCurrentTimeSeconds());
|
|
|
record.setDepositEndTime(DateUtil.getCurrentTimeSeconds() + 45*24*60*60);
|
|
|
record.setEditPid(new UserHelper().getUserId());
|
|
|
record.setOutType(0);
|
|
|
record.setSource(DepositSourceEnum.SOURCE_SPOT_GOODS.getCode());
|
|
|
record.setDepositType(DepositTypeEnum.TYPE_REAL.getCode());
|
|
|
record.setParentOrderCode(appraiseOrder.getParentOrderCode());
|
|
|
|
|
|
storageDepositMapper.insert(record);
|
|
|
|
|
|
//清缓存
|
|
|
asyncCallClearCache(appraiseOrder.getUid(), goods.getProductId(), storage.getStorageId());
|
|
|
}
|
|
|
|
|
|
private void saveStorageDeposit(BuyerOrder buyerOrder) {
|
|
|
StorageDeposit record = new StorageDeposit();
|
|
|
List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(buyerOrder.getOrderCode()));
|
...
|
...
|
@@ -2932,6 +2984,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
|
jsonObj.put("uid", buyerOrder.getUid());
|
|
|
|
|
|
Map<String, String> addressMap = subAddress(appraiseAddress);
|
|
|
//鉴定服务订单
|
|
|
|
|
|
//寄件人信息
|
|
|
jsonObj.put("jCompany", "UFO鉴定中心");
|
...
|
...
|
|