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
9d31165d
Commit
9d31165d
authored
Jun 16, 2023
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--story=1010498 --user=简曙勤 【费用系统】最终审核节点增加自动审核通过说明
https://www.tapd.cn/55346466/s/1013340
parent
046adc61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
10 deletions
+38
-10
AbstractCostService.java
...er/module/cost/service/impl/cost/AbstractCostService.java
+13
-5
FinalCheckState.java
...r/module/cost/service/impl/costcheck/FinalCheckState.java
+5
-5
FinancialCheckStateTest.java
.../cost/service/impl/costcheck/FinancialCheckStateTest.java
+20
-0
No files found.
cost-service/src/main/java/com/blt/other/module/cost/service/impl/cost/AbstractCostService.java
View file @
9d31165d
...
...
@@ -172,11 +172,19 @@ public abstract class AbstractCostService implements CostService {
}
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
BigDecimal
toRmbRate
=
CurUtils
.
getCur
(
costDomain
.
getDic
(),
"CNY"
);
costDomain
.
setToRmbRate
(
toRmbRate
);
costDomain
.
setAmountRmb
(
costDomain
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
if
(
costDomain
.
getCostForm
()
!=
1
)
{
BigDecimal
toRmbRate
=
CurUtils
.
getCur
(
costDomain
.
getDic
(),
"CNY"
);
costDomain
.
setToRmbRate
(
toRmbRate
);
costDomain
.
setAmountRmb
(
costDomain
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
}
else
{
CostDomain
oldCostDomain
=
this
.
getCostByCostNo
(
costDomain
.
getCostNo
());
if
(
oldCostDomain
!=
null
)
{
costDomain
.
setToRmbRate
(
oldCostDomain
.
getToRmbRate
());
costDomain
.
setAmountRmb
(
oldCostDomain
.
getAmountRmb
());
}
else
{
throw
new
BizRuntimeException
(
"修改费用单异常,请重试!"
);
}
}
if
(
StringUtils
.
isNotEmpty
(
costDomain
.
getTypeNo
()))
{
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
costDomain
.
getTypeNo
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinalCheckState.java
View file @
9d31165d
...
...
@@ -60,7 +60,7 @@ public class FinalCheckState extends CostState {
@Autowired
CostSubscribe
costSubscribe
;
private
void
autoPass
()
{
private
void
autoPass
(
String
msg
)
{
CostDomain
costDomain
=
costContext
.
costDomain
;
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
...
...
@@ -68,7 +68,7 @@ public class FinalCheckState extends CostState {
costDao
.
updateById
(
costDomain
);
List
<
CostCurrentReviewer
>
costCurrentReviewerList
=
costCurrentReviewerMapper
.
selectByCostNo
(
costDomain
.
getCostNo
());
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"最终审核自动通过,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"最终审核自动通过
"
+
msg
+
"
,当前审核人:"
+
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getUsername
)
.
collect
(
Collectors
.
joining
(
","
)),
CostLogDomain
.
DEPARTMENT_AUTO_PASS
);
//流转状态
nextState
(
unPayState
);
...
...
@@ -117,14 +117,14 @@ public class FinalCheckState extends CostState {
if
(
costLogDomain
!=
null
&&
costCurrentReviewerList
.
stream
().
map
(
CostCurrentReviewer:
:
getOaUserId
).
collect
(
Collectors
.
toList
()).
contains
(
costLogDomain
.
getUpdateUserid
()))
{
log
.
info
(
"费用单:{}部门审核人和最终审核人是同一个人,最终审核人自动通过。"
,
costDomain
.
getCostNo
());
this
.
autoPass
();
this
.
autoPass
(
"(部门审核人和最终审核人是同一人)"
);
return
;
}
//如果不需要审核 并且主体不是工会 直接通过
if
(!
costTemplate
.
shouldFinalCheck
(
costDomain
))
{
log
.
info
(
"费用单:{}不需要最终审核审核,并且主体不是工会。最终审核人自动通过"
,
costDomain
.
getCostNo
());
this
.
autoPass
();
this
.
autoPass
(
"(审核人民币金额【"
+
costDomain
.
getAmountRmb
()
+
"】少于单据模板设定金额【"
+
costTemplate
.
getFinalMinimumReviewAmount
()
+
"】)"
);
return
;
}
...
...
@@ -140,7 +140,7 @@ public class FinalCheckState extends CostState {
//自动审核通过
if
(
this
.
autoCheck
(
costDomain
))
{
log
.
info
(
"费用单:{}需要自动审核并且自动审核规则校验通过.最终审核人自动通过"
,
costDomain
.
getCostNo
());
this
.
autoPass
();
this
.
autoPass
(
"(自动审核并且自动审核规则校验通过)"
);
return
;
}
}
...
...
cost-service/src/test/java/com/blt/other/module/cost/service/impl/costcheck/FinancialCheckStateTest.java
View file @
9d31165d
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
costcheck
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.database.model.CostCompanyDomain
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostDao
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.service.ICostCurrentReviewerService
;
import
com.blt.other.module.cost.service.ICostTemplateService
;
import
com.blt.other.module.sys.dao.CostReviewerMapper
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.google.common.collect.Lists
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.annotation.Rollback
;
import
org.springframework.test.context.ActiveProfiles
;
...
...
@@ -19,6 +24,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -45,6 +51,8 @@ class FinancialCheckStateTest {
ICostCurrentReviewerService
costCurrentReviewerService
;
@Resource
FinancialCheckState
financialCheckState
;
@Autowired
ICostTemplateService
costTemplateService
;
@Test
@Rollback
(
value
=
false
)
...
...
@@ -74,4 +82,16 @@ class FinancialCheckStateTest {
costContext
.
setCostState
(
financialCheckState
);
financialCheckState
.
updateCurrentReviewer
();
}
@Rollback
@Test
void
Test
()
{
CostDomain
costDomain
=
costService
.
getCostByCostNo
(
"F056018"
);
CostTemplate
costTemplate
=
costTemplateService
.
queryDetail
(
costDomain
.
getCostTemplateId
());
String
aa
=
"(审核人民币金额【"
+
costDomain
.
getAmountRmb
()
+
"】少于单据模板设定金额【"
+
costTemplate
.
getFinalMinimumReviewAmount
()
+
"】)"
;
System
.
out
.
println
(
aa
);
if
(!
costTemplate
.
shouldFinalCheck
(
costDomain
))
{
return
;
}
}
}
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