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
daa85436
Commit
daa85436
authored
Apr 25, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增片区接口
parent
e0ddf271
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
10 deletions
+109
-10
ListCompanyModel.java
...join/amos/boot/module/jxiop/api/dto/ListCompanyModel.java
+26
-0
PrivilegeController.java
...boot/module/jxiop/biz/controller/PrivilegeController.java
+22
-9
StationBasicServiceImpl.java
...odule/jxiop/biz/service/impl/StationBasicServiceImpl.java
+59
-1
application.properties
...odule-jxiop-biz/src/main/resources/application.properties
+2
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/ListCompanyModel.java
0 → 100644
View file @
daa85436
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
dto
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
lombok.Data
;
import
java.util.Collection
;
/**
* @description:
* @author: tw
* @createDate: 2023/4/25
*/
@Data
public
class
ListCompanyModel
{
private
String
companyName
;
private
String
companyCode
;
private
Long
parentId
;
private
String
orgCode
;
private
String
companyType
;
private
Boolean
disabled
;
private
Collection
<
ListCompanyModel
>
children
;
private
Long
sequenceNbr
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PrivilegeController.java
View file @
daa85436
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.ListCompanyModel
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
@@ -56,18 +57,30 @@ public class PrivilegeController extends BaseController{
...
@@ -56,18 +57,30 @@ public class PrivilegeController extends BaseController{
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/subcompany"
)
@GetMapping
(
value
=
"/subcompany"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位
、部门树"
,
notes
=
"查询单位、子单位、部门树
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位
"
,
notes
=
"查询单位、子单位
"
)
public
ResponseModel
<
List
<
CompanyModel
>>
subcompany
()
{
public
ResponseModel
<
List
<
ListCompanyModel
>>
subcompany
()
{
//获取当前登录人单位
//获取当前登录人单位
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
Long
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
Long
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
List
<
ListCompanyModel
>
date
=
new
ArrayList
();
CompanyModel
companyModel
=
new
CompanyModel
();
if
(
"area"
.
equals
(
reginParams
.
getCompany
().
getLevel
())){
companyModel
.
setSequenceNbr
(
companyId
);
ListCompanyModel
companyModel
=
new
ListCompanyModel
();
companyModel
.
setCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
companyModel
.
setSequenceNbr
(
companyId
);
companyModel
.
setChildren
(
de
.
getResult
());
companyModel
.
setCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
List
<
CompanyModel
>
date
=
new
ArrayList
();
date
.
add
(
companyModel
);
date
.
add
(
companyModel
);
}
else
if
(
"headquarter"
.
equals
(
reginParams
.
getCompany
().
getLevel
())){
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
Collection
<
CompanyModel
>
dated
=
de
.
getResult
();
for
(
CompanyModel
companyModel
:
dated
)
{
if
(
"area"
.
equals
(
companyModel
.
getLevel
())){
ListCompanyModel
companyModeld
=
new
ListCompanyModel
();
companyModeld
.
setSequenceNbr
(
companyModel
.
getSequenceNbr
());
companyModeld
.
setCompanyName
(
companyModel
.
getCompanyName
());
date
.
add
(
companyModeld
);
}
}
}
return
ResponseHelper
.
buildResponse
(
date
);
return
ResponseHelper
.
buildResponse
(
date
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/StationBasicServiceImpl.java
View file @
daa85436
...
@@ -8,9 +8,16 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationCoordinate;
...
@@ -8,9 +8,16 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationCoordinate;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IStationBasicService
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IStationBasicService
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -78,6 +85,15 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -78,6 +85,15 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
@Transactional
@Transactional
public
void
add
(
StationBasic
stationBasic
)
{
public
void
add
(
StationBasic
stationBasic
)
{
//平台增加场站
CompanyModel
companyModeldata
=
new
CompanyModel
();
companyModeldata
.
setCompanyName
(
stationBasic
.
getStationName
());
companyModeldata
.
setCompanyType
(
"company"
);
companyModeldata
.
setLevel
(
"station"
);
companyModeldata
.
setParentId
(
Long
.
valueOf
(
stationBasic
.
getArea
()));
companyModeldata
=
this
.
addCompanyModel
(
companyModeldata
);
//场站坐标信息
//场站坐标信息
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
...
@@ -88,7 +104,7 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -88,7 +104,7 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
//单位
//单位
companyModel
=
personBasicServiceImpl
.
getCompanyModel
(
Long
.
parseLong
(
stationBasic
.
getArea
()));
companyModel
=
personBasicServiceImpl
.
getCompanyModel
(
Long
.
parseLong
(
stationBasic
.
getArea
()));
stationBasic
.
setAreaName
(
companyModel
.
getCompanyName
());
stationBasic
.
setAreaName
(
companyModel
.
getCompanyName
());
stationBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
stationBasic
.
setProjectOrgCode
(
companyModel
data
.
getOrgCode
());
//场站基本信息
//场站基本信息
this
.
save
(
stationBasic
);
this
.
save
(
stationBasic
);
...
@@ -104,7 +120,49 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
...
@@ -104,7 +120,49 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
private
CompanyModel
addCompanyModel
(
CompanyModel
companyModel
)
{
FeignClientResult
<
CompanyModel
>
Model
=
Privilege
.
companyClient
.
create
(
companyModel
);
CompanyModel
user
=
new
CompanyModel
();
if
(!
ObjectUtils
.
isEmpty
(
Model
))
{
if
(
Model
.
getStatus
()==
200
){
user
=
Model
.
getResult
();
}
else
{
throw
new
RuntimeException
(
Model
.
getMessage
());
}
}
return
user
;
}
private
CompanyModel
updateCompanyModel
(
CompanyModel
companyModel
,
Long
sequenceNbr
)
{
FeignClientResult
<
CompanyModel
>
Model
=
Privilege
.
companyClient
.
update
(
companyModel
,
sequenceNbr
);
CompanyModel
user
=
new
CompanyModel
();
if
(!
ObjectUtils
.
isEmpty
(
Model
))
{
if
(
Model
.
getStatus
()==
200
){
user
=
Model
.
getResult
();
}
else
{
throw
new
RuntimeException
(
Model
.
getMessage
());
}
}
return
user
;
}
public
void
update
(
StationBasic
stationBasic
)
{
public
void
update
(
StationBasic
stationBasic
)
{
//平台增加场站
CompanyModel
companyModeldata
=
new
CompanyModel
();
companyModeldata
.
setCompanyName
(
stationBasic
.
getStationName
());
companyModeldata
.
setCompanyType
(
"company"
);
companyModeldata
.
setLevel
(
"station"
);
companyModeldata
.
setParentId
(
Long
.
valueOf
(
stationBasic
.
getArea
()));
companyModeldata
=
this
.
updateCompanyModel
(
companyModeldata
,);
//场站坐标信息
//场站坐标信息
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
list
=
stationBasic
.
getStationCoordinate
();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
List
<
StationCoordinate
>
listdate
=
new
ArrayList
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/resources/application.properties
View file @
daa85436
...
@@ -30,6 +30,8 @@ spring.liquibase.enabled=true
...
@@ -30,6 +30,8 @@ spring.liquibase.enabled=true
## eureka properties:
## eureka properties:
eureka.instance.prefer-ip-address
=
true
eureka.instance.ip-address
=
172.16.3.41
eureka.client.registry-fetch-interval-seconds
=
5
eureka.client.registry-fetch-interval-seconds
=
5
eureka.instance.health-check-url-path
=
/actuator/health
eureka.instance.health-check-url-path
=
/actuator/health
eureka.instance.lease-expiration-duration-in-seconds
=
10
eureka.instance.lease-expiration-duration-in-seconds
=
10
...
...
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