Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-module-job
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-module-job
Commits
24bde0d4
提交
24bde0d4
authored
11月 28, 2025
作者:
000516
浏览文件
操作
浏览文件
下载
差异文件
根据经纬度,逆地理解析,得到地位
上级
b1fbef92
20226086
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
296 行增加
和
11 行删除
+296
-11
LsDisStore.java
src/main/java/com/sfa/job/domain/ls/LsDisStore.java
+5
-5
LsDisStoreDaoImpl.java
src/main/java/com/sfa/job/domain/ls/LsDisStoreDaoImpl.java
+211
-6
LsDisStoreMapper.java
...n/java/com/sfa/job/domain/ls/mapper/LsDisStoreMapper.java
+12
-0
TestTask.java
src/main/java/com/sfa/job/xxljob/test/TestTask.java
+31
-0
LsDisStoreMapper.xml
src/main/resources/mapper/job/LsDisStoreMapper.xml
+37
-0
没有找到文件。
src/main/java/com/sfa/job/domain/ls/LsDisStore.java
浏览文件 @
24bde0d4
...
@@ -115,11 +115,11 @@ public class LsDisStore implements Serializable {
...
@@ -115,11 +115,11 @@ public class LsDisStore implements Serializable {
* 区
* 区
*/
*/
private
String
reArea
;
private
String
reArea
;
//
//
/**
/**
//
* 百度地址
* 百度地址
//
*/
*/
//
private String reAddress;
private
String
reAddress
;
//
//
// /**
// /**
// * [销售金额_元___Sell_Out_Value__Yuan_]
// * [销售金额_元___Sell_Out_Value__Yuan_]
...
...
src/main/java/com/sfa/job/domain/ls/LsDisStoreDaoImpl.java
浏览文件 @
24bde0d4
...
@@ -33,8 +33,8 @@ public class LsDisStoreDaoImpl {
...
@@ -33,8 +33,8 @@ public class LsDisStoreDaoImpl {
updateanhui
(
lsDisStores
,
ldsId
);
updateanhui
(
lsDisStores
,
ldsId
);
}
}
// OI4hMr7tEUoDBhSYxcrOGslnnBfZmD2b
//
东旭:
OI4hMr7tEUoDBhSYxcrOGslnnBfZmD2b
// 1ZKO0CGs6nm9HuZWR6ucRiu4p9kM8f3i
//
秋林:
1ZKO0CGs6nm9HuZWR6ucRiu4p9kM8f3i
private
void
updateanhui
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
private
void
updateanhui
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
outlet
=
lsDisStore
.
getOutletName
()+
lsDisStore
.
getOutletAddress
();
String
outlet
=
lsDisStore
.
getOutletName
()+
lsDisStore
.
getOutletAddress
();
...
@@ -72,8 +72,8 @@ public class LsDisStoreDaoImpl {
...
@@ -72,8 +72,8 @@ public class LsDisStoreDaoImpl {
updateGuangzhou
(
lsDisStores
,
ldsId
);
updateGuangzhou
(
lsDisStores
,
ldsId
);
}
}
// sJFYkogPGt8kI3xkkSPwQQ9T61b4GVQV
//
光浩:
sJFYkogPGt8kI3xkkSPwQQ9T61b4GVQV
//
8ptRbXOnQNX2TTqGVVYv5AUw3vJZ77gZ
//
黄总:
8ptRbXOnQNX2TTqGVVYv5AUw3vJZ77gZ
private
void
updateGuangzhou
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
private
void
updateGuangzhou
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
outlet
=
lsDisStore
.
getOutletName
()+
lsDisStore
.
getOutletAddress
();
String
outlet
=
lsDisStore
.
getOutletName
()+
lsDisStore
.
getOutletAddress
();
...
@@ -111,8 +111,8 @@ public class LsDisStoreDaoImpl {
...
@@ -111,8 +111,8 @@ public class LsDisStoreDaoImpl {
updateanhuisp
(
lsDisStores
,
ldsId
);
updateanhuisp
(
lsDisStores
,
ldsId
);
}
}
// StY6BS8Bw50TrclA4Zd52MfEjsL1zUXI
//
欣雨:
StY6BS8Bw50TrclA4Zd52MfEjsL1zUXI
//
anjhOkUMuRyTb3DZO6dMGRUCY2l0vAql
//
本才:
anjhOkUMuRyTb3DZO6dMGRUCY2l0vAql
private
void
updateanhuisp
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
private
void
updateanhuisp
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
outlet
=
lsDisStore
.
getOutletName
()+
lsDisStore
.
getOutletAddress
();
String
outlet
=
lsDisStore
.
getOutletName
()+
lsDisStore
.
getOutletAddress
();
...
@@ -140,4 +140,209 @@ public class LsDisStoreDaoImpl {
...
@@ -140,4 +140,209 @@ public class LsDisStoreDaoImpl {
baiduAddressAnHuisp
(
ldsId
);
baiduAddressAnHuisp
(
ldsId
);
}
}
public
void
nAddreasAnHui
(
long
ldsId
)
{
List
<
LsDisStore
>
lsDisStores
=
lsDisStoreMapper
.
selectBaseLO
(
ldsId
);
if
(
lsDisStores
.
isEmpty
()){
return
;
}
ldsId
=
lsDisStores
.
get
(
lsDisStores
.
size
()
-
1
).
getLdsIf
();
nUanhuisp
(
lsDisStores
,
ldsId
);
}
private
void
nUanhuisp
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
lng
=
lsDisStore
.
getLng
();
String
s
=
HttpUtil
.
get
(
"https://api.map.baidu.com/reverse_geocoding/v3/?location="
+
lng
+
"&output=json&ak=anjhOkUMuRyTb3DZO6dMGRUCY2l0vAql"
);
JSONObject
bd
=
JSONObject
.
parseObject
(
s
);
Integer
status
=
bd
.
getInteger
(
"status"
);
if
(
status
.
intValue
()
>=
300
&&
status
.
intValue
()
<=
399
){
log
.
info
(
s
);
return
;
}
if
(
status
.
intValue
()
!=
0
){
continue
;
}
JSONObject
jo
=
bd
.
getJSONObject
(
"result"
);
String
formattedAddress
=
jo
.
getString
(
"formatted_address"
);
JSONObject
ac
=
jo
.
getJSONObject
(
"addressComponent"
);
String
district
=
ac
.
getString
(
"district"
);
lsDisStore
.
setReAddress
(
formattedAddress
);
lsDisStore
.
setReArea
(
district
);
}
lsDisStoreMapper
.
updateListNO
(
lsDisStores
);
nAddreasAnHui
(
ldsId
);
}
public
void
lsStoreNXY
(
long
ldsId
)
{
List
<
LsDisStore
>
lsDisStores
=
lsDisStoreMapper
.
selectBaseLT
(
ldsId
);
if
(
lsDisStores
.
isEmpty
()){
return
;
}
ldsId
=
lsDisStores
.
get
(
lsDisStores
.
size
()
-
1
).
getLdsIf
();
nUXY
(
lsDisStores
,
ldsId
);
}
private
void
nUXY
(
List
<
LsDisStore
>
lsDisStores
,
Long
ldsId
){
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
lng
=
lsDisStore
.
getLng
();
String
s
=
HttpUtil
.
get
(
"https://api.map.baidu.com/reverse_geocoding/v3/?location="
+
lng
+
"&output=json&ak=StY6BS8Bw50TrclA4Zd52MfEjsL1zUXI"
);
JSONObject
bd
=
JSONObject
.
parseObject
(
s
);
Integer
status
=
bd
.
getInteger
(
"status"
);
if
(
status
.
intValue
()
>=
300
&&
status
.
intValue
()
<=
399
){
log
.
info
(
s
);
return
;
}
if
(
status
.
intValue
()
!=
0
){
continue
;
}
JSONObject
jo
=
bd
.
getJSONObject
(
"result"
);
String
formattedAddress
=
jo
.
getString
(
"formatted_address"
);
JSONObject
ac
=
jo
.
getJSONObject
(
"addressComponent"
);
String
district
=
ac
.
getString
(
"district"
);
lsDisStore
.
setReAddress
(
formattedAddress
);
lsDisStore
.
setReArea
(
district
);
}
lsDisStoreMapper
.
updateListNO
(
lsDisStores
);
lsStoreNXY
(
ldsId
);
}
public
void
lsStoreNGH
(
long
ldsId
)
{
List
<
LsDisStore
>
lsDisStores
=
lsDisStoreMapper
.
selectBaseLS
(
ldsId
);
if
(
lsDisStores
.
isEmpty
()){
return
;
}
ldsId
=
lsDisStores
.
get
(
lsDisStores
.
size
()
-
1
).
getLdsIf
();
nUGH
(
lsDisStores
,
ldsId
);
}
private
void
nUGH
(
List
<
LsDisStore
>
lsDisStores
,
long
ldsId
)
{
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
lng
=
lsDisStore
.
getLng
();
String
s
=
HttpUtil
.
get
(
"https://api.map.baidu.com/reverse_geocoding/v3/?location="
+
lng
+
"&output=json&ak=sJFYkogPGt8kI3xkkSPwQQ9T61b4GVQV"
);
JSONObject
bd
=
JSONObject
.
parseObject
(
s
);
Integer
status
=
bd
.
getInteger
(
"status"
);
if
(
status
.
intValue
()
>=
300
&&
status
.
intValue
()
<=
399
){
log
.
info
(
s
);
return
;
}
if
(
status
.
intValue
()
!=
0
){
continue
;
}
JSONObject
jo
=
bd
.
getJSONObject
(
"result"
);
String
formattedAddress
=
jo
.
getString
(
"formatted_address"
);
JSONObject
ac
=
jo
.
getJSONObject
(
"addressComponent"
);
String
district
=
ac
.
getString
(
"district"
);
lsDisStore
.
setReAddress
(
formattedAddress
);
lsDisStore
.
setReArea
(
district
);
}
lsDisStoreMapper
.
updateListNO
(
lsDisStores
);
lsStoreNGH
(
ldsId
);
}
public
void
lsStoreNHS
(
long
ldsId
)
{
List
<
LsDisStore
>
lsDisStores
=
lsDisStoreMapper
.
selectBaseLF
(
ldsId
);
if
(
lsDisStores
.
isEmpty
()){
return
;
}
ldsId
=
lsDisStores
.
get
(
lsDisStores
.
size
()
-
1
).
getLdsIf
();
nUHS
(
lsDisStores
,
ldsId
);
}
private
void
nUHS
(
List
<
LsDisStore
>
lsDisStores
,
long
ldsId
)
{
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
lng
=
lsDisStore
.
getLng
();
String
s
=
HttpUtil
.
get
(
"https://api.map.baidu.com/reverse_geocoding/v3/?location="
+
lng
+
"&output=json&ak=8ptRbXOnQNX2TTqGVVYv5AUw3vJZ77gZ"
);
JSONObject
bd
=
JSONObject
.
parseObject
(
s
);
Integer
status
=
bd
.
getInteger
(
"status"
);
if
(
status
.
intValue
()
>=
300
&&
status
.
intValue
()
<=
399
){
log
.
info
(
s
);
return
;
}
if
(
status
.
intValue
()
!=
0
){
continue
;
}
JSONObject
jo
=
bd
.
getJSONObject
(
"result"
);
String
formattedAddress
=
jo
.
getString
(
"formatted_address"
);
JSONObject
ac
=
jo
.
getJSONObject
(
"addressComponent"
);
String
district
=
ac
.
getString
(
"district"
);
lsDisStore
.
setReAddress
(
formattedAddress
);
lsDisStore
.
setReArea
(
district
);
}
lsDisStoreMapper
.
updateListNO
(
lsDisStores
);
lsStoreNHS
(
ldsId
);
}
public
void
lsStoreNDX
(
long
ldsId
)
{
List
<
LsDisStore
>
lsDisStores
=
lsDisStoreMapper
.
selectBaseLV
(
ldsId
);
if
(
lsDisStores
.
isEmpty
()){
return
;
}
ldsId
=
lsDisStores
.
get
(
lsDisStores
.
size
()
-
1
).
getLdsIf
();
nUDX
(
lsDisStores
,
ldsId
);
}
private
void
nUDX
(
List
<
LsDisStore
>
lsDisStores
,
long
ldsId
)
{
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
lng
=
lsDisStore
.
getLng
();
String
s
=
HttpUtil
.
get
(
"https://api.map.baidu.com/reverse_geocoding/v3/?location="
+
lng
+
"&output=json&ak=OI4hMr7tEUoDBhSYxcrOGslnnBfZmD2b"
);
JSONObject
bd
=
JSONObject
.
parseObject
(
s
);
Integer
status
=
bd
.
getInteger
(
"status"
);
if
(
status
.
intValue
()
>=
300
&&
status
.
intValue
()
<=
399
){
log
.
info
(
s
);
return
;
}
if
(
status
.
intValue
()
!=
0
){
continue
;
}
JSONObject
jo
=
bd
.
getJSONObject
(
"result"
);
String
formattedAddress
=
jo
.
getString
(
"formatted_address"
);
JSONObject
ac
=
jo
.
getJSONObject
(
"addressComponent"
);
String
district
=
ac
.
getString
(
"district"
);
lsDisStore
.
setReAddress
(
formattedAddress
);
lsDisStore
.
setReArea
(
district
);
}
lsDisStoreMapper
.
updateListNO
(
lsDisStores
);
lsStoreNDX
(
ldsId
);
}
public
void
lsStoreNQL
(
long
ldsId
)
{
List
<
LsDisStore
>
lsDisStores
=
lsDisStoreMapper
.
selectBaseLX
(
ldsId
);
if
(
lsDisStores
.
isEmpty
()){
return
;
}
ldsId
=
lsDisStores
.
get
(
lsDisStores
.
size
()
-
1
).
getLdsIf
();
nUQL
(
lsDisStores
,
ldsId
);
}
private
void
nUQL
(
List
<
LsDisStore
>
lsDisStores
,
long
ldsId
)
{
for
(
LsDisStore
lsDisStore
:
lsDisStores
)
{
String
lng
=
lsDisStore
.
getLng
();
String
s
=
HttpUtil
.
get
(
"https://api.map.baidu.com/reverse_geocoding/v3/?location="
+
lng
+
"&output=json&ak=1ZKO0CGs6nm9HuZWR6ucRiu4p9kM8f3i"
);
JSONObject
bd
=
JSONObject
.
parseObject
(
s
);
Integer
status
=
bd
.
getInteger
(
"status"
);
if
(
status
.
intValue
()
>=
300
&&
status
.
intValue
()
<=
399
){
log
.
info
(
s
);
return
;
}
if
(
status
.
intValue
()
!=
0
){
continue
;
}
JSONObject
jo
=
bd
.
getJSONObject
(
"result"
);
String
formattedAddress
=
jo
.
getString
(
"formatted_address"
);
JSONObject
ac
=
jo
.
getJSONObject
(
"addressComponent"
);
String
district
=
ac
.
getString
(
"district"
);
lsDisStore
.
setReAddress
(
formattedAddress
);
lsDisStore
.
setReArea
(
district
);
}
lsDisStoreMapper
.
updateListNO
(
lsDisStores
);
lsStoreNQL
(
ldsId
);
}
}
}
src/main/java/com/sfa/job/domain/ls/mapper/LsDisStoreMapper.java
浏览文件 @
24bde0d4
...
@@ -27,6 +27,18 @@ public interface LsDisStoreMapper extends BaseMapper<LsDisStore> {
...
@@ -27,6 +27,18 @@ public interface LsDisStoreMapper extends BaseMapper<LsDisStore> {
List
<
LsDisStore
>
selectBaseS
(
Long
lastId
);
List
<
LsDisStore
>
selectBaseS
(
Long
lastId
);
void
updateListS
(
@Param
(
"lsDisStores"
)
List
<
LsDisStore
>
lsDisStores
);
void
updateListS
(
@Param
(
"lsDisStores"
)
List
<
LsDisStore
>
lsDisStores
);
/**
* 逆地理编码
*/
List
<
LsDisStore
>
selectBaseLO
(
long
ldsId
);
List
<
LsDisStore
>
selectBaseLT
(
long
ldsId
);
List
<
LsDisStore
>
selectBaseLS
(
long
ldsId
);
List
<
LsDisStore
>
selectBaseLF
(
long
ldsId
);
List
<
LsDisStore
>
selectBaseLV
(
long
ldsId
);
List
<
LsDisStore
>
selectBaseLX
(
long
ldsId
);
void
updateListNO
(
@Param
(
"lsDisStores"
)
List
<
LsDisStore
>
lsDisStores
);
}
}
...
...
src/main/java/com/sfa/job/xxljob/test/TestTask.java
浏览文件 @
24bde0d4
...
@@ -34,4 +34,35 @@ public class TestTask {
...
@@ -34,4 +34,35 @@ public class TestTask {
lsDisStoreDaoImpl
.
baiduAddressAnHuisp
(
1000000L
);
lsDisStoreDaoImpl
.
baiduAddressAnHuisp
(
1000000L
);
}
}
/**
* 逆地理编码
*/
@XxlJob
(
"ls_store_n_anhui"
)
public
void
lsStoreNAnHui
()
{
lsDisStoreDaoImpl
.
nAddreasAnHui
(
0L
);
}
@XxlJob
(
"ls_store_n_xy"
)
public
void
lsStoreNXY
()
{
lsDisStoreDaoImpl
.
lsStoreNXY
(
250000L
);
}
@XxlJob
(
"ls_store_n_gh"
)
public
void
lsStoreNGH
()
{
lsDisStoreDaoImpl
.
lsStoreNGH
(
500000L
);
}
@XxlJob
(
"ls_store_n_hs"
)
public
void
lsStoreNHS
()
{
lsDisStoreDaoImpl
.
lsStoreNHS
(
750000L
);
}
@XxlJob
(
"ls_store_n_dx"
)
public
void
lsStoreNDX
()
{
lsDisStoreDaoImpl
.
lsStoreNDX
(
1000000L
);
}
@XxlJob
(
"ls_store_n_ql"
)
public
void
lsStoreNQL
()
{
lsDisStoreDaoImpl
.
lsStoreNQL
(
1250000L
);
}
}
}
src/main/resources/mapper/job/LsDisStoreMapper.xml
浏览文件 @
24bde0d4
...
@@ -70,4 +70,41 @@
...
@@ -70,4 +70,41 @@
</update>
</update>
<select
id=
"selectBaseLO"
resultMap=
"LsDisStoreBase"
>
select lds_if,lng
from ls_dis_store where lng is not null and lds_if
>
#{lastId} and lds_if
<
= 250000
</select>
<select
id=
"selectBaseLT"
resultMap=
"LsDisStoreBase"
>
select lds_if,lng
from ls_dis_store where lng is not null and lds_if
>
#{lastId} and lds_if
<
= 500000
</select>
<select
id=
"selectBaseLS"
resultMap=
"LsDisStoreBase"
>
select lds_if,lng
from ls_dis_store where lng is not null and lds_if
>
#{lastId} and lds_if
<
= 750000
</select>
<select
id=
"selectBaseLF"
resultMap=
"LsDisStoreBase"
>
select lds_if,lng
from ls_dis_store where lng is not null and lds_if
>
#{lastId} and lds_if
<
= 1000000
</select>
<select
id=
"selectBaseLV"
resultMap=
"LsDisStoreBase"
>
select lds_if,lng
from ls_dis_store where lng is not null and lds_if
>
#{lastId} and lds_if
<
= 1250000
</select>
<select
id=
"selectBaseLX"
resultMap=
"LsDisStoreBase"
>
select lds_if,lng
from ls_dis_store where lng is not null and lds_if
>
#{lastId} and lds_if
<
= 1537130
</select>
<update
id=
"updateListNO"
parameterType=
"java.util.List"
>
<foreach
collection=
"lsDisStores"
item=
"item"
separator=
";"
>
update ls_dis_store set re_address = #{item.reAddress},re_area = #{item.reArea} where lds_if = #{item.ldsIf}
</foreach>
</update>
</mapper>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论