| | |
| | | package com.matrix.system.shopXcx.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.component.tools.HttpCurlUtil; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; |
| | | import com.matrix.system.shopXcx.api.vo.LogisticsInfoVo; |
| | | import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopLogisticsInfo; |
| | | import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopLogisticsInfoDao; |
| | | import com.matrix.component.tools.HttpCurlUtil; |
| | | import com.matrix.system.shopXcx.api.service.WxShopLogisticsQueryService; |
| | | import com.matrix.system.shopXcx.api.vo.LogisticsInfoVo; |
| | | import com.matrix.system.shopXcx.api.vo.SfLogisticsInfoVo; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | List<ShopLogisticsInfo> shopLogisticsList = new ArrayList<ShopLogisticsInfo>(); |
| | | AjaxResult result = new AjaxResult(); |
| | | Map<String, String> logisticsInfo = new HashMap<String, String>(); |
| | | try { |
| | | |
| | | if (shopDeliveryInfo == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "找不到发货信息"); |
| | | } |
| | |
| | | shopLogisticsInfoDao.batchInsert(shopLogisticsList); |
| | | } |
| | | } |
| | | } else { |
| | | throw new GlobleException(SystemErrorCode.REQUEST_INVALID, logisticsInfoVo.getReason()); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | LogUtil.error("物流信息查询失败", e); |
| | | throw new GlobleException(SystemErrorCode.REQUEST_INVALID); |
| | | } |
| | | |
| | | List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); |
| | | result.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | result.setRows(shopLogisticsInfos); |
| | |
| | | * @param map |
| | | * @return |
| | | */ |
| | | private Map<String, String> getparams(Map<String, String> map) throws Exception { |
| | | private Map<String, String> getparams(Map<String, String> map) { |
| | | String params = JSON.toJSONString(map); |
| | | Map<String, String> paramsUrl = new HashMap<String, String>(); |
| | | try { |
| | | paramsUrl.put("RequestData", URLEncoder.encode(params, "UTF-8")); |
| | | paramsUrl.put("EBusinessID", eBusinessID); |
| | | paramsUrl.put("RequestType", requestType); |
| | | String dataSign = encrypt(params, appKey, "UTF-8"); |
| | | paramsUrl.put("DataSign", URLEncoder.encode(dataSign, "UTF-8")); |
| | | } catch (Exception e) { |
| | | throw new GlobleException(e.getMessage()); |
| | | } |
| | | paramsUrl.put("EBusinessID", eBusinessID); |
| | | paramsUrl.put("RequestType", requestType); |
| | | paramsUrl.put("DataType", AppConstance.DATATYPE); |
| | | return paramsUrl; |
| | | } |