| @@ -163,7 +163,7 @@ public class ShiroConfig { | |||||
| filterChainDefinitionMap.put("/logout", "authc"); | filterChainDefinitionMap.put("/logout", "authc"); | ||||
| filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); | filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); | ||||
| filterChainDefinitionMap.put("/**", "anon"); | |||||
| // filterChainDefinitionMap.put("/**", "anon"); | |||||
| shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); | shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); | ||||
| @@ -254,13 +254,13 @@ public class TtMerchantPoiController extends DouyinBaseController { | |||||
| //@SystemControllerLog(description = "poi-来客模版补齐地理位置信息") | //@SystemControllerLog(description = "poi-来客模版补齐地理位置信息") | ||||
| public void addLocationInfo(@RequestParam("poiFile") MultipartFile mFile,HttpServletRequest request, HttpServletResponse response) { | public void addLocationInfo(@RequestParam("poiFile") MultipartFile mFile,HttpServletRequest request, HttpServletResponse response) { | ||||
| try { | try { | ||||
| // boolean isSaas = this.isGoodLifeSaas(); | |||||
| // if (!isSaas) { | |||||
| // //return addLocationInfo(mFile,false); | |||||
| // throw new MallinkException(Result.ERROR,"当前版本无需补齐地理位置信息"); | |||||
| // }else { | |||||
| boolean isSaas = this.isGoodLifeSaas(); | |||||
| if (!isSaas) { | |||||
| //return addLocationInfo(mFile,false); | |||||
| throw new MallinkException(Result.ERROR,"当前版本无需补齐地理位置信息"); | |||||
| }else { | |||||
| addLocationInfo(mFile,true,"1bdc087fc6f72820dc5c848a033de7f9",request,response); | addLocationInfo(mFile,true,"1bdc087fc6f72820dc5c848a033de7f9",request,response); | ||||
| // } | |||||
| } | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("addLocationInfo error.",e); | logger.error("addLocationInfo error.",e); | ||||
| throw new MallinkException(Result.ERROR,e.getMessage()); | throw new MallinkException(Result.ERROR,e.getMessage()); | ||||
| @@ -273,7 +273,6 @@ public class TtMerchantPoiController extends DouyinBaseController { | |||||
| throw new MallinkException(Result.ERROR, "上传文件不能为空"); | throw new MallinkException(Result.ERROR, "上传文件不能为空"); | ||||
| } | } | ||||
| //得到当前用户ID | //得到当前用户ID | ||||
| // final MallUserInfo user = getUser(); | |||||
| String fpath = fmUploadDir; | String fpath = fmUploadDir; | ||||
| File targetFile = new File(fpath); | File targetFile = new File(fpath); | ||||
| @@ -34,6 +34,7 @@ import org.springframework.stereotype.Component; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.util.ArrayList; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.concurrent.TimeUnit; | import java.util.concurrent.TimeUnit; | ||||
| @@ -264,6 +265,7 @@ public class AsyncTask { | |||||
| List<MerchantPoiTNew> successList = datalist.getList(); | List<MerchantPoiTNew> successList = datalist.getList(); | ||||
| //List<MerchantPoiTNew> failList = datalist.getFailList(); | //List<MerchantPoiTNew> failList = datalist.getFailList(); | ||||
| if(null != successList && successList.size() > 0 ) { | if(null != successList && successList.size() > 0 ) { | ||||
| List<MerchantPoiTNew> tlist = new ArrayList<MerchantPoiTNew>(); | |||||
| try { | try { | ||||
| successList.parallelStream().forEach(poiBase -> { | successList.parallelStream().forEach(poiBase -> { | ||||
| try { | try { | ||||
| @@ -282,16 +284,15 @@ public class AsyncTask { | |||||
| }else { | }else { | ||||
| poiBase.setGaodeRemark("未匹配到信息"); | poiBase.setGaodeRemark("未匹配到信息"); | ||||
| } | } | ||||
| tlist.add(poiBase); | |||||
| } catch (UnknownSessionException ue) { | } catch (UnknownSessionException ue) { | ||||
| logger.error("session :"+ue.getMessage()); | logger.error("session :"+ue.getMessage()); | ||||
| } | } | ||||
| }); | }); | ||||
| ExportParams exportParams = new ExportParams(); | ExportParams exportParams = new ExportParams(); | ||||
| exportParams.setCreateHeadRows(true); | |||||
| exportParams.setExclusions(headers); | |||||
| Workbook workBook = ExcelExportUtil.exportExcel(exportParams, MerchantPoiTNew.class, successList); | |||||
| //exportParams.setCreateHeadRows(true); | |||||
| //exportParams.setExclusions(headers); | |||||
| Workbook workBook = ExcelExportUtil.exportExcel(exportParams, MerchantPoiTNew.class, tlist); | |||||
| exportExcel(request, response, workBook, "POI匹配模版-高德.xls"); | exportExcel(request, response, workBook, "POI匹配模版-高德.xls"); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("更新地理信息失败:"+e.getMessage(),e); | logger.error("更新地理信息失败:"+e.getMessage(),e); | ||||
| @@ -737,23 +737,24 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { | |||||
| gaodeInfo.setErrMsg("高德匹配到多条信息"); | gaodeInfo.setErrMsg("高德匹配到多条信息"); | ||||
| }else { | }else { | ||||
| gaodeInfo.setSuccess(true); | gaodeInfo.setSuccess(true); | ||||
| String country = reo.getString("country"); | |||||
| JSONObject geo = geocodes.getJSONObject(0); | |||||
| String country = geo.getString("country"); | |||||
| if (StringUtils.isNotBlank(country)) { | if (StringUtils.isNotBlank(country)) { | ||||
| gaodeInfo.setCountry(country); | gaodeInfo.setCountry(country); | ||||
| } | } | ||||
| String province = reo.getString("province"); | |||||
| String province = geo.getString("province"); | |||||
| if (StringUtils.isNotBlank(province)) { | if (StringUtils.isNotBlank(province)) { | ||||
| gaodeInfo.setProvince(province); | gaodeInfo.setProvince(province); | ||||
| } | } | ||||
| String city = reo.getString("city"); | |||||
| String city = geo.getString("city"); | |||||
| if (StringUtils.isNotBlank(city)) { | if (StringUtils.isNotBlank(city)) { | ||||
| gaodeInfo.setCity(city); | gaodeInfo.setCity(city); | ||||
| } | } | ||||
| String district = reo.getString("district"); | |||||
| String district = geo.getString("district"); | |||||
| if (StringUtils.isNotBlank(district)) { | if (StringUtils.isNotBlank(district)) { | ||||
| gaodeInfo.setDistrict(district); | gaodeInfo.setDistrict(district); | ||||
| } | } | ||||
| String location = reo.getString("location"); | |||||
| String location = geo.getString("location"); | |||||
| if (StringUtils.isNotBlank(location)) { | if (StringUtils.isNotBlank(location)) { | ||||
| String[] locas = location.split(","); | String[] locas = location.split(","); | ||||
| if (null != locas && locas.length == 2) { | if (null != locas && locas.length == 2) { | ||||
| @@ -767,12 +768,14 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { | |||||
| gaodeInfo.setSuccess(false); | gaodeInfo.setSuccess(false); | ||||
| gaodeInfo.setErrMsg(info); | gaodeInfo.setErrMsg(info); | ||||
| } | } | ||||
| return gaodeInfo; | |||||
| } | } | ||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| logger.error("queryGaoDePoiInfo error.",e); | logger.error("queryGaoDePoiInfo error.",e); | ||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| // @Override | // @Override | ||||
| // public ResultData spuSync(TenantEntity tenantInfo, Long couponChannelId, List<Long> merchantIds) { | // public ResultData spuSync(TenantEntity tenantInfo, Long couponChannelId, List<Long> merchantIds) { | ||||
| @@ -79,7 +79,7 @@ public class HttpUtil { | |||||
| } | } | ||||
| } | } | ||||
| catch (IOException e) { | catch (IOException e) { | ||||
| logger.error(e.getMessage()); | |||||
| logger.error(e.getMessage(),e); | |||||
| throw new RuntimeException(e); | throw new RuntimeException(e); | ||||
| } | } | ||||