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
e882065c
Commit
e882065c
authored
Jun 20, 2023
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--story=1010505 --user=简曙勤 【费用系统】主体啫啫煲,审核人鹏哥【自动审核】金额为1000以下
https://www.tapd.cn/55346466/s/1013364
parent
9d31165d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
17 deletions
+63
-17
DepartmentCheckState.java
...ule/cost/service/impl/costcheck/DepartmentCheckState.java
+21
-8
GeneralManagerCheckState.java
...cost/service/impl/costcheck/GeneralManagerCheckState.java
+12
-3
FinancialCheckStateTest.java
.../cost/service/impl/costcheck/FinancialCheckStateTest.java
+30
-6
No files found.
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/DepartmentCheckState.java
View file @
e882065c
...
...
@@ -26,8 +26,10 @@ import org.springframework.stereotype.Component;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -83,18 +85,31 @@ public class DepartmentCheckState extends CostState {
costLogService
.
save
(
costDomain
.
getCostNo
(),
0
,
"匹配特殊部门:"
+
oaDepartment
.
getFullName
());
this
.
updateCurrentReviewer
(
reviewerDepartmentId
);
}
//主体啫啫煲,审核人鹏哥【自动审核】金额为1000以下
boolean
shouldAutoCheck
=
false
;
List
<
CostCurrentReviewer
>
costCurrentReviewerList
=
costCurrentReviewerMapper
.
selectByCostNo
(
costDomain
.
getCostNo
());
CostCurrentReviewer
costCurrentReviewer
=
null
;
if
(
"啫啫煲"
.
equals
(
costDomain
.
getCompanyName
()))
{
if
(
costCurrentReviewerList
!=
null
&&
costCurrentReviewerList
.
size
()
>
0
)
{
Optional
<
CostCurrentReviewer
>
optionalCostCurrentReviewer
=
costCurrentReviewerList
.
stream
().
filter
(
l
->
l
.
getOaUserId
()
==
720
).
findFirst
();
if
(
optionalCostCurrentReviewer
.
isPresent
())
{
costCurrentReviewer
=
optionalCostCurrentReviewer
.
get
();
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"1000"
))
<
0
)
{
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"人民币金额【"
+
costDomain
.
getAmountRmb
()
+
"】少于设定【1000】审核条件"
,
null
);
shouldAutoCheck
=
true
;
}
}
}
}
if
(
costCurrentReviewer
==
null
||
shouldAutoCheck
)
{
//如果不需要审核 直接通过
DepartmentReviewer
departmentReviewer
=
this
.
getCurrentDepartmentReviewer
(
oaDepartment
.
getDepartmentId
());
//收款单也不需要审核
if
(
costDomain
.
getCostForm
()
==
2
||
(!
costTemplate
.
shouldDepartmentCheck
(
costDomain
,
departmentReviewer
.
getAutoReviewAmount
())))
{
if
(
shouldAutoCheck
||
costDomain
.
getCostForm
()
==
2
||
(!
costTemplate
.
shouldDepartmentCheck
(
costDomain
,
departmentReviewer
.
getAutoReviewAmount
())))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_HR_CHECK
);
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
.
DEPARTMENT_AUTO_PASS
);
...
...
@@ -104,7 +119,6 @@ public class DepartmentCheckState extends CostState {
return
;
}
//需要自动审核
if
(
costTemplate
.
shouldDepartmentAutoCheck
(
costDomain
))
{
//自动审核通过
...
...
@@ -112,7 +126,6 @@ public class DepartmentCheckState extends CostState {
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_HR_CHECK
);
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
.
DEPARTMENT_AUTO_PASS
);
...
...
@@ -122,7 +135,7 @@ public class DepartmentCheckState extends CostState {
return
;
}
}
}
//人工审核
if
(
costContext
.
currentUserId
!=
null
)
{
//人工审核通过
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/GeneralManagerCheckState.java
View file @
e882065c
...
...
@@ -167,12 +167,20 @@ public class GeneralManagerCheckState extends CostState {
//部门审核人和总经办审核人是同一个人,总经办审核人自动通过。
return
true
;
}
//付款主体是"啫啫煲"且小于1k不需要总经办审批
if
(
"啫啫煲"
.
equals
(
costDomain
.
getCompanyName
()))
{
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"1000"
))
<
0
)
{
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"人民币金额【"
+
costDomain
.
getAmountRmb
()
+
"】少于设定【1000】审核条件"
,
null
);
return
true
;
}
}
else
{
if
(
costDomain
.
getCostForm
().
equals
(
2
))
{
//收款不需要审核
return
true
;
}
if
(
costDomain
.
getProjectType
()
!=
null
&&
costDomain
.
getProjectType
().
equalsIgnoreCase
(
"DSP"
))
{
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"项目类型【DSP】符合设定自动审核条件"
,
null
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"项目类型【DSP】符合设定自动审核条件"
,
null
);
//DSP不需要审核
return
true
;
}
...
...
@@ -182,13 +190,13 @@ public class GeneralManagerCheckState extends CostState {
||
costTypeDomain
.
getTypeName
().
contains
(
"公积金"
)
||
costTypeDomain
.
getTypeName
().
contains
(
"租金物业水电费"
)
||
costTypeDomain
.
getTypeName
().
contains
(
"车辆使用费"
))
{
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"费用类型【"
+
costTypeDomain
.
getTypeName
()
+
"】符合设定自动审核条件"
,
null
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"费用类型【"
+
costTypeDomain
.
getTypeName
()
+
"】符合设定自动审核条件"
,
null
);
return
true
;
}
//小于5k不需要总经办审批,特殊情况除外;
if
(
costDomain
.
getAmountRmb
().
compareTo
(
new
BigDecimal
(
"5000"
))
<
0
)
{
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"人民币金额【"
+
costDomain
.
getAmountRmb
()
+
"】少于设定5000审核条件"
,
null
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"人民币金额【"
+
costDomain
.
getAmountRmb
()
+
"】少于设定【5000】审核条件"
,
null
);
//特殊情况:0(含)-5k(不含)的每天随机抽取三个订单
//if (costDomain.getAmountRmb().compareTo(new BigDecimal("5000")) >= 0) {
/* 取消每天随机抽取三个订单的特殊情况
...
...
@@ -205,6 +213,7 @@ public class GeneralManagerCheckState extends CostState {
/*} else
return true;*/
}
}
return
false
;
}
...
...
cost-service/src/test/java/com/blt/other/module/cost/service/impl/costcheck/FinancialCheckStateTest.java
View file @
e882065c
...
...
@@ -5,7 +5,9 @@ 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.CostCurrentReviewerMapper
;
import
com.blt.other.module.cost.dao.CostDao
;
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.CostService
;
...
...
@@ -26,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Optional
;
/**
* <p>
...
...
@@ -53,6 +56,8 @@ class FinancialCheckStateTest {
FinancialCheckState
financialCheckState
;
@Autowired
ICostTemplateService
costTemplateService
;
@Resource
CostCurrentReviewerMapper
costCurrentReviewerMapper
;
@Test
@Rollback
(
value
=
false
)
...
...
@@ -86,12 +91,31 @@ class FinancialCheckStateTest {
@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
;
CostDomain
costDomain
=
costService
.
getCostByCostNo
(
"F056167"
);
List
<
CostCurrentReviewer
>
costCurrentReviewerList
=
costCurrentReviewerMapper
.
selectByCostNo
(
costDomain
.
getCostNo
());
CostCurrentReviewer
costCurrentReviewer
=
null
;
Optional
<
CostCurrentReviewer
>
listCostCurrentReviewer
=
costCurrentReviewerList
.
stream
().
filter
(
l
->
l
.
getOaUserId
()
==
720
).
findFirst
();
if
(
listCostCurrentReviewer
.
isPresent
())
{
listCostCurrentReviewer
.
get
();
}
else
{
listCostCurrentReviewer
=
costCurrentReviewerList
.
stream
().
filter
(
l
->
l
.
getOaUserId
()
==
4936
).
findFirst
();
if
(
listCostCurrentReviewer
.
isPresent
())
{
costCurrentReviewer
=
listCostCurrentReviewer
.
get
();
}
else
{
}
}
// 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