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
d6fc2a0b
Commit
d6fc2a0b
authored
May 25, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加接口附件解密地址
parent
fbb8ce10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
base-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
.../mortals/xhx/module/matter/web/MatterDatumController.java
+35
-5
No files found.
base-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterDatumController.java
View file @
d6fc2a0b
package
com.mortals.xhx.module.matter.web
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -16,10 +19,7 @@ import com.mortals.xhx.module.matter.service.MatterDatumFileService;
import
com.mortals.xhx.module.matter.service.MatterDatumService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -98,13 +98,14 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
List
<
MatterDatumEntity
>
matterDatumEntities
=
(
List
<
MatterDatumEntity
>)
model
.
get
(
KEY_RESULT_DATA
);
//去重复
List
<
MatterDatumEntity
>
collect
=
matterDatumEntities
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
model
.
put
(
KEY_RESULT_DATA
,
collect
);
model
.
put
(
KEY_RESULT_DATA
,
collect
);
return
super
.
doListAfter
(
query
,
model
,
context
);
}
/**
* 查询的材料 名称去重 并且
*
* @param query
* @return
*/
...
...
@@ -134,4 +135,33 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
return
ret
;
}
/**
* 解密下载地址
*
* @param encryptId 文件加密id
* @return
*/
@GetMapping
(
value
=
"decodeDownloadUrl"
)
@UnAuth
public
Rest
<
String
>
decodeDownloadUrl
(
@RequestParam
(
name
=
"encryptId"
)
String
encryptId
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
<>();
String
busiDesc
=
"查询材料"
+
this
.
getModuleDesc
();
try
{
String
encryUrl
=
"http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id="
+
encryptId
;
String
resp
=
HttpUtil
.
get
(
encryUrl
);
JSONObject
obj
=
JSON
.
parseObject
(
resp
);
String
code
=
obj
.
getString
(
"code"
);
String
data
=
obj
.
getString
(
"data"
);
if
(
"0"
.
equals
(
code
))
{
return
Rest
.
ok
(
data
);
}
else
{
return
Rest
.
fail
(
"获取链接失败"
);
}
}
catch
(
Exception
e
)
{
this
.
doException
(
request
,
busiDesc
,
model
,
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
}
}
\ 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