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
1586e07d
Commit
1586e07d
authored
Aug 23, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加审批历史
parent
d0665a59
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
185 additions
and
4 deletions
+185
-4
ApprovalHistoryMapper.java
.../com/blt/other/module/cost/dao/ApprovalHistoryMapper.java
+13
-0
ApprovalHistoryDomain.java
...om/blt/other/module/cost/model/ApprovalHistoryDomain.java
+47
-0
ApprovalHistoryService.java
...blt/other/module/cost/service/ApprovalHistoryService.java
+14
-0
ApprovalHistoryServiceImpl.java
.../module/cost/service/impl/ApprovalHistoryServiceImpl.java
+17
-0
DepartmentCheckState.java
...ule/cost/service/impl/costcheck/DepartmentCheckState.java
+22
-1
FinalCheckState.java
...r/module/cost/service/impl/costcheck/FinalCheckState.java
+20
-1
FinancialCheckState.java
...dule/cost/service/impl/costcheck/FinancialCheckState.java
+20
-1
HrCheckState.java
...ther/module/cost/service/impl/costcheck/HrCheckState.java
+20
-1
ApprovalHistoryMapper.xml
...rvice/src/main/resources/mapper/ApprovalHistoryMapper.xml
+12
-0
ApprovalHistoryService.xml
...src/main/resources/mapper/cost/ApprovalHistoryService.xml
+0
-0
No files found.
cost-service/src/main/java/com/blt/other/module/cost/dao/ApprovalHistoryMapper.java
0 → 100644
View file @
1586e07d
package
com
.
blt
.
other
.
module
.
cost
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
/**
* @Author: li.yanlin
* @Description:
* @Date: Created in
* @Modified by:
*/
public
interface
ApprovalHistoryMapper
extends
BaseMapper
<
ApprovalHistoryDomain
>
{
}
cost-service/src/main/java/com/blt/other/module/cost/model/ApprovalHistoryDomain.java
0 → 100644
View file @
1586e07d
package
com
.
blt
.
other
.
module
.
cost
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* @Author: li.yanlin
* @Description:
* @Date: Created in
* @Modified by:
*/
@Data
@Builder
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"审批历史"
,
description
=
""
)
public
class
ApprovalHistoryDomain
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"费用单号"
)
private
String
costNo
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"审批时间"
)
private
LocalDateTime
approvalTime
;
@ApiModelProperty
(
value
=
"审批前费用状态"
)
private
Integer
costStatus
;
@ApiModelProperty
(
value
=
"是否通过"
)
private
boolean
isPassed
;
@ApiModelProperty
(
value
=
"审批人"
)
private
Integer
approvalUserId
;
}
cost-service/src/main/java/com/blt/other/module/cost/service/ApprovalHistoryService.java
0 → 100644
View file @
1586e07d
package
com
.
blt
.
other
.
module
.
cost
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.blt.other.module.cost.dao.ApprovalHistoryMapper
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
/**
* @Author: li.yanlin
* @Description:
* @Date: Created in
* @Modified by:
*/
public
interface
ApprovalHistoryService
extends
IService
<
ApprovalHistoryDomain
>
{
}
cost-service/src/main/java/com/blt/other/module/cost/service/impl/ApprovalHistoryServiceImpl.java
0 → 100644
View file @
1586e07d
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.module.cost.dao.ApprovalHistoryMapper
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
import
org.springframework.stereotype.Service
;
/**
* @Author: li.yanlin
* @Description:
* @Date: Created in
* @Modified by:
*/
@Service
public
class
ApprovalHistoryServiceImpl
extends
ServiceImpl
<
ApprovalHistoryMapper
,
ApprovalHistoryDomain
>
implements
ApprovalHistoryService
{
}
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/DepartmentCheckState.java
View file @
1586e07d
...
...
@@ -9,9 +9,11 @@ import com.blt.other.module.auth.model.OaDepartment;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.cost.dao.CostCurrentReviewerMapper
;
import
com.blt.other.module.cost.dao.SpecDepartmentCheckConfigMapper
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
import
com.blt.other.module.cost.model.CostCurrentReviewer
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
import
com.blt.other.module.sys.dao.DepartmentReviewerMapper
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.blt.other.module.sys.model.DepartmentReviewer
;
...
...
@@ -51,6 +53,9 @@ public class DepartmentCheckState extends CostState {
@Resource
CostCurrentReviewerMapper
costCurrentReviewerMapper
;
@Resource
ApprovalHistoryService
approvalHistoryService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
handle
()
{
...
...
@@ -121,11 +126,19 @@ public class DepartmentCheckState extends CostState {
if
(
costContext
.
currentUserId
!=
null
)
{
//人工审核通过
if
(
costCurrentReviewerService
.
canAudit
(
currentUserId
,
costDomain
.
getCostNo
()))
{
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
true
)
.
build
();
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_HR_CHECK
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"部门审核通过"
,
CostLogDomain
.
DEPARTMENT_MANUAL_PASS
);
//审批历史
approvalHistoryService
.
save
(
approvalHistoryDomain
);
nextState
(
hrCheckState
);
//发布到总线尝试下个环节的自动审核
costSubscribe
.
subscribe
(
costContext
);
...
...
@@ -155,6 +168,14 @@ public class DepartmentCheckState extends CostState {
}
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"部门审核拒绝,理由:"
+
rejectReason
,
CostLogDomain
.
TYPE_UPDATE
);
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
false
)
.
build
();
approvalHistoryService
.
save
(
approvalHistoryDomain
);
costContext
.
costService
.
reject
(
costDomain
.
getCostNo
());
}
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinalCheckState.java
View file @
1586e07d
...
...
@@ -6,9 +6,11 @@ import com.blt.other.database.model.CostCompanyDomain;
import
com.blt.other.database.model.CostLogDomain
;
import
com.blt.other.module.cost.dao.CostCurrentReviewerMapper
;
import
com.blt.other.module.cost.dao.CostLogDao
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
import
com.blt.other.module.cost.model.CostCurrentReviewer
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.annotation.Scope
;
...
...
@@ -41,6 +43,8 @@ public class FinalCheckState extends CostState {
CostLogDao
costLogDao
;
@Resource
CostCurrentReviewerMapper
costCurrentReviewerMapper
;
@Resource
ApprovalHistoryService
approvalHistoryService
;
private
void
autoPass
()
{
CostDomain
costDomain
=
costContext
.
costDomain
;
...
...
@@ -100,6 +104,13 @@ public class FinalCheckState extends CostState {
if
(
costContext
.
currentUserId
!=
null
)
{
//人工审核通过
if
(
costCurrentReviewerService
.
canAudit
(
currentUserId
,
costDomain
.
getCostNo
()))
{
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
true
)
.
build
();
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
...
...
@@ -107,6 +118,7 @@ public class FinalCheckState extends CostState {
log
.
info
(
"费用单:{}最终审核人工审核通过"
,
costDomain
.
getCostNo
());
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"最终审核通过"
,
CostLogDomain
.
FINAL_MANUAL_PASS
);
approvalHistoryService
.
save
(
approvalHistoryDomain
);
//流转状态
nextState
(
unPayState
);
//通知财务系统
...
...
@@ -136,7 +148,14 @@ public class FinalCheckState extends CostState {
}
costContext
.
costService
.
reject
(
costDomain
.
getCostNo
());
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
false
)
.
build
();
approvalHistoryService
.
save
(
approvalHistoryDomain
);
log
.
info
(
"费用单:{}最终审核拒绝,理由:{}"
,
costDomain
.
getCostNo
(),
rejectReason
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"最终审核拒绝,理由:"
+
rejectReason
,
CostLogDomain
.
TYPE_UPDATE
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinancialCheckState.java
View file @
1586e07d
...
...
@@ -6,9 +6,11 @@ import com.blt.other.database.model.CostCompanyDomain;
import
com.blt.other.database.model.CostLogDomain
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostCurrentReviewerMapper
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
import
com.blt.other.module.cost.model.CostCurrentReviewer
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.stereotype.Component
;
...
...
@@ -38,6 +40,8 @@ public class FinancialCheckState extends CostState {
CostCompanyDao
costCompanyDao
;
@Resource
CostCurrentReviewerMapper
costCurrentReviewerMapper
;
@Resource
ApprovalHistoryService
approvalHistoryService
;
@Override
void
nextState
(
CostState
costState
)
{
...
...
@@ -79,12 +83,20 @@ public class FinancialCheckState extends CostState {
if
(
costContext
.
currentUserId
!=
null
)
{
//人工审核通过
if
(
costCurrentReviewerService
.
canAudit
(
currentUserId
,
costDomain
.
getCostNo
()))
{
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
true
)
.
build
();
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINAL_CHECK
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"财务审核通过"
,
CostLogDomain
.
FINANCIAL_MANUAL_PASS
);
approvalHistoryService
.
save
(
approvalHistoryDomain
);
//流转状态
nextState
(
finalCheckState
);
//发布到总线尝试下个环节的自动审核
...
...
@@ -113,7 +125,14 @@ public class FinancialCheckState extends CostState {
if
(!
costCurrentReviewerService
.
canAudit
(
currentUserId
,
costDomain
.
getCostNo
()))
{
throw
new
BizRuntimeException
(
"current user no authority"
);
}
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
false
)
.
build
();
approvalHistoryService
.
save
(
approvalHistoryDomain
);
costContext
.
costService
.
reject
(
costDomain
.
getCostNo
());
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"财务审核拒绝,理由:"
+
rejectReason
,
CostLogDomain
.
TYPE_UPDATE
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/HrCheckState.java
View file @
1586e07d
...
...
@@ -8,8 +8,10 @@ import com.blt.other.module.auth.dao.OaDepartmentMapper;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Scope
;
...
...
@@ -39,6 +41,8 @@ public class HrCheckState extends CostState {
OaUserMapper
oaUserMapper
;
@Resource
CostCompanyDao
costCompanyDao
;
@Resource
ApprovalHistoryService
approvalHistoryService
;
@Override
public
void
handle
()
{
...
...
@@ -69,11 +73,19 @@ public class HrCheckState extends CostState {
if
(
costContext
.
currentUserId
!=
null
)
{
//人工审核通过
if
(
costCurrentReviewerService
.
canAudit
(
currentUserId
,
costDomain
.
getCostNo
()))
{
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
true
)
.
build
();
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINANCIAL_CHECK
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"行政审核通过"
,
CostLogDomain
.
HR_PASS
);
approvalHistoryService
.
save
(
approvalHistoryDomain
);
nextState
(
financialCheckState
);
//发布到总线尝试下个环节的自动审核
costSubscribe
.
subscribe
(
costContext
);
...
...
@@ -108,7 +120,14 @@ public class HrCheckState extends CostState {
//sd
costContext
.
costService
.
reject
(
costDomain
.
getCostNo
());
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalTime
(
LocalDateTime
.
now
())
.
costStatus
(
costDomain
.
getCostStatus
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
false
)
.
build
();
approvalHistoryService
.
save
(
approvalHistoryDomain
);
}
@Override
...
...
cost-service/src/main/resources/mapper/ApprovalHistoryMapper.xml
0 → 100644
View file @
1586e07d
<?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.ApprovalHistoryMapper"
>
<!--<select id="select" resultType="com.blt.other.module.cost.model.ApprovalHistoryDomain">
SELECT
*
FROM
approval_history
</select>-->
</mapper>
cost-service/src/main/resources/mapper/cost/
CostTemplateColMapper
.xml
→
cost-service/src/main/resources/mapper/cost/
ApprovalHistoryService
.xml
View file @
1586e07d
File moved
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