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
a707d903
Commit
a707d903
authored
Dec 17, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
特殊部门审核
parent
0097d5ce
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
652 additions
and
23 deletions
+652
-23
IOaCompanyService.java
.../com/blt/other/module/auth/service/IOaCompanyService.java
+8
-0
OaCompanyServiceImpl.java
.../other/module/auth/service/impl/OaCompanyServiceImpl.java
+7
-3
SpecDepartmentCheckConfigController.java
.../cost/controller/SpecDepartmentCheckConfigController.java
+73
-0
SpecDepartmentCheckConfigMapper.java
...ther/module/cost/dao/SpecDepartmentCheckConfigMapper.java
+19
-0
BatchUpdateReviewerReq.java
...other/module/cost/dto/request/BatchUpdateReviewerReq.java
+24
-0
SpecDepartmentCheckAddReq.java
...er/module/cost/dto/request/SpecDepartmentCheckAddReq.java
+29
-0
SpecDepartmentCheckBaseQuery.java
...module/cost/dto/request/SpecDepartmentCheckBaseQuery.java
+37
-0
SpecDepartmentCheckExportExcelReq.java
...e/cost/dto/request/SpecDepartmentCheckExportExcelReq.java
+12
-0
SpecDepartmentCheckImportExcelReq.java
...e/cost/dto/request/SpecDepartmentCheckImportExcelReq.java
+19
-0
SpecDepartmentCheckQueryPageReq.java
...ule/cost/dto/request/SpecDepartmentCheckQueryPageReq.java
+25
-0
SpecDepartmentCheckConfig.java
...lt/other/module/cost/model/SpecDepartmentCheckConfig.java
+61
-0
CostCompanyService.java
...com/blt/other/module/cost/service/CostCompanyService.java
+9
-7
ISpecDepartmentCheckConfigService.java
...odule/cost/service/ISpecDepartmentCheckConfigService.java
+58
-0
CostCompanyServiceImpl.java
...ther/module/cost/service/impl/CostCompanyServiceImpl.java
+6
-12
SpecDepartmentCheckConfigServiceImpl.java
...st/service/impl/SpecDepartmentCheckConfigServiceImpl.java
+252
-0
application-prod.yml
bailuntec-cost-core/src/main/resources/application-prod.yml
+1
-1
CostCompanyMapper.xml
...cost-core/src/main/resources/mapper/CostCompanyMapper.xml
+1
-0
SpecDepartmentCheckConfigMapper.xml
...resources/mapper/cost/SpecDepartmentCheckConfigMapper.xml
+5
-0
SpecDepartmentCheckConfigMapper.xml
...es/mapper/module/cost/SpecDepartmentCheckConfigMapper.xml
+6
-0
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/service/IOaCompanyService.java
View file @
a707d903
...
@@ -6,6 +6,7 @@ import com.blt.other.module.auth.dto.request.CompanyReviewerListReq;
...
@@ -6,6 +6,7 @@ import com.blt.other.module.auth.dto.request.CompanyReviewerListReq;
import
com.blt.other.module.auth.model.OaCompany
;
import
com.blt.other.module.auth.model.OaCompany
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* <p>
* <p>
...
@@ -36,4 +37,11 @@ public interface IOaCompanyService extends IService<OaCompany> {
...
@@ -36,4 +37,11 @@ public interface IOaCompanyService extends IService<OaCompany> {
*/
*/
IPage
<
OaCompany
>
reviewerList
(
CompanyReviewerListReq
req
);
IPage
<
OaCompany
>
reviewerList
(
CompanyReviewerListReq
req
);
/**
* oa公司字典 缓存
*
* @return oa公司字典
*/
Map
<
String
,
OaCompany
>
companyDict
();
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/service/impl/OaCompanyServiceImpl.java
View file @
a707d903
...
@@ -7,16 +7,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -7,16 +7,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.module.auth.dao.CostReviewerMapper
;
import
com.blt.other.module.auth.dao.CostReviewerMapper
;
import
com.blt.other.module.auth.dao.OaCompanyMapper
;
import
com.blt.other.module.auth.dao.OaCompanyMapper
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.dto.request.CompanyReviewerListReq
;
import
com.blt.other.module.auth.dto.request.CompanyReviewerListReq
;
import
com.blt.other.module.auth.model.CostReviewer
;
import
com.blt.other.module.auth.model.CostReviewer
;
import
com.blt.other.module.auth.model.OaCompany
;
import
com.blt.other.module.auth.model.OaCompany
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.IOaCompanyService
;
import
com.blt.other.module.auth.service.IOaCompanyService
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -73,4 +71,10 @@ public class OaCompanyServiceImpl extends ServiceImpl<OaCompanyMapper, OaCompany
...
@@ -73,4 +71,10 @@ public class OaCompanyServiceImpl extends ServiceImpl<OaCompanyMapper, OaCompany
return
page
;
return
page
;
}
}
@Cacheable
(
"companyDict"
)
@Override
public
Map
<
String
,
OaCompany
>
companyDict
()
{
return
this
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
OaCompany:
:
getName
,
oaCompany
->
oaCompany
));
}
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/SpecDepartmentCheckConfigController.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
controller
;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.blt.other.module.cost.dto.request.*
;
import
com.blt.other.module.cost.model.SpecDepartmentCheckConfig
;
import
com.blt.other.module.cost.service.ISpecDepartmentCheckConfigService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* <p>
* 前端控制器
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
@Api
(
tags
=
"特殊审核人"
)
@RestController
@RequestMapping
(
"/specDepartmentCheckConfig"
)
public
class
SpecDepartmentCheckConfigController
{
@Resource
ISpecDepartmentCheckConfigService
specDepartmentCheckConfigService
;
@ApiOperation
(
"分页查询特殊审核人"
)
@PostMapping
(
"/queryPage"
)
public
CostResult
<
Page
<
SpecDepartmentCheckConfig
>>
queryPage
(
@RequestBody
SpecDepartmentCheckQueryPageReq
req
)
{
Page
<
SpecDepartmentCheckConfig
>
page
=
specDepartmentCheckConfigService
.
queryPage
(
req
);
return
CostResult
.
success
(
page
);
}
@ApiOperation
(
"批量设置特殊审核人"
)
@PostMapping
(
"/batchUpdateReviewer"
)
public
CostResult
<
Void
>
batchUpdateReviewer
(
@RequestBody
BatchUpdateReviewerReq
req
)
{
specDepartmentCheckConfigService
.
batchUpdateReviewer
(
req
);
return
CostResult
.
success
();
}
@ApiOperation
(
"新增特殊审核数据"
)
@PostMapping
(
"/add"
)
public
CostResult
<
Void
>
add
(
@RequestBody
SpecDepartmentCheckAddReq
req
)
{
specDepartmentCheckConfigService
.
add
(
req
);
return
CostResult
.
success
();
}
@ApiOperation
(
"批量导入数据"
)
@PostMapping
(
"/importExcel"
)
public
CostResult
<
Void
>
importExcel
(
SpecDepartmentCheckImportExcelReq
excel
)
throws
IOException
{
specDepartmentCheckConfigService
.
importExcel
(
excel
);
return
CostResult
.
success
();
}
@ApiOperation
(
"导出excel"
)
@PostMapping
(
"/importExcel"
)
public
CostResult
<
Void
>
exportExcel
(
HttpServletResponse
response
,
@RequestBody
SpecDepartmentCheckExportExcelReq
req
)
throws
IOException
{
specDepartmentCheckConfigService
.
exportExcel
(
response
,
req
);
return
CostResult
.
success
();
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dao/SpecDepartmentCheckConfigMapper.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
dao
;
import
com.blt.other.module.cost.dto.request.SpecDepartmentCheckExportExcelReq
;
import
com.blt.other.module.cost.model.SpecDepartmentCheckConfig
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
public
interface
SpecDepartmentCheckConfigMapper
extends
BaseMapper
<
SpecDepartmentCheckConfig
>
{
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/BatchUpdateReviewerReq.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:23 上午
*/
@Data
public
class
BatchUpdateReviewerReq
{
@ApiModelProperty
(
"特殊配置id list"
)
private
List
<
Integer
>
idList
;
@ApiModelProperty
(
"更新人"
)
private
Integer
updateUserId
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/SpecDepartmentCheckAddReq.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:28 上午
*/
@Data
public
class
SpecDepartmentCheckAddReq
{
@ApiModelProperty
(
value
=
"付款财务主体id"
)
private
Integer
costCompanyId
;
@ApiModelProperty
(
value
=
"申请人oa公司id"
)
private
Integer
oaCompanyId
;
@ApiModelProperty
(
value
=
"特殊审核人oa用户id"
)
private
Integer
reviewerUserId
;
@ApiModelProperty
(
value
=
"修改人id"
)
private
Integer
updateUserId
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/SpecDepartmentCheckBaseQuery.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 11:34 上午
*/
@Data
public
class
SpecDepartmentCheckBaseQuery
{
@ApiModelProperty
(
value
=
"付款财务主体id"
)
private
Integer
costCompanyId
;
@ApiModelProperty
(
value
=
"申请人oa公司id"
)
private
Integer
oaCompanyId
;
@ApiModelProperty
(
value
=
"特殊审核人oa用户id"
)
private
Integer
reviewerUserId
;
@ApiModelProperty
(
value
=
"修改时间开始"
)
private
LocalDateTime
lastUpdateTimeStart
;
@ApiModelProperty
(
value
=
"修改时间开始结束"
)
private
LocalDateTime
lastUpdateTimeStartEnd
;
@ApiModelProperty
(
value
=
"修改人"
)
private
Integer
updateUserId
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/SpecDepartmentCheckExportExcelReq.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:31 上午
*/
public
class
SpecDepartmentCheckExportExcelReq
extends
SpecDepartmentCheckBaseQuery
{
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/SpecDepartmentCheckImportExcelReq.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
lombok.Data
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:31 上午
*/
@Data
public
class
SpecDepartmentCheckImportExcelReq
{
private
MultipartFile
multipartFile
;
private
Integer
currentUserId
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/SpecDepartmentCheckQueryPageReq.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:19 上午
*/
@Data
public
class
SpecDepartmentCheckQueryPageReq
extends
SpecDepartmentCheckBaseQuery
{
private
Integer
pageNum
;
private
Integer
pageSize
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/SpecDepartmentCheckConfig.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"SpecDepartmentCheckConfig对象"
,
description
=
""
)
public
class
SpecDepartmentCheckConfig
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"付款财务主体id"
)
private
Integer
costCompanyId
;
@ApiModelProperty
(
value
=
"付款财务主体"
)
private
String
costCompanyName
;
@ApiModelProperty
(
value
=
"申请人oa公司id"
)
private
Integer
oaCompanyId
;
@ApiModelProperty
(
value
=
"申请人oa公司"
)
private
String
oaCompany
;
@ApiModelProperty
(
value
=
"特殊审核人oa用户id"
)
private
Integer
reviewerUserId
;
@ApiModelProperty
(
value
=
"特殊审核人"
)
private
String
reviewerUser
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
lastUpdateTime
;
@ApiModelProperty
(
value
=
"修改人id"
)
private
Integer
updateUserId
;
@ApiModelProperty
(
value
=
"修改人"
)
private
String
updateUserName
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/CostCompanyService.java
View file @
a707d903
...
@@ -6,6 +6,7 @@ import com.blt.other.module.auth.dto.request.CompanyReviewerListReq;
...
@@ -6,6 +6,7 @@ import com.blt.other.module.auth.dto.request.CompanyReviewerListReq;
import
com.blt.other.module.database.model.CostCompanyDomain
;
import
com.blt.other.module.database.model.CostCompanyDomain
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
CostCompanyService
extends
IService
<
CostCompanyDomain
>
{
public
interface
CostCompanyService
extends
IService
<
CostCompanyDomain
>
{
...
@@ -26,13 +27,6 @@ public interface CostCompanyService extends IService<CostCompanyDomain> {
...
@@ -26,13 +27,6 @@ public interface CostCompanyService extends IService<CostCompanyDomain> {
List
<
CostCompanyDomain
>
getAllCompanyAuthority
();
List
<
CostCompanyDomain
>
getAllCompanyAuthority
();
/**
* 根据 companyNo 获取付款主体
*
* @param companyNo
* @return
*/
CostCompanyDomain
getCompanyByCompanyNo
(
String
companyNo
);
/**
/**
* <p>
* <p>
...
@@ -77,4 +71,12 @@ public interface CostCompanyService extends IService<CostCompanyDomain> {
...
@@ -77,4 +71,12 @@ public interface CostCompanyService extends IService<CostCompanyDomain> {
* @param hrReviewerUserIdList 财务审核核人oa userid
* @param hrReviewerUserIdList 财务审核核人oa userid
*/
*/
void
modifyHrReviewer
(
Integer
userId
,
List
<
String
>
companyNoList
,
List
<
Integer
>
hrReviewerUserIdList
);
void
modifyHrReviewer
(
Integer
userId
,
List
<
String
>
companyNoList
,
List
<
Integer
>
hrReviewerUserIdList
);
/**
* 财务主体字典 缓存
*
* @return 财务主体字典
*/
Map
<
String
,
CostCompanyDomain
>
costCompanyMap
();
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/ISpecDepartmentCheckConfigService.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.blt.other.module.cost.dto.request.*
;
import
com.blt.other.module.cost.model.SpecDepartmentCheckConfig
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
/**
* <p>
* 服务类
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
public
interface
ISpecDepartmentCheckConfigService
extends
IService
<
SpecDepartmentCheckConfig
>
{
/**
* 分页查询特殊审核人
*
* @param req req
* @return res
*/
Page
<
SpecDepartmentCheckConfig
>
queryPage
(
SpecDepartmentCheckQueryPageReq
req
);
/**
* 批量设置特殊审核人
*
* @param req req
*/
void
batchUpdateReviewer
(
BatchUpdateReviewerReq
req
);
/**
* 新增特殊审核数据
*
* @param req req
*/
void
add
(
SpecDepartmentCheckAddReq
req
);
/**
* importExcel
*
* @param req req
*/
void
importExcel
(
SpecDepartmentCheckImportExcelReq
req
)
throws
IOException
;
/**
* 导出excel
*
* @param response response
* @param req req
*/
void
exportExcel
(
HttpServletResponse
response
,
SpecDepartmentCheckExportExcelReq
req
)
throws
IOException
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/CostCompanyServiceImpl.java
View file @
a707d903
...
@@ -18,8 +18,8 @@ import com.blt.other.module.database.model.CostCompanyDomain;
...
@@ -18,8 +18,8 @@ import com.blt.other.module.database.model.CostCompanyDomain;
import
com.blt.other.module.purchasing.vo.CompanyVo
;
import
com.blt.other.module.purchasing.vo.CompanyVo
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
springfox.documentation.annotations.Cacheable
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -88,17 +88,6 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp
...
@@ -88,17 +88,6 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp
return
costCompanyDao
.
getAllCompanyAuthority
();
return
costCompanyDao
.
getAllCompanyAuthority
();
}
}
/**
* 根据 companyNo 获取 company
*
* @param companyNo
* @return
*/
@Override
public
CostCompanyDomain
getCompanyByCompanyNo
(
String
companyNo
)
{
return
costCompanyDao
.
selectByNo
(
companyNo
);
}
@Override
@Override
public
IPage
<
CostCompanyDomain
>
reviewerList
(
CompanyReviewerListReq
req
)
{
public
IPage
<
CostCompanyDomain
>
reviewerList
(
CompanyReviewerListReq
req
)
{
...
@@ -241,6 +230,11 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp
...
@@ -241,6 +230,11 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp
});
});
}
}
@Cacheable
(
"costCompanyMap"
)
@Override
public
Map
<
String
,
CostCompanyDomain
>
costCompanyMap
()
{
return
this
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
CostCompanyDomain:
:
getCompanyName
,
costCompanyDomain
->
costCompanyDomain
));
}
/**
/**
* 生成唯一的主体编号
* 生成唯一的主体编号
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/SpecDepartmentCheckConfigServiceImpl.java
0 → 100644
View file @
a707d903
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.IOaCompanyService
;
import
com.blt.other.module.cost.dao.SpecDepartmentCheckConfigMapper
;
import
com.blt.other.module.cost.dto.request.*
;
import
com.blt.other.module.cost.model.SpecDepartmentCheckConfig
;
import
com.blt.other.module.cost.service.CostCompanyService
;
import
com.blt.other.module.cost.service.ISpecDepartmentCheckConfigService
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
* 服务实现类
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
@Service
public
class
SpecDepartmentCheckConfigServiceImpl
extends
ServiceImpl
<
SpecDepartmentCheckConfigMapper
,
SpecDepartmentCheckConfig
>
implements
ISpecDepartmentCheckConfigService
{
@Resource
OaUserMapper
oaUserMapper
;
@Resource
private
CostCompanyService
costCompanyService
;
@Resource
private
IOaCompanyService
oaCompanyService
;
private
<
T
extends
SpecDepartmentCheckBaseQuery
>
LambdaQueryWrapper
<
SpecDepartmentCheckConfig
>
buildQueryWrapper
(
T
req
)
{
LambdaQueryWrapper
<
SpecDepartmentCheckConfig
>
wrapper
=
new
LambdaQueryWrapper
<>();
if
(
req
.
getCostCompanyId
()
!=
null
)
{
wrapper
.
eq
(
SpecDepartmentCheckConfig:
:
getCostCompanyId
,
req
.
getCostCompanyId
());
}
if
(
req
.
getOaCompanyId
()
!=
null
)
{
wrapper
.
eq
(
SpecDepartmentCheckConfig:
:
getOaCompanyId
,
req
.
getOaCompanyId
());
}
if
(
req
.
getReviewerUserId
()
!=
null
)
{
wrapper
.
eq
(
SpecDepartmentCheckConfig:
:
getReviewerUserId
,
req
.
getReviewerUserId
());
}
if
(
req
.
getUpdateUserId
()
!=
null
)
{
wrapper
.
eq
(
SpecDepartmentCheckConfig:
:
getUpdateUserId
,
req
.
getUpdateUserId
());
}
if
(
req
.
getLastUpdateTimeStart
()
!=
null
)
{
wrapper
.
ge
(
SpecDepartmentCheckConfig:
:
getLastUpdateTime
,
req
.
getLastUpdateTimeStart
());
}
if
(
req
.
getLastUpdateTimeStartEnd
()
!=
null
)
{
wrapper
.
le
(
SpecDepartmentCheckConfig:
:
getLastUpdateTime
,
req
.
getLastUpdateTimeStartEnd
());
}
return
wrapper
;
}
@Override
public
Page
<
SpecDepartmentCheckConfig
>
queryPage
(
SpecDepartmentCheckQueryPageReq
req
)
{
IPage
<
SpecDepartmentCheckConfig
>
page
=
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
());
return
(
Page
<
SpecDepartmentCheckConfig
>)
baseMapper
.
selectPage
(
page
,
this
.
buildQueryWrapper
(
req
));
}
@Override
public
void
batchUpdateReviewer
(
BatchUpdateReviewerReq
req
)
{
OaUser
oaUser
=
oaUserMapper
.
selectByOaUserId
(
req
.
getUpdateUserId
());
List
<
SpecDepartmentCheckConfig
>
specDepartmentCheckConfigList
=
this
.
listByIds
(
req
.
getIdList
());
specDepartmentCheckConfigList
.
forEach
(
specDepartmentCheckConfig
->
{
specDepartmentCheckConfig
.
setLastUpdateTime
(
LocalDateTime
.
now
());
specDepartmentCheckConfig
.
setUpdateUserId
(
req
.
getUpdateUserId
());
specDepartmentCheckConfig
.
setUpdateUserName
(
oaUser
.
getUserName
());
});
}
@Override
public
void
add
(
SpecDepartmentCheckAddReq
req
)
{
SpecDepartmentCheckConfig
specDepartmentCheckConfig
=
new
SpecDepartmentCheckConfig
();
specDepartmentCheckConfig
.
setReviewerUserId
(
req
.
getReviewerUserId
());
specDepartmentCheckConfig
.
setReviewerUser
(
oaUserMapper
.
selectByOaUserId
(
req
.
getReviewerUserId
()).
getUserName
());
specDepartmentCheckConfig
.
setOaCompanyId
(
req
.
getOaCompanyId
());
specDepartmentCheckConfig
.
setOaCompany
(
oaCompanyService
.
getById
(
req
.
getOaCompanyId
()).
getName
());
specDepartmentCheckConfig
.
setCostCompanyId
(
req
.
getCostCompanyId
());
specDepartmentCheckConfig
.
setOaCompany
(
costCompanyService
.
getById
(
req
.
getCostCompanyId
()).
getCompanyName
());
specDepartmentCheckConfig
.
setUpdateUserId
(
req
.
getUpdateUserId
());
specDepartmentCheckConfig
.
setUpdateUserName
(
oaUserMapper
.
selectByOaUserId
(
req
.
getUpdateUserId
()).
getUserName
());
specDepartmentCheckConfig
.
setLastUpdateTime
(
LocalDateTime
.
now
());
this
.
save
(
specDepartmentCheckConfig
);
}
@Override
public
void
importExcel
(
SpecDepartmentCheckImportExcelReq
req
)
throws
IOException
{
SpecDepartmentCheckConfigExcelItemListener
listener
=
new
SpecDepartmentCheckConfigExcelItemListener
(
this
,
costCompanyService
,
oaCompanyService
,
oaUserMapper
,
req
.
getCurrentUserId
());
EasyExcel
.
read
(
req
.
getMultipartFile
().
getInputStream
(),
SpecDepartmentCheckConfigImportExcelItem
.
class
,
listener
).
sheet
().
doRead
();
}
@Override
public
void
exportExcel
(
HttpServletResponse
response
,
SpecDepartmentCheckExportExcelReq
req
)
throws
IOException
{
response
.
setContentType
(
"application/vnd.ms-excel"
);
response
.
setCharacterEncoding
(
"utf-8"
);
String
fileName
=
URLEncoder
.
encode
(
"模版"
,
"UTF-8"
);
response
.
setHeader
(
"Content-disposition"
,
"attachment;filename="
+
fileName
+
".xlsx"
);
List
<
SpecDepartmentCheckConfigExportExcelItem
>
aiList
=
baseMapper
.
selectList
(
this
.
buildQueryWrapper
(
req
)).
stream
()
.
map
(
specDepartmentCheckConfig
->
{
SpecDepartmentCheckConfigExportExcelItem
item
=
new
SpecDepartmentCheckConfigExportExcelItem
();
item
.
setCostCompanyName
(
specDepartmentCheckConfig
.
getCostCompanyName
());
item
.
setOaCompany
(
specDepartmentCheckConfig
.
getOaCompany
());
item
.
setReviewerUser
(
specDepartmentCheckConfig
.
getReviewerUser
());
return
item
;
})
.
collect
(
Collectors
.
toList
());
EasyExcel
.
write
(
response
.
getOutputStream
(),
SpecDepartmentCheckConfigExportExcelItem
.
class
).
sheet
(
"sheet"
).
doWrite
(
aiList
);
}
@Data
static
class
SpecDepartmentCheckConfigExportExcelItem
{
@ExcelProperty
(
"付款财务主体"
)
@ApiModelProperty
(
value
=
"付款财务主体"
)
private
String
costCompanyName
;
@ExcelProperty
(
"申请人oa公司"
)
@ApiModelProperty
(
value
=
"申请人oa公司"
)
private
String
oaCompany
;
@ExcelProperty
(
"特殊审核人"
)
@ApiModelProperty
(
value
=
"特殊审核人"
)
private
String
reviewerUser
;
}
@Data
static
class
SpecDepartmentCheckConfigImportExcelItem
{
@ExcelProperty
(
"付款财务主体"
)
@ApiModelProperty
(
value
=
"付款财务主体"
)
private
String
costCompanyName
;
@ExcelProperty
(
"申请人oa公司"
)
@ApiModelProperty
(
value
=
"申请人oa公司"
)
private
String
oaCompany
;
@ExcelProperty
(
"特殊审核人"
)
@ApiModelProperty
(
value
=
"特殊审核人"
)
private
String
reviewerUser
;
}
static
class
SpecDepartmentCheckConfigExcelItemListener
extends
AnalysisEventListener
<
SpecDepartmentCheckConfigImportExcelItem
>
{
private
final
ISpecDepartmentCheckConfigService
specDepartmentCheckConfigService
;
private
final
CostCompanyService
costCompanyService
;
private
final
IOaCompanyService
oaCompanyService
;
private
final
OaUserMapper
oaUserMapper
;
private
final
Integer
currnetUserId
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
SpecDepartmentCheckConfigExcelItemListener
.
class
);
SpecDepartmentCheckConfigExcelItemListener
(
ISpecDepartmentCheckConfigService
specDepartmentCheckConfigService
,
CostCompanyService
costCompanyService
,
IOaCompanyService
oaCompanyService
,
OaUserMapper
oaUserMapper
,
Integer
currentUserId
)
{
this
.
specDepartmentCheckConfigService
=
specDepartmentCheckConfigService
;
this
.
costCompanyService
=
costCompanyService
;
this
.
oaCompanyService
=
oaCompanyService
;
this
.
oaUserMapper
=
oaUserMapper
;
this
.
currnetUserId
=
currentUserId
;
}
private
static
final
int
BATCH_COUNT
=
2000
;
List
<
SpecDepartmentCheckConfigImportExcelItem
>
list
=
new
ArrayList
<>();
@Override
public
void
invoke
(
SpecDepartmentCheckConfigImportExcelItem
data
,
AnalysisContext
context
)
{
LOGGER
.
info
(
"解析到一条数据:{}"
,
JSON
.
toJSONString
(
data
));
list
.
add
(
data
);
if
(
list
.
size
()
>=
BATCH_COUNT
)
{
syncData
();
list
.
clear
();
}
}
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
syncData
();
LOGGER
.
info
(
"所有数据解析完成!"
);
}
private
void
syncData
()
{
LOGGER
.
info
(
"{}条数据,开始存储数据库!"
,
list
.
size
());
List
<
SpecDepartmentCheckConfig
>
specDepartmentCheckConfigList
=
list
.
stream
()
.
map
(
specDepartmentCheckConfigImportExcelItem
->
{
SpecDepartmentCheckConfig
specDepartmentCheckConfig
=
new
SpecDepartmentCheckConfig
();
specDepartmentCheckConfig
.
setCostCompanyName
(
specDepartmentCheckConfigImportExcelItem
.
getCostCompanyName
());
specDepartmentCheckConfig
.
setCostCompanyId
(
costCompanyService
.
costCompanyMap
().
get
(
specDepartmentCheckConfigImportExcelItem
.
getCostCompanyName
()).
getId
());
specDepartmentCheckConfig
.
setOaCompany
(
specDepartmentCheckConfig
.
getOaCompany
());
specDepartmentCheckConfig
.
setOaCompanyId
(
oaCompanyService
.
companyDict
().
get
(
specDepartmentCheckConfigImportExcelItem
.
getOaCompany
()).
getOaCompanyId
());
specDepartmentCheckConfig
.
setReviewerUser
(
specDepartmentCheckConfigImportExcelItem
.
getReviewerUser
());
specDepartmentCheckConfig
.
setReviewerUserId
(
oaUserMapper
.
selectByUserName
(
specDepartmentCheckConfigImportExcelItem
.
getReviewerUser
()).
getOaUserId
());
specDepartmentCheckConfig
.
setReviewerUserId
(
currnetUserId
);
specDepartmentCheckConfig
.
setReviewerUser
(
oaUserMapper
.
selectById
(
currnetUserId
).
getUserName
());
specDepartmentCheckConfig
.
setLastUpdateTime
(
LocalDateTime
.
now
());
return
specDepartmentCheckConfig
;
})
.
filter
(
specDepartmentCheckConfig
->
specDepartmentCheckConfig
.
getCostCompanyId
()
!=
null
)
.
filter
(
specDepartmentCheckConfig
->
specDepartmentCheckConfig
.
getOaCompanyId
()
!=
null
)
.
filter
(
specDepartmentCheckConfig
->
specDepartmentCheckConfig
.
getReviewerUserId
()
!=
null
)
.
collect
(
Collectors
.
toList
());
specDepartmentCheckConfigService
.
saveBatch
(
specDepartmentCheckConfigList
);
LOGGER
.
info
(
"存储数据库成功!"
);
}
}
}
bailuntec-cost-core/src/main/resources/application-prod.yml
View file @
a707d903
...
@@ -3,7 +3,7 @@ spring:
...
@@ -3,7 +3,7 @@ spring:
datasource
:
datasource
:
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
# url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false
# url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url
:
jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
url
:
jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
&rewriteBatchedStatements=true
username
:
root
username
:
root
password
:
"
#7kfnymAM$Y9-Ntf"
password
:
"
#7kfnymAM$Y9-Ntf"
hikari
:
hikari
:
...
...
bailuntec-cost-core/src/main/resources/mapper/CostCompanyMapper.xml
View file @
a707d903
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
FROM cost_company
FROM cost_company
</select>
</select>
<select
id=
"getAllCompanyAuthority"
resultType=
"com.blt.other.module.database.model.CostCompanyDomain"
>
<select
id=
"getAllCompanyAuthority"
resultType=
"com.blt.other.module.database.model.CostCompanyDomain"
>
SELECT value as id,
SELECT value as id,
company_name,
company_name,
...
...
bailuntec-cost-core/src/main/resources/mapper/cost/SpecDepartmentCheckConfigMapper.xml
0 → 100644
View file @
a707d903
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.blt.other.cost.dao.SpecDepartmentCheckConfigMapper"
>
</mapper>
bailuntec-cost-core/src/main/resources/mapper/module/cost/SpecDepartmentCheckConfigMapper.xml
0 → 100644
View file @
a707d903
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.blt.other.module.cost.dao.SpecDepartmentCheckConfigMapper"
>
<select
id=
"exportExcel"
resultType=
"com.blt.other.module.cost.model.SpecDepartmentCheckConfig"
></select>
</mapper>
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