| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 交控-客户信息表Service实现 |
| | |
| | | .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){ |
| | |
| | | redisTemplate.opsForValue().set(Constants.RedisKeys.CHECKING_JKCUSTOMER_LOCATION,true); |
| | | try { |
| | | LambdaQueryWrapper<JkCustomer> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.isNotNull(JkCustomer::getLocation); |
| | | queryWrapper.isNotNull(JkCustomer::getLocation); |
| | | queryWrapper.and(wrapper ->{ |
| | | wrapper.isNull(JkCustomer::getLatitude) |
| | |
| | | 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 |
| | |
| | | ); |
| | | } |
| | | }else{ |
| | | log.error("更新交控中心客户经纬度信息=====获取失败=========="+c.getName()+"-"+c.getLocation()); |
| | | log.error("更新交控中心客户经纬度信息=====获取json=========="+json); |
| | | log.error("更新交控中心客户经纬度信息=====获取失败=========="+urlStr+c.getName()+"-"+c.getLocation()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("更新交控中心客户经纬度信息=====失败=========="+c.getName()+"-"+c.getLocation()); |
| | | } |
| | | |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("更新交控中心客户经纬度信息===============",e.getMessage()); |
| | |
| | | if(importing!=null && importing){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,已存在导入任务正在执行中,请稍后再试!"); |
| | | } |
| | | redisTemplate.opsForValue().set(Constants.RedisKeys.IMPORTING_JKCUSTOMER,true); |
| | | redisTemplate.opsForValue().set(Constants.RedisKeys.IMPORTING_JKCUSTOMER,true,30, TimeUnit.MINUTES); |
| | | try { |
| | | ExcelImporter ie = null; |
| | | List<JkCustomerImport> dataList =null; |
| | |
| | | tModel.setCreator(loginUserInfo.getId()); |
| | | tModel.setCreateDate(new Date()); |
| | | tModel.setIsnew(Constants.ONE); |
| | | tModel.setStatus(Constants.ZERO); |
| | | tModel.setDistanceStatus(Constants.ZERO); |
| | | newList.add(tModel); |
| | | }else{ |
| | | tModel.setIsnew(Constants.ZERO); |