Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
bfdc4889
Commit
bfdc4889
authored
Jan 07, 2025
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer_bw' into developer_bw
parents
18520d42
2005d359
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
10 deletions
+70
-10
DropDown.java
...a/com/yeejoin/amos/boot/module/hygf/api/dto/DropDown.java
+3
-0
JpStationMapper.java
...oin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
+1
-1
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+33
-6
JpStationController.java
.../boot/module/hygf/biz/controller/JpStationController.java
+33
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/DropDown.java
View file @
bfdc4889
...
...
@@ -25,4 +25,7 @@ public class DropDown {
@ApiModelProperty
(
value
=
"单位地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"区域编码"
)
private
String
regionSeq
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
View file @
bfdc4889
...
...
@@ -39,7 +39,7 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
@UserEmpower
(
field
={
"ORG_CODE"
}
,
dealerField
={
"ORG_CODE"
},
fieldConditions
={
"in"
,
"in"
}
,
relationship
=
"and"
,
specific
=
false
)
List
<
DropDown
>
getRegion
(
String
regionName
,
String
address
);
List
<
String
>
getRegionAddress
();
List
<
String
>
getRegionAddress
(
@Param
(
"regionSeqList"
)
List
<
String
>
regionSeqList
);
@UserEmpower
(
field
={
"ORG_CODE"
}
,
dealerField
={
"ORG_CODE"
},
fieldConditions
={
"in"
,
"in"
}
,
relationship
=
"and"
,
specific
=
false
)
List
<
DropDown
>
getRegionByProvince
(
@Param
(
value
=
"ids"
)
List
<
String
>
ids
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
bfdc4889
...
...
@@ -245,9 +245,10 @@
</select>
<select
id=
"getRegion"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.DropDown"
>
SELECT privilege_company.ORG_CODE
orgCode,
SELECT privilege_company.ORG_CODE orgCode,
privilege_company.COMPANY_NAME name,
privilege_company.ADDRESS address
privilege_company.ADDRESS address,
privilege_company.REGION_SEQ regionSeq
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
...
...
@@ -263,10 +264,36 @@
</select>
<select
id=
"getRegionAddress"
resultType=
"String"
>
SELECT DISTINCT IFNULL(privilege_company.address, '未知省份') AS address
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
WITH RECURSIVE ParentTree AS (
-- 初始查询:选择根节点
SELECT
SEQUENCE_NBR,
PARENT_ID,
REGION_NAME
FROM
systemctl_region sr
WHERE
sr.SEQUENCE_NBR in
<foreach
collection=
"regionSeqList"
item=
"regionSeq"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{regionSeq}
</foreach>
UNION ALL
-- 递归部分:选择父节点
SELECT
p.SEQUENCE_NBR,
p.PARENT_ID,
p.REGION_NAME
FROM
systemctl_region p
JOIN
ParentTree pt ON p.SEQUENCE_NBR = pt.PARENT_ID
)
SELECT
pt.REGION_NAME AS topLevelNodeName
FROM
ParentTree pt
WHERE
pt.PARENT_ID = 0;
</select>
<select
id=
"getRegionNode"
resultType=
"string"
>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpStationController.java
View file @
bfdc4889
...
...
@@ -444,14 +444,44 @@ public class JpStationController extends BaseController {
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司地址"
,
notes
=
"查询当前登录人权限区域公司地址"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司"
,
notes
=
"查询当前登录人权限区域公司"
)
@GetMapping
(
value
=
"/getRegionCompanyByProvince"
)
@UserLimits
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
getRegionCompanyByProvince
(
String
province
)
{
List
<
DropDown
>
list
=
new
ArrayList
<>();
if
(
StringUtils
.
isEmpty
(
province
)){
list
=
jpStationMapper
.
getRegion
(
null
,
null
);
}
else
{
List
<
String
>
ids
=
jpStationMapper
.
getRegionNode
(
province
);
list
=
jpStationMapper
.
getRegionByProvince
(
ids
);
}
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
list
.
forEach
(
dropDown
->
{
Map
<
String
,
String
>
item
=
new
HashMap
<>();
item
.
put
(
"text"
,
dropDown
.
getName
());
item
.
put
(
"value"
,
dropDown
.
getOrgCode
());
result
.
add
(
item
);
});
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司省份地址"
,
notes
=
"查询当前登录人权限区域公司省份地址"
)
@GetMapping
(
value
=
"/getRegionAddress"
)
@UserLimits
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
getRegionAddress
()
{
List
<
String
>
list
=
jpStationMapper
.
getRegionAddress
();
List
<
DropDown
>
list
=
jpStationMapper
.
getRegion
(
null
,
null
);
List
<
String
>
regionSeqList
=
list
.
stream
().
map
(
DropDown:
:
getRegionSeq
).
distinct
().
collect
(
Collectors
.
toList
());
if
(
regionSeqList
==
null
)
{
regionSeqList
=
new
ArrayList
<>();
}
List
<
String
>
addressList
=
new
ArrayList
<>(
new
HashSet
<>(
jpStationMapper
.
getRegionAddress
(
regionSeqList
)));
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
l
ist
.
forEach
(
address
->
{
addressL
ist
.
forEach
(
address
->
{
Map
<
String
,
String
>
item
=
new
HashMap
<>();
item
.
put
(
"text"
,
address
);
item
.
put
(
"value"
,
address
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment