Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
e50a5968
Commit
e50a5968
authored
Mar 30, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
a36ff5a7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
7 deletions
+31
-7
IHouseholdPvDistrictService.java
...module/jxiop/api/service/IHouseholdPvDistrictService.java
+2
-0
HouseholdPvDistrictMapper.xml
...i/src/main/resources/mapper/HouseholdPvDistrictMapper.xml
+1
-3
HouseholdPvDistrictController.java
...e/jxiop/biz/controller/HouseholdPvDistrictController.java
+11
-1
HouseholdPvDistrictServiceImpl.java
...xiop/biz/service/impl/HouseholdPvDistrictServiceImpl.java
+13
-0
HouseholdPvServiceImpl.java
...module/jxiop/biz/service/impl/HouseholdPvServiceImpl.java
+4
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/IHouseholdPvDistrictService.java
View file @
e50a5968
...
...
@@ -19,6 +19,8 @@ public interface IHouseholdPvDistrictService extends IService<HouseholdPvDistric
List
<
CompanyTreeDto
>
getBusinessTree
(
Long
parentId
);
List
<
CompanyTreeDto
>
stationTree
();
HouseholdPvDistrict
treeAdd
(
Long
parentId
,
String
name
);
HouseholdPvDistrict
treeUpdate
(
Long
id
,
String
name
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/HouseholdPvDistrictMapper.xml
View file @
e50a5968
...
...
@@ -22,9 +22,7 @@
household_pv hp
LEFT JOIN household_pv_install hpi ON hp.sequence_nbr = hpi.household_pv_id
WHERE
hp.platform_company_id = #{id}
OR hp.district_id = #{id}
OR hpi.platform_company_id = #{id}
hp.district_id = #{id}
</select>
<select
id=
"selectIds"
resultType=
"java.lang.Long"
>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/HouseholdPvDistrictController.java
View file @
e50a5968
...
...
@@ -125,7 +125,7 @@ public class HouseholdPvDistrictController extends BaseController {
@GetMapping
(
value
=
"/getTree"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
厂站树"
,
notes
=
"
厂站树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
全量厂站树"
,
notes
=
"全量
厂站树"
)
public
ResponseModel
<
Object
>
getTree
()
{
return
ResponseHelper
.
buildResponse
(
householdPvDistrictService
.
getTree
());
}
...
...
@@ -138,6 +138,13 @@ public class HouseholdPvDistrictController extends BaseController {
return
ResponseHelper
.
buildResponse
(
householdPvDistrictService
.
getBusinessTree
(
parentId
));
}
@GetMapping
(
value
=
"/stationTree"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"厂站树"
,
notes
=
"厂站树"
)
public
ResponseModel
<
Object
>
stationTree
()
{
return
ResponseHelper
.
buildResponse
(
householdPvDistrictService
.
stationTree
());
}
/**
* 树节点新增
*
...
...
@@ -152,6 +159,7 @@ public class HouseholdPvDistrictController extends BaseController {
String
name
=
dto
.
get
(
"name"
).
toString
();
LambdaQueryWrapper
<
HouseholdPvDistrict
>
lambda
=
new
QueryWrapper
<
HouseholdPvDistrict
>().
lambda
();
lambda
.
eq
(
HouseholdPvDistrict
::
getName
,
name
);
lambda
.
eq
(
HouseholdPvDistrict:
:
getParentId
,
id
);
Integer
integer
=
householdPvDistrictService
.
getBaseMapper
().
selectCount
(
lambda
);
if
(
integer
>
0
){
return
CommonResponseUtil
.
failure
(
"节点已存在!"
);
...
...
@@ -171,8 +179,10 @@ public class HouseholdPvDistrictController extends BaseController {
Map
<
String
,
Object
>
dto
=
(
Map
<
String
,
Object
>)
model
.
get
(
"dto"
);
String
id
=
dto
.
get
(
"id"
).
toString
();
String
name
=
dto
.
get
(
"name"
).
toString
();
HouseholdPvDistrict
householdPvDistrict
=
householdPvDistrictService
.
getBaseMapper
().
selectById
(
id
);
LambdaQueryWrapper
<
HouseholdPvDistrict
>
lambda
=
new
QueryWrapper
<
HouseholdPvDistrict
>().
lambda
();
lambda
.
eq
(
HouseholdPvDistrict
::
getName
,
name
);
lambda
.
eq
(
HouseholdPvDistrict:
:
getParentId
,
householdPvDistrict
.
getParentId
());
lambda
.
ne
(
HouseholdPvDistrict
::
getSequenceNbr
,
id
);
Integer
integer
=
householdPvDistrictService
.
getBaseMapper
().
selectCount
(
lambda
);
if
(
integer
>
0
){
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HouseholdPvDistrictServiceImpl.java
View file @
e50a5968
...
...
@@ -127,6 +127,19 @@ public class HouseholdPvDistrictServiceImpl extends BaseService<HouseholdPvDistr
return
list
.
stream
().
filter
(
a
->
list
.
stream
().
noneMatch
(
c
->
c
.
getId
().
equals
(
a
.
getParentId
()))).
peek
(
b
->
b
.
setChildren
(
getCompanyBuildingChildrenTree
(
b
.
getId
(),
list
))).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
CompanyTreeDto
>
stationTree
()
{
ArrayList
<
CompanyTreeDto
>
list
=
new
ArrayList
<>();
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
Long
sequenceNbr
=
reginParams
.
getCompany
().
getSequenceNbr
();
FeignClientResult
<
Collection
<
UserOrgTreeModel
>>
collectionFeignClientResult
=
Privilege
.
companyClient
.
queryOrgTree
(
sequenceNbr
);
if
(
collectionFeignClientResult
!=
null
)
{
Collection
<
UserOrgTreeModel
>
result
=
collectionFeignClientResult
.
getResult
();
change
(
result
,
list
);
}
return
list
.
stream
().
filter
(
a
->
list
.
stream
().
noneMatch
(
c
->
c
.
getId
().
equals
(
a
.
getParentId
()))).
peek
(
b
->
b
.
setChildren
(
getCompanyBuildingChildrenTree
(
b
.
getId
(),
list
))).
collect
(
Collectors
.
toList
());
}
private
String
getOrgCode
(
Long
platformCompanyId
)
{
String
bizOrgCode
=
null
;
HouseholdPvDistrict
parentDetail
=
householdPvDistrictMapper
.
selectById
(
platformCompanyId
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HouseholdPvServiceImpl.java
View file @
e50a5968
...
...
@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IHouseholdPvContactService
import
com.yeejoin.amos.boot.module.jxiop.api.service.IHouseholdPvInstallService
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IHouseholdPvLeaseService
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IHouseholdPvService
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.CommonResponseUtil
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
...
...
@@ -145,13 +146,13 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
if
(!
ObjectUtils
.
isEmpty
(
item
.
getPlatformCompanyId
()))
{
if
(
map
.
containsKey
(
item
.
getPlatformCompanyId
()))
{
householdPv
.
setPlatformCompanyId
(
Long
.
parseLong
(
String
.
valueOf
(
map
.
get
(
item
.
getPlatformCompanyId
()))));
householdPv
.
setBizOrgCode
(
getOrgCode
(
householdPv
.
getPlatformCompanyId
()));
}
}
// 所属乡镇
if
(!
ObjectUtils
.
isEmpty
(
item
.
getDistrictId
()))
{
if
(
map
.
containsKey
(
item
.
getDistrictId
()))
{
householdPv
.
setDistrictId
(
Long
.
parseLong
(
String
.
valueOf
(
map
.
get
(
item
.
getDistrictId
()))));
householdPv
.
setBizOrgCode
(
getOrgCode
(
householdPv
.
getDistrictId
()));
}
}
householdPvs
.
add
(
householdPv
);
...
...
@@ -287,7 +288,7 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
BeanUtils
.
copyProperties
(
householdPvDto
,
householdPv
);
// 默认状态为正常
householdPv
.
setLevel
(
LevelType
.
NORMAL
.
getName
());
householdPv
.
setBizOrgCode
(
getOrgCode
(
householdPv
.
get
PlatformCompany
Id
()));
householdPv
.
setBizOrgCode
(
getOrgCode
(
householdPv
.
get
District
Id
()));
this
.
save
(
householdPv
);
HouseholdPvContact
householdPvContact
=
new
HouseholdPvContact
();
...
...
@@ -312,7 +313,7 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
public
HouseholdPvDto
update
(
HouseholdPvDto
householdPvDto
)
{
HouseholdPv
householdPv
=
new
HouseholdPv
();
BeanUtils
.
copyProperties
(
householdPvDto
,
householdPv
);
householdPv
.
setBizOrgCode
(
getOrgCode
(
householdPv
.
get
PlatformCompany
Id
()));
householdPv
.
setBizOrgCode
(
getOrgCode
(
householdPv
.
get
District
Id
()));
this
.
updateById
(
householdPv
);
HouseholdPvContact
householdPvContact
=
new
HouseholdPvContact
();
...
...
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