Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
ebfabe34
Commit
ebfabe34
authored
Nov 21, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改同步事项
parent
b9ca272d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
portal-manager/src/main/java/com/mortals/xhx/module/uploadfile/web/UploadfileController.java
...rtals/xhx/module/uploadfile/web/UploadfileController.java
+44
-1
No files found.
portal-manager/src/main/java/com/mortals/xhx/module/uploadfile/web/UploadfileController.java
View file @
ebfabe34
...
@@ -8,6 +8,10 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
...
@@ -8,6 +8,10 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import
com.mortals.xhx.module.menu.model.MenuEntity
;
import
com.mortals.xhx.module.menu.model.MenuEntity
;
import
com.mortals.xhx.module.menu.service.MenuService
;
import
com.mortals.xhx.module.menu.service.MenuService
;
import
com.mortals.xhx.module.param.service.ParamService
;
import
com.mortals.xhx.module.param.service.ParamService
;
import
com.mortals.xhx.module.product.model.ProductAppsEntity
;
import
com.mortals.xhx.module.product.model.ProductDocumentEntity
;
import
com.mortals.xhx.module.product.service.ProductAppsService
;
import
com.mortals.xhx.module.product.service.ProductDocumentService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -66,6 +70,11 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo
...
@@ -66,6 +70,11 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo
@Autowired
@Autowired
private
MenuService
menuService
;
private
MenuService
menuService
;
@Autowired
private
ProductDocumentService
productDocumentService
;
@Autowired
private
ProductAppsService
productAppsService
;
public
UploadfileController
()
{
public
UploadfileController
()
{
super
.
setFormClass
(
UploadfileForm
.
class
);
super
.
setFormClass
(
UploadfileForm
.
class
);
super
.
setModuleDesc
(
"上传文件业务"
);
super
.
setModuleDesc
(
"上传文件业务"
);
...
@@ -107,9 +116,43 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo
...
@@ -107,9 +116,43 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo
}
}
}
}
List
<
ProductDocumentEntity
>
productDocumentEntities
=
productDocumentService
.
find
(
new
ProductDocumentEntity
());
for
(
ProductDocumentEntity
productDocumentEntity
:
productDocumentEntities
)
{
String
docFileUrl
=
productDocumentEntity
.
getDocFileUrl
();
String
filePath
=
uploadService
.
getFilePath
(
docFileUrl
);
File
file
=
new
File
(
filePath
);
if
(
file
.
exists
())
{
try
{
zip
.
putNextEntry
(
new
ZipEntry
(
StrUtil
.
subAfter
(
docFileUrl
,
"/"
,
false
)));
IOUtils
.
write
(
FileUtil
.
readBytes
(
file
),
zip
);
zip
.
flush
();
zip
.
closeEntry
();
}
catch
(
Exception
e
)
{
log
.
error
(
"异常"
,
e
.
getMessage
());
}
}
}
List
<
ProductAppsEntity
>
productAppsEntities
=
productAppsService
.
find
(
new
ProductAppsEntity
());
for
(
ProductAppsEntity
productAppsEntity
:
productAppsEntities
)
{
String
appFileUrl
=
productAppsEntity
.
getAppFileUrl
();
String
filePath
=
uploadService
.
getFilePath
(
appFileUrl
);
File
file
=
new
File
(
filePath
);
if
(
file
.
exists
())
{
try
{
zip
.
putNextEntry
(
new
ZipEntry
(
StrUtil
.
subAfter
(
appFileUrl
,
"/"
,
false
)));
IOUtils
.
write
(
FileUtil
.
readBytes
(
file
),
zip
);
zip
.
flush
();
zip
.
closeEntry
();
}
catch
(
Exception
e
)
{
log
.
error
(
"异常"
,
e
.
getMessage
());
}
}
}
IOUtils
.
closeQuietly
(
zip
);
IOUtils
.
closeQuietly
(
zip
);
byte
[]
bytes
=
outputStream
.
toByteArray
();
byte
[]
bytes
=
outputStream
.
toByteArray
();
genCode
(
response
,
bytes
);
genCode
(
response
,
bytes
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
...
...
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