Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fd276d2b
authored
Sep 09, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add] Controller 返回类型为 String 时,类型设置为 JSON
1 parent
aa428362
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
3 deletions
pom.xml
src/main/java/vion/advice/ResBodyAdvice.java
src/main/java/vion/cron/TaskRunner.java
src/main/java/vion/service/impl/ContractServiceImpl.java
src/main/resources/application.yml
pom.xml
View file @
fd276d2
...
...
@@ -23,6 +23,7 @@
<wx-mp.version>
4.6.2.B
</wx-mp.version>
<sa-token.verion>
1.38.0
</sa-token.verion>
<myexcel.version>
4.5.2
</myexcel.version>
<maxmind.version>
4.2.0
</maxmind.version>
</properties>
<dependencies>
...
...
@@ -96,7 +97,7 @@
<dependency>
<groupId>
com.maxmind.geoip2
</groupId>
<artifactId>
geoip2
</artifactId>
<version>
4.2.0
</version>
<version>
${maxmind.version}
</version>
</dependency>
</dependencies>
...
...
src/main/java/vion/advice/ResBodyAdvice.java
View file @
fd276d2
...
...
@@ -44,8 +44,10 @@ public class ResBodyAdvice implements ResponseBodyAdvice<Object> {
if
(
returnType
.
getParameterType
().
isAssignableFrom
(
String
.
class
))
{
// 字符串类型特殊处理
try
{
response
.
getHeaders
().
setContentType
(
MediaType
.
APPLICATION_JSON
);
return
new
ObjectMapper
().
writeValueAsString
(
resultVO
);
}
catch
(
JsonProcessingException
e
)
{
log
.
error
(
"Json 序列化失败"
);
}
}
return
resultVO
;
...
...
src/main/java/vion/cron/TaskRunner.java
View file @
fd276d2
...
...
@@ -35,7 +35,6 @@ public class TaskRunner {
void
pushUndoneTask
()
{
log
.
info
(
"开始推送未完成工单"
);
var
taskList
=
taskService
.
list
(
Wrappers
.<
Task
>
lambdaQuery
().
notIn
(
Task:
:
getStatus
,
3
,
5
));
// todo 需要异步发送吗?
Opt
.
ofEmptyAble
(
taskList
)
.
map
(
l
->
l
.
stream
().
map
(
Task:
:
getActiveUser
).
collect
(
Collectors
.
toSet
()))
.
ifPresent
(
userIds
->
{
...
...
src/main/java/vion/service/impl/ContractServiceImpl.java
View file @
fd276d2
...
...
@@ -871,6 +871,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
* */
@Scheduled
(
cron
=
"0 0 8 * * ?"
)
public
void
verifyNum
()
{
log
.
info
(
"合同比对开始"
);
var
contractNoList
=
this
.
listObjs
(
Wrappers
.<
Contract
>
lambdaQuery
().
select
(
Contract:
:
getContractNo
),
Object:
:
toString
);
...
...
@@ -931,6 +932,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
var
sameList
=
CollUtil
.
intersectionDistinct
(
dataIdSet
,
contractNoList
);
// 只比对合同编号SC开头的合同
contractDiff
(
sameList
.
stream
().
filter
(
no
->
StrUtil
.
startWith
(
no
,
"SC"
)).
collect
(
Collectors
.
toSet
()));
log
.
info
(
"合同比对结束"
);
}
/**
...
...
@@ -988,7 +990,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
Contract:
:
getReceivableAmount
,
Contract:
:
getOutstandingAmount
,
Contract:
:
getSubject
,
Contract:
:
getRemark
,
Contract:
:
getCreateUser
,
Contract:
:
getModifyUser
,
Contract:
:
getCreateTime
,
Contract:
:
getModifyTime
,
Contract:
:
getFinalDate
,
Contract:
:
getInvoiceAmount
,
Contract:
:
getFinancialStatus
,
Contract:
:
getOriginalModTime
)
Contract:
:
getFinancialStatus
,
Contract:
:
getOriginalModTime
,
Contract:
:
getBackInfo
)
.
ignoreNullValue
();
var
platMap
=
BeanUtil
.
beanToMap
(
platContract
,
new
HashMap
<>(),
copyOptions
);
...
...
@@ -1008,6 +1010,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
.
header
(
"sign"
,
SecureUtil
.
sha256
(
json
.
toString
()
+
token
))
.
body
(
json
.
toString
())
.
retrieve
()
// fixme GOAWAY received
.
body
(
JSONObject
.
class
);
if
(
jobO
.
getInt
(
"code"
)
!=
1
)
{
log
.
error
(
"获取合同列表失败,错误原因:{}"
,
jobO
);
...
...
@@ -1118,6 +1121,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
V
value
=
entry
.
getValue
();
if
(!
map2
.
containsKey
(
key
)
||
ObjUtil
.
notEquals
(
value
,
map2
.
get
(
key
)))
{
log
.
info
(
"不一致内容项:{}"
,
key
);
return
false
;
}
}
...
...
src/main/resources/application.yml
View file @
fd276d2
server
:
port
:
8011
shutdown
:
graceful
spring
:
profiles
:
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment