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
b4c93ca8
Commit
b4c93ca8
authored
Aug 28, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
3d75cc0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
FinalCheckState.java
...r/module/cost/service/impl/costcheck/FinalCheckState.java
+0
-2
FinancialCheckState.java
...dule/cost/service/impl/costcheck/FinancialCheckState.java
+32
-1
No files found.
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinalCheckState.java
View file @
b4c93ca8
...
@@ -83,12 +83,10 @@ public class FinalCheckState extends CostState {
...
@@ -83,12 +83,10 @@ public class FinalCheckState extends CostState {
" \"msgtype\": \"markdown\",\n"
+
" \"msgtype\": \"markdown\",\n"
+
" \"markdown\": {\n"
+
" \"markdown\": {\n"
+
" \"content\": \"单号【<font color=\\\"info\\\">%s</font>】通过人工操作最终审核。\\n"
+
" \"content\": \"单号【<font color=\\\"info\\\">%s</font>】通过人工操作最终审核。\\n"
+
">金额: <font color=\\\"info\\\">%s</font>\\n"
+
">审核人: <font color=\\\"info\\\">%s</font>\\n"
+
">审核人: <font color=\\\"info\\\">%s</font>\\n"
+
">审核时间: <font color=\\\"info\\\">%s</font>\""
+
">审核时间: <font color=\\\"info\\\">%s</font>\""
+
" }\n"
+
" }\n"
+
"}"
,
costDomain
.
getCostNo
(),
"}"
,
costDomain
.
getCostNo
(),
"CNY "
+
costDomain
.
getAmountRmb
(),
userDomain
==
null
?
currentUserId
:
userDomain
.
getUsername
(),
userDomain
==
null
?
currentUserId
:
userDomain
.
getUsername
(),
LocalDateTime
.
now
().
format
(
dtf
));
LocalDateTime
.
now
().
format
(
dtf
));
restTemplate
.
getMessageConverters
().
set
(
1
,
new
StringHttpMessageConverter
(
StandardCharsets
.
UTF_8
));
restTemplate
.
getMessageConverters
().
set
(
1
,
new
StringHttpMessageConverter
(
StandardCharsets
.
UTF_8
));
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinancialCheckState.java
View file @
b4c93ca8
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
costcheck
;
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
costcheck
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.blt.other.common.config.property.WxWebHook
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.database.model.CostCompanyDomain
;
import
com.blt.other.database.model.CostCompanyDomain
;
import
com.blt.other.database.model.CostLogDomain
;
import
com.blt.other.database.model.CostLogDomain
;
import
com.blt.other.database.model.UserDomain
;
import
com.blt.other.module.auth.dao.UserDao
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostCurrentReviewerMapper
;
import
com.blt.other.module.cost.dao.CostCurrentReviewerMapper
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
...
@@ -13,11 +16,15 @@ import com.blt.other.module.cost.model.CostTemplate;
...
@@ -13,11 +16,15 @@ import com.blt.other.module.cost.model.CostTemplate;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.http.converter.StringHttpMessageConverter
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -43,6 +50,30 @@ public class FinancialCheckState extends CostState {
...
@@ -43,6 +50,30 @@ public class FinancialCheckState extends CostState {
@Resource
@Resource
ApprovalHistoryService
approvalHistoryService
;
ApprovalHistoryService
approvalHistoryService
;
@Resource
WxWebHook
webHook
;
@Resource
RestTemplate
restTemplate
;
@Resource
UserDao
userDao
;
private
void
sendWxMsg
(
CostDomain
costDomain
,
Integer
currentUserId
)
{
UserDomain
userDomain
=
userDao
.
selectByuserid
(
currentUserId
);
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
String
msg
=
String
.
format
(
"{\n"
+
" \"msgtype\": \"markdown\",\n"
+
" \"markdown\": {\n"
+
" \"content\": \"单号【<font color=\\\"info\\\">%s</font>】通过人工操作财务审核。\\n"
+
">审核人: <font color=\\\"info\\\">%s</font>\\n"
+
">审核时间: <font color=\\\"info\\\">%s</font>\""
+
" }\n"
+
"}"
,
costDomain
.
getCostNo
(),
userDomain
==
null
?
currentUserId
:
userDomain
.
getUsername
(),
LocalDateTime
.
now
().
format
(
dtf
));
restTemplate
.
getMessageConverters
().
set
(
1
,
new
StringHttpMessageConverter
(
StandardCharsets
.
UTF_8
));
restTemplate
.
postForEntity
(
webHook
.
getUrl
()
+
webHook
.
getFinalReview
(),
msg
,
Object
.
class
);
}
@Override
@Override
void
nextState
(
CostState
costState
)
{
void
nextState
(
CostState
costState
)
{
super
.
nextState
(
costState
);
super
.
nextState
(
costState
);
...
@@ -95,7 +126,7 @@ public class FinancialCheckState extends CostState {
...
@@ -95,7 +126,7 @@ public class FinancialCheckState extends CostState {
costDao
.
updateById
(
costDomain
);
costDao
.
updateById
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"财务审核通过"
,
CostLogDomain
.
FINANCIAL_MANUAL_PASS
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
currentUserId
,
"财务审核通过"
,
CostLogDomain
.
FINANCIAL_MANUAL_PASS
);
sendWxMsg
(
costDomain
,
currentUserId
);
approvalHistoryService
.
save
(
approvalHistoryDomain
);
approvalHistoryService
.
save
(
approvalHistoryDomain
);
//流转状态
//流转状态
nextState
(
finalCheckState
);
nextState
(
finalCheckState
);
...
...
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