Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
Overview
Overview
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
huluobin
bailuntec-cost
Commits
a1f205b4
Commit
a1f205b4
authored
Oct 26, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取部门 序列化
parent
bdf1b53e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
124 deletions
+35
-124
DeparmentController.java
...blt/other/module/auth/controller/DeparmentController.java
+3
-3
GetDeparmentListService.java
...lt/other/module/auth/service/GetDeparmentListService.java
+3
-3
GetDeparmentListServiceImpl.java
...module/auth/service/impl/GetDeparmentListServiceImpl.java
+11
-26
DeparmentMsg.java
.../main/java/com/blt/other/module/auth/vo/DeparmentMsg.java
+0
-91
DepartmentMsg.java
...main/java/com/blt/other/module/auth/vo/DepartmentMsg.java
+17
-0
deploy-miniapp-prod.sh
bailuntec-cost-core/src/main/shell/deploy-miniapp-prod.sh
+1
-1
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/controller/DeparmentController.java
View file @
a1f205b4
package
com
.
blt
.
other
.
module
.
auth
.
controller
;
package
com
.
blt
.
other
.
module
.
auth
.
controller
;
import
com.blt.other.module.auth.service.GetDeparmentListService
;
import
com.blt.other.module.auth.vo.DeparmentMsg
;
import
com.blt.other.common.util.AxiosUtil
;
import
com.blt.other.common.util.AxiosUtil
;
import
com.blt.other.module.auth.service.GetDeparmentListService
;
import
com.blt.other.module.auth.vo.DepartmentMsg
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -19,7 +19,7 @@ public class DeparmentController {
...
@@ -19,7 +19,7 @@ public class DeparmentController {
private
GetDeparmentListService
getDeparmentListService
;
private
GetDeparmentListService
getDeparmentListService
;
@PostMapping
(
"/getDeparmentByName"
)
@PostMapping
(
"/getDeparmentByName"
)
public
DeparmentMsg
getDeparmentByName
(
HttpServletResponse
response
,
HttpServletRequest
request
)
{
public
Depar
t
mentMsg
getDeparmentByName
(
HttpServletResponse
response
,
HttpServletRequest
request
)
{
AxiosUtil
.
setCors
(
response
,
request
);
AxiosUtil
.
setCors
(
response
,
request
);
String
deparmentName
=
request
.
getParameter
(
"deparmentName"
);
String
deparmentName
=
request
.
getParameter
(
"deparmentName"
);
return
getDeparmentListService
.
getDeparment
(
deparmentName
);
return
getDeparmentListService
.
getDeparment
(
deparmentName
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/service/GetDeparmentListService.java
View file @
a1f205b4
package
com
.
blt
.
other
.
module
.
auth
.
service
;
package
com
.
blt
.
other
.
module
.
auth
.
service
;
import
com.blt.other.module.auth.vo.DeparmentMsg
;
import
com.blt.other.module.auth.vo.Depar
t
mentMsg
;
import
java.util.List
;
import
java.util.List
;
public
interface
GetDeparmentListService
{
public
interface
GetDeparmentListService
{
List
<
DeparmentMsg
>
getList
();
List
<
Depar
t
mentMsg
>
getList
();
DeparmentMsg
getDeparment
(
String
deparmentName
);
Depar
t
mentMsg
getDeparment
(
String
deparmentName
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/service/impl/GetDeparmentListServiceImpl.java
View file @
a1f205b4
package
com
.
blt
.
other
.
module
.
auth
.
service
.
impl
;
package
com
.
blt
.
other
.
module
.
auth
.
service
.
impl
;
import
com.bailuntec.common.JsonUtilByFsJson
;
import
com.blt.other.module.auth.service.GetDeparmentListService
;
import
com.blt.other.module.auth.service.GetDeparmentListService
;
import
com.blt.other.module.auth.vo.DeparmentMsg
;
import
com.blt.other.module.auth.vo.DepartmentMsg
;
import
com.fasterxml.jackson.databind.JavaType
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
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.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
java.io.IOException
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
...
@@ -28,29 +24,18 @@ public class GetDeparmentListServiceImpl implements GetDeparmentListService {
...
@@ -28,29 +24,18 @@ public class GetDeparmentListServiceImpl implements GetDeparmentListService {
private
String
getDeparmentListApi
;
private
String
getDeparmentListApi
;
@Override
@Override
public
List
<
DeparmentMsg
>
getList
()
{
public
List
<
DepartmentMsg
>
getList
()
{
ResponseEntity
<
String
>
forEntity
=
restTemplate
.
getForEntity
(
getDeparmentListApi
,
String
.
class
);
String
response
=
restTemplate
.
getForEntity
(
getDeparmentListApi
,
String
.
class
).
getBody
();
if
(
forEntity
.
getStatusCodeValue
()
==
200
){
return
JsonUtilByFsJson
.
jsonToList
(
response
,
DepartmentMsg
.
class
);
String
strBody
=
forEntity
.
getBody
();
ObjectMapper
mapper
=
new
ObjectMapper
();
JavaType
javaType
=
mapper
.
getTypeFactory
().
constructParametricType
(
Collection
.
class
,
DeparmentMsg
.
class
);
try
{
assert
strBody
!=
null
;
return
mapper
.
readValue
(
strBody
,
javaType
);
}
catch
(
IOException
e
)
{
logger
.
error
(
"GetDeparmentListServiceImpl"
,
e
);
}
}
return
null
;
}
}
@Override
@Override
public
DeparmentMsg
getDeparment
(
String
deparmentName
)
{
public
Depar
t
mentMsg
getDeparment
(
String
deparmentName
)
{
List
<
DeparmentMsg
>
list
=
getList
();
List
<
Depar
t
mentMsg
>
list
=
getList
();
if
(
null
!=
list
&&
list
.
size
()
>=
1
){
if
(
null
!=
list
&&
list
.
size
()
>=
1
)
{
for
(
Depar
mentMsg
deparmentMsg:
list
)
{
for
(
Depar
tmentMsg
departmentMsg
:
list
)
{
if
(
null
!=
deparmentName
&&
(
deparmentName
.
toLowerCase
()).
equals
((
depar
mentMsg
.
getName
()).
toLowerCase
()))
{
if
(
null
!=
deparmentName
&&
(
deparmentName
.
toLowerCase
()).
equals
((
depar
tmentMsg
.
getName
()).
toLowerCase
()))
{
return
deparmentMsg
;
return
depar
t
mentMsg
;
}
}
}
}
}
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/vo/DeparmentMsg.java
deleted
100644 → 0
View file @
bdf1b53e
package
com
.
blt
.
other
.
module
.
auth
.
vo
;
public
class
DeparmentMsg
{
private
Integer
companyId
;
private
String
name
;
private
String
code
;
private
Integer
parentId
;
private
Integer
sort
;
private
String
manageUser1
;
private
String
manageUser2
;
private
Integer
id
;
public
Integer
getCompanyId
()
{
return
companyId
;
}
public
void
setCompanyId
(
Integer
companyId
)
{
this
.
companyId
=
companyId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
public
String
getManageUser1
()
{
return
manageUser1
;
}
public
void
setManageUser1
(
String
manageUser1
)
{
this
.
manageUser1
=
manageUser1
;
}
public
String
getManageUser2
()
{
return
manageUser2
;
}
public
void
setManageUser2
(
String
manageUser2
)
{
this
.
manageUser2
=
manageUser2
;
}
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
@Override
public
String
toString
()
{
return
"DeparmentMsg{"
+
"companyId="
+
companyId
+
", name='"
+
name
+
'\''
+
", code='"
+
code
+
'\''
+
", parentId="
+
parentId
+
", sort="
+
sort
+
", manageUser1='"
+
manageUser1
+
'\''
+
", manageUser2='"
+
manageUser2
+
'\''
+
", id="
+
id
+
'}'
;
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/vo/DepartmentMsg.java
0 → 100644
View file @
a1f205b4
package
com
.
blt
.
other
.
module
.
auth
.
vo
;
import
lombok.Data
;
@Data
public
class
DepartmentMsg
{
private
Integer
companyId
;
private
String
name
;
private
String
code
;
private
Integer
parentId
;
private
Integer
sort
;
private
String
manageUser1
;
private
String
manageUser2
;
private
Integer
id
;
private
Integer
departmentId
;
}
bailuntec-cost-core/src/main/shell/deploy-miniapp-prod.sh
View file @
a1f205b4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
cd
/home/ubuntu/data/other/dc-cost-system/bailuntec-cost-core
cd
/home/ubuntu/data/other/dc-cost-system/bailuntec-cost-core
git pull
git pull
# 拉取开发分支代码
# 拉取开发分支代码
git checkout cost-check-flow
git checkout cost-check-flow
-master
#打包
#打包
mvn clean package
-Dmaven
.test.skip
=
true
-Dmaven
.compile.fork
=
true
mvn clean package
-Dmaven
.test.skip
=
true
-Dmaven
.compile.fork
=
true
# kill测试进程
# kill测试进程
...
...
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