Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
50494e7b
Commit
50494e7b
authored
Mar 19, 2020
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
换流站修改bug
parent
2448ffd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
2 deletions
+54
-2
BasicEntity.java
...ain/java/com/yeejoin/amos/fas/dao/entity/BasicEntity.java
+1
-1
CommonController.java
...eejoin/amos/fas/business/controller/CommonController.java
+53
-1
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/BasicEntity.java
View file @
50494e7b
...
@@ -38,7 +38,7 @@ public class BasicEntity /*extends Resource*/ implements Serializable{
...
@@ -38,7 +38,7 @@ public class BasicEntity /*extends Resource*/ implements Serializable{
private
Date
createDate
=
new
Date
();
private
Date
createDate
=
new
Date
();
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"ID"
,
nullable
=
false
,
unique
=
true
)
@Column
(
name
=
"ID"
,
nullable
=
false
,
unique
=
true
)
public
long
getId
()
{
public
long
getId
()
{
return
id
;
return
id
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/CommonController.java
View file @
50494e7b
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.fas.business.param.PointListParam
;
import
com.yeejoin.amos.fas.business.param.PointListParam
;
import
com.yeejoin.amos.fas.business.param.QueryParamUtil
;
import
com.yeejoin.amos.fas.business.param.QueryParamUtil
;
import
com.yeejoin.amos.fas.business.service.intfc.ICommonService
;
import
com.yeejoin.amos.fas.business.service.intfc.ICommonService
;
...
@@ -16,11 +18,13 @@ import io.swagger.annotations.ApiParam;
...
@@ -16,11 +18,13 @@ import io.swagger.annotations.ApiParam;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanMap
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RestController
@RequestMapping
(
value
=
"/api/common"
)
@RequestMapping
(
value
=
"/api/common"
)
...
@@ -47,9 +51,57 @@ public class CommonController extends BaseController {
...
@@ -47,9 +51,57 @@ public class CommonController extends BaseController {
return
CommonResponseUtil
.
failure
(
"公司信息获取失败!"
);
return
CommonResponseUtil
.
failure
(
"公司信息获取失败!"
);
}
}
List
<
DepartmentModel
>
deps
=
commonService
.
getDepartment
(
getToken
(),
getProduct
(),
getAppKey
(),
companyId
);
List
<
DepartmentModel
>
deps
=
commonService
.
getDepartment
(
getToken
(),
getProduct
(),
getAppKey
(),
companyId
);
return
CommonResponseUtil
.
success
(
deps
);
return
CommonResponseUtil
.
success
(
objectsToMaps
(
deps
));
}
}
public
static
<
T
>
Map
<
String
,
Object
>
beanToMap
(
T
bean
)
{
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
if
(
bean
!=
null
)
{
BeanMap
beanMap
=
BeanMap
.
create
(
bean
);
for
(
Object
key
:
beanMap
.
keySet
())
{
if
(
"sequenceNbr"
.
equals
(
key
+
""
)){
map
.
put
(
key
+
""
,
beanMap
.
get
(
key
)+
""
);
}
else
{
map
.
put
(
key
+
""
,
beanMap
.
get
(
key
));
}
}
}
return
map
;
}
public
static
<
T
>
List
<
Map
<
String
,
Object
>>
objectsToMaps
(
List
<
T
>
objList
)
{
List
<
Map
<
String
,
Object
>>
list
=
Lists
.
newArrayList
();
if
(
objList
!=
null
&&
objList
.
size
()
>
0
)
{
Map
<
String
,
Object
>
map
=
null
;
T
bean
=
null
;
for
(
int
i
=
0
,
size
=
objList
.
size
();
i
<
size
;
i
++)
{
bean
=
objList
.
get
(
i
);
map
=
beanToMap
(
bean
);
list
.
add
(
map
);
}
}
return
list
;
}
/**
/**
* 查询巡检点信息
* 查询巡检点信息
*
*
...
...
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