Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
50ea7b4a
Commit
50ea7b4a
authored
Jan 02, 2025
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加聚富通导出 增加定时获取回盘文件
parent
5a4cb052
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
274 additions
and
28 deletions
+274
-28
application-dev.properties
...-housepvapi/src/main/resources/application-dev.properties
+7
-6
HygfIcbcRecordExportDTO.java
...mos/boot/module/hygf/api/dto/HygfIcbcRecordExportDTO.java
+8
-2
HygfIcbcWithholdRecordExportDTO.java
.../module/hygf/api/dto/HygfIcbcWithholdRecordExportDTO.java
+80
-0
IcbcWithhold.java
...eejoin/amos/boot/module/hygf/api/entity/IcbcWithhold.java
+1
-1
HygfIcbcRecordMapper.java
...mos/boot/module/hygf/api/mapper/HygfIcbcRecordMapper.java
+3
-0
SFTPUtil.java
.../com/yeejoin/amos/boot/module/hygf/api/util/SFTPUtil.java
+4
-1
HygfIcbcRecordMapper.xml
.../src/main/resources/mapper/mysql/HygfIcbcRecordMapper.xml
+68
-1
IcbcWithholdController.java
...ot/module/hygf/biz/controller/IcbcWithholdController.java
+13
-5
IcbcWithholdServiceImpl.java
...module/hygf/biz/service/impl/IcbcWithholdServiceImpl.java
+90
-12
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/resources/application-dev.properties
View file @
50ea7b4a
## DB properties hygf
## db1-production database
spring.db1.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url
=
jdbc:mysql://47.92.234.253:13306/amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.url
=
jdbc:kingbase8://39.98.224.23:54321/amos_openapi_47?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.username
=
root
spring.db1.datasource.password
=
Yeejoin
_1234
spring.db1.datasource.driver-class-name
=
com.
mysql.cj.jdbc
.Driver
spring.db1.datasource.password
=
Yeejoin
@2020
spring.db1.datasource.driver-class-name
=
com.
kingbase8
.Driver
## db2-sync_data
spring.db2.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url
=
jdbc:
mysql://47.92.234.253:13306/amos_project
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.url
=
jdbc:
kingbase8://39.98.224.23:54321/amos_project_47
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username
=
root
spring.db2.datasource.password
=
Yeejoin
_1234
spring.db2.datasource.driver-class-name
=
com.
mysql.cj.jdbc
.Driver
spring.db2.datasource.password
=
Yeejoin
@2020
spring.db2.datasource.driver-class-name
=
com.
kingbase8
.Driver
## db3-taosiData
spring.db3.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db3.datasource.url
=
jdbc:TAOS-RS://47.92.234.253:6041/house_pv_data?user=root&password=taosdata&characterEncoding=utf8
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/HygfIcbcRecordExportDTO.java
View file @
50ea7b4a
...
...
@@ -56,7 +56,7 @@ public class HygfIcbcRecordExportDTO {
/**
* 聚富通电子账户账号
*/
@ExcelProperty
(
value
=
"
银行卡号
"
,
index
=
4
)
@ExcelProperty
(
value
=
"
聚富通账户
"
,
index
=
4
)
@ApiModelProperty
(
value
=
"聚富通电子账户账号"
)
private
String
mediumId
;
...
...
@@ -74,7 +74,12 @@ public class HygfIcbcRecordExportDTO {
@ApiModelProperty
(
value
=
"协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认"
)
private
String
protocolStatus
;
/**
* 协议状态, 0-未生效,1-已生效,2-过期,3-作废,4-待短信确认
*/
@ExcelProperty
(
value
=
"扣款总金额"
,
index
=
7
)
@ApiModelProperty
(
value
=
"扣款总金额"
)
private
double
paymentAmount
;
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/HygfIcbcWithholdRecordExportDTO.java
0 → 100644
View file @
50ea7b4a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
dto
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* (hygf_icbc_record)实体类
*
* @author yangyang
* @description
* @since 2024-07-18 11:40:46
*/
@Data
@NoArgsConstructor
@ApiModel
(
value
=
"HygfIcbcRecordExportDTO"
,
description
=
"聚富通钱包开户DTO"
)
public
class
HygfIcbcWithholdRecordExportDTO
{
@ExcelIgnore
private
static
final
long
serialVersionUID
=
1L
;
@ExcelIgnore
protected
Long
sequenceNbr
;
@ExcelProperty
(
value
=
"开户名"
,
index
=
0
)
@ApiModelProperty
(
value
=
"开户名"
)
private
String
custName
;
/**
* 身份证号
*/
@ExcelProperty
(
value
=
"项目公司"
,
index
=
1
)
@ApiModelProperty
(
value
=
"项目公司"
)
private
String
regionalCompaniesName
;
/**
* 手机号码
*/
@ExcelProperty
(
value
=
"批次号"
,
index
=
2
)
@ApiModelProperty
(
value
=
"批次号"
)
private
String
batchNo
;
/**
* 聚富通电子账户账号
*/
@ExcelProperty
(
value
=
"聚富通账户"
,
index
=
3
)
@ApiModelProperty
(
value
=
"聚富通电子账户账号"
)
private
String
mediumId
;
/**
*
*/
@ExcelProperty
(
value
=
"扣款金额"
,
index
=
4
)
@ApiModelProperty
(
value
=
"扣款金额"
)
private
double
paymentAmount
;
@ExcelProperty
(
value
=
"扣款状态"
,
index
=
5
)
@ApiModelProperty
(
value
=
"扣款状态"
)
private
String
withholdStatus
;
@ExcelProperty
(
value
=
"扣款时间"
,
index
=
6
)
@ApiModelProperty
(
value
=
"扣款时间"
)
private
Date
paymentTime
;
@ExcelProperty
(
value
=
"操作人"
,
index
=
7
)
@ApiModelProperty
(
value
=
"操作人"
)
private
String
uploader
;
@ExcelProperty
(
value
=
"说明"
,
index
=
8
)
@ApiModelProperty
(
value
=
"说明"
)
private
String
desc
;
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/IcbcWithhold.java
View file @
50ea7b4a
...
...
@@ -114,7 +114,7 @@ public class IcbcWithhold extends BaseEntity {
private
String
paymentErrorDesc
;
/**
* 户主icbcid
* 户主icbcid
弃用冗余 传递导出参数使用
*/
@TableField
(
"icbc_id"
)
private
String
icbcId
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/HygfIcbcRecordMapper.java
View file @
50ea7b4a
...
...
@@ -32,4 +32,7 @@ public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
@UserEmpower
(
field
=
{
"ph.regional_companies_code"
},
dealerField
=
{
"ph.developer_code"
,
"ph.regional_companies_code"
,
"ph.developer_user_id"
},
fieldConditions
=
{
"in"
,
"in"
,
"in"
},
relationship
=
"and"
)
List
<
HygfIcbcRecordExportDTO
>
exportTotal
(
String
developerCode
,
String
regionalCompaniesCode
,
String
province
,
String
city
,
String
district
);
@UserEmpower
(
field
=
{
"ph.regional_companies_code"
},
dealerField
=
{
"ph.developer_code"
,
"ph.regional_companies_code"
,
"ph.developer_user_id"
},
fieldConditions
=
{
"in"
,
"in"
,
"in"
},
relationship
=
"and"
)
List
<
HygfIcbcRecordExportDTO
>
paymentAmountExport
(
String
developerCode
,
String
regionalCompaniesCode
,
String
province
,
String
city
,
String
district
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/util/SFTPUtil.java
View file @
50ea7b4a
...
...
@@ -316,7 +316,7 @@ public class SFTPUtil {
// return success;
// }
public
boolean
downloadAndZipFiles
(
String
remotePath
,
String
filenamePattern
,
String
localZipPath
)
{
public
boolean
downloadAndZipFiles
(
String
remotePath
,
String
filenamePattern
,
String
localZipPath
,
Boolean
flag
)
{
boolean
success
=
false
;
Path
tempDir
=
null
;
try
{
...
...
@@ -336,7 +336,10 @@ public class SFTPUtil {
downloadedFiles
.
add
(
localFilePath
);
}
}
if
(
flag
){
disconnect
();
}
// 确保本地ZIP路径的父目录存在
Path
localZipFilePath
=
Paths
.
get
(
localZipPath
);
Path
parentDir
=
localZipFilePath
.
getParent
();
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/HygfIcbcRecordMapper.xml
View file @
50ea7b4a
...
...
@@ -180,10 +180,13 @@
'待短信确认' ELSE''
END
) AS protocolStatus,
MAX( CASE re.open_account_status WHEN 02 THEN '开户成功' WHEN 03 THEN '开户失败' ELSE'未开户' END ) AS openAccountStatus
MAX( CASE re.open_account_status WHEN 02 THEN '开户成功' WHEN 03 THEN '开户失败' ELSE'未开户' END ) AS openAccountStatus,
SUM(iw.payment_amount) as paymentAmount
FROM
`hygf_peasant_household` ph
LEFT JOIN hygf_icbc_record re ON re.amos_user_id = ph.amos_user_id
LEFT JOIN hygf_icbc_withhold_record iw ON re.amos_user_id = iw.amos_user_id
<where>
<if
test=
"developerCode != null and developerCode != ''"
>
AND ph.developer_code = #{developerCode}
...
...
@@ -204,4 +207,67 @@
GROUP BY
ph.amos_user_id
</select>
<select
id=
"paymentAmountExport"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordExportDTO"
>
WITH PaymentAmounts AS (
SELECT
iw.amos_user_id,
SUM(iw.payment_amount) AS paymentAmount
FROM
hygf_icbc_withhold_record iw
WHERE
iw.withhold_status = '成功'
GROUP BY
iw.amos_user_id
)
SELECT
MAX(ph.owners_name) AS custName,
MAX(ph.telephone) AS phone,
MAX(ph.id_card) AS idCard,
MAX(ph.regional_companies_name) AS regionalCompaniesName,
MAX(re.medium_id) AS mediumId,
MAX(
CASE re.protocol_status
WHEN 0 THEN '未生效'
WHEN 1 THEN '已生效'
WHEN 2 THEN '过期'
WHEN 3 THEN '作废'
WHEN 4 THEN '待短信确认'
ELSE ''
END
) AS protocolStatus,
MAX(
CASE re.open_account_status
WHEN '02' THEN '开户成功'
WHEN '03' THEN '开户失败'
ELSE '未开户'
END
) AS openAccountStatus,
pa.paymentAmount AS paymentAmount
FROM
`hygf_peasant_household` ph
LEFT JOIN
hygf_icbc_record re ON re.amos_user_id = ph.amos_user_id
LEFT JOIN
PaymentAmounts pa ON pa.amos_user_id = ph.amos_user_id
<where>
<if
test=
"developerCode != null and developerCode != ''"
>
AND ph.developer_code = #{developerCode}
</if>
<if
test=
"regionalCompaniesCode != null and regionalCompaniesCode != ''"
>
AND ph.regional_companies_code = #{regionalCompaniesCode}
</if>
<if
test=
"province != null and province != ''"
>
AND ph.project_address LIKE CONCAT ('%',#{province},'%')
</if>
<if
test=
"city != null and city != ''"
>
AND ph.project_address LIKE CONCAT ('%',#{city},'%')
</if>
<if
test=
"district != null and district != ''"
>
AND ph.project_address LIKE CONCAT ('%',#{district},'%')
</if>
</where>
GROUP BY
ph.amos_user_id, pa.paymentAmount;
</select>
</mapper>
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/IcbcWithholdController.java
View file @
50ea7b4a
...
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.IcbcWithholdRecordDto;
import
com.yeejoin.amos.boot.module.hygf.api.entity.IcbcWithhold
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.IcbcWithholdRecord
;
import
com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -16,6 +17,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.IcbcWithholdServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -157,9 +160,11 @@ public class IcbcWithholdController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
" 聚富通代扣信息文件生成"
,
notes
=
" 聚富通代扣信息文件生成"
)
@PostMapping
(
value
=
"/fileGeneration"
)
public
ResponseModel
fileGeneration
(
@RequestBody
IcbcWithhold
model
)
throws
Exception
{
@Transactional
public
ResponseModel
fileGeneration
(
@RequestBody
List
<
IcbcWithhold
>
models
)
throws
Exception
{
for
(
IcbcWithhold
model
:
models
)
{
icbcWithholdServiceImpl
.
fileGeneration
(
model
);
}
return
CommonResponseNewUtil
.
success
();
}
/**
...
...
@@ -170,9 +175,12 @@ public class IcbcWithholdController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
" 聚富通代扣信息文件上传"
,
notes
=
" 聚富通代扣信息文件上传"
)
@GetMapping
(
value
=
"/sftpUploadAndUnzip"
)
public
ResponseModel
sftpUploadAndUnzip
(
String
fileUrl
,
String
batchNo
)
throws
Exception
{
@Transactional
public
ResponseModel
sftpUploadAndUnzip
(
List
<
Map
<
String
,
String
>>
maps
)
throws
Exception
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
icbcWithholdServiceImpl
.
sftpUploadAndUnzip
(
fileUrl
,
batchNo
,
reginParams
.
getUserModel
().
getRealName
());
for
(
Map
<
String
,
String
>
map
:
maps
)
{
icbcWithholdServiceImpl
.
sftpUploadAndUnzip
(
map
.
get
(
"fileUrl"
),
map
.
get
(
"batchNo"
),
reginParams
.
getUserModel
().
getRealName
());
}
return
CommonResponseNewUtil
.
success
();
}
...
...
@@ -207,7 +215,7 @@ public class IcbcWithholdController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批次
人员信息下载"
,
notes
=
"批次人员
信息下载"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批次
明细信息下载"
,
notes
=
"批次明细
信息下载"
)
@PostMapping
(
value
=
"/export"
)
public
void
downTemplate
(
HttpServletResponse
response
,
@RequestBody
IcbcWithhold
model
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/IcbcWithholdServiceImpl.java
View file @
50ea7b4a
...
...
@@ -91,6 +91,8 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
public
String
sftpIp
;
@Value
(
"${icbc.Withhold.sftpPort}"
)
public
int
sftpPort
;
@Autowired
IcbcWithholdRecordMapper
icbcWithholdRecordMapper
;
@Value
(
"${icbc.Withhold.sftpUserName}"
)
public
String
sftpUserName
;
private
static
final
DateTimeFormatter
DATE_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
);
...
...
@@ -125,6 +127,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
* 生成文件
*
*/
public
void
fileGeneration
(
IcbcWithhold
model
)
throws
Exception
{
model
.
setUploadStatus
(
UploadStatusEnum
.
未上传
.
getName
());
int
billNo
=
0
;
...
...
@@ -381,7 +384,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
IcbcWithhold
model
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
if
(
StringUtils
.
isNotEmpty
(
model
.
getReceiptFile
())){
this
.
downloadAndSaveZipFile
(
model
.
getReceiptFile
(),
batchNo
,
"回盘文件"
,
response
);
}
}
else
{
String
path
=
new
ClassPathResource
(
file
+
"secretKey/登录-gxjrid_rsa"
).
getPath
();
SFTPUtil
sftp
=
new
SFTPUtil
(
sftpIp
,
sftpPort
,
...
...
@@ -409,7 +412,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
}
System
.
out
.
println
(
"Current working directory: "
+
System
.
getProperty
(
"user.dir"
));
if
(
sftp
.
isExist
(
downLoadPath
))
{
sftp
.
downloadAndZipFiles
(
downLoadPath
,
batchNo
,
dirPath
.
toString
()+
"/"
+
batchNo
+
".zip"
);
sftp
.
downloadAndZipFiles
(
downLoadPath
,
batchNo
,
dirPath
.
toString
()+
"/"
+
batchNo
+
".zip"
,
true
);
logger
.
info
(
"文件下载成功"
);
}
try
{
...
...
@@ -428,10 +431,77 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
}
finally
{
cleanup
(
dirPath
);
}
}
}
@Scheduled
(
cron
=
"${withholdReceiptFileCron}"
)
void
setReceiptFile
()
throws
Exception
{
String
path
=
new
ClassPathResource
(
file
+
"secretKey/登录-gxjrid_rsa"
).
getPath
();
SFTPUtil
sftp
=
new
SFTPUtil
(
sftpIp
,
sftpPort
,
sftpUserName
,
path
,
null
);
logger
.
info
(
String
.
valueOf
(
new
StringBuffer
().
append
(
"服务器地址: "
)
.
append
(
sftp
.
getHostName
()).
append
(
" 端口:"
)
.
append
(
sftp
.
getPort
()).
append
(
"用户名:"
)
.
append
(
sftp
.
getUserName
()).
append
(
"密钥文件:"
)
.
append
(
sftp
.
getPriKeyFile
())));
sftp
.
priKeyConnect
();
//获取所有已上传但代扣状态为空的数据
LambdaQueryWrapper
<
IcbcWithhold
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
IcbcWithhold:
:
getWithholdStatus
,
UploadStatusEnum
.
成功
.
getName
()).
or
().
eq
(
IcbcWithhold:
:
getWithholdStatus
,
UploadStatusEnum
.
失败
.
getName
());
wrapper
.
isNull
(
IcbcWithhold:
:
getReceiptFile
);
List
<
IcbcWithhold
>
icbcWithholds
=
this
.
getBaseMapper
().
selectList
(
wrapper
);
boolean
flag
=
false
;
Iterator
<
IcbcWithhold
>
iterator
=
icbcWithholds
.
iterator
();
while
(
iterator
.
hasNext
()){
IcbcWithhold
model
=
iterator
.
next
();
Path
currentWorkingDir
=
Paths
.
get
(
""
);
Path
dirPath
=
currentWorkingDir
.
resolve
(
model
.
getBatchNo
());
//没有下一个元素的时候关闭连接
if
(!
iterator
.
hasNext
()){
flag
=
true
;
}
try
{
if
(!
Files
.
exists
(
dirPath
))
{
Files
.
createDirectories
(
dirPath
);
System
.
out
.
println
(
"Directory created: "
+
dirPath
);
}
else
{
System
.
out
.
println
(
"Directory already exists: "
+
dirPath
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
System
.
err
.
println
(
"Failed to create directory: "
+
dirPath
);
}
System
.
out
.
println
(
"Current working directory: "
+
System
.
getProperty
(
"user.dir"
));
if
(
sftp
.
isExist
(
downLoadPath
))
{
sftp
.
downloadAndZipFiles
(
downLoadPath
,
model
.
getBatchNo
(),
dirPath
.
toString
()+
"/"
+
model
.
getBatchNo
()+
".zip"
,
flag
);
logger
.
info
(
"文件下载成功"
);
}
try
{
MultipartFile
multipartFile
=
fileToMultipartFile
(
new
File
(
dirPath
.
toString
()
+
"/"
+
model
.
getBatchNo
()
+
".zip"
));
FeignClientResult
<
Map
<
String
,
String
>>
result
=
Systemctl
.
fileStorageClient
.
updateCommonFile
(
multipartFile
);
if
(
result
!=
null
)
{
for
(
String
url
:
result
.
getResult
().
keySet
())
{
model
.
setReceiptFile
(
url
);
}
this
.
saveOrUpdate
(
model
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"平台上传文件失败"
);
e
.
printStackTrace
();
}
finally
{
cleanup
(
dirPath
);
}
}
}
@Scheduled
(
cron
=
"${withholdStatusCron}"
)
public
void
updateWithholdStatus
()
throws
Exception
{
//获取所有已上传但代扣状态为空的数据
...
...
@@ -519,6 +589,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
* @param fileUrl 文件url地址
* @param batchNo 批次号
*/
@Async
public
void
sftpUploadAndUnzip
(
String
fileUrl
,
String
batchNo
,
String
uploader
)
{
Path
currentWorkingDir
=
Paths
.
get
(
""
);
Path
dirPath
=
currentWorkingDir
.
resolve
(
batchNo
);
...
...
@@ -643,18 +714,25 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
public
void
exportData
(
HttpServletResponse
response
,
IcbcWithhold
icbcWithhold
){
List
<
HygfIcbcRecordExportDTO
>
dtos
=
new
ArrayList
<>();
JSONArray
.
parseArray
(
icbcWithhold
.
getIcbcRecordInfos
(),
IcbcWithholdRecord
.
class
).
forEach
(
e
->{
HygfIcbcRecordExportDTO
hygfIcbcRecordExportDTO
=
new
HygfIcbcRecordExportDTO
();
BeanUtil
.
copyProperties
(
e
,
hygfIcbcRecordExportDTO
);
hygfIcbcRecordExportDTO
.
setOpenAccountStatus
(
e
.
getOpenAccountStatusName
());
hygfIcbcRecordExportDTO
.
setProtocolStatus
(
e
.
getProtocolStatusName
());
dtos
.
add
(
hygfIcbcRecordExportDTO
);
});
List
<
HygfIcbcWithholdRecordExportDTO
>
datas
=
new
ArrayList
<>();
IcbcWithholdRecordDto
dto
=
new
IcbcWithholdRecordDto
();
if
(
StringUtils
.
isNotEmpty
(
icbcWithhold
.
getBatchNo
())){
dto
.
setBatchNo
(
icbcWithhold
.
getBatchNo
());
}
if
(
StringUtils
.
isNotEmpty
(
icbcWithhold
.
getIcbcId
())){
dto
.
setAmosUserId
(
icbcWithhold
.
getIcbcId
());
}
List
<
IcbcWithholdRecordDto
>
dtos
=
icbcWithholdRecordMapper
.
exportTotal
(
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
dto
);
for
(
IcbcWithholdRecordDto
icbcWithholdRecordDto
:
dtos
)
{
HygfIcbcWithholdRecordExportDTO
exportDTO
=
new
HygfIcbcWithholdRecordExportDTO
();
BeanUtil
.
copyProperties
(
icbcWithholdRecordDto
,
exportDTO
);
exportDTO
.
setDesc
(
icbcWithhold
.
getDesc
());
datas
.
add
(
exportDTO
);
}
if
(
CollectionUtil
.
isNotEmpty
(
d
to
s
)){
ExcelUtil
.
createTemplate
(
response
,
icbcWithhold
.
getBatchNo
()+
"人员信息"
,
icbcWithhold
.
getBatchNo
()+
"人员信息"
,
d
to
s
,
HygfIcbcRecordExportDTO
.
class
,
null
,
false
);
if
(
CollectionUtil
.
isNotEmpty
(
d
ata
s
)){
ExcelUtil
.
createTemplate
(
response
,
icbcWithhold
.
getBatchNo
()+
"人员信息"
,
icbcWithhold
.
getBatchNo
()+
"人员信息"
,
d
ata
s
,
HygfIcbcRecordExportDTO
.
class
,
null
,
false
);
}
}
...
...
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