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
407204a7
Commit
407204a7
authored
Sep 25, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d90c179d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
39 deletions
+40
-39
GeneralManagerCheckState.java
...cost/service/impl/costcheck/GeneralManagerCheckState.java
+40
-39
No files found.
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/GeneralManagerCheckState.java
View file @
407204a7
...
...
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
*/
@Component
@Scope
(
"prototype"
)
public
class
GeneralManagerCheckState
extends
CostState
{
public
class
GeneralManagerCheckState
extends
CostState
{
@Resource
UnPayState
unPayState
;
...
...
@@ -54,7 +54,7 @@ public class GeneralManagerCheckState extends CostState{
throw
new
BizRuntimeException
(
"invalid status"
);
}
//小于1w的自动审核
if
(
this
.
autoPass
(
costDomain
))
{
if
(
this
.
autoPass
(
costDomain
))
{
//自动审核通过
if
(
this
.
autoCheck
(
costDomain
))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
...
...
@@ -74,30 +74,30 @@ public class GeneralManagerCheckState extends CostState{
return
;
}
}
if
(
currentUserId
!=
null
)
{
if
(
currentUserId
!=
null
)
{
//目前限定铭哥能审核
if
(
currentUserId
!=
681
)
{
if
(
currentUserId
==
681
||
currentUserId
==
2346
)
{
//大于等于1w需要铭哥审批
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"10000"
))
>=
0
)
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
List
<
CostCurrentReviewer
>
costCurrentReviewerList
=
costCurrentReviewerMapper
.
selectByCostNo
(
costDomain
.
getCostNo
());
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"总经办审核通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
MANAGER_MANUAL_PASS
);
//流转状态
nextState
(
unPayState
);
//发布到总线尝试下个环节的自动审核
costSubscribe
.
subscribe
(
costContext
);
//通知财务系统
costContext
.
costService
.
toFinancial
(
costDomain
);
return
;
}
}
else
{
throw
new
BizRuntimeException
(
"current user no authority"
);
}
//大于等于1w需要铭哥审批
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"10000"
))
>=
0
)
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
List
<
CostCurrentReviewer
>
costCurrentReviewerList
=
costCurrentReviewerMapper
.
selectByCostNo
(
costDomain
.
getCostNo
());
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"总经办审核通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
MANAGER_MANUAL_PASS
);
//流转状态
nextState
(
unPayState
);
//发布到总线尝试下个环节的自动审核
costSubscribe
.
subscribe
(
costContext
);
//通知财务系统
costContext
.
costService
.
toFinancial
(
costDomain
);
return
;
}
}
}
...
...
@@ -114,25 +114,26 @@ public class GeneralManagerCheckState extends CostState{
}
//人工审核通过
if
(
currentUserId
!=
681
)
{
if
(
currentUserId
==
681
||
currentUserId
==
2346
)
{
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
);
}
else
{
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
);
}
@Override
public
void
updateCurrentReviewer
()
{
CostDomain
costDomain
=
costContext
.
costDomain
;
//只查铭哥的ID
OaUser
user
=
oaUserMapper
.
selectByOaUserId
(
681
);
...
...
@@ -146,16 +147,16 @@ public class GeneralManagerCheckState extends CostState{
}
private
boolean
autoPass
(
CostDomain
costDomain
){
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"10000"
))
<
0
)
{
private
boolean
autoPass
(
CostDomain
costDomain
)
{
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"10000"
))
<
0
)
{
return
true
;
}
if
(
costDomain
.
getCostForm
().
equals
(
2
))
{
if
(
costDomain
.
getCostForm
().
equals
(
2
))
{
//收款不需要审核
return
true
;
}
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
costDomain
.
getTypeNo
());
if
(
costTypeDomain
.
getTypeName
().
contains
(
"工资"
)
||
costTypeDomain
.
getTypeName
().
contains
(
"物流"
))
{
if
(
costTypeDomain
.
getTypeName
().
contains
(
"工资"
)
||
costTypeDomain
.
getTypeName
().
contains
(
"物流"
))
{
return
true
;
}
return
false
;
...
...
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