...
|
...
|
@@ -20,11 +20,13 @@ import com.yoho.core.common.utils.DateUtil; |
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.order.dal.BuyerOrderGoodsMapper;
|
|
|
import com.yoho.order.dal.BuyerOrderMapper;
|
|
|
import com.yoho.order.dal.BuyerOrderMetaMapper;
|
|
|
import com.yoho.order.dal.ExpressInfoMapper;
|
|
|
import com.yoho.order.dal.SellerOrderGoodsMapper;
|
|
|
import com.yoho.order.dal.SellerOrderMapper;
|
|
|
import com.yoho.order.model.BuyerOrder;
|
|
|
import com.yoho.order.model.BuyerOrderGoods;
|
|
|
import com.yoho.order.model.BuyerOrderMeta;
|
|
|
import com.yoho.order.model.BuyerOrderReq;
|
|
|
import com.yoho.order.model.ExpressInfo;
|
|
|
import com.yoho.order.model.SellerOrder;
|
...
|
...
|
@@ -59,8 +61,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerOrderMetaMapper buyerOrderMetaMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ServiceCaller serviceCaller;
|
|
|
|
|
|
private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address";
|
|
|
|
|
|
public Map<String, Integer> getCountByJudgeStatus(){
|
|
|
List<Byte> toBeJudgedList = Lists.newArrayList();
|
|
|
List<Byte> alreadyJudgedList = Lists.newArrayList();
|
...
|
...
|
@@ -130,7 +137,35 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
}
|
|
|
|
|
|
return buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());
|
|
|
}
|
|
|
|
|
|
public BuyerOrderResp getReceiveInfoByOrderCode(BuyerOrderReq req) {
|
|
|
BuyerOrderMeta meta = buyerOrderMetaMapper.selectByOrderCodeAndKey(req.getOrderCode(), BUYER_ORDER_META_KEY_DELIVERY_ADDRESS);
|
|
|
if(null == meta) {
|
|
|
return null;
|
|
|
}
|
|
|
JSONObject metaValue = JSONObject.parseObject(meta.getMetaValue());
|
|
|
BuyerOrderResp result = new BuyerOrderResp();
|
|
|
result.setReceiveName(metaValue.getString("addresseeName"));
|
|
|
result.setReceiveMobile(metaValue.getString("mobile"));
|
|
|
result.setReceiveAddress(rebuildReceiveAddress(metaValue.getJSONObject("area")));
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private String rebuildReceiveAddress(JSONObject address) {
|
|
|
String fourthName = address.getString("caption");
|
|
|
JSONObject thirdObj = address.getJSONObject("parent");
|
|
|
String thirdName = thirdObj.getString("caption");
|
|
|
JSONObject secondObj = thirdObj.getJSONObject("parent");
|
|
|
String secondName = secondObj.getString("caption");
|
|
|
JSONObject firstObj = secondObj.getJSONObject("parent");
|
|
|
String firstName = firstObj.getString("caption");
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
sb.append(firstName).append(secondName).append(thirdName).append(fourthName);
|
|
|
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|
|
|
private List<BuyerOrderResp> convertToResp(List<BuyerOrder> orderList, Map<String, BuyerOrderGoods> buyerGoodsMap,
|
...
|
...
|
@@ -147,6 +182,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
resp.setSkuStr(sellerGoodsMap.get(skup).getStorageId().toString());
|
|
|
resp.setDepotNo(sellerGoodsMap.get(skup).getDepotNo());
|
|
|
resp.setSellerWaybillCode(expressInfoMap.get(sellerOrder.getOrderCode()).getWaybillCode());
|
|
|
resp.setSellerOrderCode(sellerOrder.getOrderCode());
|
|
|
resp.setSkup(skup);
|
|
|
resp.setCreateTimeStr(null == item.getCreateTime() ? "" : DateUtil.long2DateStr(item.getCreateTime().longValue()*1000, "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
respList.add(resp);
|
...
|
...
|
|