|
@@ -22,6 +22,7 @@ import org.apache.commons.collections.CollectionUtils; |
|
@@ -22,6 +22,7 @@ import org.apache.commons.collections.CollectionUtils; |
22
|
import org.apache.commons.lang3.StringUtils;
|
22
|
import org.apache.commons.lang3.StringUtils;
|
23
|
import org.elasticsearch.common.collect.Lists;
|
23
|
import org.elasticsearch.common.collect.Lists;
|
24
|
import org.elasticsearch.common.collect.Maps;
|
24
|
import org.elasticsearch.common.collect.Maps;
|
|
|
25
|
+import org.elasticsearch.common.collect.Sets;
|
25
|
import org.elasticsearch.common.netty.util.internal.StringUtil;
|
26
|
import org.elasticsearch.common.netty.util.internal.StringUtil;
|
26
|
import org.slf4j.Logger;
|
27
|
import org.slf4j.Logger;
|
27
|
import org.slf4j.LoggerFactory;
|
28
|
import org.slf4j.LoggerFactory;
|
|
@@ -149,6 +150,8 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes; |
|
@@ -149,6 +150,8 @@ import com.yohobuy.ufo.model.order.common.OrderAttributes; |
149
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
150
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
150
|
import com.yohobuy.ufo.model.order.constants.DepositOrderStatusEnum;
|
151
|
import com.yohobuy.ufo.model.order.constants.DepositOrderStatusEnum;
|
151
|
import com.yohobuy.ufo.model.order.constants.DepositOutTypeEnum;
|
152
|
import com.yohobuy.ufo.model.order.constants.DepositOutTypeEnum;
|
|
|
153
|
+import com.yohobuy.ufo.model.order.constants.DepositSourceEnum;
|
|
|
154
|
+import com.yohobuy.ufo.model.order.constants.DepositTypeEnum;
|
152
|
import com.yohobuy.ufo.model.order.constants.ExpressCompanyEnum;
|
155
|
import com.yohobuy.ufo.model.order.constants.ExpressCompanyEnum;
|
153
|
import com.yohobuy.ufo.model.order.constants.IdentifyCenterEnum;
|
156
|
import com.yohobuy.ufo.model.order.constants.IdentifyCenterEnum;
|
154
|
import com.yohobuy.ufo.model.order.constants.RegionEnum;
|
157
|
import com.yohobuy.ufo.model.order.constants.RegionEnum;
|
|
@@ -936,6 +939,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
@@ -936,6 +939,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
936
|
|
939
|
|
937
|
private List<BuyerOrderResp> convertAppraiseToBuyerOrderResp(List<AppraiseOrder> list, JSONObject jsonObject){
|
940
|
private List<BuyerOrderResp> convertAppraiseToBuyerOrderResp(List<AppraiseOrder> list, JSONObject jsonObject){
|
938
|
List<BuyerOrderResp> respList = Lists.newArrayList();
|
941
|
List<BuyerOrderResp> respList = Lists.newArrayList();
|
|
|
942
|
+ Set<String> parentOrderSet = Sets.newHashSet();
|
939
|
List<String> orderCodeList = list.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList());
|
943
|
List<String> orderCodeList = list.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList());
|
940
|
List<ExpressRecord> expressList = expressRecordMapper.selectByOrderCodeListAndType(orderCodeList, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
|
944
|
List<ExpressRecord> expressList = expressRecordMapper.selectByOrderCodeListAndType(orderCodeList, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
|
941
|
Map<String, ExpressRecord> expressMap = expressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
|
945
|
Map<String, ExpressRecord> expressMap = expressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
|
|
@@ -956,9 +960,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
@@ -956,9 +960,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
956
|
resp.setProductCode(goodsMap.get(item.getOrderCode()).getProductCode());
|
960
|
resp.setProductCode(goodsMap.get(item.getOrderCode()).getProductCode());
|
957
|
resp.setSizeName(storageMap.get(item.getOrderCode()).getSizeName());
|
961
|
resp.setSizeName(storageMap.get(item.getOrderCode()).getSizeName());
|
958
|
|
962
|
|
|
|
963
|
+ if(StringUtils.isNotEmpty(item.getParentOrderCode())) {
|
|
|
964
|
+ parentOrderSet.add(item.getParentOrderCode());
|
|
|
965
|
+ }
|
|
|
966
|
+
|
959
|
respList.add(resp);
|
967
|
respList.add(resp);
|
960
|
}
|
968
|
}
|
961
|
|
969
|
|
|
|
970
|
+ jsonObject.put("parentOrderNum", parentOrderSet.size());
|
|
|
971
|
+
|
962
|
return respList;
|
972
|
return respList;
|
963
|
}
|
973
|
}
|
964
|
|
974
|
|
|
@@ -1665,10 +1675,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
@@ -1665,10 +1675,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
1665
|
UserHelper userHelper = new UserHelper();
|
1675
|
UserHelper userHelper = new UserHelper();
|
1666
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
1676
|
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
|
1667
|
|
1677
|
|
1668
|
- //如果是寄存商品
|
1678
|
+ //如果是购买寄存商品
|
1669
|
if(buyerOrder.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {
|
1679
|
if(buyerOrder.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {
|
1670
|
saveStorageDeposit(buyerOrder);
|
1680
|
saveStorageDeposit(buyerOrder);
|
1671
|
}
|
1681
|
}
|
|
|
1682
|
+
|
|
|
1683
|
+ //如果是现货寄存商品
|
|
|
1684
|
+ AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
|
|
|
1685
|
+ if(null != appraiseOrder && appraiseOrder.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {//现货寄存
|
|
|
1686
|
+ saveAppraiseStorageDeposit(appraiseOrder);
|
|
|
1687
|
+ }
|
1672
|
|
1688
|
|
1673
|
String args = "orderAppraise.judgeCenterPass";
|
1689
|
String args = "orderAppraise.judgeCenterPass";
|
1674
|
LOGGER.info("judgeCenterPass begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
|
1690
|
LOGGER.info("judgeCenterPass begin call enter interface is {}, orderCode is {}", buyerOrder.getOrderCode(), args);
|
|
@@ -1678,6 +1694,42 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
@@ -1678,6 +1694,42 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
1678
|
return jsonObject;
|
1694
|
return jsonObject;
|
1679
|
}
|
1695
|
}
|
1680
|
|
1696
|
|
|
|
1697
|
+ private void saveAppraiseStorageDeposit(AppraiseOrder appraiseOrder) {
|
|
|
1698
|
+ StorageDeposit record = new StorageDeposit();
|
|
|
1699
|
+
|
|
|
1700
|
+ StorageDeposit deposit = storageDepositMapper.selectByOrderCode(appraiseOrder.getOrderCode());
|
|
|
1701
|
+ if(null != deposit) {
|
|
|
1702
|
+ return;
|
|
|
1703
|
+ }
|
|
|
1704
|
+
|
|
|
1705
|
+ AppraiseOrderGoods goods = appraiseOrderGoodsMapper.selectByOrderCode(Long.parseLong(appraiseOrder.getOrderCode()));
|
|
|
1706
|
+ AppraiseOrderStorage storage = appraiseOrderStorageMapper.selectByOrderCodes(Lists.newArrayList(appraiseOrder.getOrderCode())).get(0);
|
|
|
1707
|
+
|
|
|
1708
|
+ record.setProductId(goods.getProductId());
|
|
|
1709
|
+ record.setGoodsId(goods.getId());
|
|
|
1710
|
+ record.setStorageId(storage.getStorageId());
|
|
|
1711
|
+ record.setDepositCode(generateDepositCode());
|
|
|
1712
|
+ record.setOwnerUid(appraiseOrder.getUid());
|
|
|
1713
|
+ record.setOrderCode(appraiseOrder.getOrderCode());
|
|
|
1714
|
+ record.setSkup(0);
|
|
|
1715
|
+ record.setStatus(StorageDepositStatusEnum.WAITING_IN.getCode());
|
|
|
1716
|
+ record.setOrderStatus(DepositOrderStatusEnum.ORDER_STATUS_DOWN.getCode());
|
|
|
1717
|
+ record.setUpdateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
1718
|
+ record.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
1719
|
+ record.setDepositStartTime(DateUtil.getCurrentTimeSeconds());
|
|
|
1720
|
+ record.setDepositEndTime(DateUtil.getCurrentTimeSeconds() + 45*24*60*60);
|
|
|
1721
|
+ record.setEditPid(new UserHelper().getUserId());
|
|
|
1722
|
+ record.setOutType(0);
|
|
|
1723
|
+ record.setSource(DepositSourceEnum.SOURCE_SPOT_GOODS.getCode());
|
|
|
1724
|
+ record.setDepositType(DepositTypeEnum.TYPE_REAL.getCode());
|
|
|
1725
|
+ record.setParentOrderCode(appraiseOrder.getParentOrderCode());
|
|
|
1726
|
+
|
|
|
1727
|
+ storageDepositMapper.insert(record);
|
|
|
1728
|
+
|
|
|
1729
|
+ //清缓存
|
|
|
1730
|
+ asyncCallClearCache(appraiseOrder.getUid(), goods.getProductId(), storage.getStorageId());
|
|
|
1731
|
+ }
|
|
|
1732
|
+
|
1681
|
private void saveStorageDeposit(BuyerOrder buyerOrder) {
|
1733
|
private void saveStorageDeposit(BuyerOrder buyerOrder) {
|
1682
|
StorageDeposit record = new StorageDeposit();
|
1734
|
StorageDeposit record = new StorageDeposit();
|
1683
|
List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(buyerOrder.getOrderCode()));
|
1735
|
List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(buyerOrder.getOrderCode()));
|
|
@@ -2932,6 +2984,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
|
@@ -2932,6 +2984,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon |
2932
|
jsonObj.put("uid", buyerOrder.getUid());
|
2984
|
jsonObj.put("uid", buyerOrder.getUid());
|
2933
|
|
2985
|
|
2934
|
Map<String, String> addressMap = subAddress(appraiseAddress);
|
2986
|
Map<String, String> addressMap = subAddress(appraiseAddress);
|
|
|
2987
|
+ //鉴定服务订单
|
2935
|
|
2988
|
|
2936
|
//寄件人信息
|
2989
|
//寄件人信息
|
2937
|
jsonObj.put("jCompany", "UFO鉴定中心");
|
2990
|
jsonObj.put("jCompany", "UFO鉴定中心");
|