Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QG
customer-service
Commits
9ec20093
Commit
9ec20093
authored
Mar 05, 2022
by
吴琼
Browse files
Options
Browse Files
Download
Plain Diff
合并master
parents
aed1a2fc
e984cf57
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
679 additions
and
324 deletions
+679
-324
pom.xml
pom.xml
+20
-24
OfflineRepaySubmitRecordRepo.java
...uantgroup/customer/repo/OfflineRepaySubmitRecordRepo.java
+0
-2
VccRest.java
src/main/java/cn/quantgroup/customer/rest/VccRest.java
+17
-35
IFastDFSService.java
.../java/cn/quantgroup/customer/service/IFastDFSService.java
+74
-74
FastDFSServiceImpl.java
.../quantgroup/customer/service/impl/FastDFSServiceImpl.java
+179
-177
TransactionReceiptRecordServiceImpl.java
...mer/service/impl/TransactionReceiptRecordServiceImpl.java
+0
-2
VccServiceImpl.java
...a/cn/quantgroup/customer/service/impl/VccServiceImpl.java
+388
-0
WorkOrderTest.java
src/test/xiaoman/WorkOrderTest.java
+1
-10
No files found.
pom.xml
View file @
9ec20093
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<encoding>
${project.build.sourceEncoding}
</encoding>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</configuration>
</plugin>
</plugin>
<!--
<plugin>
<plugin>
<groupId>
com.mysema.maven
</groupId>
<groupId>
com.mysema.maven
</groupId>
<artifactId>
apt-maven-plugin
</artifactId>
<artifactId>
apt-maven-plugin
</artifactId>
<version>
1.1.3
</version>
<version>
1.1.3
</version>
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
</configuration>
</configuration>
</execution>
</execution>
</executions>
</executions>
</plugin>
-->
</plugin>
</plugins>
</plugins>
</build>
</build>
...
@@ -271,27 +271,6 @@
...
@@ -271,27 +271,6 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.itextpdf
</groupId>
<artifactId>
itextpdf
</artifactId>
<version>
5.5.13
</version>
</dependency>
<dependency>
<groupId>
com.itextpdf.tool
</groupId>
<artifactId>
xmlworker
</artifactId>
<version>
5.5.6
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.4.1
</version>
</dependency>
<dependency>
<groupId>
com.jcraft
</groupId>
<artifactId>
jsch
</artifactId>
<version>
0.1.54
</version>
</dependency>
<!--<dependency>
<groupId>
com.querydsl
</groupId>
<groupId>
com.querydsl
</groupId>
<artifactId>
querydsl-jpa
</artifactId>
<artifactId>
querydsl-jpa
</artifactId>
<version>
4.2.1
</version>
<version>
4.2.1
</version>
...
@@ -302,8 +281,9 @@
...
@@ -302,8 +281,9 @@
<artifactId>
querydsl-apt
</artifactId>
<artifactId>
querydsl-apt
</artifactId>
<version>
4.2.1
</version>
<version>
4.2.1
</version>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
-->
</dependency>
<!-- fastdfs start -->
<dependency>
<dependency>
<groupId>
com.github.tobato
</groupId>
<groupId>
com.github.tobato
</groupId>
<artifactId>
fastdfs-client
</artifactId>
<artifactId>
fastdfs-client
</artifactId>
...
@@ -334,6 +314,22 @@
...
@@ -334,6 +314,22 @@
<artifactId>
jsch
</artifactId>
<artifactId>
jsch
</artifactId>
<version>
0.1.54
</version>
<version>
0.1.54
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.itextpdf
</groupId>
<artifactId>
itextpdf
</artifactId>
<version>
5.5.13
</version>
</dependency>
<dependency>
<groupId>
com.itextpdf.tool
</groupId>
<artifactId>
xmlworker
</artifactId>
<version>
5.5.6
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.4.1
</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
src/main/java/cn/quantgroup/customer/repo/OfflineRepaySubmitRecordRepo.java
View file @
9ec20093
/*
package
cn
.
quantgroup
.
customer
.
repo
;
package
cn
.
quantgroup
.
customer
.
repo
;
import
cn.quantgroup.customer.entity.OfflineRepaySubmitRecord
;
import
cn.quantgroup.customer.entity.OfflineRepaySubmitRecord
;
...
@@ -20,4 +19,3 @@ public interface OfflineRepaySubmitRecordRepo extends JpaRepository<OfflineRepay
...
@@ -20,4 +19,3 @@ public interface OfflineRepaySubmitRecordRepo extends JpaRepository<OfflineRepay
OfflineRepaySubmitRecord
findBySerialNoEqualsAndApprovalStatusEquals
(
String
serialNo
,
Integer
approvalStatus
);
OfflineRepaySubmitRecord
findBySerialNoEqualsAndApprovalStatusEquals
(
String
serialNo
,
Integer
approvalStatus
);
}
}
*/
src/main/java/cn/quantgroup/customer/rest/VccRest.java
View file @
9ec20093
/*
package
cn
.
quantgroup
.
customer
.
rest
;
package
cn
.
quantgroup
.
customer
.
rest
;
import
cn.quantgroup.customer.aop.OperateLog
;
import
cn.quantgroup.customer.aop.OperateLog
;
...
@@ -28,13 +27,11 @@ public class VccRest {
...
@@ -28,13 +27,11 @@ public class VccRest {
@Autowired
@Autowired
private
IVccService
vccService
;
private
IVccService
vccService
;
*/
/**
/**
* 查询用户的待还款信息
* 查询用户的待还款信息
* @param query
* @param query
* @return
* @return
*//*
*/
@PostMapping
(
"/offline_pre_repay/query_page"
)
@PostMapping
(
"/offline_pre_repay/query_page"
)
@OperateLog
(
moduleName
=
"查询用户的待还款信息"
)
@OperateLog
(
moduleName
=
"查询用户的待还款信息"
)
public
JsonResult
queryPage
(
@RequestBody
@Valid
UserPreRepayInfoQuery
query
,
BindingResult
bindingResult
){
public
JsonResult
queryPage
(
@RequestBody
@Valid
UserPreRepayInfoQuery
query
,
BindingResult
bindingResult
){
...
@@ -48,7 +45,7 @@ public class VccRest {
...
@@ -48,7 +45,7 @@ public class VccRest {
return
JsonResult
.
buildErrorStateResult
(
"请求参数userId,phone,billId,orderNo不能同时为空"
);
return
JsonResult
.
buildErrorStateResult
(
"请求参数userId,phone,billId,orderNo不能同时为空"
);
}
}
try
{
try
{
JsonResult jsonResult =
//
vccService.queryPage(query);
JsonResult
jsonResult
=
vccService
.
queryPage
(
query
);
log
.
info
(
"queryPage | 结束用户待还款查询,param={}"
,
query
);
log
.
info
(
"queryPage | 结束用户待还款查询,param={}"
,
query
);
return
jsonResult
;
return
jsonResult
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
@@ -57,14 +54,12 @@ public class VccRest {
...
@@ -57,14 +54,12 @@ public class VccRest {
}
}
}
}
*/
/**
/**
* 查询分期账单的详情
* 查询分期账单的详情
* @param uniqueId
* @param uniqueId
* @param repayType
* @param repayType
* @return
* @return
*//*
*/
@GetMapping
(
"/pre_repay_cal/detail"
)
@GetMapping
(
"/pre_repay_cal/detail"
)
@OperateLog
(
moduleName
=
"查询分期账单的详情"
)
@OperateLog
(
moduleName
=
"查询分期账单的详情"
)
public
JsonResult
repayPlanDetail
(
@NotNull
String
uniqueId
,
@NotNull
Integer
repayType
){
public
JsonResult
repayPlanDetail
(
@NotNull
String
uniqueId
,
@NotNull
Integer
repayType
){
...
@@ -79,14 +74,12 @@ public class VccRest {
...
@@ -79,14 +74,12 @@ public class VccRest {
}
}
}
}
*/
/**
/**
* 保存线下还款的申请记录
* 保存线下还款的申请记录
* @param request
* @param request
* @param param
* @param param
* @return
* @return
*//*
*/
@PostMapping
(
"/offline_repay/save_submit"
)
@PostMapping
(
"/offline_repay/save_submit"
)
@OperateLog
(
moduleName
=
"保存线下还款的申请记录"
)
@OperateLog
(
moduleName
=
"保存线下还款的申请记录"
)
public
JsonResult
saveSubmit
(
HttpServletRequest
request
,
@RequestBody@Valid
OfflineRepaySubmitParam
param
,
BindingResult
bindingResult
){
public
JsonResult
saveSubmit
(
HttpServletRequest
request
,
@RequestBody@Valid
OfflineRepaySubmitParam
param
,
BindingResult
bindingResult
){
...
@@ -118,13 +111,11 @@ public class VccRest {
...
@@ -118,13 +111,11 @@ public class VccRest {
}
}
}
}
*/
/**
/**
* 审批回显提交的线下还款申请记录
* 审批回显提交的线下还款申请记录
* @param serialNo
* @param serialNo
* @return
* @return
*//*
*/
@GetMapping
(
"/offline_repay/approval"
)
@GetMapping
(
"/offline_repay/approval"
)
@OperateLog
(
moduleName
=
"审批回显提交的线下还款申请记录"
)
@OperateLog
(
moduleName
=
"审批回显提交的线下还款申请记录"
)
public
JsonResult
approval
(
@NotNull
String
serialNo
){
public
JsonResult
approval
(
@NotNull
String
serialNo
){
...
@@ -139,13 +130,11 @@ public class VccRest {
...
@@ -139,13 +130,11 @@ public class VccRest {
}
}
}
}
*/
/**
/**
* 查看审批流水记录
* 查看审批流水记录
* @param serialNo
* @param serialNo
* @return
* @return
*//*
*/
@GetMapping
(
"/approval/detail"
)
@GetMapping
(
"/approval/detail"
)
@OperateLog
(
moduleName
=
"查看审批流水记录"
)
@OperateLog
(
moduleName
=
"查看审批流水记录"
)
public
JsonResult
queryApprovalRecord
(
@NotNull
String
serialNo
){
public
JsonResult
queryApprovalRecord
(
@NotNull
String
serialNo
){
...
@@ -160,16 +149,14 @@ public class VccRest {
...
@@ -160,16 +149,14 @@ public class VccRest {
}
}
}
}
*/
/**
/**
* 审批结果:通过/拒绝
* 审批结果:通过/拒绝
* @param request
* @param request
* @param serialNo
* @param serialNo
* @param remark
* @param remark
* @param status
* @param status
* @return
* @return
*//*
*/
@GetMapping
(
"/approval/result"
)
@GetMapping
(
"/approval/result"
)
@OperateLog
(
moduleName
=
"审批结果:通过/拒绝"
)
@OperateLog
(
moduleName
=
"审批结果:通过/拒绝"
)
public
JsonResult
approvalResult
(
HttpServletRequest
request
,
@NotNull
String
serialNo
,
String
remark
,
@NotNull
Integer
status
){
public
JsonResult
approvalResult
(
HttpServletRequest
request
,
@NotNull
String
serialNo
,
String
remark
,
@NotNull
Integer
status
){
...
@@ -185,13 +172,11 @@ public class VccRest {
...
@@ -185,13 +172,11 @@ public class VccRest {
}
}
}
}
*/
/**
/**
* 上传打款凭证
* 上传打款凭证
* @param file
* @param file
* @return
* @return
*//*
*/
@PostMapping
(
"/offline_repay_file/upload"
)
@PostMapping
(
"/offline_repay_file/upload"
)
@OperateLog
(
moduleName
=
"上传打款凭证"
)
@OperateLog
(
moduleName
=
"上传打款凭证"
)
public
JsonResult
fileUpload
(
MultipartFile
file
){
public
JsonResult
fileUpload
(
MultipartFile
file
){
...
@@ -206,13 +191,11 @@ public class VccRest {
...
@@ -206,13 +191,11 @@ public class VccRest {
}
}
}
}
*/
/**
/**
* 查询线下还款的申请记录
* 查询线下还款的申请记录
* @param query
* @param query
* @return
* @return
*//*
*/
@PostMapping
(
"/approval/query_applly_record"
)
@PostMapping
(
"/approval/query_applly_record"
)
@OperateLog
(
moduleName
=
"查询线下还款的申请记录"
)
@OperateLog
(
moduleName
=
"查询线下还款的申请记录"
)
public
JsonResult
queryApplyRecord
(
@RequestBody@Valid
UserPreRepayInfoQuery
query
,
BindingResult
bindingResult
){
public
JsonResult
queryApplyRecord
(
@RequestBody@Valid
UserPreRepayInfoQuery
query
,
BindingResult
bindingResult
){
...
@@ -235,4 +218,3 @@ public class VccRest {
...
@@ -235,4 +218,3 @@ public class VccRest {
}
}
}
}
}
}
*/
src/main/java/cn/quantgroup/customer/service/IFastDFSService.java
View file @
9ec20093
package
cn
.
quantgroup
.
customer
.
service
;
//
package cn.quantgroup.customer.service;
//
import
java.io.IOException
;
//
import java.io.IOException;
import
java.io.InputStream
;
//
import java.io.InputStream;
//
/**
/
//
**
* fastDFS 接入 http://confluence.quantgroup.cn/x/bMU5AQ
//
* fastDFS 接入 http://confluence.quantgroup.cn/x/bMU5AQ
*
//
*
* @author jingfeng.guo
//
* @author jingfeng.guo
* @since 2019-08-24 17:04
//
* @since 2019-08-24 17:04
*/
//
*/
//
public
interface
IFastDFSService
{
//
public interface IFastDFSService {
//
/**
//
/**
* 上传文件
//
* 上传文件
*
//
*
* @param fileInput
//
* @param fileInput
* @param fileSize
//
* @param fileSize
* @param fileExtName 扩展名
//
* @param fileExtName 扩展名
* @return
//
* @return
* @throws IOException
//
* @throws IOException
*/
//
*/
String
uploadFile
(
InputStream
fileInput
,
Long
fileSize
,
String
fileExtName
)
throws
IOException
;
//
String uploadFile(InputStream fileInput, Long fileSize, String fileExtName) throws IOException;
//
/**
//
/**
* 上传文件
//
* 上传文件
*
//
*
* @param bytes
//
* @param bytes
* @param fileExtName
//
* @param fileExtName
* @return
//
* @return
* @throws IOException
//
* @throws IOException
*/
//
*/
String
uploadFile
(
byte
[]
bytes
,
String
fileExtName
)
throws
IOException
;
//
String uploadFile(byte[] bytes, String fileExtName) throws IOException;
//
/**
//
/**
* 文件上传, 下载url 再传
//
* 文件上传, 下载url 再传
*
//
*
* @param url
//
* @param url
* @param fileExtName
//
* @param fileExtName
* @return
//
* @return
* @throws IOException
//
* @throws IOException
*/
//
*/
String
uploadFile
(
String
url
,
String
fileExtName
)
throws
IOException
;
//
String uploadFile(String url, String fileExtName) throws IOException;
//
//
/**
//
/**
* 上传文件 base64
//
* 上传文件 base64
*
//
*
* @param base64String
//
* @param base64String
* @param fileExtName
//
* @param fileExtName
* @return
//
* @return
* @throws IOException
//
* @throws IOException
*/
//
*/
String
uploadFileOfBase64String
(
String
base64String
,
String
fileExtName
)
throws
IOException
;
//
String uploadFileOfBase64String(String base64String, String fileExtName) throws IOException;
//
/**
//
/**
* 下载文件
//
* 下载文件
*
//
*
* @param path
//
* @param path
* @return
//
* @return
* @throws IOException
//
* @throws IOException
*/
//
*/
byte
[]
downloadFile
(
String
path
)
throws
IOException
;
//
byte[] downloadFile(String path) throws IOException;
//
/**
//
/**
* 转成一个临时可用的url
//
* 转成一个临时可用的url
*
//
*
* @param path
//
* @param path
* @return
//
* @return
* @throws IOException
//
* @throws IOException
*/
//
*/
String
toUrl
(
String
path
)
throws
IOException
;
//
String toUrl(String path) throws IOException;
}
//
}
src/main/java/cn/quantgroup/customer/service/impl/FastDFSServiceImpl.java
View file @
9ec20093
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
//package cn.quantgroup.customer.service.impl;
import
cn.quantgroup.customer.service.IFastDFSService
;
//
import
cn.quantgroup.customer.util.ProtoCommon
;
//
import
com.github.tobato.fastdfs.domain.StorePath
;
//import cn.quantgroup.customer.service.IFastDFSService;
import
com.github.tobato.fastdfs.proto.storage.DownloadByteArray
;
//import cn.quantgroup.customer.util.ProtoCommon;
import
com.github.tobato.fastdfs.service.FastFileStorageClient
;
//import com.github.tobato.fastdfs.domain.StorePath;
import
lombok.extern.slf4j.Slf4j
;
//import com.github.tobato.fastdfs.proto.storage.DownloadByteArray;
import
org.apache.commons.codec.binary.Base64
;
//import com.github.tobato.fastdfs.service.FastFileStorageClient;
import
org.apache.commons.lang3.StringUtils
;
//import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Value
;
//import org.apache.commons.codec.binary.Base64;
import
org.springframework.stereotype.Service
;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Value;
import
javax.annotation.Resource
;
//import org.springframework.stereotype.Service;
import
java.io.ByteArrayInputStream
;
//
import
java.io.IOException
;
//import javax.annotation.Resource;
import
java.io.InputStream
;
//import java.io.ByteArrayInputStream;
import
java.net.HttpURLConnection
;
//import java.io.IOException;
import
java.net.URL
;
//import java.io.InputStream;
//import java.net.HttpURLConnection;
/**
//import java.net.URL;
* @author xing.yuan
//
*/
///**
@Service
// * @author xing.yuan
@Slf4j
// */
public
class
FastDFSServiceImpl
implements
IFastDFSService
{
//@Service
//@Slf4j
@Resource
//public class FastDFSServiceImpl implements IFastDFSService {
private
FastFileStorageClient
storageClient
;
//
// @Resource
@Value
(
"${fdfs.secret_key}"
)
// private FastFileStorageClient storageClient;
private
String
secretKey
;
//
// @Value("${fdfs.secret_key}")
@Value
(
"${fdfs.domain}"
)
// private String secretKey;
private
String
fastDfsHttp
;
//
// @Value("${fdfs.domain}")
/**
// private String fastDfsHttp;
* 文件上传
//
*
// /**
* @param fileInput
// * 文件上传
* @param fileSize
// *
* @param fileExtName 扩展名
// * @param fileInput
* @return
// * @param fileSize
*/
// * @param fileExtName 扩展名
@Override
// * @return
public
String
uploadFile
(
InputStream
fileInput
,
Long
fileSize
,
String
fileExtName
)
throws
IOException
{
// */
StorePath
storePath
=
null
;
// @Override
try
{
// public String uploadFile(InputStream fileInput, Long fileSize, String fileExtName) throws IOException {
storePath
=
storageClient
.
uploadFile
(
fileInput
,
fileSize
,
fileExtName
,
null
);
// StorePath storePath = null;
}
finally
{
// try {
if
(
fileInput
!=
null
)
{
// storePath = storageClient.uploadFile(fileInput, fileSize, fileExtName, null);
try
{
// } finally {
fileInput
.
close
();
// if (fileInput != null) {
}
catch
(
IOException
e
)
{
// try {
}
// fileInput.close();
}
// } catch (IOException e) {
}
// }
if
(
storePath
!=
null
&&
StringUtils
.
isNotBlank
(
storePath
.
getFullPath
()))
{
// }
return
storePath
.
getFullPath
();
// }
}
else
{
// if (storePath != null && StringUtils.isNotBlank(storePath.getFullPath())) {
throw
new
IOException
(
"文件上传失败"
);
// return storePath.getFullPath();
}
// } else {
}
// throw new IOException("文件上传失败");
// }
/**
// }
* 文件上传
//
*
// /**
* @param bytes
// * 文件上传
* @param fileExtName 扩展名
// *
* @return
// * @param bytes
*/
// * @param fileExtName 扩展名
@Override
// * @return
public
String
uploadFile
(
byte
[]
bytes
,
String
fileExtName
)
throws
IOException
{
// */
return
uploadFile
(
new
ByteArrayInputStream
(
bytes
),
(
long
)
bytes
.
length
,
fileExtName
);
// @Override
}
// public String uploadFile(byte[] bytes, String fileExtName) throws IOException {
// return uploadFile(new ByteArrayInputStream(bytes), (long) bytes.length, fileExtName);
// }
/**
//
* 文件上传, 下载url 再传
//
*
// /**
* @param url
// * 文件上传, 下载url 再传
* @param fileExtName
// *
* @return
// * @param url
* @throws IOException
// * @param fileExtName
*/
// * @return
@Override
// * @throws IOException
public
String
uploadFile
(
String
url
,
String
fileExtName
)
throws
IOException
{
// */
InputStream
in
=
null
;
// @Override
long
size
=
0
;
// public String uploadFile(String url, String fileExtName) throws IOException {
HttpURLConnection
conn
=
null
;
// InputStream in = null;
try
{
// long size = 0;
URL
httpUrl
=
new
URL
(
url
);
// HttpURLConnection conn = null;
conn
=
(
HttpURLConnection
)
httpUrl
.
openConnection
();
// try {
//设置超时间为3秒
// URL httpUrl = new URL(url);
conn
.
setConnectTimeout
(
3
*
1000
);
// conn = (HttpURLConnection) httpUrl.openConnection();
conn
.
setRequestProperty
(
"User-Agent"
,
"Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"
);
// //设置超时间为3秒
in
=
conn
.
getInputStream
();
// conn.setConnectTimeout(3 * 1000);
size
=
in
.
available
();
// conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
}
catch
(
IOException
e
)
{
// in = conn.getInputStream();
log
.
warn
(
"下载文件异常,url={},"
,
url
,
e
);
// size = in.available();
throw
e
;
// } catch (IOException e) {
}
// log.warn("下载文件异常,url={},", url, e);
log
.
info
(
"准备上传文件; url={}, "
,
url
);
// throw e;
try
{
// }
String
path
=
uploadFile
(
in
,
size
,
fileExtName
);
// log.info("准备上传文件; url={}, ", url);
return
path
;
// try {
}
finally
{
// String path = uploadFile(in, size, fileExtName);
if
(
conn
!=
null
)
{
// return path;
try
{
// } finally {
conn
.
disconnect
();
// if (conn != null) {
}
catch
(
Exception
e
)
{
// try {
}
// conn.disconnect();
}
// } catch (Exception e) {
}
// }
}
// }
// }
// }
/**
//
* 上传文件 base64
//
*
// /**
* @param base64String
// * 上传文件 base64
* @param fileExtName
// *
* @return
// * @param base64String
* @throws IOException
// * @param fileExtName
*/
// * @return
@Override
// * @throws IOException
public
String
uploadFileOfBase64String
(
String
base64String
,
String
fileExtName
)
throws
IOException
{
// */
byte
[]
bytes
=
Base64
.
decodeBase64
(
base64String
);
// @Override
return
uploadFile
(
bytes
,
fileExtName
);
// public String uploadFileOfBase64String(String base64String, String fileExtName) throws IOException {
}
// byte[] bytes = Base64.decodeBase64(base64String);
// return uploadFile(bytes, fileExtName);
/**
// }
* 下载文件
//
*
// /**
* @param path
// * 下载文件
* @return
// *
*/
// * @param path
@Override
// * @return
public
byte
[]
downloadFile
(
String
path
)
throws
IOException
{
// */
if
(
StringUtils
.
isBlank
(
path
))
{
// @Override
return
null
;
// public byte[] downloadFile(String path) throws IOException {
}
// if (StringUtils.isBlank(path)) {
String
[]
split
=
StringUtils
.
split
(
path
,
"/"
,
2
);
// return null;
if
(
split
.
length
<
2
)
{
// }
throw
new
IOException
(
"路径不对"
);
// String[] split = StringUtils.split(path, "/", 2);
}
// if (split.length < 2) {
byte
[]
bytes
=
storageClient
.
downloadFile
(
split
[
0
],
split
[
1
],
new
DownloadByteArray
()
{
// throw new IOException("路径不对");
});
// }
return
bytes
;
// byte[] bytes = storageClient.downloadFile(split[0], split[1], new DownloadByteArray() {
}
// });
// return bytes;
/**
// }
* 转成一个临时可用的url
//
* @param path
// /**
* @return
// * 转成一个临时可用的url
* @throws IOException
// * @param path
*/
// * @return
@Override
// * @throws IOException
public
String
toUrl
(
String
path
)
throws
IOException
{
// */
if
(
StringUtils
.
isBlank
(
path
))
{
// @Override
return
null
;
// public String toUrl(String path) throws IOException {
}
// if (StringUtils.isBlank(path)) {
String
fileName
=
path
;
// return null;
if
(
fileName
.
indexOf
(
"/M"
)
>
0
)
{
// }
fileName
=
fileName
.
substring
(
fileName
.
indexOf
(
"/M"
)
+
1
);
// String fileName = path;
}
// if (fileName.indexOf("/M") > 0) {
int
lts
=
(
int
)
(
System
.
currentTimeMillis
()
/
1000
);
// fileName = fileName.substring(fileName.indexOf("/M") + 1);
// 初始化secret_key
// }
try
{
// int lts = (int) (System.currentTimeMillis() / 1000);
String
token
=
ProtoCommon
.
getToken
(
fileName
,
lts
,
secretKey
);
// // 初始化secret_key
return
fastDfsHttp
+
"/"
+
path
+
"?token="
+
token
+
"&ts="
+
lts
;
// try {
}
catch
(
Exception
e
)
{
// String token = ProtoCommon.getToken(fileName, lts, secretKey);
log
.
warn
(
"生成FastDFS下载链接失败:path:{},"
,
path
,
e
);
// return fastDfsHttp + "/" + path + "?token=" + token + "&ts=" + lts;
throw
new
IOException
(
"生成下载链接失败"
);
// } catch (Exception e) {
}
// log.warn("生成FastDFS下载链接失败:path:{},", path, e);
}
// throw new IOException("生成下载链接失败");
// }
}
// }
//
//}
src/main/java/cn/quantgroup/customer/service/impl/TransactionReceiptRecordServiceImpl.java
View file @
9ec20093
...
@@ -9,8 +9,6 @@ import cn.quantgroup.customer.repo.TransactionReceiptRecordRepo;
...
@@ -9,8 +9,6 @@ import cn.quantgroup.customer.repo.TransactionReceiptRecordRepo;
import
cn.quantgroup.customer.rest.param.transactionreceipt.TransactionReceiptRecordQuery
;
import
cn.quantgroup.customer.rest.param.transactionreceipt.TransactionReceiptRecordQuery
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.transaction.*
;
import
cn.quantgroup.customer.rest.vo.transaction.*
;
import
cn.quantgroup.customer.service.IFastDFSService
;
import
cn.quantgroup.customer.service.IFileService
;
import
cn.quantgroup.customer.service.ITransactionReceiptRecordService
;
import
cn.quantgroup.customer.service.ITransactionReceiptRecordService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.util.ExcelUtil
;
import
cn.quantgroup.customer.util.ExcelUtil
;
...
...
src/main/java/cn/quantgroup/customer/service/impl/VccServiceImpl.java
0 → 100644
View file @
9ec20093
package
cn
.
quantgroup
.
customer
.
service
.
impl
;
import
cn.quantgroup.customer.entity.OfflineRepayOperateRecord
;
import
cn.quantgroup.customer.entity.OfflineRepaySubmitRecord
;
import
cn.quantgroup.customer.entity.OpUser
;
import
cn.quantgroup.customer.entity.QOfflineRepaySubmitRecord
;
import
cn.quantgroup.customer.enums.ApprovalStatus
;
import
cn.quantgroup.customer.enums.VccRepayStatusEnum
;
import
cn.quantgroup.customer.repo.OfflineRepayOperateRecordRepo
;
import
cn.quantgroup.customer.repo.OfflineRepaySubmitRecordRepo
;
import
cn.quantgroup.customer.rest.param.vcc.ApplyBill
;
import
cn.quantgroup.customer.rest.param.vcc.OfflineRepaySubmitParam
;
import
cn.quantgroup.customer.rest.param.vcc.UserPreRepayInfoQuery
;
import
cn.quantgroup.customer.rest.vo.JsonResult
;
import
cn.quantgroup.customer.rest.vo.vcc.QueryPreOfflineRepayVo
;
import
cn.quantgroup.customer.rest.vo.vcc.QuerySubmitRecordVo
;
//import cn.quantgroup.customer.service.IFastDFSService;
import
cn.quantgroup.customer.service.IOpSystemService
;
import
cn.quantgroup.customer.service.IVccService
;
import
cn.quantgroup.customer.service.ftp.IFtpService
;
import
cn.quantgroup.customer.service.http.IHttpService
;
import
cn.quantgroup.customer.util.IdUtil
;
import
cn.quantgroup.user.retbean.XUser
;
import
cn.quantgroup.user.vo.UserSysResult
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.reflect.TypeToken
;
import
com.google.gson.Gson
;
import
com.querydsl.core.types.dsl.BooleanExpression
;
import
com.querydsl.core.types.dsl.Expressions
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.transaction.Transactional
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.List
;
@Slf4j
@Service
public
class
VccServiceImpl
implements
IVccService
{
@Value
(
"${vcc-talos.http}"
)
private
String
talosHttp
;
@Autowired
private
IHttpService
httpService
;
@Resource
private
OfflineRepaySubmitRecordRepo
offlineRepaySubmitRecordRepo
;
@Resource
private
OfflineRepayOperateRecordRepo
offlineRepayOperateRecordRepo
;
@Autowired
private
IOpSystemService
IOpSystemService
;
// @Autowired
// private IFastDFSService fastDfsService;
@Autowired
private
IFtpService
ftpService
;
@Autowired
private
UserSdkImpl
userSdk
;
@Override
public
JsonResult
queryPage
(
UserPreRepayInfoQuery
query
)
throws
Exception
{
String
url
=
talosHttp
+
"/vcc/offline_pre_repay/query_page"
;
JSONObject
param
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
query
));
log
.
info
(
"queryPage | 开始请求talos获取预还款的详情,param={}"
,
param
);
String
post
=
httpService
.
post
(
url
,
param
);
log
.
info
(
"queryPage | 请求talos结束,param={},result={}"
,
param
,
post
);
if
(
StringUtils
.
isBlank
(
post
)){
log
.
error
(
"queryPage | 请求talos异常,返回值为空,param={}"
,
query
);
return
JsonResult
.
buildErrorStateResult
(
"请求talos获取详情异常:没有请求通"
);
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
post
);
if
(!
"0000"
.
equals
(
jsonObject
.
getString
(
"code"
))
||
!
"0000"
.
equals
(
jsonObject
.
getString
(
"businessCode"
))){
log
.
error
(
"queryPage | talos没有正确查询出结果:"
+
jsonObject
.
getString
(
"msg"
));
return
JsonResult
.
buildErrorStateResult
(
"talos没有正确查询出结果:"
+
jsonObject
.
getString
(
"msg"
));
}
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
JSONArray
list
=
data
.
getJSONArray
(
"list"
);
List
<
QueryPreOfflineRepayVo
>
voList
=
new
Gson
().
fromJson
(
list
.
toString
(),
new
TypeToken
<
List
<
QueryPreOfflineRepayVo
>>()
{
}.
getType
());
for
(
int
i
=
0
;
i
<
voList
.
size
();
i
++){
if
(
1
==
query
.
getRepayType
()){
ApplyBill
applyBill
=
new
ApplyBill
();
applyBill
.
setBillId
(
Long
.
parseLong
(
voList
.
get
(
i
).
getUniqueId
()));
applyBill
.
setAmount
(
voList
.
get
(
i
).
getCurrBall
());
List
<
OfflineRepaySubmitRecord
>
byUserIdEqualsAndRepayTypeEquals
=
offlineRepaySubmitRecordRepo
.
findByUserIdEqualsAndRepayTypeEquals
(
voList
.
get
(
i
).
getUserId
(),
1
);
if
(!
CollectionUtils
.
isEmpty
(
byUserIdEqualsAndRepayTypeEquals
)){
for
(
OfflineRepaySubmitRecord
record:
byUserIdEqualsAndRepayTypeEquals
){
List
<
ApplyBill
>
billList
=
new
Gson
().
fromJson
(
record
.
getBills
(),
new
TypeToken
<
List
<
ApplyBill
>>()
{
}.
getType
());
log
.
info
(
"billList={},applyBill={}"
,
billList
,
applyBill
);
if
(
billList
.
contains
(
applyBill
)){
log
.
info
(
"发现已经提交过了,补充流水号前:voList={}"
,
voList
);
voList
.
get
(
i
).
setSerialNo
(
record
.
getSerialNo
());
voList
.
get
(
i
).
setApprovalStatus
(
record
.
getApprovalStatus
());
log
.
info
(
"发现已经提交过了,补充流水号后:voList={}"
,
voList
);
break
;
}
}
}
}
else
{
OfflineRepaySubmitRecord
firstByUniqueIdEquals
=
offlineRepaySubmitRecordRepo
.
findFirstByUniqueIdEquals
(
voList
.
get
(
i
).
getUniqueId
());
if
(
Objects
.
nonNull
(
firstByUniqueIdEquals
)){
voList
.
get
(
i
).
setSerialNo
(
firstByUniqueIdEquals
.
getSerialNo
());
voList
.
get
(
i
).
setApprovalStatus
(
firstByUniqueIdEquals
.
getApprovalStatus
());
}
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"count"
,
data
.
get
(
"count"
));
map
.
put
(
"type"
,
data
.
get
(
"type"
));
map
.
put
(
"list"
,
voList
);
log
.
info
(
"voList={}"
,
voList
);
return
JsonResult
.
buildSuccessResult
(
"请求成功"
,
map
);
}
@Override
public
JsonResult
queryRepayCalDetail
(
String
uniqueId
,
Integer
repayType
)
throws
Exception
{
String
url
=
talosHttp
+
"/vcc/offline_pre_repay/detail?uniqueId="
+
uniqueId
+
"&repayType="
+
repayType
;
log
.
info
(
"queryRepayCalDetail | 开始请求talos,url={}"
,
url
);
String
get
=
httpService
.
get
(
url
);
log
.
info
(
"queryRepayCalDetail | 请求talos结束,get={}"
,
get
);
if
(
StringUtils
.
isBlank
(
get
)){
log
.
error
(
"queryRepayCalDetail | 请求talos异常,返回值为空"
);
return
JsonResult
.
buildErrorStateResult
(
"请求talos获取详情异常:没有请求通"
);
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
get
);
if
(!
"0000"
.
equals
(
jsonObject
.
getString
(
"code"
))
||
!
"0000"
.
equals
(
jsonObject
.
getString
(
"businessCode"
))){
log
.
error
(
"queryRepayCalDetail | talos没有正确查询出结果:"
+
jsonObject
.
getString
(
"msg"
));
return
JsonResult
.
buildErrorStateResult
(
"talos没有正确查询出结果:"
+
jsonObject
.
getString
(
"msg"
));
}
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
return
JsonResult
.
buildSuccessResult
(
"请求成功"
,
data
);
}
@Override
@Transactional
public
void
saveSubmitRecord
(
OfflineRepaySubmitParam
param
,
String
token
)
throws
Exception
{
String
serialNo
=
IdUtil
.
generateSequenceNo
();
if
(
1
==
param
.
getRepayType
()){
//月还账单
List
<
ApplyBill
>
list
=
param
.
getList
();
List
<
OfflineRepaySubmitRecord
>
byUserIdEqualsAndRepayTypeEquals
=
offlineRepaySubmitRecordRepo
.
findByUserIdEqualsAndRepayTypeEqualsAndApprovalStatusNot
(
param
.
getUserId
(),
1
,
2
);
if
(!
CollectionUtils
.
isEmpty
(
byUserIdEqualsAndRepayTypeEquals
)){
for
(
OfflineRepaySubmitRecord
record:
byUserIdEqualsAndRepayTypeEquals
){
List
<
ApplyBill
>
billList
=
new
Gson
().
fromJson
(
record
.
getBills
(),
new
TypeToken
<
List
<
ApplyBill
>>()
{
}.
getType
());
if
(!
Collections
.
disjoint
(
list
,
billList
)){
log
.
error
(
"saveSubmitRecord | 提交时发现已经提交过了,请确认,newBills={},existBills={}"
,
list
.
toString
(),
billList
.
toString
());
throw
new
Exception
(
"提交时发现已经提交过了,请确认,newBills="
+
list
.
toString
()+
",existBills="
+
billList
.
toString
());
}
}
}
OfflineRepaySubmitRecord
record
=
new
OfflineRepaySubmitRecord
();
BeanUtils
.
copyProperties
(
param
,
record
);
record
.
setSerialNo
(
serialNo
);
record
.
setBills
(
JSONObject
.
toJSONString
(
list
));
String
replace
=
param
.
getCredentialsAddress
().
toString
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
);
record
.
setCredentialsAddress
(
replace
);
record
.
setApprovalStatus
(
0
);
offlineRepaySubmitRecordRepo
.
save
(
record
);
}
else
{
OfflineRepaySubmitRecord
firstByUniqueIdEquals
=
offlineRepaySubmitRecordRepo
.
findFirstByUniqueIdEqualsAndApprovalStatusNot
(
param
.
getUniqueId
(),
2
);
if
(
Objects
.
nonNull
(
firstByUniqueIdEquals
)){
log
.
error
(
"saveSubmitRecord | 提交时发现已经提交过了,请确认,uniqueId={}"
,
param
.
getUniqueId
());
throw
new
Exception
(
"提交时发现已经提交过了,请确认,uniqueId="
+
param
.
getUniqueId
());
}
OfflineRepaySubmitRecord
record
=
new
OfflineRepaySubmitRecord
();
BeanUtils
.
copyProperties
(
param
,
record
);
record
.
setSerialNo
(
serialNo
);
String
replace
=
param
.
getCredentialsAddress
().
toString
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
);
record
.
setCredentialsAddress
(
replace
);
record
.
setApprovalStatus
(
0
);
offlineRepaySubmitRecordRepo
.
save
(
record
);
}
//保存操作人记录
saveApprovalRecord
(
serialNo
,
""
,
0
,
token
);
}
@Override
public
OfflineRepaySubmitParam
approvalQuery
(
String
serialNo
)
throws
Exception
{
OfflineRepaySubmitRecord
bySerialNoEquals
=
offlineRepaySubmitRecordRepo
.
findBySerialNoEquals
(
serialNo
);
if
(
Objects
.
isNull
(
bySerialNoEquals
)){
log
.
error
(
"approvalQuery | 没有查询到这条申请记录,请确认:serialNo = {}"
,
serialNo
);
throw
new
Exception
(
"没有查询到这条申请记录,请确认:serialNo = "
+
serialNo
);
}
OfflineRepaySubmitParam
param
=
new
OfflineRepaySubmitParam
();
BeanUtils
.
copyProperties
(
bySerialNoEquals
,
param
);
List
<
ApplyBill
>
billList
=
new
Gson
().
fromJson
(
bySerialNoEquals
.
getBills
(),
new
TypeToken
<
List
<
ApplyBill
>>()
{
}.
getType
());
param
.
setList
(
billList
);
String
[]
split
=
bySerialNoEquals
.
getCredentialsAddress
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
split
);
// List<String> addressList = new ArrayList<>();
// for (String baseUrl:list){
//// String viewUrl = fastDfsService.toUrl(baseUrl);
//// addressList.add(viewUrl);
// byte[] down = ftpService.down(baseUrl);
// addressList.add(Base64.getEncoder().encodeToString(down));
// }
param
.
setCredentialsAddress
(
list
);
return
param
;
}
@Override
public
JsonResult
queryApprovalRecord
(
String
serialNo
)
throws
Exception
{
List
<
OfflineRepayOperateRecord
>
bySerialNoEquals
=
offlineRepayOperateRecordRepo
.
findBySerialNoEquals
(
serialNo
);
return
JsonResult
.
buildSuccessResult
(
"请求成功"
,
bySerialNoEquals
);
}
@Override
@Transactional
public
void
approvalResult
(
String
serialNo
,
String
remark
,
Integer
status
,
String
token
)
throws
Exception
{
OfflineRepaySubmitRecord
bySerialNoEquals
=
offlineRepaySubmitRecordRepo
.
findBySerialNoEqualsAndApprovalStatusEquals
(
serialNo
,
0
);
if
(
Objects
.
isNull
(
bySerialNoEquals
)){
log
.
error
(
"approvalQuery | 没有查询到这条申请记录,请确认:serialNo = {}"
,
serialNo
);
throw
new
Exception
(
"没有查询到这条申请记录,请确认:serialNo = "
+
serialNo
);
}
if
(
0
==
status
){
//审批拒绝
bySerialNoEquals
.
setApprovalStatus
(
2
);
offlineRepaySubmitRecordRepo
.
save
(
bySerialNoEquals
);
saveApprovalRecord
(
serialNo
,
remark
,
2
,
token
);
}
else
if
(
1
==
status
){
//审批通过
String
url
=
""
;
// String phone = bySerialNoEquals.getPhone();
// UserSysResult<XUser> userByPhoneNo = userSdk.getService().findUserByPhoneNo(phone);
// if (userByPhoneNo == null || !userByPhoneNo.isSuccess() || userByPhoneNo.getData() == null) {
// throw new RuntimeException("用户中心接口findUserDetailByPhone返回失败");
// }
if
(
1
==
bySerialNoEquals
.
getRepayType
()){
//月还账单
List
<
ApplyBill
>
billList
=
new
Gson
().
fromJson
(
bySerialNoEquals
.
getBills
(),
new
TypeToken
<
List
<
ApplyBill
>>()
{
}.
getType
());
StringBuilder
stringBuilder
=
new
StringBuilder
();
for
(
ApplyBill
applyBill:
billList
){
stringBuilder
.
append
(
applyBill
.
getBillId
()).
append
(
","
);
}
String
billNo
=
stringBuilder
.
substring
(
0
,
stringBuilder
.
lastIndexOf
(
","
));
url
=
talosHttp
+
"/vcc/repay/offlineRepay?userId="
+
bySerialNoEquals
.
getUserId
()
+
"&amount="
+
bySerialNoEquals
.
getAmount
()
+
"&billNo="
+
billNo
;
}
else
{
//提前结清
url
=
talosHttp
+
"/vcc/offline_pre_repay/repay?userId="
+
bySerialNoEquals
.
getUserId
()
+
"&amount="
+
bySerialNoEquals
.
getAmount
()
+
"&repayType="
+
bySerialNoEquals
.
getRepayType
()
+
"&uniqueId="
+
bySerialNoEquals
.
getUniqueId
();
}
log
.
info
(
"queryRepayCalDetail | 开始请求talos,url={}"
,
url
);
String
get
=
httpService
.
get
(
url
);
log
.
info
(
"queryRepayCalDetail | 请求talos结束,get={}"
,
get
);
if
(
StringUtils
.
isBlank
(
get
)){
log
.
error
(
"queryRepayCalDetail | 请求talos异常,返回值为空"
);
throw
new
Exception
(
"请求talos异常:没有请求通"
);
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
get
);
if
(!
"0000"
.
equals
(
jsonObject
.
getString
(
"code"
))
||
!
"0000"
.
equals
(
jsonObject
.
getString
(
"businessCode"
))){
log
.
error
(
"queryRepayCalDetail | 请求talos处理失败,msg={}"
,
jsonObject
.
getString
(
"msg"
));
throw
new
Exception
(
"请求talos处理失败:"
+
jsonObject
.
getString
(
"msg"
));
}
bySerialNoEquals
.
setApprovalStatus
(
1
);
offlineRepaySubmitRecordRepo
.
save
(
bySerialNoEquals
);
saveApprovalRecord
(
serialNo
,
remark
,
1
,
token
);
}
}
@Override
public
Map
<
String
,
String
>
fileUpload
(
MultipartFile
file
)
throws
Exception
{
// String name = file.getOriginalFilename();
// log.info("fileUpload | filename={}",name);
// String substring = name.substring(name.lastIndexOf(".") + 1);
// String baseUrl = fastDfsService.uploadFile(file.getBytes(), substring);
// String viewUrl = fastDfsService.toUrl(baseUrl);
// Map<String,String> map = new HashMap<>();
// map.put("baseUrl",baseUrl);
// map.put("viewUrl",viewUrl);
// return map;
String
fileName
=
file
.
getOriginalFilename
();
byte
[]
bytes
=
file
.
getBytes
();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>(
8
);
paramMap
.
put
(
"fileName"
,
fileName
);
paramMap
.
put
(
"fileBytes"
,
bytes
);
String
filePath
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
))
+
"/"
;
paramMap
.
put
(
"filePath"
,
filePath
);
ftpService
.
send
(
paramMap
,
3
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"base64"
,
Base64
.
getEncoder
().
encodeToString
(
bytes
));
map
.
put
(
"url"
,
filePath
+
fileName
);
return
map
;
}
@Override
public
JsonResult
queryApplyRecord
(
UserPreRepayInfoQuery
query
)
throws
Exception
{
BooleanExpression
booleanExpression
=
Expressions
.
asBoolean
(
true
).
isTrue
();
if
(
StringUtils
.
isNotBlank
(
query
.
getUserId
())){
booleanExpression
=
booleanExpression
.
and
(
QOfflineRepaySubmitRecord
.
offlineRepaySubmitRecord
.
userId
.
eq
(
Integer
.
valueOf
(
query
.
getUserId
())));
}
if
(
StringUtils
.
isNotBlank
(
query
.
getPhone
())){
booleanExpression
=
booleanExpression
.
and
(
QOfflineRepaySubmitRecord
.
offlineRepaySubmitRecord
.
phone
.
eq
(
query
.
getPhone
()));
}
if
(
query
.
getApprovalStatus
()
!=
null
){
booleanExpression
=
booleanExpression
.
and
(
QOfflineRepaySubmitRecord
.
offlineRepaySubmitRecord
.
approvalStatus
.
eq
(
query
.
getApprovalStatus
()));
}
if
(
query
.
getRepayType
()
!=
null
){
booleanExpression
=
booleanExpression
.
and
(
QOfflineRepaySubmitRecord
.
offlineRepaySubmitRecord
.
repayType
.
eq
(
query
.
getRepayType
()));
}
if
(
StringUtils
.
isNotBlank
(
query
.
getOrderNo
())){
booleanExpression
=
booleanExpression
.
and
(
QOfflineRepaySubmitRecord
.
offlineRepaySubmitRecord
.
uniqueId
.
eq
(
query
.
getOrderNo
()));
}
if
(
StringUtils
.
isNotBlank
(
query
.
getBillId
())){
if
(
1
==
query
.
getRepayType
()){
booleanExpression
=
booleanExpression
.
and
(
QOfflineRepaySubmitRecord
.
offlineRepaySubmitRecord
.
bills
.
contains
(
query
.
getBillId
()));
}
else
{
booleanExpression
=
booleanExpression
.
and
(
QOfflineRepaySubmitRecord
.
offlineRepaySubmitRecord
.
uniqueId
.
eq
(
query
.
getBillId
()));
}
}
long
count
=
offlineRepaySubmitRecordRepo
.
count
(
booleanExpression
);
int
offset
=
(
query
.
getPageIndex
()
-
1
)
*
query
.
getPageSize
();
Page
<
OfflineRepaySubmitRecord
>
plantPage
=
offlineRepaySubmitRecordRepo
.
findAll
(
booleanExpression
,
new
PageRequest
(
offset
,
query
.
getPageSize
()));
List
<
OfflineRepaySubmitRecord
>
content
=
plantPage
.
getContent
();
List
<
QuerySubmitRecordVo
>
submitRecordVoList
=
new
ArrayList
<>();
for
(
OfflineRepaySubmitRecord
record
:
content
){
QuerySubmitRecordVo
submitRecordVo
=
new
QuerySubmitRecordVo
();
BeanUtils
.
copyProperties
(
record
,
submitRecordVo
);
submitRecordVo
.
setRepayStatusName
(
VccRepayStatusEnum
.
getDescByValue
(
submitRecordVo
.
getRepayStatus
()));
submitRecordVo
.
setApprovalStatusName
(
ApprovalStatus
.
getDescByValue
(
submitRecordVo
.
getApprovalStatus
()));
if
(
1
==
submitRecordVo
.
getRepayType
())
{
//月还账单
List
<
ApplyBill
>
billList
=
new
Gson
().
fromJson
(
submitRecordVo
.
getBills
(),
new
TypeToken
<
List
<
ApplyBill
>>()
{
}.
getType
());
StringBuilder
stringBuilder
=
new
StringBuilder
();
for
(
ApplyBill
applyBill
:
billList
)
{
stringBuilder
.
append
(
applyBill
.
getBillId
()).
append
(
","
);
}
String
billNo
=
stringBuilder
.
substring
(
0
,
stringBuilder
.
lastIndexOf
(
","
));
submitRecordVo
.
setUniqueId
(
billNo
);
}
submitRecordVoList
.
add
(
submitRecordVo
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"count"
,
count
);
map
.
put
(
"type"
,
query
.
getRepayType
());
map
.
put
(
"list"
,
submitRecordVoList
);
return
JsonResult
.
buildSuccessResult
(
"请求成功"
,
map
);
}
@Override
public
void
saveApprovalRecord
(
String
serialNo
,
String
remark
,
Integer
status
,
String
token
)
throws
Exception
{
JsonResult
<
OpUser
>
opUserResult
=
IOpSystemService
.
findUserByToken
(
token
,
null
);
if
(
Objects
.
isNull
(
opUserResult
)
||
!
opUserResult
.
isSuccess
())
{
log
.
error
(
"根据token查询不到用户信息 token:{}"
,
token
);
return
;
}
else
{
OpUser
opUser
=
opUserResult
.
getData
();
OfflineRepayOperateRecord
record
=
new
OfflineRepayOperateRecord
();
record
.
setSerialNo
(
serialNo
);
record
.
setOperateAccount
(
opUser
.
getUser
());
record
.
setOperateName
(
opUser
.
getName
());
if
(
0
==
status
){
record
.
setOperateContent
(
"已提交"
);
}
else
if
(
1
==
status
){
record
.
setOperateContent
(
"审批通过"
);
}
else
if
(
2
==
status
){
record
.
setOperateContent
(
"审批拒绝"
);
}
record
.
setOperateTime
(
new
Date
());
record
.
setRemark
(
remark
);
offlineRepayOperateRecordRepo
.
save
(
record
);
}
}
}
src/test/xiaoman/WorkOrderTest.java
View file @
9ec20093
...
@@ -31,8 +31,7 @@ public class WorkOrderTest {
...
@@ -31,8 +31,7 @@ public class WorkOrderTest {
@Autowired
@Autowired
private
IWorkOrderService
workOrderService
;
private
IWorkOrderService
workOrderService
;
@Autowired
private
IHttpService
httpService
;
@Test
@Test
public
void
queryPage
()
{
public
void
queryPage
()
{
...
@@ -40,14 +39,6 @@ public class WorkOrderTest {
...
@@ -40,14 +39,6 @@ public class WorkOrderTest {
System
.
out
.
println
(
JSONTools
.
serialize
(
pageJsonResult
));
System
.
out
.
println
(
JSONTools
.
serialize
(
pageJsonResult
));
}
}
@Test
public
void
testUser
(){
String
url
=
"https://passportapi-qa2.liangkebang.net/api/sync/listByUserIds?userIds=70356056,70356055"
;
String
result
=
httpService
.
get
(
url
);
JSONObject
userJsonObject
=
JSONObject
.
parseObject
(
userResult
);
JSONObject
userData
=
userJsonObject
.
getJSONObject
(
"data"
);
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
DesensitizeUtil
.
mobileDesensitization
(
"13597778033"
));
System
.
out
.
println
(
DesensitizeUtil
.
mobileDesensitization
(
"13597778033"
));
System
.
out
.
println
(
DesensitizeUtil
.
idcardDesensitization
(
"422802199007261711"
));
System
.
out
.
println
(
DesensitizeUtil
.
idcardDesensitization
(
"422802199007261711"
));
...
...
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