Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
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
bltdc
dc-cost-system
Commits
0de2e153
Commit
0de2e153
authored
Jan 09, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4fad407c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
11 deletions
+50
-11
SessionUtils.java
...src/main/java/com/blt/other/common/util/SessionUtils.java
+9
-4
DepartmentReviewerListItem.java
...r/module/sys/dto/response/DepartmentReviewerListItem.java
+19
-1
DepartmentReviewerServiceImpl.java
...odule/sys/service/impl/DepartmentReviewerServiceImpl.java
+1
-0
application-dev.yml
bailuntec-cost-core/src/main/resources/application-dev.yml
+5
-5
OtherApplicationTests.java
...re/src/test/java/com/blt/other/OtherApplicationTests.java
+16
-1
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/common/util/SessionUtils.java
View file @
0de2e153
...
...
@@ -3,8 +3,6 @@ package com.blt.other.common.util;
import
com.blt.other.common.base.SysUser
;
import
java.util.Optional
;
/**
* 应用会话管理工具类
*/
...
...
@@ -20,7 +18,14 @@ public class SessionUtils {
}
public
static
SysUser
getSysUser
()
{
return
sysUserThreadLocal
.
get
();
SysUser
sysUser
=
sysUserThreadLocal
.
get
();
if
(
sysUser
==
null
)
{
SysUser
defaultSysUser
=
new
SysUser
();
defaultSysUser
.
setOaUserId
(
0
);
defaultSysUser
.
setUserName
(
"sys"
);
return
defaultSysUser
;
}
return
sysUser
;
}
public
static
void
removeSysUser
()
{
...
...
@@ -30,7 +35,7 @@ public class SessionUtils {
public
static
Integer
getCurrentUserId
()
{
return
Optional
.
ofNullable
(
sysUserThreadLocal
.
get
()).
map
(
SysUser:
:
getOaUserId
).
orElse
(
null
);
return
getSysUser
().
getOaUserId
(
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/sys/dto/response/DepartmentReviewerListItem.java
View file @
0de2e153
package
com
.
blt
.
other
.
module
.
sys
.
dto
.
response
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
...
...
@@ -24,42 +26,58 @@ import java.util.List;
public
class
DepartmentReviewerListItem
{
@ExcelIgnore
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"一级部门id"
)
private
Integer
primaryDepartmentId
;
@ApiModelProperty
(
value
=
"一级部门"
)
@ExcelProperty
(
value
=
"一级部门"
)
private
String
primaryDepartmentName
;
@ApiModelProperty
(
value
=
"二级部门id"
)
@ExcelIgnore
@ExcelProperty
(
value
=
"二级部门id"
)
private
Integer
secondDepartmentId
;
@ApiModelProperty
(
value
=
"二级部门"
)
@ExcelProperty
(
value
=
"二级部门"
)
private
String
secondDepartmentName
;
@ApiModelProperty
(
value
=
"自动审核金额"
)
@ExcelProperty
(
value
=
"自动审核金额"
)
private
BigDecimal
autoReviewAmount
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ExcelIgnore
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ExcelIgnore
@ApiModelProperty
(
value
=
"最近一次更新时间"
)
private
LocalDateTime
lastUpdateTime
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"更新人id"
)
private
Integer
updateUserId
;
@ExcelIgnore
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateUserName
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"公司"
)
@ExcelProperty
(
value
=
"公司"
)
private
String
companyName
;
@TableField
(
exist
=
false
)
@ExcelIgnore
private
List
<
CostReviewer
>
costReviewerList
;
@TableField
(
exist
=
false
)
@ExcelProperty
(
value
=
"审核人"
)
private
String
costReviewerNames
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/sys/service/impl/DepartmentReviewerServiceImpl.java
View file @
0de2e153
...
...
@@ -110,6 +110,7 @@ public class DepartmentReviewerServiceImpl extends ServiceImpl<DepartmentReviewe
departmentReviewer
.
setSecondDepartmentName
(
secondDepartment
.
getName
());
departmentReviewer
.
setUpdateUserId
(
SessionUtils
.
getCurrentUserId
());
departmentReviewer
.
setUpdateUserName
(
SessionUtils
.
getSysUser
().
getUserName
());
...
...
bailuntec-cost-core/src/main/resources/application-dev.yml
View file @
0de2e153
...
...
@@ -2,12 +2,12 @@ spring:
# 数据源配置
datasource
:
driver-class-name
:
com.mysql.jdbc.Driver
# url: jdbc:mysql://cdb-aanqm573.gz.tencentcdb.com:10120/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
# username: root
# password: 'Aarob2020#'
url
:
jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true
url
:
jdbc:mysql://cdb-aanqm573.gz.tencentcdb.com:10120/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
username
:
root
password
:
"
#7kfnymAM$Y9-Ntf"
password
:
'
Aarob2020#'
# url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true
# username: root
# password: "#7kfnymAM$Y9-Ntf"
hikari
:
maximum-pool-size
:
200
minimum-idle
:
10
...
...
bailuntec-cost-core/src/test/java/com/blt/other/OtherApplicationTests.java
View file @
0de2e153
...
...
@@ -26,6 +26,8 @@ import com.blt.other.module.cost.model.CostCurrentReviewer;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.sys.dao.CostReviewerMapper
;
import
com.blt.other.module.sys.dao.DepartmentReviewerMapper
;
import
com.blt.other.module.sys.dto.request.DepartmentReviewerListReq
;
import
com.blt.other.module.sys.dto.response.DepartmentReviewerListItem
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.blt.other.module.sys.model.DepartmentReviewer
;
import
com.blt.other.module.sys.service.IDepartmentReviewerService
;
...
...
@@ -52,7 +54,7 @@ import java.util.stream.Collectors;
@Transactional
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
OtherApplication
.
class
)
@ActiveProfiles
(
"
prod
"
)
@ActiveProfiles
(
"
test
"
)
public
class
OtherApplicationTests
{
@Autowired
...
...
@@ -408,5 +410,18 @@ public class OtherApplicationTests {
}
@Test
public
void
exportDepartmentReviewer
()
{
DepartmentReviewerListReq
req
=
new
DepartmentReviewerListReq
();
req
.
setPageNum
(
1
);
req
.
setPageSize
(
100
);
List
<
DepartmentReviewerListItem
>
list
=
departmentReviewerService
.
departmentReviewerList
(
req
).
getRecords
();
list
.
forEach
(
item
->
item
.
setCostReviewerNames
(
item
.
getCostReviewerList
().
stream
().
map
(
CostReviewer:
:
getReviewerUserName
).
collect
(
Collectors
.
joining
(
","
))));
EasyExcel
.
write
(
"/Users/huluobin/exportDepartmentReviewer.xlsx"
,
DepartmentReviewerListItem
.
class
).
sheet
(
"sheet"
).
doWrite
(
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