Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
Project
Project
Details
Activity
Releases
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
gavelinfo
kwell-mes
Commits
dd7ea989
Commit
dd7ea989
authored
May 05, 2022
by
yff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改产品跟踪导出操作
parent
9823ea7f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
11 deletions
+76
-11
GpfkDaoImpl.java
...l/src/main/java/com/gavel/kwell/dao/impl/GpfkDaoImpl.java
+3
-3
UWosnServiceImpl.java
...n/java/com/gavel/kwell/service/impl/UWosnServiceImpl.java
+62
-7
GpfkVO.java
gavel/src/main/java/com/gavel/kwell/vo/GpfkVO.java
+11
-1
生产工单.xlsx
gavel/src/main/resources/static/model/生产工单.xlsx
+0
-0
No files found.
gavel/src/main/java/com/gavel/kwell/dao/impl/GpfkDaoImpl.java
View file @
dd7ea989
...
...
@@ -440,10 +440,10 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
public
List
<
GpfkVO
>
queryWosngzByWosnid
(
String
wosnid
,
String
[]
lhids
){
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
setTranslate
(
false
);
sqlMap
.
append
(
"select GPFK_ID, GPFK_FKSJ, GPFK_FKJSSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
"select GPFK_ID,
WOGYLX_XH,
GPFK_FKSJ, GPFK_FKJSSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, BZGX_NAME,BZGX_CODE, BZGX_GXLX "
);
sqlMap
.
append
(
"from ( "
);
sqlMap
.
append
(
" select GPFK_ID, GPFK_FKSJ, GPFK_FKJSSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" select GPFK_ID,
WOGYLX_XH,
GPFK_FKSJ, GPFK_FKJSSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, BZGX_NAME,BZGX_CODE, BZGX_GXLX "
);
sqlMap
.
append
(
" from GPFK "
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_ID = GPFK_FKGX "
);
...
...
@@ -452,7 +452,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap
.
append
(
" and GPFK_WOSNID = :pCode "
);
sqlMap
.
setParamValue
(
"pCode"
,
wosnid
);
sqlMap
.
append
(
" )GC "
);
sqlMap
.
append
(
"order by GPFK_FKSJ "
);
sqlMap
.
append
(
"order by
WOGYLX_XH asc,BZGX_NAME asc,
GPFK_FKSJ "
);
return
sqlMap
.
query
(
GpfkVO
.
class
);
}
...
...
gavel/src/main/java/com/gavel/kwell/service/impl/UWosnServiceImpl.java
View file @
dd7ea989
...
...
@@ -23,13 +23,17 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.poi.ss.usermodel.BorderStyle
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.util.CellRangeAddress
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
org.apache.poi.xssf.usermodel.XSSFCellStyle
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
...
...
@@ -87,6 +91,8 @@ public class UWosnServiceImpl extends BaseEditServiceImpl implements UWosnServic
XSSFWorkbook
wb
=
null
;
OutputStream
outputStream
=
null
;
try
{
//3.将Excel文件通过Response输出到前端
outputStream
=
response
.
getOutputStream
();
File
file
=
resource
.
getFile
();
fs
=
new
FileInputStream
(
file
);
wb
=
new
XSSFWorkbook
(
fs
);
...
...
@@ -130,18 +136,47 @@ public class UWosnServiceImpl extends BaseEditServiceImpl implements UWosnServic
cellStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
//设置居中
cellStyle
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
String
currentXh
=
""
;
String
currentGx
=
""
;
int
startRow
=
6
;
int
endRow
=
5
;
List
<
Map
>
maps
=
new
ArrayList
<
Map
>();
for
(
int
i
=
0
;
i
<
gpfkVOList
.
size
();
i
++)
{
XSSFRow
row
=
sheet
.
createRow
(
6
+
i
);
XSSFCell
bz
Cell
=
row
.
createCell
(
1
);
bz
Cell
.
setCellStyle
(
cellStyle
);
XSSFCell
gw
Cell
=
row
.
createCell
(
1
);
gw
Cell
.
setCellStyle
(
cellStyle
);
XSSFCell
gxCell
=
row
.
createCell
(
2
);
gxCell
.
setCellStyle
(
cellStyle
);
XSSFCell
zynrCell
=
row
.
createCell
(
3
);
XSSFCell
bzCell
=
row
.
createCell
(
3
);
bzCell
.
setCellStyle
(
cellStyle
);
XSSFCell
zynrCell
=
row
.
createCell
(
4
);
zynrCell
.
setCellStyle
(
cellStyle
);
XSSFCell
zyygCell
=
row
.
createCell
(
4
);
XSSFCell
zyygCell
=
row
.
createCell
(
5
);
zyygCell
.
setCellStyle
(
cellStyle
);
XSSFCell
zysjCell
=
row
.
createCell
(
5
);
XSSFCell
zysjCell
=
row
.
createCell
(
6
);
zysjCell
.
setCellStyle
(
cellStyle
);
if
(!
currentXh
.
equals
(
gpfkVOList
.
get
(
i
).
getXh
()))
{
if
(
i
!=
0
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"start"
,
startRow
);
map
.
put
(
"end"
,
endRow
);
map
.
put
(
"gx"
,
currentGx
);
map
.
put
(
"gw"
,
"工位"
+
currentXh
);
maps
.
add
(
map
);
}
currentGx
=
gpfkVOList
.
get
(
i
).
getBzgxName
();
currentXh
=
gpfkVOList
.
get
(
i
).
getXh
();
startRow
=
6
+
i
;
}
endRow
=
endRow
+
1
;
if
(
i
==
gpfkVOList
.
size
()-
1
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"start"
,
startRow
);
map
.
put
(
"end"
,
endRow
);
map
.
put
(
"gx"
,
currentGx
);
map
.
put
(
"gw"
,
"工位"
+
currentXh
);
maps
.
add
(
map
);
}
if
(
StringUtils
.
isNotEmpty
(
gpfkVOList
.
get
(
i
).
getBzgxGxlx
()))
{
String
id
=
HzGylxEnum
.
getIdByName
(
gpfkVOList
.
get
(
i
).
getBzgxGxlx
());
bzCell
.
setCellValue
(
id
);
...
...
@@ -182,10 +217,30 @@ public class UWosnServiceImpl extends BaseEditServiceImpl implements UWosnServic
zysjCell
.
setCellValue
(
DateUtils
.
formatDate
(
gpfkVOList
.
get
(
i
).
getFksj
()));
}
}
if
(
maps
!=
null
&&
maps
.
size
()>
0
)
{
for
(
Map
map1:
maps
)
{
int
start
=
(
int
)
map1
.
get
(
"start"
);
int
end
=
(
int
)
map1
.
get
(
"end"
);
String
gw
=
(
String
)
map1
.
get
(
"gw"
);
String
gx
=
(
String
)
map1
.
get
(
"gx"
);
if
(
start
!=
end
)
{
CellRangeAddress
gwRange
=
new
CellRangeAddress
(
start
,
end
,
1
,
1
);
// sheet 中合并要合并的单元格地址对象
sheet
.
addMergedRegion
(
gwRange
);
CellRangeAddress
gxRange
=
new
CellRangeAddress
(
start
,
end
,
2
,
2
);
// sheet 中合并要合并的单元格地址对象
sheet
.
addMergedRegion
(
gxRange
);
}
XSSFRow
startrow1
=
sheet
.
getRow
(
start
);
XSSFCell
startCell1
=
startrow1
.
getCell
(
1
);
startCell1
.
setCellValue
(
gw
);
XSSFRow
startrow2
=
sheet
.
getRow
(
start
);
XSSFCell
startCell2
=
startrow2
.
getCell
(
2
);
startCell2
.
setCellValue
(
gx
);
}
}
}
}
//3.将Excel文件通过Response输出到前端
outputStream
=
response
.
getOutputStream
();
// 清空response
response
.
reset
();
response
.
setContentType
(
"application/vnd.ms-excel"
);
...
...
gavel/src/main/java/com/gavel/kwell/vo/GpfkVO.java
View file @
dd7ea989
...
...
@@ -64,6 +64,16 @@ public class GpfkVO extends Gpfk {
@FieldMeta
(
fieldName
=
"SNYEAR"
,
caption
=
"条码创建年"
)
private
String
snyear
;
@FieldMeta
(
fieldName
=
"WOGYLX_XH"
,
caption
=
"序号"
)
private
String
xh
;
public
String
getXh
()
{
return
xh
;
}
public
void
setXh
(
String
xh
)
{
this
.
xh
=
xh
;
}
public
String
getSnyear
()
{
return
snyear
;
...
...
gavel/src/main/resources/static/model/生产工单.xlsx
View file @
dd7ea989
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