Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zjsgfa_mysql
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
zjsgfa_mysql
Commits
7fe6c4f7
Commit
7fe6c4f7
authored
Dec 01, 2025
by
jiang'yun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
018e522b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
190 additions
and
18 deletions
+190
-18
src/main/java/com/zjsgfa/framework/task/MxdyTask.java
+65
-0
src/main/java/com/zjsgfa/project/zjsgfa/controller/MxfxjgbController.java
+35
-2
src/main/java/com/zjsgfa/project/zjsgfa/controller/SjDjjcController.java
+0
-0
src/main/java/com/zjsgfa/project/zjsgfa/domain/Mxfxjgb.java
+4
-0
src/main/java/com/zjsgfa/project/zjsgfa/domain/SjDjjc.java
+3
-1
src/main/java/com/zjsgfa/project/zjsgfa/service/IMxfxjgbService.java
+4
-1
src/main/java/com/zjsgfa/project/zjsgfa/service/impl/MxfxjgbServiceImpl.java
+25
-3
src/main/java/com/zjsgfa/project/zjsgfa/service/impl/SjFdsgcsServiceImpl.java
+4
-4
src/main/resources/mybatis/zjsgfa/MxfxjgbMapper.xml
+11
-1
src/main/resources/mybatis/zjsgfa/SjDjjcMapper.xml
+37
-4
src/main/resources/mybatis/zt/DjdcInfoMapper.xml
+2
-2
src/main/resources/static/excel/sgfamb.docx
+0
-0
src/main/resources/static/excel/sjdrmb.xlsx
+0
-0
No files found.
src/main/java/com/zjsgfa/framework/task/MxdyTask.java
0 → 100644
View file @
7fe6c4f7
package
com
.
zjsgfa
.
framework
.
task
;
import
cn.hutool.http.HttpRequest
;
import
com.alibaba.fastjson2.JSON
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.JsonObject
;
import
com.zjsgfa.project.zjsgfa.domain.Mxfxjgb
;
import
com.zjsgfa.project.zjsgfa.mapper.MxfxjgbMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Component
(
"mxdyTask"
)
public
class
MxdyTask
{
@Autowired
private
MxfxjgbMapper
mxfxjgbMapper
;
public
void
ryParams
(
Long
mxid
)
{
Mxfxjgb
mxfxjgb
=
mxfxjgbMapper
.
selectMxfxjgbById
(
mxid
);
System
.
out
.
println
(
mxfxjgb
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"stream"
,
false
);
Map
<
String
,
Object
>
map2
=
new
HashMap
<>();
map2
.
put
(
"field_name"
,
"data"
);
map2
.
put
(
"type"
,
"input"
);
map2
.
put
(
"value"
,
mxfxjgb
.
getRwnr
());
List
<
Map
>
listMap
=
new
ArrayList
<>();
listMap
.
add
(
map2
);
map
.
put
(
"content"
,
listMap
);
String
url
=
"https://agent.ai.sinopec.com/aicoapi/gateway/v2/workflow/api_run/53f4afd436d2417180cb27d6dc0a3e17"
;
String
key
=
"278GANwseRJ98YbADs3G1tj7Fg40sI7d"
;
Gson
gson
=
new
GsonBuilder
().
setPrettyPrinting
().
create
();
String
json
=
gson
.
toJson
(
map
);
String
result2
=
HttpRequest
.
post
(
url
).
header
(
"Authorization"
,
"Bearer "
+
key
).
body
(
json
).
execute
().
body
();
System
.
out
.
println
(
result2
);
// // 解析API响应
String
textPresentation
=
""
;
// 解析为顶层JsonObject
JsonObject
root
=
gson
.
fromJson
(
result2
,
JsonObject
.
class
);
// 逐层获取"文本呈现"内容
// 1. 获取外层data节点
JsonObject
outerData
=
root
.
getAsJsonObject
(
"data"
);
// 2. 获取内层data节点
JsonObject
innerData
=
outerData
.
getAsJsonObject
(
"data"
);
// 3. 获取"文本呈现"字段的值
textPresentation
=
innerData
.
get
(
"文本呈现"
).
getAsString
();
// 打印结果
System
.
out
.
println
(
"文本呈现内容:\n"
+
textPresentation
);
mxfxjgb
.
setFhjg
(
textPresentation
);
mxfxjgb
.
setJxzt
(
"解析完成"
);
mxfxjgbMapper
.
updateMxfxjgb
(
mxfxjgb
);
}
}
src/main/java/com/zjsgfa/project/zjsgfa/controller/MxfxjgbController.java
View file @
7fe6c4f7
...
...
@@ -2,6 +2,12 @@ package com.zjsgfa.project.zjsgfa.controller;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
com.zjsgfa.common.exception.job.TaskException
;
import
com.zjsgfa.project.monitor.domain.SysJob
;
import
com.zjsgfa.project.monitor.service.ISysJobService
;
import
oracle.jdbc.proxy.annotation.Post
;
import
org.quartz.SchedulerException
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -34,6 +40,9 @@ public class MxfxjgbController extends BaseController
@Autowired
private
IMxfxjgbService
mxfxjgbService
;
@Autowired
private
ISysJobService
jobService
;
/**
* 查询大模型分析列表
*/
...
...
@@ -75,8 +84,7 @@ public class MxfxjgbController extends BaseController
//@PreAuthorize("@ss.hasPermi('system:mxfxjgb:add')")
@Log
(
title
=
"大模型分析"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
Mxfxjgb
mxfxjgb
)
{
public
AjaxResult
add
(
@RequestBody
Mxfxjgb
mxfxjgb
)
throws
SchedulerException
,
TaskException
{
return
toAjax
(
mxfxjgbService
.
insertMxfxjgb
(
mxfxjgb
));
}
...
...
@@ -101,4 +109,29 @@ public class MxfxjgbController extends BaseController
{
return
toAjax
(
mxfxjgbService
.
deleteMxfxjgbByIds
(
ids
));
}
@GetMapping
(
"/run/{id}"
)
public
AjaxResult
run
(
@PathVariable
(
"id"
)
Long
id
)
throws
SchedulerException
{
boolean
result
=
false
;
Mxfxjgb
mxfxjgb1
=
mxfxjgbService
.
selectMxfxjgbById
(
id
);
if
(
mxfxjgb1
!=
null
){
if
(
mxfxjgb1
.
getJobid
()!=
null
){
SysJob
job
=
jobService
.
selectJobById
(
mxfxjgb1
.
getJobid
());
result
=
jobService
.
run
(
job
);
if
(
result
){
mxfxjgb1
.
setJxzt
(
"解析中"
);
}
else
{
mxfxjgb1
.
setJxzt
(
"解析失败"
);
}
mxfxjgbService
.
updateMxfxjgb
(
mxfxjgb1
);
}
}
return
result
?
success
()
:
error
(
"任务不存在或已过期!"
);
}
}
src/main/java/com/zjsgfa/project/zjsgfa/controller/SjDjjcController.java
View file @
7fe6c4f7
This diff is collapsed.
Click to expand it.
src/main/java/com/zjsgfa/project/zjsgfa/domain/Mxfxjgb.java
View file @
7fe6c4f7
...
...
@@ -38,6 +38,8 @@ public class Mxfxjgb extends BaseEntity
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
rwsj
;
//任务内容
private
String
rwnr
;
/** 解析状态 */
@Excel
(
name
=
"解析状态"
)
...
...
@@ -64,4 +66,6 @@ public class Mxfxjgb extends BaseEntity
@Excel
(
name
=
"创建时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
createdTime
;
private
Long
jobid
;
}
src/main/java/com/zjsgfa/project/zjsgfa/domain/SjDjjc.java
View file @
7fe6c4f7
...
...
@@ -83,8 +83,10 @@ public class SjDjjc extends BaseEntity
private
String
zjgs
;
/** 钻井队 */
@Excel
(
name
=
"钻井队"
)
private
String
zjd
;
@Excel
(
name
=
"钻井队"
)
private
String
zjdmc
;
/** 井底横坐标 */
@Excel
(
name
=
"井底横坐标"
)
...
...
src/main/java/com/zjsgfa/project/zjsgfa/service/IMxfxjgbService.java
View file @
7fe6c4f7
package
com
.
zjsgfa
.
project
.
zjsgfa
.
service
;
import
java.util.List
;
import
com.zjsgfa.common.exception.job.TaskException
;
import
com.zjsgfa.project.zjsgfa.domain.Mxfxjgb
;
import
org.quartz.SchedulerException
;
/**
* 大模型分析Service接口
...
...
@@ -33,7 +36,7 @@ public interface IMxfxjgbService
* @param mxfxjgb 大模型分析
* @return 结果
*/
public
int
insertMxfxjgb
(
Mxfxjgb
mxfxjgb
);
public
int
insertMxfxjgb
(
Mxfxjgb
mxfxjgb
)
throws
SchedulerException
,
TaskException
;
/**
* 修改大模型分析
...
...
src/main/java/com/zjsgfa/project/zjsgfa/service/impl/MxfxjgbServiceImpl.java
View file @
7fe6c4f7
package
com
.
zjsgfa
.
project
.
zjsgfa
.
service
.
impl
;
import
java.util.List
;
import
com.zjsgfa.common.exception.job.TaskException
;
import
com.zjsgfa.common.utils.DateUtils
;
import
com.zjsgfa.project.monitor.domain.SysJob
;
import
com.zjsgfa.project.monitor.service.ISysJobService
;
import
org.quartz.SchedulerException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zjsgfa.project.zjsgfa.mapper.MxfxjgbMapper
;
import
com.zjsgfa.project.zjsgfa.domain.Mxfxjgb
;
import
com.zjsgfa.project.zjsgfa.service.IMxfxjgbService
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 大模型分析Service业务层处理
...
...
@@ -20,6 +26,9 @@ public class MxfxjgbServiceImpl implements IMxfxjgbService
@Autowired
private
MxfxjgbMapper
mxfxjgbMapper
;
@Autowired
private
ISysJobService
jobService
;
/**
* 查询大模型分析
*
...
...
@@ -51,9 +60,22 @@ public class MxfxjgbServiceImpl implements IMxfxjgbService
* @return 结果
*/
@Override
public
int
insertMxfxjgb
(
Mxfxjgb
mxfxjgb
)
{
return
mxfxjgbMapper
.
insertMxfxjgb
(
mxfxjgb
);
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
insertMxfxjgb
(
Mxfxjgb
mxfxjgb
)
throws
SchedulerException
,
TaskException
{
int
i
=
mxfxjgbMapper
.
insertMxfxjgb
(
mxfxjgb
);
if
(
i
>
0
)
{
SysJob
sysJob
=
new
SysJob
();
sysJob
.
setJobName
(
mxfxjgb
.
getRwmc
());
sysJob
.
setJobGroup
(
"DEFAULT"
);
sysJob
.
setInvokeTarget
(
"mxdyTask.ryParams("
+
mxfxjgb
.
getId
()+
"L)"
);
sysJob
.
setCronExpression
(
"0 0 * * * ?"
);
sysJob
.
setMisfirePolicy
(
"2"
);
sysJob
.
setConcurrent
(
"0"
);
sysJob
.
setStatus
(
"0"
);
jobService
.
insertJob
(
sysJob
);
mxfxjgb
.
setJobid
(
sysJob
.
getJobId
());
}
return
i
;
}
/**
...
...
src/main/java/com/zjsgfa/project/zjsgfa/service/impl/SjFdsgcsServiceImpl.java
View file @
7fe6c4f7
...
...
@@ -396,8 +396,8 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
}
}
}
sjFdsgcs
.
setZjgccs
(
zjgccs
);
sjFdsgcs
.
setZjycs
(
zjycs
);
//
sjFdsgcs.setZjgccs(zjgccs);
//
sjFdsgcs.setZjycs(zjycs);
if
(
zyfx
.
endsWith
(
"<p>邻井风险<p>"
)){
zyfx
=
zyfx
.
replace
(
"<p>邻井风险<p>"
,
""
);
}
...
...
@@ -491,8 +491,8 @@ public class SjFdsgcsServiceImpl implements ISjFdsgcsService
}
}
}
sjFdsgcs1
.
setZjgccs
(
zjgccs
);
sjFdsgcs1
.
setZjycs
(
zjycs
);
//
sjFdsgcs1.setZjgccs(zjgccs);
//
sjFdsgcs1.setZjycs(zjycs);
sjFdsgcs1
.
setFxgkcs
(
fxgkcs
);
sjFdsgcs1
.
setZyfx
(
zyfx
);
String
join
=
""
;
...
...
src/main/resources/mybatis/zjsgfa/MxfxjgbMapper.xml
View file @
7fe6c4f7
...
...
@@ -18,10 +18,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"createdTime"
column=
"created_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"rwnr"
column=
"rwnr"
/>
<result
property=
"jobid"
column=
"jobid"
/>
</resultMap>
<sql
id=
"selectMxfxjgbVo"
>
select id, mklx, rwlx, rwmc, rwsj, jxzt, fhjg, url, bz, created_by, created_time, update_by, update_time from mxfxjgb
select id, mklx, rwlx, rwmc, rwsj, jxzt, fhjg, url, bz, created_by, created_time, update_by, update_time
,rwnr,jobid
from mxfxjgb
</sql>
<select
id=
"selectMxfxjgbList"
parameterType=
"Mxfxjgb"
resultMap=
"MxfxjgbResult"
>
...
...
@@ -37,7 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"bz != null and bz != ''"
>
and bz = #{bz}
</if>
<if
test=
"createdBy != null and createdBy != ''"
>
and created_by = #{createdBy}
</if>
<if
test=
"createdTime != null "
>
and created_time = #{createdTime}
</if>
<if
test=
"jobid != null "
>
and jobid = #{jobid}
</if>
</where>
order by created_time desc
</select>
<select
id=
"selectMxfxjgbById"
parameterType=
"Long"
resultMap=
"MxfxjgbResult"
>
...
...
@@ -60,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createdTime != null"
>
created_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"rwnr != null"
>
rwnr,
</if>
<if
test=
"jobid != null"
>
jobid,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"mklx != null"
>
#{mklx},
</if>
...
...
@@ -74,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createdTime != null"
>
#{createdTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"rwnr != null"
>
#{rwnr},
</if>
<if
test=
"jobid != null"
>
#{jobid},
</if>
</trim>
</insert>
...
...
@@ -92,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createdTime != null"
>
created_time = #{createdTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"rwnr != null"
>
rwnr = #{rwnr},
</if>
<if
test=
"jobid != null"
>
jobid = #{jobid},
</if>
</trim>
where id = #{id}
</update>
...
...
src/main/resources/mybatis/zjsgfa/SjDjjcMapper.xml
View file @
7fe6c4f7
...
...
@@ -40,7 +40,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectSjDjjcVo"
>
select id, jh, jb, jx, jkhzb, jkzzb, gzwz, wzcw, ztmd, wzyz, wjfa, created_by, created_time, update_by, update_time, zjgs, zjd, jdhzb, jdzzb, zt, qk, sjzt, ljzlzt, dzfxzt, fxtszt, sggyzt, fdsgzt, jkzt, hsezt, jhjdzt, flzt, faid from sj_djjc
select a.id,
jh,
jb,
jx,
jkhzb,
jkzzb,
gzwz,
wzcw,
ztmd,
wzyz,
wjfa,
a.created_by,
a.created_time,
a.update_by,
a.update_time,
a.zjgs,
a.zjd,
b.zjjd zjdmc,
jdhzb,
jdzzb,
zt,
qk,
sjzt,
ljzlzt,
dzfxzt,
fxtszt,
sggyzt,
fdsgzt,
jkzt,
hsezt,
jhjdzt,
flzt,
faid
from sj_djjc a left join jcxx_jdxx b on a.zjd=b.id
</sql>
<select
id=
"selectSjDjjcList"
parameterType=
"SjDjjc"
resultMap=
"SjDjjcResult"
>
...
...
@@ -75,16 +108,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"jhjdzt != null and jhjdzt != ''"
>
and jhjdzt = #{jhjdzt}
</if>
<if
test=
"flzt != null and flzt != ''"
>
and flzt = #{flzt}
</if>
</where>
order by created_time desc
order by
a.
created_time desc
</select>
<select
id=
"selectSjDjjcById"
parameterType=
"Long"
resultMap=
"SjDjjcResult"
>
<include
refid=
"selectSjDjjcVo"
/>
where id = #{id}
where
a.
id = #{id}
</select>
<select
id=
"selectSjDjjcByJh"
resultType=
"com.zjsgfa.project.zjsgfa.domain.SjDjjc"
>
<include
refid=
"selectSjDjjcVo"
/>
where jh = #{jh}
where
a.
jh = #{jh}
</select>
<insert
id=
"insertSjDjjc"
parameterType=
"SjDjjc"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
src/main/resources/mybatis/zt/DjdcInfoMapper.xml
View file @
7fe6c4f7
...
...
@@ -134,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"getDjjcList"
resultType=
"com.zjsgfa.project.zt.domain.Djjc"
>
select a.jh,a.jdhzb,a.jdzzb,to_char(b.WJRQ,'YYYY-MM-DD') wjrq,c.kc,
c.
jd,ksjs,c.JS,xh,
select a.jh,a.jdhzb,a.jdzzb,to_char(b.WJRQ,'YYYY-MM-DD') wjrq,c.kc,
d.QSJS ||'-' || d.ZZJS
jd,ksjs,c.JS,xh,
SZDC cw,
JC,
jxzs,
...
...
@@ -192,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
Qzyy,
zzjs,
ROUND(jc / case when (JCSJHJ / 24) =0 then 1 else (JCSJHJ / 24) end , 2) zb
,pl,LGBY,cc
,pl,LGBY,cc
,QSJS
from JSHA
order by xh
...
...
src/main/resources/static/excel/sgfamb.docx
View file @
7fe6c4f7
No preview for this file type
src/main/resources/static/excel/sjdrmb.xlsx
View file @
7fe6c4f7
No preview for this file type
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