Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
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
bltdc
dc-cost-system
Commits
0fbc0caa
Commit
0fbc0caa
authored
Nov 16, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4ecf37c4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
61 deletions
+49
-61
CostController.java
...blt/other/module/cost/controller/cost/CostController.java
+4
-4
CostTemplate.java
...in/java/com/blt/other/module/cost/model/CostTemplate.java
+24
-10
CostExportService.java
.../com/blt/other/module/cost/service/CostExportService.java
+2
-1
DepartmentCheckState.java
...ule/cost/service/impl/costcheck/DepartmentCheckState.java
+15
-28
FinalCheckState.java
...r/module/cost/service/impl/costcheck/FinalCheckState.java
+3
-17
FinancialCheckState.java
...dule/cost/service/impl/costcheck/FinancialCheckState.java
+1
-1
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/cost/CostController.java
View file @
0fbc0caa
...
...
@@ -358,7 +358,7 @@ public class CostController {
return
resp
;
}
@PostMapping
(
"/exportList"
)
@PostMapping
(
"/
list/
exportList"
)
public
String
exportList
(
HttpServletResponse
response
,
HttpServletRequest
request
)
{
Enumeration
<
String
>
parameterNames
=
request
.
getParameterNames
();
if
(
null
!=
parameterNames
&&
parameterNames
.
hasMoreElements
())
{
...
...
@@ -372,7 +372,7 @@ public class CostController {
return
null
;
}
@PostMapping
(
"/exportListAll"
)
@PostMapping
(
"/
list/
exportListAll"
)
public
String
exportListAll
(
HttpServletResponse
response
,
HttpServletRequest
request
)
{
CostService
costService
=
CostServiceFactory
.
getCostService
();
...
...
@@ -400,7 +400,7 @@ public class CostController {
return
null
;
}
@GetMapping
(
"download"
)
@GetMapping
(
"
list/
download"
)
public
ResponseEntity
<
InputStreamResource
>
download
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
String
pathNo
=
request
.
getParameter
(
"pathNo"
);
CostExpDomain
exp
=
costExportService
.
getByExpNo
(
pathNo
);
...
...
@@ -422,7 +422,7 @@ public class CostController {
.
body
(
new
InputStreamResource
(
file
.
getInputStream
()));
}
@GetMapping
(
"downloadCashierAnnex"
)
@GetMapping
(
"
list/
downloadCashierAnnex"
)
public
ResponseEntity
<
InputStreamResource
>
downCashierAnnex
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostTemplate.java
View file @
0fbc0caa
...
...
@@ -3,6 +3,7 @@ package com.blt.other.module.cost.model;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -65,9 +66,12 @@ public class CostTemplate implements Serializable {
private
Integer
createUserId
;
private
String
createUserName
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"更新时间"
)
private
LocalDateTime
lastUpdateTime
;
...
...
@@ -79,23 +83,33 @@ public class CostTemplate implements Serializable {
private
List
<
CostTemplateCol
>
costTemplateColList
;
public
boolean
shouldDepartmentAutoCheck
()
{
return
enableAutoReview
&&
enableDepartmentReview
&&
!
isDefault
;
public
boolean
shouldDepartmentAutoCheck
(
CostDomain
cost
)
{
return
enableAutoReview
&&
enableDepartmentReview
&&
!
isDefault
&&
!
cost
.
getCompanyName
().
contains
(
"工会"
);
}
public
boolean
shouldFinancialAutoCheck
()
{
return
enableAutoReview
&&
enableFinancialAutoReview
&&
!
isDefault
;
public
boolean
shouldFinancialAutoCheck
(
CostDomain
cost
)
{
return
enableAutoReview
&&
enableFinancialAutoReview
&&
!
isDefault
&&
!
cost
.
getCompanyName
().
contains
(
"工会"
);
}
public
boolean
shouldFinalAutoCheck
()
{
return
enableAutoReview
&&
enableFinalReview
&&
!
isDefault
;
public
boolean
shouldFinalAutoCheck
(
CostDomain
cost
)
{
return
enableAutoReview
&&
enableFinalReview
&&
!
isDefault
&&
!
cost
.
getCompanyName
().
contains
(
"工会"
);
}
public
boolean
shouldFinalCheck
(
BigDecimal
amount
)
{
return
finalMinimumReviewAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
&&
amount
.
compareTo
(
finalMinimumReviewAmount
)
>=
0
;
public
boolean
shouldFinalCheck
(
CostDomain
cost
)
{
BigDecimal
amount
=
cost
.
getAmount
();
return
finalMinimumReviewAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
&&
amount
.
compareTo
(
finalMinimumReviewAmount
)
>=
0
&&
!
cost
.
getCompanyName
().
contains
(
"工会"
);
}
public
boolean
shouldDepartmentCheck
(
BigDecimal
amount
,
BigDecimal
departmentMinimumReviewAmount
)
{
return
departmentMinimumReviewAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
&&
amount
.
compareTo
(
departmentMinimumReviewAmount
)
>=
0
;
public
boolean
shouldDepartmentCheck
(
CostDomain
cost
,
BigDecimal
departmentMinimumReviewAmount
)
{
BigDecimal
amount
=
cost
.
getAmount
();
return
departmentMinimumReviewAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
&&
amount
.
compareTo
(
departmentMinimumReviewAmount
)
>=
0
&&
!
cost
.
getCompanyName
().
contains
(
"工会"
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/CostExportService.java
View file @
0fbc0caa
...
...
@@ -6,9 +6,10 @@ import com.blt.other.module.database.model.CostExpDomain;
import
java.util.List
;
public
interface
CostExportService
{
String
exportFees
(
List
<
String
>
exportNos
);
CostExpDomain
saveRecord
(
CostExportVo
costExportVo
,
String
filePath
);
CostExpDomain
saveRecord
(
CostExportVo
costExportVo
,
String
filePath
);
String
createExpNo
();
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/DepartmentCheckState.java
View file @
0fbc0caa
...
...
@@ -2,10 +2,10 @@ package com.blt.other.module.cost.service.impl.costcheck;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.module.auth.dao.OaDepartmentMapper
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.CostReviewer
;
import
com.blt.other.module.auth.model.OaDepartment
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.IOaUserService
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.database.model.CostLogDomain
;
...
...
@@ -31,7 +31,7 @@ public class DepartmentCheckState extends CostState {
@Resource
OaDepartmentMapper
oaDepartmentMapper
;
@Resource
IOaUserService
oaUserService
;
OaUserMapper
oaUserMapper
;
@Override
public
void
handle
()
{
...
...
@@ -44,41 +44,28 @@ public class DepartmentCheckState extends CostState {
throw
new
BizRuntimeException
(
"invalid status"
);
}
//如果是默认模版 不需要部门审核
if
(
costTemplate
.
getIsDefault
())
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINANCIAL_CHECK
);
costDao
.
updateById
(
costDomain
);
//流转状态
nextState
(
financialCheckState
);
costSubscribe
.
subscribe
(
costContext
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"部门审核自动通过"
,
CostLogDomain
.
DEPARTMENT_AUTO_PASS
);
return
;
}
//如果不需要审核 直接通过
OaUser
oaUser
=
oaUserService
.
getById
(
currentUserId
);
OaDepartment
oaDepartment
=
oaDepartmentMapper
.
selectByDepartmentId
(
oaUser
.
getPrimaryDepartmentId
());
if
(
costTemplate
.
shouldDepartmentCheck
(
costDomain
.
getAmount
(),
oaDepartment
.
getDepartmentMinimumReviewAmount
()))
{
if
(
costContext
.
currentUserId
!=
null
)
{
OaUser
oaUser
=
oaUserMapper
.
selectByOaUserId
(
currentUserId
);
OaDepartment
oaDepartment
=
oaDepartmentMapper
.
selectByDepartmentId
(
oaUser
.
getPrimaryDepartmentId
());
if
(
costTemplate
.
shouldDepartmentCheck
(
costDomain
,
oaDepartment
.
getDepartmentMinimumReviewAmount
()))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINANCIAL_CHECK
);
costDao
.
updateById
(
costDomain
);
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINANCIAL_CHECK
);
costDao
.
updateById
(
costDomain
);
//流转状态
nextState
(
financialCheckState
);
costSubscribe
.
subscribe
(
costContext
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"部门审核自动通过"
,
CostLogDomain
.
DEPARTMENT_AUTO_PASS
);
//流转状态
nextState
(
financialCheckState
);
costSubscribe
.
subscribe
(
costContext
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"部门审核自动通过"
,
CostLogDomain
.
DEPARTMENT_AUTO_PASS
);
return
;
return
;
}
}
//需要自动审核
if
(
costTemplate
.
shouldDepartmentAutoCheck
())
{
if
(
costTemplate
.
shouldDepartmentAutoCheck
(
costDomain
))
{
//自动审核通过
if
(
this
.
autoCheck
(
costDomain
))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINANCIAL_CHECK
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinalCheckState.java
View file @
0fbc0caa
...
...
@@ -43,22 +43,8 @@ public class FinalCheckState extends CostState {
throw
new
BizRuntimeException
(
"invalid status"
);
}
//如果是默认模版 不需要最终审核
if
(
costTemplate
.
getIsDefault
())
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
costDao
.
updateById
(
costDomain
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"最终审核自动通过"
,
CostLogDomain
.
DEPARTMENT_AUTO_PASS
);
//流转状态
nextState
(
unPayState
);
//通知财务系统
costContext
.
costService
.
toFinancial
(
costDomain
);
return
;
}
//如果不需要审核 直接通过
if
(!
costTemplate
.
shouldFinalCheck
(
costDomain
.
getAmount
()))
{
//如果不需要审核 并且主体不是工会 直接通过
if
(!
costTemplate
.
shouldFinalCheck
(
costDomain
))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
costDao
.
updateById
(
costDomain
);
costLogService
.
saveByManage
(
costDomain
.
getCostNo
(),
"最终审核自动通过"
,
null
);
...
...
@@ -69,7 +55,7 @@ public class FinalCheckState extends CostState {
}
//需要自动审核
if
(
costTemplate
.
shouldFinalAutoCheck
())
{
if
(
costTemplate
.
shouldFinalAutoCheck
(
costDomain
))
{
//自动审核通过
if
(
this
.
autoCheck
(
costDomain
))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_UN_PAY
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinancialCheckState.java
View file @
0fbc0caa
...
...
@@ -45,7 +45,7 @@ public class FinancialCheckState extends CostState {
}
//需要自动审核
if
(
costTemplate
.
shouldFinancialAutoCheck
())
{
if
(
costTemplate
.
shouldFinancialAutoCheck
(
costDomain
))
{
//自动审核通过
if
(
this
.
autoCheck
(
costDomain
))
{
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINAL_CHECK
);
...
...
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