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
9cccfde8
Commit
9cccfde8
authored
Sep 30, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、流程变更,提单人->对应部门负责人审核->人事->总经办->财务->最终审->出纳;
2、总经办和最终审无需审核DSP的单。
parent
743a1a18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
27 deletions
+38
-27
FinalCheckState.java
...r/module/cost/service/impl/costcheck/FinalCheckState.java
+14
-12
GeneralManagerCheckState.java
...cost/service/impl/costcheck/GeneralManagerCheckState.java
+18
-11
HrCheckState.java
...ther/module/cost/service/impl/costcheck/HrCheckState.java
+6
-4
No files found.
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinalCheckState.java
View file @
9cccfde8
...
@@ -48,8 +48,8 @@ public class FinalCheckState extends CostState {
...
@@ -48,8 +48,8 @@ public class FinalCheckState extends CostState {
@Resource
@Resource
UnPayState
unPayState
;
UnPayState
unPayState
;
@Resource
//
@Resource
GeneralManagerCheckState
generalManagerCheckState
;
//
GeneralManagerCheckState generalManagerCheckState;
@Resource
@Resource
CostLogDao
costLogDao
;
CostLogDao
costLogDao
;
@Resource
@Resource
...
@@ -62,7 +62,7 @@ public class FinalCheckState extends CostState {
...
@@ -62,7 +62,7 @@ public class FinalCheckState extends CostState {
private
void
autoPass
()
{
private
void
autoPass
()
{
CostDomain
costDomain
=
costContext
.
costDomain
;
CostDomain
costDomain
=
costContext
.
costDomain
;
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
MANAGER_CHECK
);
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
UN_PAY
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costDao
.
updateById
(
costDomain
);
...
@@ -70,11 +70,9 @@ public class FinalCheckState extends CostState {
...
@@ -70,11 +70,9 @@ public class FinalCheckState extends CostState {
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"最终审核自动通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"最终审核自动通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
DEPARTMENT_AUTO_PASS
);
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
DEPARTMENT_AUTO_PASS
);
//流转状态
//流转状态
nextState
(
generalManagerCheckState
);
nextState
(
unPayState
);
//尝试自动下一个流程自动审核
costSubscribe
.
subscribe
(
costContext
);
//通知财务系统
//通知财务系统
//
costContext.costService.toFinancial(costDomain);
costContext
.
costService
.
toFinancial
(
costDomain
);
}
}
@Resource
@Resource
...
@@ -131,6 +129,12 @@ public class FinalCheckState extends CostState {
...
@@ -131,6 +129,12 @@ public class FinalCheckState extends CostState {
return
;
return
;
}
}
if
(
costDomain
.
getProjectType
().
equalsIgnoreCase
(
"DSP"
))
{
log
.
info
(
"费用单:{}不需要最终审核审核,原因:该订单为DSP。最终审核人自动通过"
,
costDomain
.
getCostNo
());
this
.
autoPass
();
return
;
}
//需要自动审核
//需要自动审核
if
(
costTemplate
.
shouldFinalAutoCheck
(
costDomain
))
{
if
(
costTemplate
.
shouldFinalAutoCheck
(
costDomain
))
{
//自动审核通过
//自动审核通过
...
@@ -151,7 +155,7 @@ public class FinalCheckState extends CostState {
...
@@ -151,7 +155,7 @@ public class FinalCheckState extends CostState {
.
costNo
(
costDomain
.
getCostNo
())
.
costNo
(
costDomain
.
getCostNo
())
.
isPassed
(
true
)
.
isPassed
(
true
)
.
build
();
.
build
();
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
MANAGER_CHECK
);
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
UN_PAY
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costDao
.
updateById
(
costDomain
);
...
@@ -162,11 +166,9 @@ public class FinalCheckState extends CostState {
...
@@ -162,11 +166,9 @@ public class FinalCheckState extends CostState {
sendWxMsg
(
costDomain
,
currentUserId
);
sendWxMsg
(
costDomain
,
currentUserId
);
//流转状态
//流转状态
nextState
(
generalManagerCheck
State
);
nextState
(
unPay
State
);
//通知财务系统
//通知财务系统
//costContext.costService.toFinancial(costDomain);
costContext
.
costService
.
toFinancial
(
costDomain
);
//尝试自动下一个流程自动审核
costSubscribe
.
subscribe
(
costContext
);
}
}
//人工审核没权限
//人工审核没权限
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/GeneralManagerCheckState.java
View file @
9cccfde8
...
@@ -22,6 +22,7 @@ import java.math.BigDecimal;
...
@@ -22,6 +22,7 @@ import java.math.BigDecimal;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -34,8 +35,10 @@ import java.util.stream.Collectors;
...
@@ -34,8 +35,10 @@ import java.util.stream.Collectors;
@Scope
(
"prototype"
)
@Scope
(
"prototype"
)
public
class
GeneralManagerCheckState
extends
CostState
{
public
class
GeneralManagerCheckState
extends
CostState
{
//@Resource
//UnPayState unPayState;
@Resource
@Resource
UnPayState
unPay
State
;
FinancialCheckState
financialCheck
State
;
@Resource
@Resource
CostCurrentReviewerMapper
costCurrentReviewerMapper
;
CostCurrentReviewerMapper
costCurrentReviewerMapper
;
@Resource
@Resource
...
@@ -55,7 +58,7 @@ public class GeneralManagerCheckState extends CostState {
...
@@ -55,7 +58,7 @@ public class GeneralManagerCheckState extends CostState {
}
}
//小于1w的自动审核
//小于1w的自动审核
if
(
this
.
autoPass
(
costDomain
))
{
if
(
this
.
autoPass
(
costDomain
))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
UN_PAY
);
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
FINANCIAL_CHECK
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costDao
.
updateById
(
costDomain
);
...
@@ -63,12 +66,12 @@ public class GeneralManagerCheckState extends CostState {
...
@@ -63,12 +66,12 @@ public class GeneralManagerCheckState extends CostState {
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"总经办自动审核通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"总经办自动审核通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
MANAGER_AUTO_PASS
);
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
MANAGER_AUTO_PASS
);
//流转状态
//流转状态
nextState
(
unPay
State
);
nextState
(
financialCheck
State
);
//发布到总线尝试下个环节的自动审核
//发布到总线尝试下个环节的自动审核
//
costSubscribe.subscribe(costContext);
costSubscribe
.
subscribe
(
costContext
);
//通知财务系统
//通知财务系统
costContext
.
costService
.
toFinancial
(
costDomain
);
//
costContext.costService.toFinancial(costDomain);
return
;
return
;
}
}
...
@@ -77,7 +80,7 @@ public class GeneralManagerCheckState extends CostState {
...
@@ -77,7 +80,7 @@ public class GeneralManagerCheckState extends CostState {
if
(
currentUserId
==
681
||
currentUserId
==
2346
)
{
if
(
currentUserId
==
681
||
currentUserId
==
2346
)
{
//大于等于1w需要铭哥审批
//大于等于1w需要铭哥审批
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"10000"
))
>=
0
)
{
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"10000"
))
>=
0
)
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
UN_PAY
);
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_
FINANCIAL_CHECK
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
costDao
.
updateById
(
costDomain
);
...
@@ -85,12 +88,12 @@ public class GeneralManagerCheckState extends CostState {
...
@@ -85,12 +88,12 @@ public class GeneralManagerCheckState extends CostState {
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"总经办审核通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"总经办审核通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
MANAGER_MANUAL_PASS
);
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
MANAGER_MANUAL_PASS
);
//流转状态
//流转状态
nextState
(
unPay
State
);
nextState
(
financialCheck
State
);
//发布到总线尝试下个环节的自动审核
//发布到总线尝试下个环节的自动审核
//
costSubscribe.subscribe(costContext);
costSubscribe
.
subscribe
(
costContext
);
//通知财务系统
//通知财务系统
costContext
.
costService
.
toFinancial
(
costDomain
);
//
costContext.costService.toFinancial(costDomain);
return
;
return
;
}
}
}
else
{
}
else
{
...
@@ -104,14 +107,14 @@ public class GeneralManagerCheckState extends CostState {
...
@@ -104,14 +107,14 @@ public class GeneralManagerCheckState extends CostState {
CostDomain
costDomain
=
costContext
.
costDomain
;
CostDomain
costDomain
=
costContext
.
costDomain
;
Integer
currentUserId
=
costContext
.
currentUserId
;
Integer
currentUserId
=
costContext
.
currentUserId
;
CostCompanyDomain
costCompany
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
//
CostCompanyDomain costCompany = costCompanyDao.selectByNo(costDomain.getCompanyNo());
//check status
//check status
if
(!
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_MANAGER_CHECK
))
{
if
(!
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_MANAGER_CHECK
))
{
throw
new
BizRuntimeException
(
"invalid status"
);
throw
new
BizRuntimeException
(
"invalid status"
);
}
}
//人工审核
通过
//人工审核
拒绝
if
(
currentUserId
==
681
||
currentUserId
==
2346
)
{
if
(
currentUserId
==
681
||
currentUserId
==
2346
)
{
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
ApprovalHistoryDomain
approvalHistoryDomain
=
ApprovalHistoryDomain
.
builder
()
.
approvalUserId
(
currentUserId
)
.
approvalUserId
(
currentUserId
)
...
@@ -153,6 +156,10 @@ public class GeneralManagerCheckState extends CostState {
...
@@ -153,6 +156,10 @@ public class GeneralManagerCheckState extends CostState {
//收款不需要审核
//收款不需要审核
return
true
;
return
true
;
}
}
if
(
costDomain
.
getProjectType
().
equalsIgnoreCase
(
"DSP"
))
{
//DSP不需要审核
return
true
;
}
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
costDomain
.
getTypeNo
());
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
costDomain
.
getTypeNo
());
if
(
costTypeDomain
.
getTypeName
().
contains
(
"工资"
)
||
costTypeDomain
.
getTypeName
().
contains
(
"物流"
)||
costTypeDomain
.
getTypeName
().
contains
(
"社保费"
))
{
if
(
costTypeDomain
.
getTypeName
().
contains
(
"工资"
)
||
costTypeDomain
.
getTypeName
().
contains
(
"物流"
)||
costTypeDomain
.
getTypeName
().
contains
(
"社保费"
))
{
return
true
;
return
true
;
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/HrCheckState.java
View file @
9cccfde8
...
@@ -33,8 +33,10 @@ import java.util.List;
...
@@ -33,8 +33,10 @@ import java.util.List;
@Scope
(
"prototype"
)
@Scope
(
"prototype"
)
public
class
HrCheckState
extends
CostState
{
public
class
HrCheckState
extends
CostState
{
@Autowired
//@Autowired
FinancialCheckState
financialCheckState
;
//FinancialCheckState financialCheckState;
@Resource
GeneralManagerCheckState
generalManagerCheckState
;
@Resource
@Resource
OaDepartmentMapper
oaDepartmentMapper
;
OaDepartmentMapper
oaDepartmentMapper
;
@Resource
@Resource
...
@@ -63,7 +65,7 @@ public class HrCheckState extends CostState {
...
@@ -63,7 +65,7 @@ public class HrCheckState extends CostState {
costDao
.
updateById
(
costDomain
);
costDao
.
updateById
(
costDomain
);
//流转状态
//流转状态
nextState
(
financial
CheckState
);
nextState
(
generalManager
CheckState
);
costSubscribe
.
subscribe
(
costContext
);
costSubscribe
.
subscribe
(
costContext
);
return
;
return
;
...
@@ -86,7 +88,7 @@ public class HrCheckState extends CostState {
...
@@ -86,7 +88,7 @@ public class HrCheckState extends CostState {
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"行政审核通过"
,
CostLogDomain
.
HR_PASS
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"行政审核通过"
,
CostLogDomain
.
HR_PASS
);
approvalHistoryService
.
save
(
approvalHistoryDomain
);
approvalHistoryService
.
save
(
approvalHistoryDomain
);
nextState
(
financial
CheckState
);
nextState
(
generalManager
CheckState
);
//发布到总线尝试下个环节的自动审核
//发布到总线尝试下个环节的自动审核
costSubscribe
.
subscribe
(
costContext
);
costSubscribe
.
subscribe
(
costContext
);
}
}
...
...
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