Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hunanPythonModel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宦普
hunanPythonModel
Commits
c14ca565
Commit
c14ca565
authored
Sep 24, 2025
by
王宦普
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whp:open Other Api
parent
95136c08
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
20 deletions
+25
-20
MqConsumer.java
src/main/java/com/jianju/hunanconsumer/mq/MqConsumer.java
+24
-19
AnalysisDataUtil.java
.../java/com/jianju/hunanconsumer/util/AnalysisDataUtil.java
+1
-1
No files found.
src/main/java/com/jianju/hunanconsumer/mq/MqConsumer.java
View file @
c14ca565
...
@@ -78,12 +78,15 @@ public class MqConsumer {
...
@@ -78,12 +78,15 @@ public class MqConsumer {
}
}
}
}
//其他系统回调
//其他系统回调
// Map<String, Object> param2 = new HashMap<>();
log
.
info
(
"开始回调"
);
// param2.put("jobId",jsonData.get("uuid"));
Map
<
String
,
Object
>
param2
=
new
HashMap
<>();
// param2.put("status",1);
param2
.
put
(
"jobId"
,
jsonData
.
get
(
"uuid"
));
// param2.put("outputParam","");
param2
.
put
(
"status"
,
1
);
// param2.put("message", "");
param2
.
put
(
"outputParam"
,
null
);
// ApiRequest.Send(otherApiPath,param2,restTemplate);
param2
.
put
(
"message"
,
null
);
log
.
info
(
"otherApiPath:"
+
otherApiPath
);
log
.
info
(
param2
.
toString
());
ApiRequest
.
Send
(
otherApiPath
,
param2
,
restTemplate
);
//解析python
//解析python
Map
<
String
,
Object
>
result
=
AnalysisDataUtil
.
analysisData
(
params
);
Map
<
String
,
Object
>
result
=
AnalysisDataUtil
.
analysisData
(
params
);
//正确消息回调
//正确消息回调
...
@@ -94,12 +97,14 @@ public class MqConsumer {
...
@@ -94,12 +97,14 @@ public class MqConsumer {
log
.
info
(
"SendMessage"
);
log
.
info
(
"SendMessage"
);
ApiRequest
.
Send
(
apiPath
,
param
,
restTemplate
);
ApiRequest
.
Send
(
apiPath
,
param
,
restTemplate
);
//其他系统回调
//其他系统回调
// Map<String, Object> param3 = new HashMap<>();
log
.
info
(
"其他系统回调"
);
// param3.put("jobId",jsonData.get("uuid"));
Map
<
String
,
Object
>
param3
=
new
HashMap
<>();
// param3.put("status",result.get("type"));
param3
.
put
(
"jobId"
,
jsonData
.
get
(
"uuid"
));
// param3.put("outputParam", JSONObject.parseObject((String) result.get("msg")));
param3
.
put
(
"status"
,
result
.
get
(
"type"
));
// param3.put("message", "");
param3
.
put
(
"outputParam"
,
JSONObject
.
parseObject
((
String
)
result
.
get
(
"msg"
)));
// ApiRequest.Send(otherApiPath,param3,restTemplate);
param3
.
put
(
"message"
,
""
);
log
.
info
(
param3
.
toString
());
ApiRequest
.
Send
(
otherApiPath
,
param3
,
restTemplate
);
channelTask
.
basicAck
(
message
.
getEnvelope
().
getDeliveryTag
(),
false
);
channelTask
.
basicAck
(
message
.
getEnvelope
().
getDeliveryTag
(),
false
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -109,13 +114,13 @@ public class MqConsumer {
...
@@ -109,13 +114,13 @@ public class MqConsumer {
param
.
put
(
"msg"
,
e
.
getMessage
());
param
.
put
(
"msg"
,
e
.
getMessage
());
ApiRequest
.
Send
(
apiPath
,
param
,
restTemplate
);
ApiRequest
.
Send
(
apiPath
,
param
,
restTemplate
);
//其他系统回调
//其他系统回调
//
Map<String, Object> param2 = new HashMap<>();
Map
<
String
,
Object
>
param2
=
new
HashMap
<>();
//
param2.put("jobId",jsonData.get("uuid"));
param2
.
put
(
"jobId"
,
jsonData
.
get
(
"uuid"
));
//
param2.put("status",3);
param2
.
put
(
"status"
,
3
);
// param2.put("outputParam", ""
);
param2
.
put
(
"outputParam"
,
null
);
//
param2.put("message", e.getMessage());
param2
.
put
(
"message"
,
e
.
getMessage
());
//
ApiRequest.Send(otherApiPath,param2,restTemplate);
ApiRequest
.
Send
(
otherApiPath
,
param2
,
restTemplate
);
//
channelTask.basicAck(message.getEnvelope().getDeliveryTag(), false);
channelTask
.
basicAck
(
message
.
getEnvelope
().
getDeliveryTag
(),
false
);
}
}
},
},
consumerTag
->
{
consumerTag
->
{
...
...
src/main/java/com/jianju/hunanconsumer/util/AnalysisDataUtil.java
View file @
c14ca565
...
@@ -20,7 +20,7 @@ public class AnalysisDataUtil {
...
@@ -20,7 +20,7 @@ public class AnalysisDataUtil {
System
.
out
.
println
(
"pythonPath: "
+
pythonPath
);
System
.
out
.
println
(
"pythonPath: "
+
pythonPath
);
System
.
out
.
println
(
"fileInput : "
+
fileInput
);
System
.
out
.
println
(
"fileInput : "
+
fileInput
);
//TODO 查询python 环境日志
// 构建 ProcessBuilder
// 构建 ProcessBuilder
ProcessBuilder
pb
=
new
ProcessBuilder
(
ProcessBuilder
pb
=
new
ProcessBuilder
(
"/opt/conda/envs/py310gdal/bin/python"
,
"/opt/conda/envs/py310gdal/bin/python"
,
...
...
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