|
@@ -1,5 +1,7 @@
|
|
package com.fs.hisStore.service.impl;
|
|
package com.fs.hisStore.service.impl;
|
|
|
|
|
|
|
|
+import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
|
|
|
|
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetListResponse;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.hutool.core.net.URLDecoder;
|
|
import cn.hutool.core.net.URLDecoder;
|
|
@@ -38,6 +40,7 @@ import com.fs.core.config.WxMaConfiguration;
|
|
import com.fs.core.config.WxPayProperties;
|
|
import com.fs.core.config.WxPayProperties;
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
import com.fs.course.dto.FsOrderDeliveryNoteDTO;
|
|
import com.fs.course.dto.FsOrderDeliveryNoteDTO;
|
|
|
|
+import com.fs.course.dto.OrderOpenIdTransDTO;
|
|
import com.fs.erp.domain.*;
|
|
import com.fs.erp.domain.*;
|
|
import com.fs.erp.dto.*;
|
|
import com.fs.erp.dto.*;
|
|
import com.fs.erp.mapper.FsErpFinishPushMapper;
|
|
import com.fs.erp.mapper.FsErpFinishPushMapper;
|
|
@@ -105,7 +108,6 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import java.lang.reflect.Field;
|
|
import java.lang.reflect.Field;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.nio.charset.Charset;
|
|
import java.nio.charset.Charset;
|
|
-import java.sql.SQLException;
|
|
|
|
import java.sql.Timestamp;
|
|
import java.sql.Timestamp;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -3569,54 +3571,252 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public R importDeliveryNoteExpress(List<FsOrderDeliveryNoteDTO> dtoList) {
|
|
|
|
|
|
+ public R importDeliveryNoteExpress(List<FsOrderDeliveryNoteDTO> dtoList, String appId) {
|
|
try {
|
|
try {
|
|
- // 检查必填字段
|
|
|
|
- List<FsOrderDeliveryNoteDTO> list=new LinkedList<>();
|
|
|
|
- Map<String,String> expressDeliveryMap=buildExpressDeliveryMap();
|
|
|
|
- for (FsOrderDeliveryNoteDTO dto : dtoList) {
|
|
|
|
|
|
+ StringBuilder builder = new StringBuilder();
|
|
|
|
+ //获取商城配置
|
|
|
|
+ String json = configService.selectConfigByKey("store.config");
|
|
|
|
+ StoreConfig config = JSONUtil.toBean(json, StoreConfig.class);
|
|
|
|
+
|
|
|
|
+ List<FsOrderDeliveryNoteDTO> successList = new ArrayList<>(dtoList.size());
|
|
|
|
+ //提前获取所有必要数据
|
|
|
|
+ Map<String, String> expressDeliveryMap = buildExpressDeliveryMap();
|
|
|
|
+ //提取所有有效订单号
|
|
|
|
+ List<String> orderCodeList = new ArrayList<>(dtoList.size());
|
|
|
|
+ for (int i = 0; i < dtoList.size(); i++) {
|
|
|
|
+ FsOrderDeliveryNoteDTO dto = dtoList.get(i);
|
|
if (StringUtils.isEmpty(dto.getOrderNumber())) {
|
|
if (StringUtils.isEmpty(dto.getOrderNumber())) {
|
|
- return R.error("导入失败,系统订单不能为空!");
|
|
|
|
- } else if (StringUtils.isEmpty(dto.getDeliveryId())) {
|
|
|
|
- return R.error("导入失败,快递单号不能为空!");
|
|
|
|
- } else if (StringUtils.isEmpty(dto.getDeliverySn())) {
|
|
|
|
- return R.error("导入失败,快递公司编号不能为空!");
|
|
|
|
|
|
+ builder.append("数据第").append(i + 2).append("行系统订单为空!").append(System.lineSeparator());
|
|
|
|
+ } else {
|
|
|
|
+ orderCodeList.add(dto.getOrderNumber());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //批量查询订单信息
|
|
|
|
+ if (orderCodeList.isEmpty()) {
|
|
|
|
+ return R.ok(builder.toString());
|
|
|
|
+ }
|
|
|
|
+ List<FsStoreOrderCodeOpenIdVo> orderCodeOpenIdVoList = fsStoreOrderMapper.selectOrderCodeOpenIdInOrderCode(orderCodeList);
|
|
|
|
+ Map<String, OrderOpenIdTransDTO> orderMap = new HashMap<>(orderCodeOpenIdVoList.size());
|
|
|
|
+ Map<String, List<FsStoreOrderCodeOpenIdVo>> orderDetailsMap = new HashMap<>(orderCodeOpenIdVoList.size());
|
|
|
|
+
|
|
|
|
+ for (FsStoreOrderCodeOpenIdVo vo : orderCodeOpenIdVoList) {
|
|
|
|
+ orderMap.computeIfAbsent(vo.getOrderCode(), k -> {
|
|
|
|
+ OrderOpenIdTransDTO dto = new OrderOpenIdTransDTO();
|
|
|
|
+ dto.setOpenId(vo.getOpenId());
|
|
|
|
+ dto.setTransactionId(vo.getOutTransId());
|
|
|
|
+ return dto;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ orderDetailsMap
|
|
|
|
+ .computeIfAbsent(vo.getOrderCode(), k -> new ArrayList<>())
|
|
|
|
+ .add(vo);
|
|
|
|
+ }
|
|
|
|
+ final WxMaService wxService = WxMaConfiguration.getMaService(appId);
|
|
|
|
+ String uploadTime = ZonedDateTime.now(ZoneId.of("Asia/Shanghai"))
|
|
|
|
+ .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < dtoList.size(); i++) {
|
|
|
|
+ FsOrderDeliveryNoteDTO dto = dtoList.get(i);
|
|
|
|
+ int rowNum = i + 2;
|
|
|
|
+ if (StringUtils.isEmpty(dto.getOrderNumber())) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isEmpty(dto.getDeliveryId())) {
|
|
|
|
+ builder.append("数据第").append(rowNum).append("行快递单号为空!")
|
|
|
|
+ .append(System.lineSeparator());
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isEmpty(dto.getDeliverySn())) {
|
|
|
|
+ builder.append("数据第").append(rowNum).append("行快递公司编号为空!")
|
|
|
|
+ .append(System.lineSeparator());
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
if (dto.getDeliveryStatus() == null) {
|
|
if (dto.getDeliveryStatus() == null) {
|
|
dto.setDeliveryStatus(0);
|
|
dto.setDeliveryStatus(0);
|
|
}
|
|
}
|
|
- if(ObjectUtil.isNotNull(dto.getDeliveryTime())){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(dto.getDeliveryTime())) {
|
|
dto.setDeliveryTime(parseCstToDateOnlyString(dto.getDeliveryTime()));
|
|
dto.setDeliveryTime(parseCstToDateOnlyString(dto.getDeliveryTime()));
|
|
}
|
|
}
|
|
- if(ObjectUtil.isNotNull(dto.getDeliveryPayTime()) && !dto.getDeliveryPayTime().equals("")){
|
|
|
|
|
|
+
|
|
|
|
+ if (ObjectUtil.isNotNull(dto.getDeliveryPayTime()) &&
|
|
|
|
+ !dto.getDeliveryPayTime().isEmpty()) {
|
|
dto.setDeliveryPayTime(parseCstToDateOnlyString(dto.getDeliveryPayTime()));
|
|
dto.setDeliveryPayTime(parseCstToDateOnlyString(dto.getDeliveryPayTime()));
|
|
}
|
|
}
|
|
- if(expressDeliveryMap.containsKey(dto.getDeliverySn())){
|
|
|
|
- dto.setDeliveryName(expressDeliveryMap.get(dto.getDeliverySn()));
|
|
|
|
|
|
+ // 验证快递公司
|
|
|
|
+ String deliveryName = expressDeliveryMap.get(dto.getDeliverySn());
|
|
|
|
+ if (deliveryName == null) {
|
|
|
|
+ builder.append("数据第").append(rowNum).append("行订单号为")
|
|
|
|
+ .append(dto.getOrderNumber()).append("物流编码异常")
|
|
|
|
+ .append(System.lineSeparator());
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ dto.setDeliveryName(deliveryName);
|
|
|
|
+
|
|
|
|
+ // 检查订单是否存在
|
|
|
|
+ String orderNumber = dto.getOrderNumber();
|
|
|
|
+ OrderOpenIdTransDTO orderInfo = orderMap.get(orderNumber);
|
|
|
|
+ if (orderInfo == null) {
|
|
|
|
+ builder.append("数据第").append(rowNum).append("行订单号")
|
|
|
|
+ .append(orderNumber).append("不存在").append(System.lineSeparator());
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //验证是否开启微信发货
|
|
|
|
+ if(config.getIsWeChatShipping() != null && config.getIsWeChatShipping()){
|
|
|
|
+ // 上传物流信息到微信
|
|
|
|
+ List<FsStoreOrderCodeOpenIdVo> orderDetails = orderDetailsMap.get(orderNumber);
|
|
|
|
+ if (uploadShippingInfoToWechat(wxService, orderInfo, orderDetails, dto, uploadTime)) {
|
|
|
|
+ successList.add(dto);
|
|
|
|
+ } else {
|
|
|
|
+ builder.append("数据第").append(rowNum).append("行订单号为")
|
|
|
|
+ .append(orderNumber).append("上传微信失败").append(System.lineSeparator());
|
|
|
|
+ }
|
|
}else {
|
|
}else {
|
|
- return R.error("导入失败,订单号为"+dto.getOrderNumber()+"物流编码异常,请核对后再导入!");
|
|
|
|
|
|
+ successList.add(dto);
|
|
}
|
|
}
|
|
- list.add(dto);
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- //分批次处理
|
|
|
|
- int batchSize = 500;
|
|
|
|
- int total = list.size();
|
|
|
|
- int batches = (total + batchSize - 1) / batchSize;
|
|
|
|
- for (int i = 0; i < batches; i++) {
|
|
|
|
- int start = i * batchSize;
|
|
|
|
- int end = Math.min(start + batchSize, total);
|
|
|
|
- List<FsOrderDeliveryNoteDTO> subList = list.subList(start, end);
|
|
|
|
- fsStoreOrderMapper.batchUpdateInOrderCode(subList);
|
|
|
|
|
|
+ //批量更新数据
|
|
|
|
+ if (!successList.isEmpty()) {
|
|
|
|
+ batchUpdateDeliveryNotes(successList);
|
|
}
|
|
}
|
|
- return R.ok("导入成功,共更新 " + total + " 条记录");
|
|
|
|
|
|
+
|
|
|
|
+ return R.ok(builder.toString());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- // 处理其他异常
|
|
|
|
- log.error("导入物流信息异常", e);
|
|
|
|
|
|
+ log.error("导入发货单快递信息失败", e);
|
|
return R.error("导入失败:" + e.getMessage());
|
|
return R.error("导入失败:" + e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public R queryReceiptType() {
|
|
|
|
+ //获取商城配置
|
|
|
|
+ String json = configService.selectConfigByKey("store.config");
|
|
|
|
+ StoreConfig config = JSONUtil.toBean(json, StoreConfig.class);
|
|
|
|
+ boolean receiptType=false;
|
|
|
|
+ if(config != null && config.getIsWeChatShipping() != null && config.getIsWeChatShipping()){
|
|
|
|
+ receiptType=config.getIsWeChatShipping();
|
|
|
|
+ }
|
|
|
|
+ return R.ok().put("data",receiptType);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
|
|
|
|
+ public void refreshOrderSettlementStatus(){
|
|
|
|
+ try {
|
|
|
|
+ //判断是否对接微信发货
|
|
|
|
+ String json = configService.selectConfigByKey("store.config");
|
|
|
|
+ StoreConfig config = JSONUtil.toBean(json, StoreConfig.class);
|
|
|
|
+ if(config != null && config.getIsWeChatShipping() != null && config.getIsWeChatShipping()){
|
|
|
|
+ //获取未结算订单
|
|
|
|
+ List<FsStoreOrderScrm> orderScrmList=fsStoreOrderMapper.getUnsettledOrder();
|
|
|
|
+ String payConfig=configService.selectConfigByKey("store.pay");
|
|
|
|
+ JSONObject js=JSON.parseObject(payConfig);
|
|
|
|
+ String appId=js.getString("hf");
|
|
|
|
+ if(ObjectUtil.isNotNull(appId) && !appId.equals("")){
|
|
|
|
+ //请求微信批量查询订单
|
|
|
|
+ final WxMaService wxService = WxMaConfiguration.getMaService(appId);
|
|
|
|
+ WxMaOrderShippingInfoGetListRequest request=new WxMaOrderShippingInfoGetListRequest();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ WxMaOrderShippingInfoGetListResponse response=wxService.getWxMaOrderShippingService().getList(request);
|
|
|
|
+
|
|
|
|
+ logger.info("请求信息------------------------》{}",response);
|
|
|
|
+// if(!orderScrmList.isEmpty()){
|
|
|
|
+// orderScrmList.forEach(order->{
|
|
|
|
+// if (order.getStatus() == OrderInfoEnum.STATUS_2.getValue()) {
|
|
|
|
+// order.setFinishTime(new Date());
|
|
|
|
+// order.setStatus(3);
|
|
|
|
+// fsStoreOrderMapper.updateFsStoreOrder(order);
|
|
|
|
+// orderStatusService.create(order.getId(), OrderLogEnum.FINISH_ORDER.getValue(),
|
|
|
|
+// OrderLogEnum.FINISH_ORDER.getDesc());
|
|
|
|
+// //写入公司余额 条件是只有全款订单才分,非全款后台导入
|
|
|
|
+// if (order.getCompanyId() != null && order.getCompanyId() > 0 && order.getPayDelivery().compareTo(new BigDecimal(0)) == 0) {
|
|
|
|
+// if (order.getTuiMoneyStatus() == null || order.getTuiMoneyStatus() != 1) {
|
|
|
|
+// companyService.addCompanyMoney(order);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// FsErpConfig erpConfig = configUtil.getErpConfig();
|
|
|
|
+// Integer erpType = erpConfig.getErpType();
|
|
|
|
+// Integer erpOpen = erpConfig.getErpOpen();
|
|
|
|
+// if (erpOpen != null && erpOpen == 1) {
|
|
|
|
+// if (erpType != null && erpType == 2) {
|
|
|
|
+// // 如果是物流代收 或者 货到付款
|
|
|
|
+// if ("2".equals(order.getPayType()) || "3".equals(order.getPayType())) {
|
|
|
|
+// // 已结算
|
|
|
|
+// if ("1".equals(order.getDeliveryPayStatus())) {
|
|
|
|
+// FsErpFinishPush fsErpFinishPush = new FsErpFinishPush();
|
|
|
|
+// fsErpFinishPush.setOrderId(order.getId());
|
|
|
|
+// fsErpFinishPush.setTaskStatus(0);
|
|
|
|
+// fsErpFinishPush.setRetryCount(0);
|
|
|
|
+// fsErpFinishPush.setCreateTime(new Date());
|
|
|
|
+// fsErpFinishPushMapper.insert(fsErpFinishPush);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// });
|
|
|
|
+// }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.getStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private boolean uploadShippingInfoToWechat(WxMaService wxService,
|
|
|
|
+ OrderOpenIdTransDTO orderInfo,
|
|
|
|
+ List<FsStoreOrderCodeOpenIdVo> orderDetails,
|
|
|
|
+ FsOrderDeliveryNoteDTO dto,
|
|
|
|
+ String uploadTime) {
|
|
|
|
+ try {
|
|
|
|
+ WxMaOrderShippingInfoUploadRequest request = new WxMaOrderShippingInfoUploadRequest();
|
|
|
|
+ OrderKeyBean orderKeyBean = new OrderKeyBean();
|
|
|
|
+ orderKeyBean.setOrderNumberType(2);
|
|
|
|
+ orderKeyBean.setTransactionId(orderInfo.getTransactionId());
|
|
|
|
+ request.setOrderKey(orderKeyBean);
|
|
|
|
+ request.setDeliveryMode(1);
|
|
|
|
+ request.setLogisticsType(1);
|
|
|
|
+ List<ShippingListBean> shippingList = new ArrayList<>(orderDetails.size());
|
|
|
|
+ for (FsStoreOrderCodeOpenIdVo detail : orderDetails) {
|
|
|
|
+ ShippingListBean shippingListBean = new ShippingListBean();
|
|
|
|
+ shippingListBean.setTrackingNo(dto.getDeliveryId());
|
|
|
|
+ shippingListBean.setExpressCompany(dto.getDeliverySn());
|
|
|
|
+ JSONObject js = JSON.parseObject(detail.getJsonInfo());
|
|
|
|
+ shippingListBean.setItemDesc(js.getString("productName"));
|
|
|
|
+ ContactBean contactBean = new ContactBean();
|
|
|
|
+ contactBean.setReceiverContact(detail.getPhone());
|
|
|
|
+ shippingListBean.setContact(contactBean);
|
|
|
|
+ shippingList.add(shippingListBean);
|
|
|
|
+ }
|
|
|
|
+ request.setShippingList(shippingList);
|
|
|
|
+ request.setUploadTime(uploadTime);
|
|
|
|
+ // 设置支付者信息
|
|
|
|
+ PayerBean payerBean = new PayerBean();
|
|
|
|
+ payerBean.setOpenid(orderInfo.getOpenId());
|
|
|
|
+ request.setPayer(payerBean);
|
|
|
|
+
|
|
|
|
+ // 上传物流信息
|
|
|
|
+ return wxService.getWxMaOrderShippingService().upload(request).getErrCode() == 0;
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("上传物流信息到微信失败,订单号: {}", dto.getOrderNumber(), e);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void batchUpdateDeliveryNotes(List<FsOrderDeliveryNoteDTO> list) {
|
|
|
|
+ int batchSize = 500;
|
|
|
|
+ int total = list.size();
|
|
|
|
+ int batches = (total + batchSize - 1) / batchSize;
|
|
|
|
+ for (int i = 0; i < batches; i++) {
|
|
|
|
+ int start = i * batchSize;
|
|
|
|
+ int end = Math.min(start + batchSize, total);
|
|
|
|
+ List<FsOrderDeliveryNoteDTO> subList = list.subList(start, end);
|
|
|
|
+ fsStoreOrderMapper.batchUpdateInOrderCode(subList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private static final DateTimeFormatter CST_FORMATTER = DateTimeFormatter
|
|
private static final DateTimeFormatter CST_FORMATTER = DateTimeFormatter
|
|
.ofPattern("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US)
|
|
.ofPattern("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US)
|
|
.withZone(ZoneId.of("Asia/Shanghai"));
|
|
.withZone(ZoneId.of("Asia/Shanghai"));
|
|
@@ -3624,34 +3824,39 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
private static final DateTimeFormatter STANDARD_FORMATTER = DateTimeFormatter
|
|
private static final DateTimeFormatter STANDARD_FORMATTER = DateTimeFormatter
|
|
.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
+ private static final DateTimeFormatter DATE_ONLY_FORMATTER = DateTimeFormatter
|
|
|
|
+ .ofPattern("yyyy-MM-dd");
|
|
|
|
+
|
|
public static LocalDateTime parseCstToLocalDateTime(String cstDateStr) {
|
|
public static LocalDateTime parseCstToLocalDateTime(String cstDateStr) {
|
|
- if (cstDateStr == null || cstDateStr.trim().isEmpty()) {
|
|
|
|
|
|
+ if (StringUtils.isEmpty(cstDateStr)) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
try {
|
|
try {
|
|
- // 解析为带时区的日期时间
|
|
|
|
- ZonedDateTime zonedDateTime = ZonedDateTime.parse(cstDateStr, CST_FORMATTER);
|
|
|
|
- // 转换为本地日期时间(忽略时区,仅保留年月日时分秒)
|
|
|
|
- return zonedDateTime.toLocalDateTime();
|
|
|
|
|
|
+ return ZonedDateTime.parse(cstDateStr, CST_FORMATTER).toLocalDateTime();
|
|
} catch (DateTimeParseException e) {
|
|
} catch (DateTimeParseException e) {
|
|
- System.err.println("日期解析失败: " + e.getMessage());
|
|
|
|
|
|
+ log.warn("日期解析失败: {}", cstDateStr, e);
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
public static String parseCstToDateOnlyString(String cstDateStr) {
|
|
public static String parseCstToDateOnlyString(String cstDateStr) {
|
|
LocalDateTime dateTime = parseCstToLocalDateTime(cstDateStr);
|
|
LocalDateTime dateTime = parseCstToLocalDateTime(cstDateStr);
|
|
- return dateTime != null ? dateTime.format(DateTimeFormatter
|
|
|
|
- .ofPattern("yyyy-MM-dd")) : null;
|
|
|
|
|
|
+ return dateTime != null ? dateTime.format(DATE_ONLY_FORMATTER) : null;
|
|
}
|
|
}
|
|
|
|
+ private static final Map<String, String> EXPRESS_DELIVERY_MAP = createExpressDeliveryMap();
|
|
|
|
|
|
- public Map<String,String> buildExpressDeliveryMap(){
|
|
|
|
- Map<String,String> map=new HashMap<>();
|
|
|
|
- map.put("SF","顺丰");
|
|
|
|
- map.put("EMS","邮政");
|
|
|
|
- map.put("ZTO","中通");
|
|
|
|
- map.put("JD","京东");
|
|
|
|
- map.put("DBL","德邦");
|
|
|
|
|
|
+ private static Map<String, String> createExpressDeliveryMap() {
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
|
+ map.put("SF", "顺丰");
|
|
|
|
+ map.put("EMS", "邮政");
|
|
|
|
+ map.put("ZTO", "中通");
|
|
|
|
+ map.put("JD", "京东");
|
|
|
|
+ map.put("DBL", "德邦");
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public Map<String, String> buildExpressDeliveryMap() {
|
|
|
|
+ return EXPRESS_DELIVERY_MAP;
|
|
|
|
+ }
|
|
}
|
|
}
|