From 6500da411f234b8ad0ee493909d515bf9eeecdd5 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 16 十月 2025 19:28:27 +0800
Subject: [PATCH] 最新版本541200007
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCustomerServiceImpl.java | 36 ++++++++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCustomerServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCustomerServiceImpl.java
index 2e04143..5cb15bf 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCustomerServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCustomerServiceImpl.java
@@ -38,6 +38,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.concurrent.TimeUnit;
/**
* 浜ゆ帶-瀹㈡埛淇℃伅琛⊿ervice瀹炵幇
@@ -110,6 +111,12 @@
.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())
);
@@ -155,6 +162,7 @@
.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());
@@ -226,7 +234,6 @@
@Override
public void checkNullLocation() {
-
log.error("鏇存柊浜ゆ帶涓績瀹㈡埛缁忕含搴︿俊鎭�===============寮�濮�");
Boolean importing = (Boolean) redisTemplate.opsForValue().get(Constants.RedisKeys.CHECKING_JKCUSTOMER_LOCATION);
if(importing!=null && importing){
@@ -238,7 +245,8 @@
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){
@@ -247,7 +255,9 @@
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
@@ -265,17 +275,22 @@
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("鏇存柊浜ゆ帶涓績瀹㈡埛缁忕含搴︿俊鎭�=====鑾峰彇澶辫触=========="+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());
@@ -299,7 +314,7 @@
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;
@@ -390,8 +405,17 @@
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);
}
--
Gitblit v1.9.3