Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
windows
Project
Project
Details
Activity
Releases
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
zhanhai
windows
Commits
aa9144b4
Commit
aa9144b4
authored
Mar 12, 2025
by
LSL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送天思
parent
92d21fda
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
178 additions
and
9 deletions
+178
-9
LoanComponent.java
src/main/java/com/jqtx/windows/component/LoanComponent.java
+4
-3
RetryStateEnum.java
...java/com/jqtx/windows/component/enums/RetryStateEnum.java
+40
-0
RetryTypeEnum.java
.../java/com/jqtx/windows/component/enums/RetryTypeEnum.java
+38
-0
LoanComponentImpl.java
...va/com/jqtx/windows/component/impl/LoanComponentImpl.java
+11
-0
SyncRetryJob.java
src/main/java/com/jqtx/windows/job/SyncRetryJob.java
+39
-6
WindowsPublicMapper.java
...m/jqtx/windows/repository/mapper/WindowsPublicMapper.java
+11
-0
WindowsPublicMapper.xml
src/main/resources/mybatis/mapper/WindowsPublicMapper.xml
+35
-0
No files found.
src/main/java/com/jqtx/windows/component/LoanComponent.java
View file @
aa9144b4
package
com
.
jqtx
.
windows
.
component
;
import
com.jqtx.windows.component.model.LoanModel
;
import
com.jqtx.windows.repository.mapper.WindowsCreditMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
public
interface
LoanComponent
{
...
...
@@ -16,4 +15,6 @@ public interface LoanComponent {
LoanModel
getByOrderNo
(
String
orderNo
);
LoanModel
getByOrderNoInit
(
String
orderNo
);
List
<
String
>
getNotTsLoanModel
();
}
src/main/java/com/jqtx/windows/component/enums/RetryStateEnum.java
0 → 100644
View file @
aa9144b4
package
com
.
jqtx
.
windows
.
component
.
enums
;
/**
* @Author: wuwei
* @Date: 2019/12/04 13:40
* 重试推送类型
*/
public
enum
RetryStateEnum
{
SUBMITED
(
"SUBMITED"
,
"待推送"
),
PUSH_SUCCESS
(
"SUCCESS"
,
"推送成功"
),
PUSH_FAIL
(
"FAIL"
,
"推送失败"
);
private
String
message
;
private
String
code
;
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
private
RetryStateEnum
(
String
code
,
String
message
)
{
this
.
message
=
message
;
this
.
code
=
code
;
}
}
src/main/java/com/jqtx/windows/component/enums/RetryTypeEnum.java
0 → 100644
View file @
aa9144b4
package
com
.
jqtx
.
windows
.
component
.
enums
;
/**
* @Author: wuwei
* @Date: 2019/12/04 13:40
* 重试推送类型
*/
public
enum
RetryTypeEnum
{
RETRY_TYPE_BACK_LOAN
(
"RETRY_TYPE_BACK_LOAN"
,
"借款推送"
),
RETRY_TYPE_BACK_PLAN
(
"RETRY_TYPE_BACK_PLAN"
,
"还款计划推送"
)
;
private
String
message
;
private
String
code
;
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
private
RetryTypeEnum
(
String
code
,
String
message
)
{
this
.
message
=
message
;
this
.
code
=
code
;
}
}
src/main/java/com/jqtx/windows/component/impl/LoanComponentImpl.java
View file @
aa9144b4
...
...
@@ -3,12 +3,15 @@ package com.jqtx.windows.component.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
com.jqtx.windows.component.LoanComponent
;
import
com.jqtx.windows.component.model.LoanModel
;
import
com.jqtx.windows.component.model.LoanPlanModel
;
import
com.jqtx.windows.repository.entity.WindowsLoan
;
import
com.jqtx.windows.repository.entity.WindowsLoanExample
;
import
com.jqtx.windows.repository.mapper.WindowsLoanMapper
;
import
com.jqtx.windows.repository.mapper.WindowsPublicMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
...
...
@@ -17,6 +20,9 @@ public class LoanComponentImpl implements LoanComponent {
@Autowired
private
WindowsLoanMapper
windowsLoanMapper
;
@Autowired
private
WindowsPublicMapper
windowsPublicMapper
;
@Override
public
LoanModel
getByLoanNo
(
String
loanNo
)
{
WindowsLoanExample
example
=
new
WindowsLoanExample
();
...
...
@@ -63,4 +69,9 @@ public class LoanComponentImpl implements LoanComponent {
List
<
WindowsLoan
>
windowsLoans
=
windowsLoanMapper
.
selectByExample
(
example
);
return
windowsLoans
.
stream
().
map
(
m
->
BeanUtil
.
toBean
(
m
,
LoanModel
.
class
)).
findFirst
().
orElse
(
null
);
}
@Override
public
List
<
String
>
getNotTsLoanModel
()
{
return
windowsPublicMapper
.
getNotTsLoanModel
();
}
}
src/main/java/com/jqtx/windows/job/SyncRetryJob.java
View file @
aa9144b4
package
com
.
jqtx
.
windows
.
job
;
import
com.alibaba.fastjson2.JSON
;
import
com.jqtx.windows.component.LoanPlanComponent
;
import
com.jqtx.windows.component.SyncBuildComponent
;
import
com.jqtx.windows.component.config.Contant
;
import
com.jqtx.windows.component.config.FeignUrlConfig
;
import
com.jqtx.windows.component.enums.RetryStateEnum
;
import
com.jqtx.windows.component.enums.RetryTypeEnum
;
import
com.jqtx.windows.component.impl.LoanComponentImpl
;
import
com.jqtx.windows.component.model.LoanPlanModel
;
import
com.jqtx.windows.component.tsmodel.AddCaseRequest
;
import
com.jqtx.windows.repository.entity.WindowsRetry
;
import
com.jqtx.windows.repository.mapper.WindowsRetryMapper
;
import
com.jqtx.windows.service.SyncDataService
;
import
com.jqtx.windows.web.response.JsonResult
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.
collections.Collection
Utils
;
import
org.apache.commons.
lang3.String
Utils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.text.MessageFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
...
...
@@ -37,6 +42,10 @@ public class SyncRetryJob {
private
LoanPlanComponent
loanPlanComponent
;
@Autowired
private
SyncBuildComponent
syncBuildComponent
;
@Autowired
private
LoanComponentImpl
loanComponent
;
@Autowired
private
WindowsRetryMapper
windowsRetryMapper
;
@XxlJob
(
value
=
"syncRetryJobHandler"
)
private
void
process
()
{
...
...
@@ -47,9 +56,14 @@ public class SyncRetryJob {
log
.
info
(
"任务开始时间-[{}]"
,
executeStartTime
.
format
(
formatter
));
log
.
info
(
"需要重新推送案件处理开始..."
);
Long
li1
=
System
.
currentTimeMillis
();
List
<
LoanPlanModel
>
list
=
loanPlanComponent
.
getByLoan
(
param
);
for
(
LoanPlanModel
planModel
:
list
)
{
sendTs
(
syncBuildComponent
.
buildAddCaseRequest
(
planModel
.
getPlanNo
()));
//查询
if
(
StringUtils
.
isNotBlank
(
param
))
{
sendTs
(
param
);
}
else
{
List
<
String
>
loanModels
=
loanComponent
.
getNotTsLoanModel
();
for
(
String
loanNo
:
loanModels
)
{
sendTs
(
loanNo
);
}
}
Long
li2
=
System
.
currentTimeMillis
();
log
.
info
(
"任务结束时间-[{}],执行-[{}]"
,
executeStartTime
.
format
(
formatter
),
li2
-
li1
);
...
...
@@ -59,6 +73,26 @@ public class SyncRetryJob {
log
.
info
(
"需要重新推送案件处理结束..."
);
}
public
void
sendTs
(
String
loanNo
)
{
List
<
LoanPlanModel
>
list
=
loanPlanComponent
.
getByLoan
(
loanNo
);
for
(
LoanPlanModel
planModel
:
list
)
{
Boolean
planboolean
=
sendTs
(
syncBuildComponent
.
buildAddCaseRequest
(
planModel
.
getPlanNo
()));
insertRetry
(
planModel
.
getPlanNo
(),
RetryTypeEnum
.
RETRY_TYPE_BACK_PLAN
.
getCode
(),
planboolean
);
}
insertRetry
(
loanNo
,
RetryTypeEnum
.
RETRY_TYPE_BACK_LOAN
.
getCode
(),
true
);
}
private
void
insertRetry
(
String
bizCode
,
String
bizType
,
Boolean
bizState
){
WindowsRetry
windowsRetry
=
new
WindowsRetry
();
windowsRetry
.
setBizCode
(
bizCode
);
windowsRetry
.
setBizType
(
bizType
);
windowsRetry
.
setBizState
(
bizState
?
RetryStateEnum
.
PUSH_SUCCESS
.
getCode
()
:
RetryStateEnum
.
PUSH_FAIL
.
getCode
());
windowsRetry
.
setPushDate
(
LocalDate
.
now
());
LocalDateTime
localDateTime
=
LocalDateTime
.
now
();
windowsRetry
.
setGmtCreated
(
localDateTime
);
windowsRetry
.
setGmtModified
(
localDateTime
);
windowsRetryMapper
.
insert
(
windowsRetry
);
}
public
Boolean
sendTs
(
AddCaseRequest
addCaseRequest
)
{
String
url
=
feignUrlConfig
.
getUrl
()
+
Contant
.
REMIND_URL
;
String
body
=
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
(
addCaseRequest
);
...
...
@@ -73,5 +107,4 @@ public class SyncRetryJob {
}
}
src/main/java/com/jqtx/windows/repository/mapper/WindowsPublicMapper.java
0 → 100644
View file @
aa9144b4
package
com
.
jqtx
.
windows
.
repository
.
mapper
;
import
com.jqtx.windows.repository.entity.WindowsLoan
;
import
com.jqtx.windows.repository.entity.WindowsLoanExample
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
WindowsPublicMapper
{
List
<
String
>
getNotTsLoanModel
();
}
src/main/resources/mybatis/mapper/WindowsPublicMapper.xml
0 → 100644
View file @
aa9144b4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jqtx.windows.repository.mapper.WindowsPublicMapper"
>
<resultMap
id=
"LoanModelResultMap"
type=
"com.jqtx.windows.repository.entity.WindowsLoan"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"loan_no"
jdbcType=
"VARCHAR"
property=
"loanNo"
/>
<result
column=
"order_no"
jdbcType=
"VARCHAR"
property=
"orderNo"
/>
<result
column=
"loan_amt"
jdbcType=
"DECIMAL"
property=
"loanAmt"
/>
<result
column=
"raise_amt"
jdbcType=
"DECIMAL"
property=
"raiseAmt"
/>
<result
column=
"service_amt"
jdbcType=
"DECIMAL"
property=
"serviceAmt"
/>
<result
column=
"rate_amt"
jdbcType=
"DECIMAL"
property=
"rateAmt"
/>
<result
column=
"burden_amt"
jdbcType=
"DECIMAL"
property=
"burdenAmt"
/>
<result
column=
"loan_usage"
jdbcType=
"VARCHAR"
property=
"loanUsage"
/>
<result
column=
"raise_date"
jdbcType=
"TIMESTAMP"
property=
"raiseDate"
/>
<result
column=
"loan_status"
jdbcType=
"VARCHAR"
property=
"loanStatus"
/>
<result
column=
"bank_account"
jdbcType=
"VARCHAR"
property=
"bankAccount"
/>
<result
column=
"loan_term"
jdbcType=
"VARCHAR"
property=
"loanTerm"
/>
<result
column=
"loan_credit_result"
jdbcType=
"VARCHAR"
property=
"loanCreditResult"
/>
<result
column=
"gmt_created"
jdbcType=
"TIMESTAMP"
property=
"gmtCreated"
/>
<result
column=
"gmt_modified"
jdbcType=
"TIMESTAMP"
property=
"gmtModified"
/>
<result
column=
"memo"
jdbcType=
"VARCHAR"
property=
"memo"
/>
</resultMap>
<select
id=
"getNotTsLoanModel"
resultType=
"java.lang.String"
>
SELECT
wl.loan_no
FROM
windows_loan wl
LEFT JOIN
windows_retry wr
ON wl.loan_no = wr.biz_code
WHERE wr.id is NULL AND wl.loan_status = 'BACKING' LIMIT 100
</select>
</mapper>
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