Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ed5682ac
authored
Oct 24, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加逆地址解析接口
1 parent
279faae8
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
218 additions
and
4 deletions
project-interface/src/main/java/com/dituhui/pea/pojo/saas/req/AdministrativeDistrictReq.java
project-interface/src/main/java/com/dituhui/pea/pojo/saas/resp/AdministrativeDistrictResp.java
project-interface/src/main/java/com/dituhui/pea/pojo/saas/resp/GovPosition.java
project-interface/src/main/java/com/dituhui/pea/pojo/saas/resp/SubNames.java
project-order/src/main/java/com/dituhui/pea/order/common/SaasUtils.java
project-order/src/main/java/com/dituhui/pea/order/controller/FendanController.java
project-order/src/main/java/com/dituhui/pea/order/feign/ISaaSRemoteService.java
project-order/src/main/java/com/dituhui/pea/order/service/FendanService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/FendanServiceImpl.java
project-interface/src/main/java/com/dituhui/pea/pojo/saas/req/AdministrativeDistrictReq.java
0 → 100644
View file @
ed5682a
package
com
.
dituhui
.
pea
.
pojo
.
saas
.
req
;
import
lombok.Data
;
@Data
public
class
AdministrativeDistrictReq
{
/**
* 经纬度
*/
private
String
points
;
/**
* 坐标编码
*/
private
String
coordType
=
"gcj02ll"
;
}
project-interface/src/main/java/com/dituhui/pea/pojo/saas/resp/AdministrativeDistrictResp.java
0 → 100644
View file @
ed5682a
package
com
.
dituhui
.
pea
.
pojo
.
saas
.
resp
;
import
java.util.List
;
public
class
AdministrativeDistrictResp
{
private
String
admincode
;
private
String
name
;
private
String
fullName
;
private
String
level
;
private
GovPosition
govPosition
;
private
String
acode
;
private
String
abbreviation
;
private
List
<
String
>
districtNames
;
private
SubNames
subNames
;
public
void
setAdmincode
(
String
admincode
)
{
this
.
admincode
=
admincode
;
}
public
String
getAdmincode
()
{
return
admincode
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setFullName
(
String
fullName
)
{
this
.
fullName
=
fullName
;
}
public
String
getFullName
()
{
return
fullName
;
}
public
void
setLevel
(
String
level
)
{
this
.
level
=
level
;
}
public
String
getLevel
()
{
return
level
;
}
public
void
setGovPosition
(
GovPosition
govPosition
)
{
this
.
govPosition
=
govPosition
;
}
public
GovPosition
getGovPosition
()
{
return
govPosition
;
}
public
void
setAcode
(
String
acode
)
{
this
.
acode
=
acode
;
}
public
String
getAcode
()
{
return
acode
;
}
public
void
setAbbreviation
(
String
abbreviation
)
{
this
.
abbreviation
=
abbreviation
;
}
public
String
getAbbreviation
()
{
return
abbreviation
;
}
public
void
setDistrictNames
(
List
<
String
>
districtNames
)
{
this
.
districtNames
=
districtNames
;
}
public
List
<
String
>
getDistrictNames
()
{
return
districtNames
;
}
public
void
setSubNames
(
SubNames
subNames
)
{
this
.
subNames
=
subNames
;
}
public
SubNames
getSubNames
()
{
return
subNames
;
}
}
\ No newline at end of file
project-interface/src/main/java/com/dituhui/pea/pojo/saas/resp/GovPosition.java
0 → 100644
View file @
ed5682a
package
com
.
dituhui
.
pea
.
pojo
.
saas
.
resp
;
public
class
GovPosition
{
private
long
x
;
private
long
y
;
public
void
setX
(
long
x
)
{
this
.
x
=
x
;
}
public
long
getX
()
{
return
x
;
}
public
void
setY
(
long
y
)
{
this
.
y
=
y
;
}
public
long
getY
()
{
return
y
;
}
}
\ No newline at end of file
project-interface/src/main/java/com/dituhui/pea/pojo/saas/resp/SubNames.java
0 → 100644
View file @
ed5682a
package
com
.
dituhui
.
pea
.
pojo
.
saas
.
resp
;
public
class
SubNames
{
private
String
province
;
private
String
town
;
private
String
city
;
private
String
county
;
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
public
String
getProvince
()
{
return
province
;
}
public
void
setTown
(
String
town
)
{
this
.
town
=
town
;
}
public
String
getTown
()
{
return
town
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setCounty
(
String
county
)
{
this
.
county
=
county
;
}
public
String
getCounty
()
{
return
county
;
}
}
\ No newline at end of file
project-order/src/main/java/com/dituhui/pea/order/common/SaasUtils.java
View file @
ed5682a
...
@@ -8,6 +8,8 @@ import com.dituhui.pea.order.dto.SaasXyFendanDTO;
...
@@ -8,6 +8,8 @@ import com.dituhui.pea.order.dto.SaasXyFendanDTO;
import
com.dituhui.pea.order.feign.ISaaSRemoteService
;
import
com.dituhui.pea.order.feign.ISaaSRemoteService
;
import
com.dituhui.pea.pojo.fendan.FenDanEsResult
;
import
com.dituhui.pea.pojo.fendan.FenDanEsResult
;
import
com.dituhui.pea.pojo.fendan.FendanDTO
;
import
com.dituhui.pea.pojo.fendan.FendanDTO
;
import
com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq
;
import
com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -80,8 +82,6 @@ public class SaasUtils {
...
@@ -80,8 +82,6 @@ public class SaasUtils {
* 根据提供的地址信息,获取对应的片区图层
* 根据提供的地址信息,获取对应的片区图层
*/
*/
public
List
<
BlockInfo
>
queryBlocksByXy
(
FendanDTO
fendanDTO
)
{
public
List
<
BlockInfo
>
queryBlocksByXy
(
FendanDTO
fendanDTO
)
{
long
t
=
System
.
currentTimeMillis
();
log
.
info
(
"===> queryBlocksByXySingleT({})"
,
t
);
String
webResultStr
=
saasRemoteService
.
single
(
ak
,
fendanDTO
);
String
webResultStr
=
saasRemoteService
.
single
(
ak
,
fendanDTO
);
log
.
info
(
"queryBlocksByXySingle返回结果: ===> {}"
,
webResultStr
);
log
.
info
(
"queryBlocksByXySingle返回结果: ===> {}"
,
webResultStr
);
SaasWebResult
webResult
=
JSONObject
.
parseObject
(
webResultStr
,
SaasWebResult
.
class
);
SaasWebResult
webResult
=
JSONObject
.
parseObject
(
webResultStr
,
SaasWebResult
.
class
);
...
@@ -106,6 +106,22 @@ public class SaasUtils {
...
@@ -106,6 +106,22 @@ public class SaasUtils {
}
}
/**
* 根据提供的地址信息,获取对应的片区图层
*/
public
List
<
AdministrativeDistrictResp
>
getAdminDistrict
(
AdministrativeDistrictReq
districtReq
)
{
String
webResultStr
=
saasRemoteService
.
getAdminDistrict
(
ak
,
districtReq
);
log
.
info
(
"queryBlocksByXySingle返回结果: ===> {}"
,
webResultStr
);
SaasWebResult
webResult
=
JSONObject
.
parseObject
(
webResultStr
,
SaasWebResult
.
class
);
log
.
info
(
"queryBlocksByXySingle返回结果: ===> {}"
,
webResult
.
getResult
());
if
(!
webResult
.
getCode
().
equals
(
"S001"
))
{
return
null
;
}
List
<
AdministrativeDistrictResp
>
administrativeDistrictResp
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
webResult
.
getResult
()),
List
.
class
);
return
administrativeDistrictResp
;
}
public
List
<
BlockInfo
>
queryBlocksByAddress
(
String
address
)
{
public
List
<
BlockInfo
>
queryBlocksByAddress
(
String
address
)
{
// 根据坐标 查询分单接口,获得区块、图层列表 ===> 查询map_block_info表,根据优先级,确定 工作队;
// 根据坐标 查询分单接口,获得区块、图层列表 ===> 查询map_block_info表,根据优先级,确定 工作队;
// 根据工作队+图层,查询 capacity_team_stat,返回
// 根据工作队+图层,查询 capacity_team_stat,返回
...
...
project-order/src/main/java/com/dituhui/pea/order/controller/FendanController.java
View file @
ed5682a
...
@@ -5,6 +5,8 @@ import com.dituhui.pea.order.dto.param.OrderDTO;
...
@@ -5,6 +5,8 @@ import com.dituhui.pea.order.dto.param.OrderDTO;
import
com.dituhui.pea.order.dto.param.OrgGroupInfo
;
import
com.dituhui.pea.order.dto.param.OrgGroupInfo
;
import
com.dituhui.pea.order.dto.param.OrgTeamInfo
;
import
com.dituhui.pea.order.dto.param.OrgTeamInfo
;
import
com.dituhui.pea.order.service.FendanService
;
import
com.dituhui.pea.order.service.FendanService
;
import
com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq
;
import
com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -29,4 +31,9 @@ public class FendanController {
...
@@ -29,4 +31,9 @@ public class FendanController {
public
Result
<
List
<
OrgGroupInfo
>>
fendanToGroup
(
@RequestBody
OrderDTO
.
OrderCreateRequest
request
)
{
public
Result
<
List
<
OrgGroupInfo
>>
fendanToGroup
(
@RequestBody
OrderDTO
.
OrderCreateRequest
request
)
{
return
fendanService
.
fendanToGroup
(
request
);
return
fendanService
.
fendanToGroup
(
request
);
}
}
@RequestMapping
(
value
=
"getAdminDistrict"
,
method
=
RequestMethod
.
POST
)
public
Result
<
List
<
AdministrativeDistrictResp
>>
getAdminDistrict
(
@RequestBody
AdministrativeDistrictReq
req
)
{
return
fendanService
.
getAdminDistrict
(
req
);
}
}
}
project-order/src/main/java/com/dituhui/pea/order/feign/ISaaSRemoteService.java
View file @
ed5682a
...
@@ -3,6 +3,7 @@ package com.dituhui.pea.order.feign;
...
@@ -3,6 +3,7 @@ package com.dituhui.pea.order.feign;
import
com.dituhui.pea.common.SaasWebResult
;
import
com.dituhui.pea.common.SaasWebResult
;
import
com.dituhui.pea.pojo.fendan.FenDanEsResult
;
import
com.dituhui.pea.pojo.fendan.FenDanEsResult
;
import
com.dituhui.pea.pojo.fendan.FendanDTO
;
import
com.dituhui.pea.pojo.fendan.FendanDTO
;
import
com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -35,6 +36,7 @@ public interface ISaaSRemoteService {
...
@@ -35,6 +36,7 @@ public interface ISaaSRemoteService {
@PostMapping
(
"/saas/fendan/distribute/single"
)
@PostMapping
(
"/saas/fendan/distribute/single"
)
public
String
single
(
@RequestParam
String
ak
,
@RequestBody
FendanDTO
fendanDTO
);
public
String
single
(
@RequestParam
String
ak
,
@RequestBody
FendanDTO
fendanDTO
);
//@PostMapping("/saas/fendan/distribute/single")
//public SaasWebResult single(@RequestParam("ak") String ak, @RequestParam("t") String t, @RequestBody FendanDTO fendanDTO);
@PostMapping
(
"/saas/baseData/area/getDistrictByRegion"
)
public
String
getAdminDistrict
(
@RequestParam
(
"ak"
)
String
ak
,
@RequestBody
AdministrativeDistrictReq
districtReq
);
}
}
project-order/src/main/java/com/dituhui/pea/order/service/FendanService.java
View file @
ed5682a
...
@@ -4,6 +4,8 @@ import com.dituhui.pea.common.Result;
...
@@ -4,6 +4,8 @@ import com.dituhui.pea.common.Result;
import
com.dituhui.pea.order.dto.param.OrderDTO
;
import
com.dituhui.pea.order.dto.param.OrderDTO
;
import
com.dituhui.pea.order.dto.param.OrgGroupInfo
;
import
com.dituhui.pea.order.dto.param.OrgGroupInfo
;
import
com.dituhui.pea.order.dto.param.OrgTeamInfo
;
import
com.dituhui.pea.order.dto.param.OrgTeamInfo
;
import
com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq
;
import
com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp
;
import
java.util.List
;
import
java.util.List
;
...
@@ -24,4 +26,6 @@ public interface FendanService {
...
@@ -24,4 +26,6 @@ public interface FendanService {
* @return
* @return
*/
*/
Result
<
List
<
OrgGroupInfo
>>
fendanToGroup
(
OrderDTO
.
OrderCreateRequest
request
);
Result
<
List
<
OrgGroupInfo
>>
fendanToGroup
(
OrderDTO
.
OrderCreateRequest
request
);
Result
<
List
<
AdministrativeDistrictResp
>>
getAdminDistrict
(
AdministrativeDistrictReq
req
);
}
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/FendanServiceImpl.java
View file @
ed5682a
...
@@ -11,6 +11,8 @@ import com.dituhui.pea.order.dto.param.OrgTeamInfo;
...
@@ -11,6 +11,8 @@ import com.dituhui.pea.order.dto.param.OrgTeamInfo;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.service.FendanService
;
import
com.dituhui.pea.order.service.FendanService
;
import
com.dituhui.pea.pojo.fendan.FendanDTO
;
import
com.dituhui.pea.pojo.fendan.FendanDTO
;
import
com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq
;
import
com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -200,6 +202,11 @@ public class FendanServiceImpl implements FendanService {
...
@@ -200,6 +202,11 @@ public class FendanServiceImpl implements FendanService {
return
Result
.
success
(
orgGroupTeamInfos
);
return
Result
.
success
(
orgGroupTeamInfos
);
}
}
@Override
public
Result
<
List
<
AdministrativeDistrictResp
>>
getAdminDistrict
(
AdministrativeDistrictReq
req
)
{
return
Result
.
success
(
saasUtils
.
getAdminDistrict
(
req
));
}
/**
/**
* 筛选品牌
* 筛选品牌
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment