Authored by mali

Merge branch 'test6.9.10' of http://git.yoho.cn/ufo/ufo-platform into test6.9.10

... ... @@ -2900,6 +2900,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
data.put("cargoInfo", "[衣服鞋帽]*1");
data.put("dWholeAddress", jsonReqObj.getString("dProvince") + jsonReqObj.getString("dCity") + jsonReqObj.getString("dDistrict") + jsonReqObj.getString("dAddress"));
data.put("cargoInfo", "[衣服鞋帽]*1");
data.put("payMethod", jsonReqObj.getInteger("payMethod"));
StorageDeposit deposit = storageDepositMapper.selectByOrderCode(req.getOrderCode());
data.put("region", RegionEnum.MAINLAND.getCode());
... ... @@ -2934,7 +2935,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
}
JSONObject cacheData = JSONObject.parseObject(resultStr);
Integer payMethodCache = cacheData.getJSONObject("data").getInteger("payMethod");
Integer payMethodCache = cacheData.getInteger("payMethod");
Integer payMethod = null;
if(order.getStatus().equals(Constant.BUYER_ORDER_STATUS_APPRAISE_UNSURE.getByteVal())) {
payMethod = PAY_METHOD_MONTHLY;//寄付月结
... ... @@ -2947,7 +2948,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
throw new CommonException(500, "状态异常,当前状态是"+Constant.convertOrderStatusStr(order.getStatus()));
}
if(!payMethod.equals(payMethodCache)) {
if(null != payMethod && !payMethod.equals(payMethodCache)) {
return null;
}
... ... @@ -3130,15 +3131,32 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
List<String> waybillCodeList = list.stream().map(SignForPackage::getSellerWaybillCode).collect(Collectors.toList());
List<ExpressRecord> expressList = expressRecordMapper.selectByWaybillCodesAndDepotNo(waybillCodeList, req.getDepotNo());
Map<String, List<ExpressRecord>> expressMap = expressList.stream().collect(Collectors.groupingBy(ExpressRecord::getWaybillCode));
List<String> orderCodeList = expressList.stream().map(ExpressRecord::getOrderCode).collect(Collectors.toList());
List<AppraiseOrder> appraiseOrderList = appraiseOrderMapper.selectBatchSonList(orderCodeList);
Map<String, List<AppraiseOrder>> expressSonMap = Maps.newHashMap();
if(CollectionUtils.isNotEmpty(appraiseOrderList)) {
List<String> parentOrderCodeList = appraiseOrderList.stream().map(AppraiseOrder::getParentOrderCode).collect(Collectors.toList());
Map<String, List<AppraiseOrder>> parentSonMap = appraiseOrderList.stream().collect(Collectors.groupingBy(AppraiseOrder::getParentOrderCode));
for(ExpressRecord item : expressList) {
if(parentOrderCodeList.contains(item.getOrderCode())) {
expressSonMap.put(item.getWaybillCode(), parentSonMap.get(item.getOrderCode()));
}
}
}
List<SignForPackageRsp> rspList = Lists.newArrayList();
for(SignForPackage item : list) {
for(String item : waybillCodeList) {
SignForPackageRsp rsp = new SignForPackageRsp();
rsp.setSellerWaybillCode(item.getSellerWaybillCode());
rsp.setOrderNum(null == expressMap.get(item.getSellerWaybillCode()) ? 0 : expressMap.get(item.getSellerWaybillCode()).size());
rsp.setSellerWaybillCode(item);
List<AppraiseOrder> appraiseList = expressSonMap.get(item);
if(CollectionUtils.isEmpty(appraiseList)) {
rsp.setOrderNum(null == expressMap.get(item) ? 0 : expressMap.get(item).size());
}else {
rsp.setOrderNum(appraiseList.size());
}
rspList.add(rsp);
}
result.setList(rspList);
result.setPage(req.getPage());
result.setSize(req.getSize());
... ... @@ -3923,16 +3941,26 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
List<String> list = abnormalPackageMapper.selectValidSellerWaybillCodeList(req);
List<ExpressRecord> expressList = expressRecordMapper.selectByWaybillCodesAndDepotNo(list, req.getDepotNo());
List<String> orderCodeList = expressList.stream().map(ExpressRecord::getOrderCode).collect(Collectors.toList());
List<AppraiseOrder> appraiseOrderList = appraiseOrderMapper.selectBatchSonList(orderCodeList);
Map<String, List<AppraiseOrder>> appraiseOrderMap = appraiseOrderList.stream().collect(Collectors.groupingBy(AppraiseOrder::getOrderCode));
Map<String, List<ExpressRecord>> expressMap = expressList.stream().collect(Collectors.groupingBy(ExpressRecord::getWaybillCode));
List<String> orderCodeList = expressList.stream().map(ExpressRecord::getOrderCode).collect(Collectors.toList());
List<AppraiseOrder> appraiseOrderList = appraiseOrderMapper.selectBatchSonList(orderCodeList);
Map<String, List<AppraiseOrder>> expressSonMap = Maps.newHashMap();
if(CollectionUtils.isNotEmpty(appraiseOrderList)) {
List<String> parentOrderCodeList = appraiseOrderList.stream().map(AppraiseOrder::getParentOrderCode).collect(Collectors.toList());
Map<String, List<AppraiseOrder>> parentSonMap = appraiseOrderList.stream().collect(Collectors.groupingBy(AppraiseOrder::getParentOrderCode));
for(ExpressRecord item : expressList) {
if(parentOrderCodeList.contains(item.getOrderCode())) {
expressSonMap.put(item.getWaybillCode(), parentSonMap.get(item.getOrderCode()));
}
}
}
List<SignForPackageRsp> rspList = Lists.newArrayList();
for(String item : list) {
SignForPackageRsp rsp = new SignForPackageRsp();
rsp.setSellerWaybillCode(item);
List<AppraiseOrder> appraiseList = appraiseOrderMap.get(item);
List<AppraiseOrder> appraiseList = expressSonMap.get(item);
if(CollectionUtils.isEmpty(appraiseList)) {
rsp.setOrderNum(null == expressMap.get(item) ? 0 : expressMap.get(item).size());
}else {
... ...