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
7ad0d18f
Commit
7ad0d18f
authored
Jul 28, 2025
by
jiang'yun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
40031266
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
147 additions
and
2 deletions
+147
-2
src/main/java/com/ruoyi/project/zt/controller/DjdcController.java
+85
-0
src/main/java/com/ruoyi/project/zt/domain/Jsha.java
+1
-0
src/main/java/com/ruoyi/project/zt/mapper/DjdcInfoMapper.java
+2
-0
src/main/java/com/ruoyi/project/zt/service/DjdcService.java
+2
-0
src/main/java/com/ruoyi/project/zt/service/impl/DjdcServiceImpl.java
+22
-2
src/main/resources/mybatis/zjsgfa/SjJygjGdsjgdcsMapper.xml
+1
-0
src/main/resources/mybatis/zt/DjdcInfoMapper.xml
+34
-0
src/main/resources/static/excel/ljfdcs.xlsx
+0
-0
No files found.
src/main/java/com/ruoyi/project/zt/controller/DjdcController.java
View file @
7ad0d18f
...
@@ -248,6 +248,9 @@ public class DjdcController {
...
@@ -248,6 +248,9 @@ public class DjdcController {
//// map.put("sldf","数量得分");
//// map.put("sldf","数量得分");
// map.put("zhdf","综合得分");
// map.put("zhdf","综合得分");
return
AjaxResult
.
success
(
djdcService
.
getDzfcList
(
param
),
map
);
return
AjaxResult
.
success
(
djdcService
.
getDzfcList
(
param
),
map
);
case
"getFdcsList"
:
//获取分段方案参数
return
AjaxResult
.
success
(
djdcService
.
getFdcsList
(
param
));
default
:
default
:
return
AjaxResult
.
success
();
return
AjaxResult
.
success
();
}
}
...
@@ -308,6 +311,11 @@ public class DjdcController {
...
@@ -308,6 +311,11 @@ public class DjdcController {
ExcelUtil
<
LjSzfxjg
>
utilSzfxjg
=
new
ExcelUtil
<
LjSzfxjg
>(
LjSzfxjg
.
class
);
ExcelUtil
<
LjSzfxjg
>
utilSzfxjg
=
new
ExcelUtil
<
LjSzfxjg
>(
LjSzfxjg
.
class
);
utilSzfxjg
.
exportExcel
(
response
,
ljSzfxjgList
,
"Sheet1"
);
utilSzfxjg
.
exportExcel
(
response
,
ljSzfxjgList
,
"Sheet1"
);
break
;
break
;
case
"exportFdcsList"
:
//导出实钻分析结果
List
<
Jsha
>
fdcsList
=
djdcService
.
getFdcsList
(
param
);
exportFdcs
(
response
,
fdcsList
);
break
;
default
:
default
:
break
;
break
;
}
}
...
@@ -395,7 +403,84 @@ public class DjdcController {
...
@@ -395,7 +403,84 @@ public class DjdcController {
public
void
exportFdcs
(
HttpServletResponse
response
,
List
<
Jsha
>
list
)
throws
IOException
{
Workbook
exl
=
null
;
OutputStream
out
=
null
;
InputStream
in
=
null
;
try
{
in
=
this
.
getClass
().
getResourceAsStream
(
"/static/excel/ljfdcs.xlsx"
);
exl
=
WorkbookFactory
.
create
(
in
);
out
=
response
.
getOutputStream
();
response
.
reset
();
String
filename
=
URLEncoder
.
encode
(
"导入模板.xlsx"
,
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
filename
);
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
);
Sheet
sheet
=
exl
.
getSheet
(
"Sheet1"
);
CellStyle
cellStyle
=
exl
.
createCellStyle
();
cellStyle
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
cellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
cellStyle
.
setBorderBottom
(
BorderStyle
.
THIN
);
//下边框
cellStyle
.
setBorderLeft
(
BorderStyle
.
THIN
);
//左边框
cellStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
//上边框
cellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
//右边框
cellStyle
.
setBottomBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setLeftBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setRightBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setTopBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
Font
cellFont
=
exl
.
createFont
();
cellFont
.
setFontHeightInPoints
((
short
)
9
);
// 字体大小
cellFont
.
setFontName
(
"宋体"
);
// 字体应用到当前单元格上
cellStyle
.
setFont
(
cellFont
);
cellStyle
.
setWrapText
(
true
);
//设置自动换行
int
lastRow
=
sheet
.
getLastRowNum
()+
1
;
for
(
Jsha
item:
list
){
Row
row
=
sheet
.
createRow
(
lastRow
);
row
.
setHeightInPoints
(
18
);
int
m
=
0
;
Cell
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getJh
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getKc
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getZy
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getZs
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getGj
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getBs
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getPl
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getLgby
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getZtyj
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getHkyh
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getCjl
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getPssd
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getZtsgl
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getBsgl
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getSfsdzg
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getSfsdzt
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
item
.
getGllyl
());
lastRow
++;
}
exl
.
write
(
out
);
exl
.
close
();
}
catch
(
Exception
e
){
e
.
getMessage
();
throw
new
IOException
();
}
finally
{
if
(
exl
!=
null
)
{
try
{
exl
.
close
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
}
if
(
out
!=
null
)
{
try
{
out
.
close
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
}
}
}
...
...
src/main/java/com/ruoyi/project/zt/domain/Jsha.java
View file @
7ad0d18f
...
@@ -7,6 +7,7 @@ import java.util.Date;
...
@@ -7,6 +7,7 @@ import java.util.Date;
@Data
@Data
public
class
Jsha
{
public
class
Jsha
{
private
String
jh
;
private
String
jh
;
private
String
kc
;
private
Integer
xh
;
private
Integer
xh
;
private
String
ztxlh
;
private
String
ztxlh
;
private
String
ztxh
;
private
String
ztxh
;
...
...
src/main/java/com/ruoyi/project/zt/mapper/DjdcInfoMapper.java
View file @
7ad0d18f
...
@@ -37,4 +37,6 @@ public interface DjdcInfoMapper {
...
@@ -37,4 +37,6 @@ public interface DjdcInfoMapper {
List
<
DjZtfx
>
getDjZtfxList
(
CommonParam
param
);
List
<
DjZtfx
>
getDjZtfxList
(
CommonParam
param
);
List
<
Jsha
>
getFdcsList
(
CommonParam
param
);
}
}
src/main/java/com/ruoyi/project/zt/service/DjdcService.java
View file @
7ad0d18f
...
@@ -47,4 +47,6 @@ public interface DjdcService {
...
@@ -47,4 +47,6 @@ public interface DjdcService {
List
<
LjSzfxjg
>
getSztfxjgList
(
List
<
DjZtfx
>
djZtfxList
,
List
<
Djjc
>
djjcList
,
CommonParam
param
);
List
<
LjSzfxjg
>
getSztfxjgList
(
List
<
DjZtfx
>
djZtfxList
,
List
<
Djjc
>
djjcList
,
CommonParam
param
);
List
<
Jsha
>
getFdcsList
(
CommonParam
param
);
}
}
src/main/java/com/ruoyi/project/zt/service/impl/DjdcServiceImpl.java
View file @
7ad0d18f
...
@@ -657,6 +657,7 @@ public class DjdcServiceImpl implements DjdcService {
...
@@ -657,6 +657,7 @@ public class DjdcServiceImpl implements DjdcService {
// }
// }
//查询进尺和时效
//查询进尺和时效
if
(
item
.
getKsjs
()!=
null
&&
item
.
getJs
()!=
null
){
DjZjzhfx
djZjzhfx
=
djdcInfoMapper
.
getJshaJc
(
item
.
getJh
(),
item
.
getKsjs
(),
item
.
getJs
());
DjZjzhfx
djZjzhfx
=
djdcInfoMapper
.
getJshaJc
(
item
.
getJh
(),
item
.
getKsjs
(),
item
.
getJs
());
if
(
djZjzhfx
!=
null
){
if
(
djZjzhfx
!=
null
){
Double
jc
=
djZjzhfx
.
getJc
();
Double
jc
=
djZjzhfx
.
getJc
();
...
@@ -670,6 +671,8 @@ public class DjdcServiceImpl implements DjdcService {
...
@@ -670,6 +671,8 @@ public class DjdcServiceImpl implements DjdcService {
}
}
}
}
}
return
list
;
return
list
;
}
}
...
@@ -917,7 +920,7 @@ public class DjdcServiceImpl implements DjdcService {
...
@@ -917,7 +920,7 @@ public class DjdcServiceImpl implements DjdcService {
//钻头关键数据(匹配数据)
//钻头关键数据(匹配数据)
List
<
SjInfo
>
collect3
=
new
ArrayList
<>();
List
<
SjInfo
>
collect3
=
new
ArrayList
<>();
List
<
Djjc
>
ztppList
=
djjcList
.
stream
().
filter
(
dj
->
equals
(
dj
.
getZtcc
(),
info
.
getZtcc
()
)
&&
dj
.
getKc
().
equals
(
info
.
getKc
())).
collect
(
Collectors
.
toList
());
List
<
Djjc
>
ztppList
=
djjcList
.
stream
().
filter
(
dj
->
equals
(
dj
.
getZtcc
(),
info
.
getZtcc
()
)
&&
info
.
getKc
().
equals
(
dj
.
getKc
())).
collect
(
Collectors
.
toList
());
ztppList
.
forEach
(
ztpp
->{
ztppList
.
forEach
(
ztpp
->{
SjInfo
sjInfo
=
new
SjInfo
();
SjInfo
sjInfo
=
new
SjInfo
();
sjInfo
.
setKc
(
ztpp
.
getKc
());
sjInfo
.
setKc
(
ztpp
.
getKc
());
...
@@ -1409,6 +1412,16 @@ public class DjdcServiceImpl implements DjdcService {
...
@@ -1409,6 +1412,16 @@ public class DjdcServiceImpl implements DjdcService {
return
ljSzfxjgList
;
return
ljSzfxjgList
;
}
}
@Override
public
List
<
Jsha
>
getFdcsList
(
CommonParam
param
)
{
if
(
StringUtils
.
isNotEmpty
(
param
.
getJh
())){
String
[]
jhs
=
param
.
getJh
().
split
(
","
);
param
.
setJhs
(
jhs
);
}
List
<
Jsha
>
jshaList
=
djdcInfoMapper
.
getFdcsList
(
param
);
return
jshaList
;
}
public
static
void
calculateScores
(
List
<
SjInfo
>
items
)
{
public
static
void
calculateScores
(
List
<
SjInfo
>
items
)
{
// 按进尺降序排序
// 按进尺降序排序
...
@@ -1485,8 +1498,15 @@ public class DjdcServiceImpl implements DjdcService {
...
@@ -1485,8 +1498,15 @@ public class DjdcServiceImpl implements DjdcService {
}
}
public
static
boolean
equals
(
double
a
,
d
ouble
b
)
{
public
static
boolean
equals
(
Double
a
,
D
ouble
b
)
{
// 注意:要使用String类型的构造函数,防止精度丢失
// 注意:要使用String类型的构造函数,防止精度丢失
if
(
a
==
null
){
return
false
;
}
// 注意:要使用String类型的构造函数,防止精度丢失
if
(
b
==
null
){
return
false
;
}
BigDecimal
bd1
=
new
BigDecimal
(
Double
.
toString
(
a
));
BigDecimal
bd1
=
new
BigDecimal
(
Double
.
toString
(
a
));
BigDecimal
bd2
=
new
BigDecimal
(
Double
.
toString
(
b
));
BigDecimal
bd2
=
new
BigDecimal
(
Double
.
toString
(
b
));
return
bd1
.
compareTo
(
bd2
)
==
0
;
return
bd1
.
compareTo
(
bd2
)
==
0
;
...
...
src/main/resources/mybatis/zjsgfa/SjJygjGdsjgdcsMapper.xml
View file @
7ad0d18f
...
@@ -51,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -51,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createdBy != null and createdBy != ''"
>
and created_by = #{createdBy}
</if>
<if
test=
"createdBy != null and createdBy != ''"
>
and created_by = #{createdBy}
</if>
<if
test=
"createdTime != null "
>
and created_time = #{createdTime}
</if>
<if
test=
"createdTime != null "
>
and created_time = #{createdTime}
</if>
</where>
</where>
order by js
</select>
</select>
<select
id=
"selectSjJygjGdsjgdcsById"
parameterType=
"Long"
resultMap=
"SjJygjGdsjgdcsResult"
>
<select
id=
"selectSjJygjGdsjgdcsById"
parameterType=
"Long"
resultMap=
"SjJygjGdsjgdcsResult"
>
...
...
src/main/resources/mybatis/zt/DjdcInfoMapper.xml
View file @
7ad0d18f
...
@@ -553,4 +553,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -553,4 +553,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)ss
)ss
group by ss.kc,ss.ztxh,ss.cc,ss.cj
group by ss.kc,ss.ztxh,ss.cc,ss.cj
</select>
</select>
<select
id=
"getFdcsList"
resultType=
"com.ruoyi.project.zt.domain.Jsha"
>
select a.jh,c.kc,zy, zs, gj, bs, pl, lgby, ztyj, hkyh, cjl, pssd, ztsgl, bsgl, sfsdzg, sfsdzt, gllyl
from JSBA a
left join jsaa b on a.jh = b.jh
left join (
SELECT
jh,kc,(CASE WHEN kc = 1 THEN 0 ELSE LAG_JS END) ksjs,js, CONCAT( CASE WHEN kc = 1 THEN '0-' ELSE LAG_JS || '-'END,JS) AS jd
FROM (
SELECT
jh, ROW_NUMBER() OVER (PARTITION BY jh ORDER BY js) AS kc,
JS,
LAG(JS, 1, 0) OVER (PARTITION BY jh ORDER BY js) AS LAG_JS
FROM JSDB
) t) c on a.jh=c.jh
left join (
select jh,xh,
JC,ZZJS,zy, zs, gj, bs, pl, lgby, ztyj, hkyh, cjl, pssd, ztsgl, bsgl, sfsdzg, sfsdzt, gllyl
from JSHA
order by xh
) d on a.JH=d.jh and d.zzjs>ksjs and d.zzjs
<
=js
where 1=1
<if
test=
"jhs!=null"
>
and a.jh in
<foreach
item=
"jh"
collection=
"jhs"
open=
"("
separator=
","
close=
")"
>
#{jh}
</foreach>
</if>
order by kc asc
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/static/excel/ljfdcs.xlsx
0 → 100644
View file @
7ad0d18f
File added
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