|  |  |  | 
|---|
|  |  |  | .set(JkCustomer::getLatitude,jkCustomer.getLatitude()) | 
|---|
|  |  |  | .set(JkCustomer::getLongitude,jkCustomer.getLongitude()) | 
|---|
|  |  |  | .set(JkCustomer::getEditor,jkCustomer.getLoginUserInfo().getId()) | 
|---|
|  |  |  | .set(JkCustomer::getStartDistance,null) | 
|---|
|  |  |  | .set(JkCustomer::getEndDistance,null) | 
|---|
|  |  |  | .set(JkCustomer::getStartSteps,null) | 
|---|
|  |  |  | .set(JkCustomer::getEndSteps,null) | 
|---|
|  |  |  | .set(JkCustomer::getDistanceStatus,Constants.ZERO) | 
|---|
|  |  |  | .set(JkCustomer::getDistance,null) | 
|---|
|  |  |  | .set(JkCustomer::getEditDate,new Date()) | 
|---|
|  |  |  | .eq(JkCustomer::getId,jkCustomer.getId()) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | 
|---|
|  |  |  | .selectAs(Category::getName,JkCustomer::getCategoryName) | 
|---|
|  |  |  | .leftJoin(JkLine.class,JkLine::getId,JkCustomer::getLineId ) | 
|---|
|  |  |  | .leftJoin(Category.class,Category::getId,JkLine::getCategoryId ); | 
|---|
|  |  |  | queryWrapper.eq( pageWrap.getModel().getDistanceStatus()!=null,JkCustomer::getDistanceStatus, pageWrap.getModel().getDistanceStatus()); | 
|---|
|  |  |  | queryWrapper.eq( pageWrap.getModel().getCategoryId()!=null,JkLine::getCategoryId, pageWrap.getModel().getCategoryId()); | 
|---|
|  |  |  | queryWrapper.eq(StringUtils.isNotBlank(pageWrap.getModel().getLineWeeks()),JkLine::getWeeks, pageWrap.getModel().getLineWeeks()); | 
|---|
|  |  |  | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getCategoryName()),Category::getName, pageWrap.getModel().getCategoryName()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public     void checkNullLocation() { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | log.error("更新交控中心客户经纬度信息===============开始"); | 
|---|
|  |  |  | Boolean importing = (Boolean) redisTemplate.opsForValue().get(Constants.RedisKeys.CHECKING_JKCUSTOMER_LOCATION); | 
|---|
|  |  |  | if(importing!=null && importing){ | 
|---|
|  |  |  | 
|---|
|  |  |  | queryWrapper.isNotNull(JkCustomer::getLocation); | 
|---|
|  |  |  | queryWrapper.and(wrapper ->{ | 
|---|
|  |  |  | wrapper.isNull(JkCustomer::getLatitude) | 
|---|
|  |  |  | .or().isNull(JkCustomer::getLongitude); }); | 
|---|
|  |  |  | .or().isNull(JkCustomer::getLongitude) | 
|---|
|  |  |  | .or().eq(JkCustomer::getDistanceStatus,Constants.TWO);}); | 
|---|
|  |  |  | //查询全部有地址,但是没有经纬度的客户信息 | 
|---|
|  |  |  | List<JkCustomer>  list = jkCustomerMapper.selectList(queryWrapper); | 
|---|
|  |  |  | if(list ==null || list.size()==0){ | 
|---|
|  |  |  | 
|---|
|  |  |  | String url = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.GAODE_LOCATION_GEOAPI_URL).getCode(); | 
|---|
|  |  |  | for(JkCustomer c : list){ | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | String result = HttpsUtil.get(url.replace("${param}",c.getLocation()),true); | 
|---|
|  |  |  | String urlStr =url.replace("${param}" | 
|---|
|  |  |  | ,c.getLocation().replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]", "")); | 
|---|
|  |  |  | String result = HttpsUtil.get(urlStr,true); | 
|---|
|  |  |  | JSONObject json = JSONObject.parseObject(result); | 
|---|
|  |  |  | if(json!=null | 
|---|
|  |  |  | && json.getInteger("status")!=null | 
|---|
|  |  |  | 
|---|
|  |  |  | jkCustomerMapper.update(null,new UpdateWrapper<JkCustomer>().lambda() | 
|---|
|  |  |  | .set(JkCustomer::getLatitude,c.getLatitude()) | 
|---|
|  |  |  | .set(JkCustomer::getLongitude,c.getLongitude()) | 
|---|
|  |  |  | .set(JkCustomer::getStartDistance,null) | 
|---|
|  |  |  | .set(JkCustomer::getEndDistance,null) | 
|---|
|  |  |  | .set(JkCustomer::getStartSteps,null) | 
|---|
|  |  |  | .set(JkCustomer::getEndSteps,null) | 
|---|
|  |  |  | .set(JkCustomer::getDistanceStatus,Constants.ZERO) | 
|---|
|  |  |  | .set(JkCustomer::getDistance,null) | 
|---|
|  |  |  | .set(JkCustomer::getEditDate,new Date()) | 
|---|
|  |  |  | .eq(JkCustomer::getId,c.getId()) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | log.error("更新交控中心客户经纬度信息=====获取json=========="+json); | 
|---|
|  |  |  | log.error("更新交控中心客户经纬度信息=====获取失败=========="+c.getName()+"-"+c.getLocation()); | 
|---|
|  |  |  | log.error("更新交控中心客户经纬度信息=====获取json=========="+urlStr+"\n"+c.getName()+"\n"+json); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("更新交控中心客户经纬度信息=====失败=========="+c.getName()+"-"+c.getLocation()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | log.error("更新交控中心客户经纬度信息===============",e.getMessage()); | 
|---|
|  |  |  | 
|---|
|  |  |  | tModel.setCreator(loginUserInfo.getId()); | 
|---|
|  |  |  | tModel.setCreateDate(new Date()); | 
|---|
|  |  |  | tModel.setIsnew(Constants.ONE); | 
|---|
|  |  |  | tModel.setDistanceStatus(Constants.TWO);//需要重新定位 | 
|---|
|  |  |  | tModel.setStatus(Constants.ZERO); | 
|---|
|  |  |  | tModel.setDistanceStatus(Constants.ZERO); | 
|---|
|  |  |  | newList.add(tModel); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | if(StringUtils.isBlank(model.getLocation()) || | 
|---|
|  |  |  | StringUtils.equals(tModel.getLocation().replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]","") | 
|---|
|  |  |  | ,model.getLocation().replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]",""))){ | 
|---|
|  |  |  | //如果位置信息发生变化 | 
|---|
|  |  |  | tModel.setDistanceStatus(Constants.TWO);//需要重新定位 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | tModel.setIsnew(Constants.ZERO); | 
|---|
|  |  |  | updateList.add(tModel); | 
|---|
|  |  |  | } | 
|---|