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
18c1447e
Commit
18c1447e
authored
Jan 08, 2025
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代扣优化项 问题处理
parent
78f73f40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
7 deletions
+67
-7
IcbcWithholdController.java
...ot/module/hygf/biz/controller/IcbcWithholdController.java
+1
-1
HygfIcbcServiceImpl.java
...oot/module/hygf/biz/service/impl/HygfIcbcServiceImpl.java
+2
-1
IcbcWithholdServiceImpl.java
...module/hygf/biz/service/impl/IcbcWithholdServiceImpl.java
+64
-5
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/IcbcWithholdController.java
View file @
18c1447e
...
...
@@ -198,7 +198,7 @@ public class IcbcWithholdController extends BaseController {
@Transactional
public
ResponseModel
sftpUploadAndUnzip
(
String
fileUrl
,
String
batchNo
)
throws
Exception
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
icbcWithholdServiceImpl
.
sftpUploadAndUnzip
(
fileUrl
,
batchNo
,
reginParams
.
getUserModel
().
getRealName
()
);
icbcWithholdServiceImpl
.
sftpUploadAndUnzip
(
fileUrl
,
batchNo
);
return
CommonResponseNewUtil
.
success
();
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/HygfIcbcServiceImpl.java
View file @
18c1447e
...
...
@@ -692,7 +692,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
public
void
exportExcel
(
HttpServletResponse
response
,
HygfIcbcRecordQueryDTO
hygfIcbcRecordQueryDTO
){
List
<
HygfIcbcRecordExportDTO
>
hygfIcbcRecordExportDTOS
=
hygfIcbcRecordMapper
.
paymentAmountExport
(
hygfIcbcRecordQueryDTO
);
if
(
CollectionUtil
.
isNotEmpty
(
hygfIcbcRecordExportDTOS
)){
ExcelUtil
.
createTemplate
(
response
,
"
聚富通信息"
,
"聚富通
信息"
,
hygfIcbcRecordExportDTOS
,
HygfIcbcRecordExportDTO
.
class
,
null
,
false
);
ExcelUtil
.
createTemplate
(
response
,
"
账号信息"
,
"账号
信息"
,
hygfIcbcRecordExportDTOS
,
HygfIcbcRecordExportDTO
.
class
,
null
,
false
);
}
}
}
\ 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/service/impl/IcbcWithholdServiceImpl.java
View file @
18c1447e
...
...
@@ -38,6 +38,7 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.SystemUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -197,7 +198,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
if
(
result
!=
null
)
{
for
(
String
url
:
result
.
getResult
().
keySet
())
{
model
.
setUploadFile
(
url
);
sftpUploadAndUnzip
(
url
,
batchNo
,
model
.
getConfirmator
()
);
sftpUploadAndUnzip
(
url
,
batchNo
);
}
}
}
catch
(
IOException
e
)
{
...
...
@@ -206,12 +207,13 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
model
.
setIcbcRecordInfos
(
JSONObject
.
toJSONString
(
model
.
getRecordDTOS
()));
model
.
setBatchNo
(
batchNo
);
this
.
saveOrUpdate
(
model
);
throw
new
BadRequest
(
"上传工行失败"
);
}
finally
{
cleanup
(
dirPath
);
}
model
.
setIcbcRecordInfos
(
JSONObject
.
toJSONString
(
model
.
getRecordDTOS
()));
model
.
setBatchNo
(
batchNo
);
model
.
setUploadFileName
(
fileName
);
model
.
setUploader
(
model
.
getConfirmator
());
model
.
setUploadTime
(
new
Date
());
...
...
@@ -222,8 +224,60 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
}
this
.
saveOrUpdate
(
model
);
}
// @Async
// void uploadFile (String batchNo,String firstLink,IcbcWithhold model) throws Exception {
// String fileName ="gxjr"+"-"+projectId+"-ENTRUST-"+batchNo;
// Path currentWorkingDir = Paths.get("");
// Path dirPath = currentWorkingDir.resolve(batchNo);
// System.out.println("Current working directory: " + System.getProperty("user.dir"));
// writeStringToFile(firstLink,dirPath.toString()+"/"+fileName+".bin");
//
//
// com.yeejoin.amos.boot.module.hygf.api.util.FileUtils.save2File(
// dirPath.toString()+"/"+fileName+".sign",
// RSASignUtils.signWithByte_New( com.yeejoin.amos.boot.module.hygf.api.util.FileUtils.toByteArray(dirPath.toString()+"/"+fileName+".bin"),
// RSASignUtils .loadPrivateKey(file+"secretKey/pkcs8.pem")));
//
// //String sign = RSASignUtils.sign(firstLink, RSASignUtils.loadPrivateKey(file+"secretKey/pkcs8.pem"));
// //生成upload需上传的三个文件
//
// //writeStringToFile(sign,dirPath.toString()+"/"+fileName+".sign");
// String checkFile = createCheckFile(fileName,batchNo);
// writeStringToFile(checkFile,dirPath.toString()+"/"+fileName+".check");
//
// try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(dirPath.toString() + "/" + fileName + ".zip"))) {
// addFileToZip(dirPath.toString() + "/" + fileName + ".bin", fileName + ".bin", zos);
// addFileToZip(dirPath.toString() + "/" + fileName + ".sign", fileName + ".sign", zos);
// addFileToZip(dirPath.toString() + "/" + fileName + ".check", fileName + ".check", zos);
//
// MultipartFile multipartFile = convertZipToMultipartFile(new File(dirPath.toString() + "/" + fileName + ".zip"));
// FeignClientResult<Map<String, String>> result = Systemctl.fileStorageClient.updateCommonFile(multipartFile);
// if (result != null) {
// for (String url : result.getResult().keySet()) {
// model.setUploadFile(url);
// sftpUploadAndUnzip(url,batchNo);
// }
// }
// } catch (IOException e) {
// model.setUploadStatus(UploadStatusEnum.未生成.getName());
// e.printStackTrace();
// model.setIcbcRecordInfos(JSONObject.toJSONString(model.getRecordDTOS()));
// model.setUploadFileName(fileName);
// model.setBatchNo(batchNo);
// this.saveOrUpdate(model);
//
// LambdaUpdateWrapper<IcbcWithholdRecord> icbcWithholdRecordUp = new LambdaUpdateWrapper<>();
// icbcWithholdRecordUp.set(BaseEntity::getIsDelete,"1");
// icbcWithholdRecordUp.eq(IcbcWithholdRecord::getBatchNo,batchNo);
// icbcWithholdRecordService.getBaseMapper().update(null ,icbcWithholdRecordUp);
// } finally {
// cleanup(dirPath);
// }
// }
/**
* 生成文件
...
...
@@ -433,7 +487,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
model
.
setReceiptFile
(
url
);
}
this
.
saveOrUpdate
(
model
);
this
.
downloadAndSaveZipFile
(
model
.
getReceiptFile
(),
batchNo
,
"
回盘文件
"
,
response
);
this
.
downloadAndSaveZipFile
(
model
.
getReceiptFile
(),
batchNo
,
"
批扣回单
"
,
response
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"平台上传文件失败"
);
...
...
@@ -602,7 +656,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
* @param batchNo 批次号
*/
@Async
public
void
sftpUploadAndUnzip
(
String
fileUrl
,
String
batchNo
,
String
uploader
)
{
public
void
sftpUploadAndUnzip
(
String
fileUrl
,
String
batchNo
)
{
Path
currentWorkingDir
=
Paths
.
get
(
""
);
Path
dirPath
=
currentWorkingDir
.
resolve
(
batchNo
);
try
{
...
...
@@ -831,7 +885,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
List
<
IcbcWithhold
>
icbcWithholds
=
this
.
getBaseMapper
().
selectList
(
wrapper
);
for
(
IcbcWithhold
icbcWithhold
:
icbcWithholds
)
{
sftpUploadAndUnzip
(
icbcWithhold
.
getUploadFile
(),
icbcWithhold
.
getBatchNo
()
,
realName
);
sftpUploadAndUnzip
(
icbcWithhold
.
getUploadFile
(),
icbcWithhold
.
getBatchNo
());
}
...
...
@@ -842,11 +896,15 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
wrapper
.
in
(
BaseEntity:
:
getSequenceNbr
,
ids
);
List
<
IcbcWithhold
>
icbcWithholds
=
this
.
getBaseMapper
().
selectList
(
wrapper
);
for
(
IcbcWithhold
icbcWithhold
:
icbcWithholds
)
{
long
l
=
System
.
currentTimeMillis
();
try
{
fileGeneration
(
icbcWithhold
);
System
.
out
.
println
(
"bbbbbbbbbbbbbbbbbbb"
+
String
.
valueOf
(
System
.
currentTimeMillis
()-
l
)
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
\ No newline at end of file
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