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
b480e5fc
Commit
b480e5fc
authored
Nov 06, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
state update
parent
2d34535d
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
104 additions
and
36 deletions
+104
-36
CostController.java
...blt/other/module/cost/controller/cost/CostController.java
+9
-7
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+1
-0
AbstractCostService.java
...er/module/cost/service/impl/cost/AbstractCostService.java
+13
-11
CostContext.java
...other/module/cost/service/impl/costcheck/CostContext.java
+2
-2
CostState.java
...t/other/module/cost/service/impl/costcheck/CostState.java
+1
-1
DepartmentCheckState.java
...ule/cost/service/impl/costcheck/DepartmentCheckState.java
+22
-1
FinalCheckState.java
...r/module/cost/service/impl/costcheck/FinalCheckState.java
+20
-1
FinancialCheckState.java
...dule/cost/service/impl/costcheck/FinancialCheckState.java
+20
-1
PayedState.java
.../other/module/cost/service/impl/costcheck/PayedState.java
+1
-1
RefuseState.java
...other/module/cost/service/impl/costcheck/RefuseState.java
+4
-3
UnPayState.java
.../other/module/cost/service/impl/costcheck/UnPayState.java
+3
-2
UnSubmitState.java
...her/module/cost/service/impl/costcheck/UnSubmitState.java
+2
-2
OaDepartmentMapper.xml
...ore/src/main/resources/mapper/auth/OaDepartmentMapper.xml
+6
-4
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/cost/CostController.java
View file @
b480e5fc
...
...
@@ -19,7 +19,6 @@ import com.blt.other.module.cost.service.impl.cost.CostServiceFactory;
import
com.blt.other.module.cost.service.impl.costcheck.*
;
import
com.blt.other.module.cost.vo.*
;
import
com.blt.other.module.database.model.CostExpDomain
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -241,10 +240,11 @@ public class CostController {
@GetMapping
(
"/check/departmentRefuse"
)
@ApiOperation
(
"部门审核驳回"
)
public
CostResult
<
Void
>
departmentCheckRefuse
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
@RequestParam
Integer
userid
,
@RequestParam
String
rejectReason
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
departmentCheckState
);
costContext
.
refuse
();
costContext
.
refuse
(
rejectReason
);
return
CostResult
.
success
();
}
...
...
@@ -262,10 +262,11 @@ public class CostController {
@GetMapping
(
"/check/financialRefuse"
)
@ApiOperation
(
"财务审核驳回"
)
public
CostResult
<
Void
>
financialRefuse
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
@RequestParam
Integer
userid
,
@RequestParam
String
rejectReason
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
financialCheckState
);
costContext
.
handle
(
);
costContext
.
refuse
(
rejectReason
);
return
CostResult
.
success
();
}
...
...
@@ -282,10 +283,11 @@ public class CostController {
@GetMapping
(
"/check/finalRefuse"
)
@ApiOperation
(
"最终审核人驳回"
)
public
CostResult
<
Void
>
finalRefuse
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
@RequestParam
Integer
userid
,
@RequestParam
String
rejectReason
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
finalCheckState
);
costContext
.
refuse
();
costContext
.
refuse
(
rejectReason
);
return
CostResult
.
success
();
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
b480e5fc
...
...
@@ -48,6 +48,7 @@ public class CostDomain implements Serializable {
public
final
static
int
STATUS_REJECT
=
3
;
public
final
static
int
STATUS_DELETE
=
5
;
// 费用单编号
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/cost/AbstractCostService.java
View file @
b480e5fc
...
...
@@ -15,7 +15,6 @@ import com.blt.other.common.util.MoneyUtil;
import
com.blt.other.common.util.SessionUtils
;
import
com.blt.other.module.auth.dao.CostReviewerMapper
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.CostReviewer
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.UserService
;
import
com.blt.other.module.cost.dao.*
;
...
...
@@ -91,7 +90,6 @@ public abstract class AbstractCostService implements CostService {
@Autowired
CostLogService
costLogService
;
@Override
public
Integer
saveNewCost
(
CostDomain
costDomain
)
{
throw
new
BizRuntimeException
(
"deprecated method"
);
...
...
@@ -129,15 +127,19 @@ public abstract class AbstractCostService implements CostService {
Integer
currentUserId
=
SessionUtils
.
getCurrentUserId
();
OaUser
costUser
=
oaUserMapper
.
selectByOaUserId
(
currentUserId
);
if
(
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_DEPARTMENT_CHECK
))
{
costDomain
.
setCanAudit
(
costReviewerMapper
.
queryOne
(
costUser
.
getPrimaryDepartmentId
(),
CostReviewer
.
departmentReviewer
,
currentUserId
)
!=
null
);
}
else
if
(
costReviewerMapper
.
queryOne
(
costCompany
.
getId
(),
CostReviewer
.
financialReviewer
,
currentUserId
)
!=
null
)
{
costDomain
.
setCanAudit
(
costReviewerMapper
.
queryOne
(
costCompany
.
getId
(),
CostReviewer
.
financialReviewer
,
currentUserId
)
!=
null
);
}
else
if
(
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_FINAL_CHECK
))
{
costDomain
.
setCanAudit
(
costReviewerMapper
.
queryOne
(
costCompany
.
getId
(),
CostReviewer
.
finalReviewer
,
currentUserId
)
!=
null
);
}
else
{
costDomain
.
setCanAudit
(
false
);
}
// if (currentUserId == null) {
// costDomain.setCanAudit(false);
// } else if (costDomain.getCostStatus().equals(CostDomain.STATUS_DEPARTMENT_CHECK)) {
// costDomain.setCanAudit(costReviewerMapper.queryOne(costUser.getPrimaryDepartmentId(), CostReviewer.departmentReviewer, currentUserId) != null);
// } else if (costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.financialReviewer, currentUserId) != null) {
// costDomain.setCanAudit(costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.financialReviewer, currentUserId) != null);
// } else if (costDomain.getCostStatus().equals(CostDomain.STATUS_FINAL_CHECK)) {
// costDomain.setCanAudit(costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.finalReviewer, currentUserId) != null);
// } else {
// costDomain.setCanAudit(false);
// }
//todo
costDomain
.
setCanAudit
(
true
);
return
costDomain
;
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/CostContext.java
View file @
b480e5fc
...
...
@@ -39,8 +39,8 @@ public class CostContext {
costState
.
handle
();
}
public
void
refuse
()
{
costState
.
refuse
();
public
void
refuse
(
String
rejectReason
)
{
costState
.
refuse
(
rejectReason
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/CostState.java
View file @
b480e5fc
...
...
@@ -80,5 +80,5 @@ public abstract class CostState {
public
abstract
void
handle
();
public
abstract
void
refuse
();
public
abstract
void
refuse
(
String
rejectReason
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/DepartmentCheckState.java
View file @
b480e5fc
...
...
@@ -23,6 +23,7 @@ public class DepartmentCheckState extends CostState {
@Autowired
FinancialCheckState
financialCheckState
;
@Override
public
void
handle
()
{
CostDomain
costDomain
=
costContext
.
costDomain
;
...
...
@@ -77,7 +78,27 @@ public class DepartmentCheckState extends CostState {
@Override
public
void
refuse
()
{
public
void
refuse
(
String
rejectReason
)
{
CostDomain
costDomain
=
costContext
.
costDomain
;
Integer
currentUserId
=
costContext
.
currentUserId
;
OaUser
costUser
=
oaUserMapper
.
selectByOaUserId
(
costDomain
.
getCreateUserid
());
//check status
if
(!
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_DEPARTMENT_CHECK
))
{
throw
new
BizRuntimeException
(
"invalid status"
);
}
//人工审核没权限
if
(
costReviewerMapper
.
queryOne
(
costUser
.
getPrimaryDepartmentId
(),
CostReviewer
.
departmentReviewer
,
currentUserId
)
==
null
)
{
throw
new
BizRuntimeException
(
"current user no authority"
);
}
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_REJECT
);
costDao
.
updateById
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"部门审核拒绝,理由:"
+
rejectReason
,
CostLogDomain
.
TYPE_UPDATE
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinalCheckState.java
View file @
b480e5fc
...
...
@@ -95,7 +95,26 @@ public class FinalCheckState extends CostState {
}
@Override
public
void
refuse
()
{
public
void
refuse
(
String
rejectReason
)
{
CostDomain
costDomain
=
costContext
.
costDomain
;
Integer
currentUserId
=
costContext
.
currentUserId
;
CostCompanyDomain
costCompany
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
//check status
if
(!
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_FINAL_CHECK
))
{
throw
new
BizRuntimeException
(
"invalid status"
);
}
//人工审核通过
if
(
costReviewerMapper
.
queryOne
(
costCompany
.
getId
(),
CostReviewer
.
finalReviewer
,
currentUserId
)
==
null
)
{
throw
new
BizRuntimeException
(
"current user no authority"
);
}
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_REJECT
);
costDao
.
updateById
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"最终审核拒绝,理由:"
+
rejectReason
,
CostLogDomain
.
TYPE_UPDATE
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinancialCheckState.java
View file @
b480e5fc
...
...
@@ -76,7 +76,26 @@ public class FinancialCheckState extends CostState {
}
@Override
public
void
refuse
()
{
public
void
refuse
(
String
rejectReason
)
{
CostDomain
costDomain
=
costContext
.
costDomain
;
Integer
currentUserId
=
costContext
.
currentUserId
;
CostCompanyDomain
costCompany
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
//check status
if
(!
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_FINANCIAL_CHECK
))
{
throw
new
BizRuntimeException
(
"invalid status"
);
}
//人工审核通过
if
(
costReviewerMapper
.
queryOne
(
costCompany
.
getId
(),
CostReviewer
.
financialReviewer
,
currentUserId
)
==
null
)
{
throw
new
BizRuntimeException
(
"current user no authority"
);
}
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_REJECT
);
costDao
.
updateById
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"财务审核拒绝,理由:"
+
rejectReason
,
CostLogDomain
.
TYPE_UPDATE
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/PayedState.java
View file @
b480e5fc
...
...
@@ -19,7 +19,7 @@ public class PayedState extends CostState {
}
@Override
public
void
refuse
(
)
{
public
void
refuse
(
String
rejectReason
{
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/RefuseState.java
View file @
b480e5fc
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
costcheck
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
org.springframework.stereotype.Component
;
/**
...
...
@@ -15,11 +16,11 @@ public class RefuseState extends CostState {
@Override
public
void
handle
()
{
throw
new
BizRuntimeException
(
"unsupported operate "
);
}
@Override
public
void
refuse
()
{
public
void
refuse
(
String
reason
)
{
throw
new
BizRuntimeException
(
"unsupported operate "
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/UnPayState.java
View file @
b480e5fc
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
costcheck
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
org.springframework.stereotype.Component
;
/**
...
...
@@ -19,7 +20,7 @@ public class UnPayState extends CostState {
}
@Override
public
void
refuse
()
{
public
void
refuse
(
String
reason
)
{
throw
new
BizRuntimeException
(
"unsupported operate "
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/UnSubmitState.java
View file @
b480e5fc
...
...
@@ -43,7 +43,7 @@ public class UnSubmitState extends CostState {
}
@Override
public
void
refuse
()
{
public
void
refuse
(
String
rejectReason
)
{
throw
new
BizRuntimeException
(
"unsupported operate "
);
}
}
bailuntec-cost-core/src/main/resources/mapper/auth/OaDepartmentMapper.xml
View file @
b480e5fc
...
...
@@ -3,9 +3,10 @@
<mapper
namespace=
"com.blt.other.module.auth.dao.OaDepartmentMapper"
>
<select
id=
"reviewerList"
resultType=
"com.blt.other.module.auth.model.OaDepartment"
>
SELECT t1.*, t2.`name` company_name
SELECT distinct t1.*,
t2.`name` company_name
from oa_department t1
LEFT JOIN
oa_company t2 on t1.company_id = t2.oa_company_id
left join
oa_company t2 on t1.company_id = t2.oa_company_id
left join cost_reviewer t3 on t1.department_id = t3.refer_id and (t3.type = 1)
where t1.parent_id = 0
/*审核人*/
...
...
@@ -28,10 +29,11 @@
<if
test=
"req.oaPrimaryDepartmentId !=null"
>
and t1.department_id = #{req.oaPrimaryDepartmentId}
</if>
group by t1.id
</select>
<select
id=
"selectByDepartmentId"
resultType=
"com.blt.other.module.auth.model.OaDepartment"
>
select * from oa_department where department_id =#{oaDepartmentId}
select *
from oa_department
where department_id = #{oaDepartmentId}
</select>
...
...
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