Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
self-service
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
廖旭伟
self-service
Commits
a9e95cd8
Commit
a9e95cd8
authored
Jan 02, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加文件下载接口
parent
ea192b9e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
362 additions
and
20 deletions
+362
-20
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/HandlingState.java
...va/com/mortals/xhx/common/code/complex/HandlingState.java
+82
-0
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/SfYofn.java
...main/java/com/mortals/xhx/common/code/complex/SfYofn.java
+73
-0
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/StepResult.java
.../java/com/mortals/xhx/common/code/complex/StepResult.java
+79
-0
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/YesNo.java
.../main/java/com/mortals/xhx/common/code/complex/YesNo.java
+73
-0
sst-manager/src/main/java/com/mortals/xhx/module/sst/feign/IApiComplexFeign.java
...va/com/mortals/xhx/module/sst/feign/IApiComplexFeign.java
+1
-1
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SyntheticalController.java
...com/mortals/xhx/module/sst/web/SyntheticalController.java
+54
-19
No files found.
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/HandlingState.java
0 → 100644
View file @
a9e95cd8
package
com.mortals.xhx.common.code.complex
;
import
com.mortals.xhx.common.code.AgentEnum
;
import
java.util.*
;
public
enum
HandlingState
{
HANDLE
(
"HANDLE"
,
"办理中"
),
FAILED
(
"FAILED"
,
"不予受理"
),
VOTE
(
"VOTE"
,
"审核未通过"
),
SUCCESS
(
"SUCCESS"
,
"办件成功"
),
UNDO
(
"UNDO"
,
"办件撤销"
),
GENERAL
(
"GENERAL"
,
"通办中"
),
GENERAL_NO_PICK
(
"GENERAL_NO_PICK"
,
"通办不接件"
),
GENERAL_SUCCESS
(
"GENERAL_SUCCESS"
,
"通办成功"
),
HANDLING_CORRECTION_FILLING
(
"HANDLING_CORRECTION_FILLING"
,
"补证补齐"
)
;
private
String
value
;
private
String
desc
;
HandlingState
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
value
;
}
public
String
getDesc
()
{
return
desc
;
}
public
static
HandlingState
getByValue
(
String
value
)
{
HandlingState
[]
var1
=
values
();
int
var2
=
var1
.
length
;
for
(
int
var3
=
0
;
var3
<
var2
;
++
var3
)
{
HandlingState
examStatus
=
var1
[
var3
];
if
(
examStatus
.
getValue
().
equals
(
value
))
{
return
examStatus
;
}
}
return
null
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumMap
(
String
...
eItem
)
{
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
HandlingState
[]
var2
=
values
();
int
var3
=
var2
.
length
;
for
(
int
var4
=
0
;
var4
<
var3
;
++
var4
)
{
HandlingState
item
=
var2
[
var4
];
try
{
boolean
hasE
=
false
;
String
[]
var7
=
eItem
;
int
var8
=
eItem
.
length
;
for
(
int
var9
=
0
;
var9
<
var8
;
++
var9
)
{
String
e
=
var7
[
var9
];
if
(
item
.
getValue
().
equals
(
e
))
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
Map
<
String
,
String
>
resultMap
=
new
HashMap
();
resultMap
.
put
(
"item_text"
,
item
.
getValue
());
resultMap
.
put
(
"item_value"
,
item
.
getDesc
());
result
.
add
(
resultMap
);
}
}
catch
(
Exception
var11
)
{
}
}
return
result
;
}
}
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/SfYofn.java
0 → 100644
View file @
a9e95cd8
package
com.mortals.xhx.common.code.complex
;
import
java.util.*
;
public
enum
SfYofn
{
是
(
"Y"
,
"是"
),
否
(
"N"
,
"否"
)
;
private
String
value
;
private
String
desc
;
SfYofn
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
value
;
}
public
String
getDesc
()
{
return
desc
;
}
public
static
SfYofn
getByValue
(
String
value
)
{
SfYofn
[]
var1
=
values
();
int
var2
=
var1
.
length
;
for
(
int
var3
=
0
;
var3
<
var2
;
++
var3
)
{
SfYofn
examStatus
=
var1
[
var3
];
if
(
examStatus
.
getValue
().
equals
(
value
))
{
return
examStatus
;
}
}
return
null
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumMap
(
String
...
eItem
)
{
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
SfYofn
[]
var2
=
values
();
int
var3
=
var2
.
length
;
for
(
int
var4
=
0
;
var4
<
var3
;
++
var4
)
{
SfYofn
item
=
var2
[
var4
];
try
{
boolean
hasE
=
false
;
String
[]
var7
=
eItem
;
int
var8
=
eItem
.
length
;
for
(
int
var9
=
0
;
var9
<
var8
;
++
var9
)
{
String
e
=
var7
[
var9
];
if
(
item
.
getValue
().
equals
(
e
))
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
Map
<
String
,
String
>
resultMap
=
new
HashMap
();
resultMap
.
put
(
"item_text"
,
item
.
getValue
());
resultMap
.
put
(
"item_value"
,
item
.
getDesc
());
result
.
add
(
resultMap
);
}
}
catch
(
Exception
var11
)
{
}
}
return
result
;
}
}
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/StepResult.java
0 → 100644
View file @
a9e95cd8
package
com.mortals.xhx.common.code.complex
;
import
java.util.*
;
public
enum
StepResult
{
通过
(
"001"
,
"通过"
),
不通过
(
"002"
,
"不通过"
),
补证补齐
(
"003"
,
"补证补齐"
),
后台重审
(
"004"
,
"后台重审"
),
准予受理
(
"005"
,
"准予受理"
),
不予受理
(
"006"
,
"不予受理"
),
容缺受理
(
"007"
,
"容缺受理"
),
外勘重审
(
"008"
,
"外勘重审"
)
;
private
String
value
;
private
String
desc
;
StepResult
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
value
;
}
public
String
getDesc
()
{
return
desc
;
}
public
static
StepResult
getByValue
(
String
value
)
{
StepResult
[]
var1
=
values
();
int
var2
=
var1
.
length
;
for
(
int
var3
=
0
;
var3
<
var2
;
++
var3
)
{
StepResult
examStatus
=
var1
[
var3
];
if
(
examStatus
.
getValue
().
equals
(
value
))
{
return
examStatus
;
}
}
return
null
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumMap
(
String
...
eItem
)
{
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
StepResult
[]
var2
=
values
();
int
var3
=
var2
.
length
;
for
(
int
var4
=
0
;
var4
<
var3
;
++
var4
)
{
StepResult
item
=
var2
[
var4
];
try
{
boolean
hasE
=
false
;
String
[]
var7
=
eItem
;
int
var8
=
eItem
.
length
;
for
(
int
var9
=
0
;
var9
<
var8
;
++
var9
)
{
String
e
=
var7
[
var9
];
if
(
item
.
getValue
().
equals
(
e
))
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
Map
<
String
,
String
>
resultMap
=
new
HashMap
();
resultMap
.
put
(
"item_text"
,
item
.
getValue
());
resultMap
.
put
(
"item_value"
,
item
.
getDesc
());
result
.
add
(
resultMap
);
}
}
catch
(
Exception
var11
)
{
}
}
return
result
;
}
}
sst-manager/src/main/java/com/mortals/xhx/common/code/complex/YesNo.java
0 → 100644
View file @
a9e95cd8
package
com.mortals.xhx.common.code.complex
;
import
java.util.*
;
public
enum
YesNo
{
有
(
"yes"
,
"有"
),
无
(
"no"
,
"无"
)
;
private
String
value
;
private
String
desc
;
YesNo
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
value
;
}
public
String
getDesc
()
{
return
desc
;
}
public
static
YesNo
getByValue
(
String
value
)
{
YesNo
[]
var1
=
values
();
int
var2
=
var1
.
length
;
for
(
int
var3
=
0
;
var3
<
var2
;
++
var3
)
{
YesNo
examStatus
=
var1
[
var3
];
if
(
examStatus
.
getValue
().
equals
(
value
))
{
return
examStatus
;
}
}
return
null
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumMap
(
String
...
eItem
)
{
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
YesNo
[]
var2
=
values
();
int
var3
=
var2
.
length
;
for
(
int
var4
=
0
;
var4
<
var3
;
++
var4
)
{
YesNo
item
=
var2
[
var4
];
try
{
boolean
hasE
=
false
;
String
[]
var7
=
eItem
;
int
var8
=
eItem
.
length
;
for
(
int
var9
=
0
;
var9
<
var8
;
++
var9
)
{
String
e
=
var7
[
var9
];
if
(
item
.
getValue
().
equals
(
e
))
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
Map
<
String
,
String
>
resultMap
=
new
HashMap
();
resultMap
.
put
(
"item_text"
,
item
.
getValue
());
resultMap
.
put
(
"item_value"
,
item
.
getDesc
());
result
.
add
(
resultMap
);
}
}
catch
(
Exception
var11
)
{
}
}
return
result
;
}
}
sst-manager/src/main/java/com/mortals/xhx/module/sst/feign/IApiComplexFeign.java
View file @
a9e95cd8
...
@@ -92,7 +92,7 @@ public interface IApiComplexFeign extends IFeign {
...
@@ -92,7 +92,7 @@ public interface IApiComplexFeign extends IFeign {
String
findPageWithPermission
(
@RequestBody
FindHandlingPageReq
query
);
String
findPageWithPermission
(
@RequestBody
FindHandlingPageReq
query
);
/**
/**
*
查询已受理事项列表
*
文件下载
* @param query
* @param query
* @return
* @return
*/
*/
...
...
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SyntheticalController.java
View file @
a9e95cd8
...
@@ -14,12 +14,17 @@ import com.mortals.framework.exception.AppException;
...
@@ -14,12 +14,17 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.util.HttpUtil
;
import
com.mortals.framework.util.HttpUtil
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.web.BaseJsonBodyController
;
import
com.mortals.framework.web.BaseJsonBodyController
;
import
com.mortals.xhx.common.code.complex.HandlingState
;
import
com.mortals.xhx.common.code.complex.SfYofn
;
import
com.mortals.xhx.common.code.complex.StepResult
;
import
com.mortals.xhx.common.code.complex.YesNo
;
import
com.mortals.xhx.common.utils.AESUtil
;
import
com.mortals.xhx.common.utils.AESUtil
;
import
com.mortals.xhx.module.matter.service.UserMatterApplyService
;
import
com.mortals.xhx.module.matter.service.UserMatterApplyService
;
import
com.mortals.xhx.module.sst.feign.IApiComplexFeign
;
import
com.mortals.xhx.module.sst.feign.IApiComplexFeign
;
import
com.mortals.xhx.module.sst.pdu.*
;
import
com.mortals.xhx.module.sst.pdu.*
;
import
lombok.Getter
;
import
lombok.Getter
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -32,6 +37,9 @@ import javax.crypto.KeyGenerator;
...
@@ -32,6 +37,9 @@ import javax.crypto.KeyGenerator;
import
javax.crypto.SecretKey
;
import
javax.crypto.SecretKey
;
import
javax.crypto.spec.IvParameterSpec
;
import
javax.crypto.spec.IvParameterSpec
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.crypto.spec.SecretKeySpec
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.OutputStream
;
import
java.net.HttpCookie
;
import
java.net.HttpCookie
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
...
@@ -57,7 +65,6 @@ public class SyntheticalController extends BaseJsonBodyController {
...
@@ -57,7 +65,6 @@ public class SyntheticalController extends BaseJsonBodyController {
@Autowired
@Autowired
private
IApiComplexFeign
iApiComplexFeign
;
private
IApiComplexFeign
iApiComplexFeign
;
/**
/**
* 查询可受理事项
* 查询可受理事项
* @param query
* @param query
...
@@ -278,13 +285,7 @@ public class SyntheticalController extends BaseJsonBodyController {
...
@@ -278,13 +285,7 @@ public class SyntheticalController extends BaseJsonBodyController {
resp
=
iApiComplexFeign
.
acceptHandling
(
pdu
);
resp
=
iApiComplexFeign
.
acceptHandling
(
pdu
);
log
.
info
(
"accept resp==>"
+
resp
);
log
.
info
(
"accept resp==>"
+
resp
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
// Rest<List<AcceptRspInfo>> rest = JSON.parseObject(resp, new TypeReference<Rest<List<AcceptRspInfo>>>() {
// });
// if(rest.getCode()==1){
// if(CollectionUtils.isNotEmpty(rest.getData())) {
// this.userMatterApplyService.saveAcceptRspInfo(rest.getData().get(0), pdu);
// }
// }
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
this
.
doException
(
this
.
request
,
busiDesc
+
" 【异常】"
,
model
,
e
);
this
.
doException
(
this
.
request
,
busiDesc
+
" 【异常】"
,
model
,
e
);
Rest
<
Object
>
ret
=
new
Rest
();
Rest
<
Object
>
ret
=
new
Rest
();
...
@@ -342,6 +343,31 @@ public class SyntheticalController extends BaseJsonBodyController {
...
@@ -342,6 +343,31 @@ public class SyntheticalController extends BaseJsonBodyController {
String
busiDesc
=
"查询已受理事项列表"
;
String
busiDesc
=
"查询已受理事项列表"
;
try
{
try
{
resp
=
iApiComplexFeign
.
downloadFileFtp
(
pdu
);
resp
=
iApiComplexFeign
.
downloadFileFtp
(
pdu
);
Rest
<
String
>
eventRest
=
JSON
.
parseObject
(
resp
,
new
TypeReference
<
Rest
<
String
>>()
{
});
if
(
eventRest
.
getCode
()==
1
&&
eventRest
.
getData
().
length
()>
1024
){
String
urlStr
=
pdu
.
getUrl
();
String
fileName
=
urlStr
.
substring
(
urlStr
.
lastIndexOf
(
"/"
)+
1
);
byte
[]
data
=
Base64
.
getDecoder
().
decode
(
eventRest
.
getData
());
// OutputStream outputStream = null;
// String path = "D:\\Download\\test1.docx";
// File file = new File(path);
// if (file.exists()) {
// file.delete();
// }
// outputStream = new FileOutputStream(file);
// outputStream.write(data);
// outputStream.flush();
// outputStream.close();
if
(
data
.
length
>
1024
)
{
this
.
responseStream
(
this
.
response
,
data
,
fileName
);
}
else
{
Rest
<
Object
>
ret
=
new
Rest
();
ret
.
setCode
(-
1
);
ret
.
setMsg
(
"下载文件不存在"
);
resp
=
JSON
.
toJSONString
(
ret
);
}
}
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
this
.
doException
(
this
.
request
,
busiDesc
+
" 【异常】"
,
model
,
e
);
this
.
doException
(
this
.
request
,
busiDesc
+
" 【异常】"
,
model
,
e
);
...
@@ -385,6 +411,26 @@ public class SyntheticalController extends BaseJsonBodyController {
...
@@ -385,6 +411,26 @@ public class SyntheticalController extends BaseJsonBodyController {
}
}
}
}
/**
* 查询字典
* @param query
* @return
*/
@PostMapping
({
"api/getDict"
})
@UnAuth
public
String
getDict
(
@RequestBody
SyntheticalPdu
query
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
model
.
put
(
"handling_state"
,
HandlingState
.
getEnumMap
());
model
.
put
(
"step_result"
,
StepResult
.
getEnumMap
());
model
.
put
(
"yes_no"
,
YesNo
.
getEnumMap
());
model
.
put
(
"sf_yofn"
,
SfYofn
.
getEnumMap
());
Rest
<
Object
>
ret
=
new
Rest
();
ret
.
setDict
(
model
);
ret
.
setCode
(
1
);
ret
.
setMsg
(
"成功"
);
return
JSON
.
toJSONString
(
ret
);
}
private
String
doPost
(
String
url
,
String
body
)
throws
Exception
{
private
String
doPost
(
String
url
,
String
body
)
throws
Exception
{
HttpRequest
httpRequest
=
HttpRequest
.
post
(
url
);
HttpRequest
httpRequest
=
HttpRequest
.
post
(
url
);
httpRequest
.
body
(
body
);
httpRequest
.
body
(
body
);
...
@@ -425,15 +471,4 @@ public class SyntheticalController extends BaseJsonBodyController {
...
@@ -425,15 +471,4 @@ public class SyntheticalController extends BaseJsonBodyController {
// }
// }
// }
// }
// public static void main(String[] args) {
// try {
// Path filePath = Paths.get("D:\\home\\mortals\\app\\aaa.jpg"); // 替换为实际文件路径
// byte[] fileBytes = Files.readAllBytes(filePath);
// String base64EncodedString = Base64.getEncoder().encodeToString(fileBytes);
// System.out.println(base64EncodedString);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
}
}
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