Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
d09d3dc3
提交
d09d3dc3
authored
3月 10, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[user file] 代码添加
上级
4bb8c2e2
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
792 行增加
和
80 行删除
+792
-80
pom.xml
dev-file/pom.xml
+4
-3
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+18
-6
WorkHandoverDevice.java
...a/com/tykj/dev/device/file/entity/WorkHandoverDevice.java
+13
-2
JavaToPdfHtmlFreeMarker.java
...om/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
+232
-57
RepelQueryServiceImpl.java
...v/device/sendback/service/impl/RepelQueryServiceImpl.java
+3
-3
HandoverController.java
.../tykj/dev/device/train/controller/HandoverController.java
+13
-0
WorkHandoverDevDao.java
...ava/com/tykj/dev/device/train/dao/WorkHandoverDevDao.java
+11
-0
WorkHandover.java
...n/java/com/tykj/dev/device/train/entity/WorkHandover.java
+14
-3
WorkHandoverDev.java
...ava/com/tykj/dev/device/train/entity/WorkHandoverDev.java
+101
-0
WorkHandoverAddVo.java
...om/tykj/dev/device/train/entity/vo/WorkHandoverAddVo.java
+6
-2
WorkHandoverServiceImpl.java
...ev/device/train/service/impl/WorkHandoverServiceImpl.java
+14
-1
bill3.html
dev-union/src/main/resources/bill3.html
+348
-0
User.java
...in/java/com/tykj/dev/device/user/subject/entity/User.java
+1
-1
UserService.java
...com/tykj/dev/device/user/subject/service/UserService.java
+6
-0
UserServiceImpl.java
...dev/device/user/subject/service/impl/UserServiceImpl.java
+8
-2
没有找到文件。
dev-file/pom.xml
浏览文件 @
d09d3dc3
...
...
@@ -12,11 +12,12 @@
<artifactId>
dev-file
</artifactId>
<dependencies>
<dependency>
<groupId>
com.itextpdf
</groupId>
<artifactId>
itext
pdf
</artifactId>
<version>
5.5.10
</version>
<groupId>
org.xhtmlrenderer
</groupId>
<artifactId>
flying-saucer-
pdf
</artifactId>
<version>
9.1.5
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.xhtmlrenderer/flying-saucer-pdf-itext5 -->
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
...
...
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
d09d3dc3
...
...
@@ -56,8 +56,20 @@ public class FileController {
@PostMapping
(
"/printDocuments"
)
public
ResponseEntity
printDocuments
(
@RequestBody
Documents
documents
)
throws
IOException
,
DocumentException
{
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成出入单据对接口"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
));
log
.
info
(
"[file] 调用了生成出入单据对接口 documents"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"documents/"
));
}
/**
* 生成工作交接的单据
* @return
*/
@ApiOperation
(
value
=
"生成工作交接的单据"
)
@PostMapping
(
"/wordHandover"
)
public
ResponseEntity
wordHandover
(
@RequestBody
WorkHandoverDoc
workHandoverDoc
)
{
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRenderWorkHandover
(
workHandoverDoc
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 生成工作交接的单据"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"workHandover/"
));
}
/**
...
...
@@ -68,8 +80,8 @@ public class FileController {
@PostMapping
(
"/printConfirm"
)
public
ResponseEntity
printConfirm
(
@RequestBody
Confirm
confirm
)
{
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRenderConfirm
(
confirm
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成确认单据对接口"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
Confirm
(
content
,
url
,
preview
));
log
.
info
(
"[file] 调用了生成确认单据对接口
confirm
"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"confirm/"
));
}
/**
...
...
@@ -81,7 +93,7 @@ public class FileController {
public
ResponseEntity
printDestruction
(
@RequestBody
Destruction
destruction
){
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRenderDestruction
(
destruction
,
url
+
"htmlModel/"
);
log
.
info
(
"[file] 调用了生成销毁单据对接口"
);
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
Destruction
(
content
,
url
,
preview
));
return
ResponseEntity
.
ok
(
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"destruction/"
));
}
/**
...
...
@@ -114,7 +126,7 @@ public class FileController {
documents
.
setDocumentDevices
(
documentDevices
);
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
,
url
+
"htmlModel/"
);
showPdf
(
response
,
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
).
getFilePath
());
showPdf
(
response
,
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
url
,
preview
,
"documents/"
).
getFilePath
());
return
ResponseEntity
.
ok
(
"ok"
);
}
...
...
dev-file/src/main/java/com/tykj/dev/device/file/entity/WorkHandoverDevice.java
浏览文件 @
d09d3dc3
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.file.entity;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -19,11 +20,14 @@ import lombok.NoArgsConstructor;
@ApiModel
(
value
=
"工作交接单据"
,
description
=
"工作交接单据提供数据"
)
public
class
WorkHandoverDevice
{
@ApiModelProperty
(
value
=
"序列号"
,
example
=
"1"
)
private
Integer
code
;
@ApiModelProperty
(
value
=
"型号"
,
example
=
"bmxx"
)
p
ublic
String
model
;
p
rivate
String
model
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"BM-1"
)
p
ublic
String
name
;
p
rivate
String
name
;
@ApiModelProperty
(
value
=
"装备类型总数"
,
example
=
"100"
)
private
Integer
deviceNumber
;
...
...
@@ -49,6 +53,13 @@ public class WorkHandoverDevice {
@ApiModelProperty
(
value
=
"使用数量"
,
example
=
"10"
)
private
Integer
useNum
;
@ApiModelProperty
(
value
=
"其他数据"
,
example
=
"10"
)
private
Integer
otherNum
=
0
;
@ApiModelProperty
(
value
=
"序列号区间"
)
public
String
seqs
;
public
Integer
getLen
(){
return
seqs
.
length
();
}
}
dev-file/src/main/java/com/tykj/dev/device/file/util/JavaToPdfHtmlFreeMarker.java
浏览文件 @
d09d3dc3
...
...
@@ -71,10 +71,6 @@ public class JavaToPdfHtmlFreeMarker {
public
static
void
main
(
String
[]
args
)
throws
IOException
,
DocumentException
{
// List<user> userList=new ArrayList<>();
// userList.add(new user("占金名",19,1));
// userList.add(new user("占金名1",19,1));
// userList.add(new user("占金名2",19,1));
Documents
documents
=
new
Documents
();
documents
.
setNumber
(
"NO:第221321134号"
);
documents
.
setReceiveUnit
(
"杭州机要"
);
...
...
@@ -97,25 +93,25 @@ public class JavaToPdfHtmlFreeMarker {
}
documents
.
setDocumentDevices
(
documentDevices
);
String
[]
content
=
JavaToPdfHtmlFreeMarker
.
freeMarkerRender
(
documents
,
"/Users/zjm/code/test-tu/htmlModel/"
);
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
"/Users/zjm/code/test-tu/"
,
"12313"
);
JavaToPdfHtmlFreeMarker
.
createPdf
(
content
,
"/Users/zjm/code/test-tu/"
,
"12313"
,
"documents/"
);
}
public
static
FileRet
createPdf
(
String
[]
htmlFiles
,
String
path
,
String
preview
){
public
static
FileRet
createPdf
(
String
[]
htmlFiles
,
String
path
,
String
preview
,
String
folderName
){
Long
startTime
=
System
.
currentTimeMillis
();
Document
document
=
new
Document
();
String
name
=
UUID
.
randomUUID
().
toString
()+
".pdf"
;
String
pdfPath
=
path
+
"documents/"
+
name
;
String
pdfPath
=
path
+
folderName
+
name
;
PdfCopy
pdfCopy
=
null
;
//创建一个新文件
try
{
pdfCopy
=
new
PdfCopy
(
document
,
new
FileOutputStream
(
pdfPath
));
document
.
open
();
for
(
String
htmlFile
:
htmlFiles
)
{
if
(
htmlFile
!=
null
)
{
String
url
=
new
File
(
htmlFile
).
toURI
().
toURL
().
toString
();
ByteArrayOutputStream
os
=
new
ByteArrayOutputStream
();
ITextRenderer
renderer
=
new
ITextRenderer
();
...
...
@@ -135,8 +131,8 @@ public class JavaToPdfHtmlFreeMarker {
}
Long
endTime
=
System
.
currentTimeMillis
();
System
.
out
.
print
(
"Itext parse Html to Pdf End -> "
+
(
endTime
-
startTime
));
return
new
FileRet
(
""
,
pdfPath
,
preview
+
"documents/"
+
name
);
}
catch
(
IOException
|
DocumentException
e
)
{
return
new
FileRet
(
""
,
pdfPath
,
preview
+
folderName
+
name
);
}
catch
(
IOException
|
DocumentException
|
com
.
lowagie
.
text
.
DocumentException
e
)
{
e
.
printStackTrace
();
}
finally
{
document
.
close
();
...
...
@@ -199,7 +195,7 @@ public class JavaToPdfHtmlFreeMarker {
data
.
put
(
"page"
,
page
);
data
.
put
(
"count"
,
count
);
if
(
documents
.
getSrcA
()==
null
||
documents
.
getSrcA
().
equals
(
""
)){
data
.
put
(
"srcA"
,
"
1
"
);
data
.
put
(
"srcA"
,
"
\""
+
1
+
"\"
"
);
data
.
put
(
"nameA"
,
" "
);
}
else
{
data
.
put
(
"srcA"
,
"\""
+
documents
.
getSrcA
()+
"\""
);
...
...
@@ -227,6 +223,8 @@ public class JavaToPdfHtmlFreeMarker {
}
private
static
Map
<
String
,
Object
>
toConfirmMap
(
Confirm
confirm
,
List
<
DocumentDevice
>
list
,
Integer
page
,
Integer
count
){
Map
<
String
,
Object
>
data
=
new
HashMap
();
data
.
put
(
"title"
,
confirm
.
getTitle
());
...
...
@@ -401,73 +399,114 @@ public class JavaToPdfHtmlFreeMarker {
return
null
;
}
// /**
// * 确认单据页面调用接口
// */
// public static FileRet createPdfConfirm(String[] htmlFiles,String path,String preview,){
//
// Long startTime = System.currentTimeMillis();
// Document document = new Document();
// String name=UUID.randomUUID().toString()+".pdf";
// String pdfPath=path+"confirm/"+name;
// PdfCopy pdfCopy = null; //创建一个新文件
// try {
// pdfCopy = new PdfCopy(document, new FileOutputStream(pdfPath));
// document.open();
// for (String htmlFile : htmlFiles) {
// if (htmlFile != null) {
//
// String url = new File(htmlFile).toURI().toURL().toString();
// ByteArrayOutputStream os = new ByteArrayOutputStream();
// ITextRenderer renderer = new ITextRenderer();
// renderer.setDocument(htmlFile);
// // 解决中文不显示问题
// ITextFontResolver fontResolver = renderer.getFontResolver();
// fontResolver.addFont(path+"fond/"+"simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
// renderer.layout();
// renderer.createPDF(os);
// PdfReader pdfReader = new PdfReader(os.toByteArray());
// for (int i = 1; i <= pdfReader.getNumberOfPages(); i++) {
// PdfImportedPage importedPage = pdfCopy.getImportedPage(pdfReader, i);
// pdfCopy.addPage(importedPage);
// }
// os.close();
// }
// }
// Long endTime = System.currentTimeMillis();
// System.out.print("Itext parse Html to Confirm Pdf End -> " + (endTime - startTime));
// return new FileRet("", pdfPath, preview +"confirm/"+ name);
// } catch (IOException | DocumentException e) {
// e.printStackTrace();
// } finally {
// document.close();
// }
// return new FileRet();
// }
/**
*
确认单据页面调用接口
*
freemarker渲染html 销毁
*/
public
static
FileRet
createPdfConfirm
(
String
[]
htmlFiles
,
String
path
,
String
preview
){
Long
startTime
=
System
.
currentTimeMillis
();
Document
document
=
new
Document
();
String
name
=
UUID
.
randomUUID
().
toString
()+
".pdf"
;
String
pdfPath
=
path
+
"confirm/"
+
name
;
PdfCopy
pdfCopy
=
null
;
//创建一个新文件
public
static
String
[]
freeMarkerRenderDestruction
(
Destruction
destruction
,
String
htmlPath
)
{
Writer
out
=
new
StringWriter
();
String
[]
strings
=
new
String
[
100000
];
int
index
=
0
;
try
{
pdfCopy
=
new
PdfCopy
(
document
,
new
FileOutputStream
(
pdfPath
));
document
.
open
();
for
(
String
htmlFile
:
htmlFiles
)
{
if
(
htmlFile
!=
null
)
{
String
url
=
new
File
(
htmlFile
).
toURI
().
toURL
().
toString
();
ByteArrayOutputStream
os
=
new
ByteArrayOutputStream
();
ITextRenderer
renderer
=
new
ITextRenderer
();
renderer
.
setDocument
(
htmlFile
);
// 解决中文不显示问题
ITextFontResolver
fontResolver
=
renderer
.
getFontResolver
();
fontResolver
.
addFont
(
path
+
"fond/"
+
"simhei.ttf"
,
BaseFont
.
IDENTITY_H
,
BaseFont
.
NOT_EMBEDDED
);
renderer
.
layout
();
renderer
.
createPDF
(
os
);
PdfReader
pdfReader
=
new
PdfReader
(
os
.
toByteArray
());
for
(
int
i
=
1
;
i
<=
pdfReader
.
getNumberOfPages
();
i
++)
{
PdfImportedPage
importedPage
=
pdfCopy
.
getImportedPage
(
pdfReader
,
i
);
pdfCopy
.
addPage
(
importedPage
);
}
os
.
close
();
// 获取模板,并设置编码方式
Template
template
=
freemarkerCfg
.
getTemplate
(
"bill1.html"
);
template
.
setEncoding
(
"UTF-8"
);
List
<
DocumentDevice
>
list
=
destruction
.
getConfirmDevices
();
List
<
List
<
DocumentDevice
>>
listList
=
toList
(
list
);
Integer
count
=
listList
.
size
();
for
(
int
i
=
1
;
i
<=
3
;
i
++){
Integer
page
=
1
;
for
(
List
<
DocumentDevice
>
list1:
listList
)
{
String
htmlname
=
htmlPath
+
UUID
.
randomUUID
().
toString
()+
".html"
;
// 合并数据模型与模板
FileWriter
fileWriter
=
new
FileWriter
(
new
File
(
htmlname
));
template
.
process
(
toDestructionMap
(
destruction
,
list1
,
MAP1
.
get
(
i
),
page
,
count
),
fileWriter
);
out
.
flush
();
strings
[
index
]=
htmlname
;
index
++;
page
++;
}
}
Long
endTime
=
System
.
currentTimeMillis
();
System
.
out
.
print
(
"Itext parse Html to Confirm Pdf End -> "
+
(
endTime
-
startTime
));
return
new
FileRet
(
""
,
pdfPath
,
preview
+
"confirm/"
+
name
);
}
catch
(
IOException
|
DocumentException
e
)
{
return
strings
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
document
.
close
();
try
{
out
.
close
();
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
}
return
new
FileRet
()
;
return
null
;
}
/**
* freemarker渲染html
销毁
* freemarker渲染html
workHandoverDoc
*/
public
static
String
[]
freeMarkerRender
Destruction
(
Destruction
destruction
,
String
htmlPath
)
{
public
static
String
[]
freeMarkerRender
WorkHandover
(
WorkHandoverDoc
workHandoverDoc
,
String
htmlPath
)
{
Writer
out
=
new
StringWriter
();
String
[]
strings
=
new
String
[
100000
];
int
index
=
0
;
try
{
// 获取模板,并设置编码方式
Template
template
=
freemarkerCfg
.
getTemplate
(
"bill
1
.html"
);
Template
template
=
freemarkerCfg
.
getTemplate
(
"bill
3
.html"
);
template
.
setEncoding
(
"UTF-8"
);
List
<
DocumentDevice
>
list
=
destruction
.
getConfirmDevices
();
List
<
List
<
DocumentDevice
>>
listList
=
toList
(
list
);
List
<
WorkHandoverDevice
>
list
=
workHandoverDoc
.
getWorkHandoverDeviceList
();
List
<
List
<
WorkHandoverDevice
>>
listList
=
toListWorkHandoverDevice
(
list
);
Integer
count
=
listList
.
size
();
for
(
int
i
=
1
;
i
<=
3
;
i
++){
Integer
page
=
1
;
for
(
List
<
Document
Device
>
list1:
listList
)
{
for
(
List
<
WorkHandover
Device
>
list1:
listList
)
{
String
htmlname
=
htmlPath
+
UUID
.
randomUUID
().
toString
()+
".html"
;
// 合并数据模型与模板
FileWriter
fileWriter
=
new
FileWriter
(
new
File
(
htmlname
));
template
.
process
(
to
DestructionMap
(
destruction
,
list1
,
MAP
.
get
(
i
),
page
,
count
),
fileWriter
);
template
.
process
(
to
MapWork
(
workHandoverDoc
,
list1
,
MAP1
.
get
(
i
),
page
,
count
),
fileWriter
);
out
.
flush
();
strings
[
index
]=
htmlname
;
index
++;
...
...
@@ -487,12 +526,33 @@ public class JavaToPdfHtmlFreeMarker {
return
null
;
}
public
static
FileRet
createPdfDestruction
(
String
[]
htmlFiles
,
String
path
,
String
preview
){
private
static
Map
<
String
,
Object
>
toMapWork
(
WorkHandoverDoc
workHandoverDoc
,
List
<
WorkHandoverDevice
>
list
,
String
test
,
Integer
page
,
Integer
count
){
Map
<
String
,
Object
>
data
=
new
HashMap
();
Instant
instant
=
workHandoverDoc
.
getTime
().
toInstant
();
String
local1
=
LocalDateTime
.
ofInstant
(
instant
,
ZoneId
.
systemDefault
()).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
data
.
put
(
"time"
,
local1
);
data
.
put
(
"page"
,
page
);
data
.
put
(
"count"
,
count
);
AtomicInteger
i
=
new
AtomicInteger
(
1
);
list
.
forEach
(
workHandoverDevice
->
{
workHandoverDevice
.
setCode
(
i
.
get
());
i
.
set
(
i
.
get
()+
1
);
}
);
data
.
put
(
"documentDevices"
,
list
);
return
data
;
}
public
static
FileRet
createPdfDestruction
(
String
[]
htmlFiles
,
String
path
,
String
preview
,
String
folderName
){
Long
startTime
=
System
.
currentTimeMillis
();
Document
document
=
new
Document
();
String
name
=
UUID
.
randomUUID
().
toString
()+
".pdf"
;
String
pdfPath
=
path
+
"destruction/"
+
name
;
String
pdfPath
=
path
+
folderName
+
name
;
PdfCopy
pdfCopy
=
null
;
//创建一个新文件
try
{
pdfCopy
=
new
PdfCopy
(
document
,
new
FileOutputStream
(
pdfPath
));
...
...
@@ -519,8 +579,8 @@ public class JavaToPdfHtmlFreeMarker {
}
Long
endTime
=
System
.
currentTimeMillis
();
System
.
out
.
print
(
"Itext parse Html to Destruction Pdf End -> "
+
(
endTime
-
startTime
));
return
new
FileRet
(
""
,
pdfPath
,
preview
+
"destruction/"
+
name
);
}
catch
(
IOException
|
DocumentException
e
)
{
return
new
FileRet
(
""
,
pdfPath
,
preview
+
folderName
+
name
);
}
catch
(
IOException
|
DocumentException
|
com
.
lowagie
.
text
.
DocumentException
e
)
{
e
.
printStackTrace
();
}
finally
{
document
.
close
();
...
...
@@ -528,6 +588,50 @@ public class JavaToPdfHtmlFreeMarker {
return
new
FileRet
();
}
// public static FileRet createPdfWordHandover(String[] htmlFiles,String path,String preview){
//
// Long startTime = System.currentTimeMillis();
// Document document = new Document();
// String name=UUID.randomUUID().toString()+".pdf";
// String pdfPath=path+"wordHandover/"+name;
// PdfCopy pdfCopy = null; //创建一个新文件
// try {
// pdfCopy = new PdfCopy(document, new FileOutputStream(pdfPath));
// document.open();
// for (String htmlFile : htmlFiles) {
// if (htmlFile != null) {
//
// String url = new File(htmlFile).toURI().toURL().toString();
// ByteArrayOutputStream os = new ByteArrayOutputStream();
// ITextRenderer renderer = new ITextRenderer();
// renderer.setDocument(htmlFile);
// // 解决中文不显示问题
// ITextFontResolver fontResolver = renderer.getFontResolver();
// fontResolver.addFont(path+"fond/"+"simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
// renderer.layout();
// renderer.createPDF(os);
// PdfReader pdfReader = new PdfReader(os.toByteArray());
// for (int i = 1; i <= pdfReader.getNumberOfPages(); i++) {
// PdfImportedPage importedPage = pdfCopy.getImportedPage(pdfReader, i);
// pdfCopy.addPage(importedPage);
// }
// os.close();
// }
// }
// Long endTime = System.currentTimeMillis();
// System.out.print("Itext parse Html to Destruction Pdf End -> " + (endTime - startTime));
// return new FileRet("", pdfPath, preview +"wordHandover/"+ name);
// } catch (IOException | DocumentException e) {
// e.printStackTrace();
// } finally {
// document.close();
// }
// return new FileRet();
// }
/**
* 计算每一页打印的内容
* 判断是否超过一页展示的最多的内容
...
...
@@ -575,4 +679,75 @@ public class JavaToPdfHtmlFreeMarker {
}
/**
* 计算每一页打印的内容
* 判断是否超过一页展示的最多的内容
* 如大于
* 直接生成一个页面的数据 放入到集合中 List<List<DocumentDevice>>
* 不大于则计算相关的值,下一个内容
* @param workHandoverDevices 装备数据信息
* @return
*/
private
static
List
<
List
<
WorkHandoverDevice
>>
toListWorkHandoverDevice
(
List
<
WorkHandoverDevice
>
workHandoverDevices
)
{
workHandoverDevices
=
workHandoverDevices
.
stream
().
sorted
(
Comparator
.
comparing
(
WorkHandoverDevice:
:
getLen
).
reversed
()).
collect
(
Collectors
.
toList
());
List
<
List
<
WorkHandoverDevice
>>
lists
=
new
ArrayList
<>();
List
<
WorkHandoverDevice
>
list
=
new
ArrayList
<>();
AtomicInteger
count
=
new
AtomicInteger
();
for
(
int
i
=
0
;
i
<
workHandoverDevices
.
size
();
i
++){
WorkHandoverDevice
workHandoverDevice
=
workHandoverDevices
.
get
(
i
);
int
len
=
workHandoverDevice
.
getSeqs
().
length
();
if
(
len
>=
3500
){
workHandoverDevice
.
setSeqs
(
toString
(
workHandoverDevice
.
getSeqs
()));
list
.
add
(
workHandoverDevice
);
lists
.
add
(
list
);
list
=
new
ArrayList
<>();
}
else
{
int
totle
=
count
.
get
()+
54
+
len
;
if
(
totle
>
3510
){
WorkHandoverDevice
workHandoverDevice1
=
new
WorkHandoverDevice
();
workHandoverDevice1
.
setSeqs
(
toString
(
workHandoverDevice1
.
getSeqs
().
substring
(
3510
-
count
.
get
(),
len
)));
workHandoverDevice
.
setSeqs
(
toString
(
workHandoverDevice1
.
getSeqs
().
substring
(
0
,
3510
-
count
.
get
())));
list
.
add
(
workHandoverDevice
);
lists
.
add
(
list
);
list
=
new
ArrayList
<>();
list
.
add
(
workHandoverDevice1
);
count
.
set
(
totle
-
3510
);
}
else
{
workHandoverDevice
.
setSeqs
(
toString
(
workHandoverDevice
.
getSeqs
()));
list
.
add
(
workHandoverDevice
);
int
yu
=
len
%
54
;
int
s
=
54
-
yu
;
count
.
set
(
totle
+
s
);
}
}
if
(
i
==
workHandoverDevices
.
size
()-
1
){
workHandoverDevice
.
setSeqs
(
toString
(
workHandoverDevice
.
getSeqs
()));
lists
.
add
(
list
);
}
}
return
lists
;
}
private
static
String
toString
(
String
str
){
int
len
=
54
;
StringBuilder
stringBuilder
=
new
StringBuilder
();
if
(
str
.
length
()>
54
){
boolean
falg
=
true
;
int
i
=
0
;
while
(
falg
){
if
((
i
+
1
)*
len
>
str
.
length
())
{
stringBuilder
.
append
(
str
.
substring
(
i
*
len
)).
toString
();
falg
=
false
;
}
else
{
stringBuilder
.
append
(
str
,
i
*
len
,
(
i
+
1
)*
len
).
append
(
"<br/>"
);
i
++;
}
}
return
stringBuilder
.
toString
();
}
else
{
return
str
;
}
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelQueryServiceImpl.java
浏览文件 @
d09d3dc3
...
...
@@ -47,9 +47,9 @@ public class RepelQueryServiceImpl implements RepelQueryService {
RepelDeviceUnitService
deviceUnitService
;
@Override
public
RepelStatisticsVo
findRepelTaskStatisticals
(
Integer
taskId
,
Integer
billId
)
{
DeviceRepelDetail
deviceRepelDetail
=
repelDetailService
.
findDeviceRepelDetailNoDev
(
billId
);
DeviceRepel
deviceRepel
=
deviceRepelService
.
findDeviceRepel
(
deviceRepelDetail
.
getRepelId
()
);
return
new
RepelStatisticsVo
(
deviceRepel
.
getInitiateName
(),
deviceRepel
.
getTime
(),
repelTaskStatisticalService
.
findAllRepelTaskStatistical
(
taskId
,
deviceRepelDetail
.
getRepelId
()
));
//
DeviceRepelDetail deviceRepelDetail= repelDetailService.findDeviceRepelDetailNoDev(billId);
DeviceRepel
deviceRepel
=
deviceRepelService
.
findDeviceRepel
(
billId
);
return
new
RepelStatisticsVo
(
deviceRepel
.
getInitiateName
(),
deviceRepel
.
getTime
(),
repelTaskStatisticalService
.
findAllRepelTaskStatistical
(
taskId
,
billId
));
}
@Override
...
...
dev-train/src/main/java/com/tykj/dev/device/train/controller/HandoverController.java
浏览文件 @
d09d3dc3
...
...
@@ -14,6 +14,8 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.stream.Collectors
;
/**
* @author zjm
* @version 1.0.0
...
...
@@ -80,4 +82,15 @@ public class HandoverController {
return
ResponseEntity
.
ok
(
workHandoverService
.
handover
(
workHandoverAddVo
.
getTurnOverUserAId
()));
}
/**
* 工作交接-查询交接人下拉
*/
@GetMapping
(
value
=
"/userList"
)
@ApiOperation
(
value
=
"工作交接-查询交接人下拉"
)
public
ResponseEntity
userList
(
@ApiIgnore
@AuthenticationPrincipal
SecurityUser
securityUser
)
{
return
ResponseEntity
.
ok
(
userService
.
findByUniteId1
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
()).
stream
().
filter
(
userShenRe
->
userShenRe
.
getTrainStatus
()!=
5
).
collect
(
Collectors
.
toList
()));
}
}
dev-train/src/main/java/com/tykj/dev/device/train/dao/WorkHandoverDevDao.java
0 → 100644
浏览文件 @
d09d3dc3
package
com
.
tykj
.
dev
.
device
.
train
.
dao
;
import
com.tykj.dev.device.train.entity.WorkHandoverDev
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.util.List
;
public
interface
WorkHandoverDevDao
extends
JpaRepository
<
WorkHandoverDev
,
Integer
>,
JpaSpecificationExecutor
<
WorkHandoverDev
>
{
List
<
WorkHandoverDev
>
findAllByWordId
(
Integer
wordId
);
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/WorkHandover.java
浏览文件 @
d09d3dc3
...
...
@@ -11,8 +11,10 @@ import lombok.NoArgsConstructor;
import
org.modelmapper.ModelMapper
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.*
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -26,12 +28,13 @@ import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
public
class
WorkHandover
{
/**
* 工作交接id
*/
@Id
@GeneratedValue
@GeneratedValue
()
@ApiModelProperty
(
value
=
"工作交接id"
)
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
private
Integer
workHandoverId
;
...
...
@@ -84,17 +87,19 @@ public class WorkHandover {
* 创建时间
*/
@CreatedDate
private
Integer
createTime
;
private
Date
createTime
;
/**
* 更新时间
*/
@LastModifiedDate
private
Integer
updateTime
;
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
/**
* 发起用户集合
*/
...
...
@@ -112,4 +117,10 @@ public class WorkHandover {
*/
@Transient
private
List
<
FileRet
>
fileRets
;
/**
* 本次交接装备信息清单
*/
@Transient
private
List
<
WorkHandoverDev
>
workHandoverDevs
;
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/WorkHandoverDev.java
0 → 100644
浏览文件 @
d09d3dc3
package
com
.
tykj
.
dev
.
device
.
train
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zjm
* @version 1.0.0
* @ClassName WorkHandoverDevice.java
* @Description TODO
* @createTime 2021年03月09日 15:52:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
public
class
WorkHandoverDev
{
@Id
@GeneratedValue
@ApiModelProperty
(
value
=
"数据id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"业务数据id"
)
private
Integer
wordId
;
@ApiModelProperty
(
value
=
"型号"
,
example
=
"bmxx"
)
private
String
model
;
@ApiModelProperty
(
value
=
"名称"
,
example
=
"BM-1"
)
private
String
name
;
@ApiModelProperty
(
value
=
"所属单位"
,
example
=
"省机要局"
)
private
String
ownUnit
;
@ApiModelProperty
(
value
=
"装备类型总数"
,
example
=
"100"
)
private
Integer
deviceNumber
;
@ApiModelProperty
(
value
=
"在库数量"
,
example
=
"10"
)
private
Integer
inLibraryNum
;
@ApiModelProperty
(
value
=
"维修数量"
,
example
=
"10"
)
private
Integer
repairNum
;
@ApiModelProperty
(
value
=
"销毁数量"
,
example
=
"10"
)
private
Integer
destoryNum
;
@ApiModelProperty
(
value
=
"退役数量"
,
example
=
"10"
)
private
Integer
retiredNum
;
@ApiModelProperty
(
value
=
"报废数量"
,
example
=
"10"
)
private
Integer
scrappedNum
;
@ApiModelProperty
(
value
=
"运输中数量"
,
example
=
"10"
)
private
Integer
allotNum
;
@ApiModelProperty
(
value
=
"使用数量"
,
example
=
"10"
)
private
Integer
useNum
;
// @ApiModelProperty(value = "该型号所有装备Id列表")
// @Transient
// private List<Integer> deviceIds = new ArrayList<>();
//
// @Transient
// @ApiModelProperty(value = "该型号在库装备Id列表")
// private List<Integer> inLibraryIds = new ArrayList<>();
//
// @Transient
// @ApiModelProperty(value = "该型号维修装备Id列表")
// private List<Integer> repairIds = new ArrayList<>();
//
// @Transient
// @ApiModelProperty(value = "该型号销毁装备Id列表")
// private List<Integer> destoryIds = new ArrayList<>();
//
// @Transient
// @ApiModelProperty(value = "该型号退役装备Id列表")
// private List<Integer> retiredIds = new ArrayList<>();
//
// @Transient
// @ApiModelProperty(value = "该型号报废装备Id列表")
// private List<Integer> scrappedIds = new ArrayList<>();
//
// @Transient
// @ApiModelProperty(value = "该型号运输中装备Id列表")
// private List<Integer> allotIds = new ArrayList<>();
//
// @Transient
// @ApiModelProperty(value = "该型号使用中装备Id列表")
// private List<Integer> useIds = new ArrayList<>();
@ApiModelProperty
(
value
=
"序列号区间"
)
@Column
(
name
=
"seq_s"
,
columnDefinition
=
"TEXT"
)
public
String
seqs
;
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/vo/WorkHandoverAddVo.java
浏览文件 @
d09d3dc3
package
com
.
tykj
.
dev
.
device
.
train
.
entity
.
vo
;
import
com.tykj.dev.device.library.subject.vo.DeviceStatisticsVo
;
import
com.tykj.dev.device.train.entity.WorkHandover
;
import
com.tykj.dev.
misc.base.BeanHelper
;
import
com.tykj.dev.
device.train.entity.WorkHandoverDev
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
...
...
@@ -27,6 +28,9 @@ public class WorkHandoverAddVo {
private
List
<
Integer
>
turnOverUserAId
;
/**
* 单据装备数据统计数据
*/
List
<
WorkHandoverDev
>
workHandoverDevices
;
}
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/WorkHandoverServiceImpl.java
浏览文件 @
d09d3dc3
...
...
@@ -7,7 +7,9 @@ import com.tykj.dev.device.task.service.TaskService;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.vo.TaskUserVo
;
import
com.tykj.dev.device.train.dao.WorkHandoverDao
;
import
com.tykj.dev.device.train.dao.WorkHandoverDevDao
;
import
com.tykj.dev.device.train.entity.WorkHandover
;
import
com.tykj.dev.device.train.entity.WorkHandoverDev
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo
;
import
com.tykj.dev.device.train.entity.vo.WorkHandoverVo
;
...
...
@@ -29,6 +31,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collector
;
...
...
@@ -59,12 +62,15 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
@Autowired
UnitsService
unitsService
;
@Autowired
WorkHandoverDevDao
workHandoverDevDao
;
@Override
public
WorkHandover
createWorkHandover
(
WorkHandoverAddVo
workHandoverAddVo
,
SecurityUser
securityUser
)
{
log
.
info
(
"[workHandover] 新建工作交接"
);
// WorkHandover
List
<
User
>
users
=
userService
.
findAllByUnite
(
securityUser
.
getCurrentUserInfo
().
getUnitsId
());
List
<
Integer
>
handoverIds
=
users
.
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
handoverIds
=
users
.
stream
().
filter
(
user
->
user
.
getTrainStatus
()!=
5
).
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
WorkHandover
workHandover
=
new
WorkHandover
();
workHandover
.
setStatus
(
1
);
workHandover
.
setTurnOverUserIds
(
StringSplitUtil
.
ListToString
(
workHandoverAddVo
.
getTurnOverUserAId
()));
...
...
@@ -72,6 +78,12 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
workHandover
.
setInitiateUserId
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
//创建workHandoverDB 存储数据库
workHandover
=
workHandoverDao
.
save
(
workHandover
);
Integer
id
=
workHandover
.
getWorkHandoverId
();
List
<
WorkHandoverDev
>
workHandoverDevs
=
workHandoverAddVo
.
getWorkHandoverDevices
();
workHandoverDevs
.
forEach
(
workHandoverDev
->
workHandoverDev
.
setWordId
(
id
)
);
workHandoverDevDao
.
saveAll
(
workHandoverDevs
);
List
<
Integer
>
integers
=
new
ArrayList
<>();
integers
.
add
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
WORKHANDOVER1011
.
id
,
"工作交接"
,
null
,
null
,
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
...
...
@@ -114,6 +126,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
workHandover
.
setHandoverUserList
(
userService
.
findAllUserIdInUser
(
StringSplitUtil
.
stringToList
(
workHandover
.
getHandoverUserIds
())));
workHandover
.
setTurnOverUserList
(
userService
.
findAllUserIdInUser
(
StringSplitUtil
.
stringToList
(
workHandover
.
getTurnOverUserIds
())));
workHandover
.
setFileRets
(
FilesUtil
.
stringFileToList
(
workHandover
.
getFile
()));
workHandover
.
setWorkHandoverDevs
(
workHandoverDevDao
.
findAllByWordId
(
workHandover
.
getWorkHandoverId
()));
return
workHandover
;
}
else
{
throw
new
ApiException
(
ResponseEntity
.
status
(
500
).
body
(
"没有这个id:"
+
workHandoverId
));
...
...
dev-union/src/main/resources/bill3.html
0 → 100755
浏览文件 @
d09d3dc3
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<title>
Document
</title>
<style>
body
{
font-family
:
SimHei
;
margin
:
0
;
padding
:
0
;
}
/*
@page
{
size
:
297mm
210mm
;}
<!
--
设置
PDF
页面大小,此配置只对生成
PDF
文件有效,不会对页面显示生效
--
>*/
@page
{
size
:
297mm
210mm
;
}
.bottomTxt
{
text-align
:
center
;
font-size
:
10px
;
color
:
#646464
;
height
:
10px
;
line-height
:
10px
;
}
.returnTablePrint
{
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
color
:
#000
;
cursor
:
default
;
}
.returnTablePrint
.content
{
width
:
100%
;
height
:
100%
;
}
.returnTablePrint
.content
>
div
{
width
:
100%
;
height
:
100%
;
background
:
#fff
;
/* padding: 30px; */
box-sizing
:
border-box
;
}
/* .returnTablePrint .content>p{
width: 100%;
text-align: center;
font-size: 22px;
font-weight: bold;
color: #4a475d;
} */
.returnTablePrint
.listWrapper
{
/*margin: 0 auto;*/
/* height: calc(100% - 40px); */
box-sizing
:
border-box
;
}
.returnTablePrint
.list
{
/*margin: 0 auto;*/
height
:
calc
(
100%
-
12px
)
}
.returnTablePrint
.title
{
width
:
100%
;
font-size
:
22px
;
text-align
:
center
;
position
:
relative
;
/* margin: 0 0 15px; */
padding
:
0
20px
;
box-sizing
:
border-box
;
}
/* .returnTablePrint .title span:nth-child(2){
font-size: 28px;
color: #000000;
}
.returnTablePrint .title span:nth-child(2) span{
font-size: 20px;
color: #141414;
} */
.returnTablePrint
.title
.number
{
font-size
:
12px
;
color
:
#646464
;
}
/* .returnTablePrint .other{
width: 100%;
color: #141414;
font-size: 20px;
margin-top: 20px;
padding-left: 50px;
position: relative;
box-sizing: border-box;
margin-bottom: 20px;
}
.returnTablePrint .other>span span:nth-child(2){
display: inline-block;
margin:0 40px 0 10px;
} */
.returnTablePrint
.listCon
{
height
:
100%
;
border
:
1px
solid
#7f7f7f
;
}
.returnTablePrint
.line1
{
width
:
100%
;
font-size
:
12px
;
box-sizing
:
border-box
;
border-bottom
:
1px
solid
#7f7f7f
;
color
:
#000
;
line-height
:
20px
;
}
.returnTablePrint
.line1
.sendTo
{
display
:
inline-block
;
width
:
49%
;
text-indent
:
5px
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
}
.returnTablePrint
.line1
.sendNum
{
display
:
inline-block
;
width
:
49%
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
}
.returnTablePrint
.line1
.sendTo
{
border-right
:
1px
solid
#7f7f7f
;
}
.returnTablePrint
.line1
.sendTo
span
:nth-child
(
2
),
.returnTablePrint
.line1
.sendNum
span
:nth-child
(
2
)
{
color
:
#4a475d
;
display
:
inline-block
;
margin-left
:
5px
;
}
.returnTablePrint
.line2
{
height
:
100%
;
/* padding: 20px; */
border-bottom
:
1px
solid
#7f7f7f
;
}
.returnTablePrint
.tableList
{
height
:
546px
;
}
.returnTablePrint
.line2
>>>
.el-table
tbody
tr
:nth-child
(
odd
)
{
background-color
:
#fff
;
}
.returnTablePrint
.line2
>>>
.el-table
tbody
tr
:nth-child
(
even
)
{
background-color
:
#fff
;
}
.returnTablePrint
.line3
{
width
:
100%
;
height
:
70px
;
/* box-sizing: border-box; */
/*height:150px;*/
/*display: flex;*/
/* height:170px; */
/* padding:20px 0 20px 0; */
}
.returnTablePrint
.line3
.left
{
display
:
inline-block
;
width
:
25%
;
box-sizing
:
border-box
;
/*padding-left: 20px;*/
position
:
relative
;
line-height
:
70px
;
}
.returnTablePrint
.line3
.left
{
border-right
:
1px
solid
#7f7f7f
;
/*padding-bottom: 40px;*/
}
.returnTablePrint
.line3
.left
:last-child
{
border-right
:
none
;
/*padding-bottom: 40px;*/
}
.returnTablePrint
.line3
.left
>
span
{
display
:
block
;
/* margin: 15px 0px; */
}
.returnTablePrint
.line3
.left
>
span
>
span
:nth-child
(
2
)
{
display
:
inline-block
;
margin-left
:
10px
;
}
.returnTablePrint
>>>
.el-scrollbar__wrap
{
overflow-x
:
hidden
;
margin-bottom
:
0
;
}
.returnTablePrint
.checkName
span
:nth-child
(
2
)
{
color
:
#4a475d
;
display
:
inline-block
;
margin-left
:
20px
;
}
.returnTablePrint
>>>
.el-table
tbody
.cell
{
color
:
#141414
;
}
.returnTablePrint
.label
{
color
:
#646464
;
font-size
:
12px
;
}
.returnTablePrint
.value
{
color
:
#000
;
font-size
:
12px
;
}
.returnTablePrint
.main-title
{
font-size
:
20px
;
color
:
#000000
;
line-height
:
20px
;
text-align
:
center
;
}
.returnTablePrint
.footer
{
display
:
flex
;
justify-content
:
flex-end
;
padding
:
0
40px
;
box-sizing
:
border-box
;
}
.button-submit
{
margin-left
:
50px
;
}
table
.altrowstable
{
width
:
100%
;
font-size
:
11px
;
color
:
#141414
;
border-width
:
0px
;
border-color
:
#a9c6c9
;
border-collapse
:
collapse
;
text-align
:
center
;
table-layout
:
fixed
;
word-break
:
break-all
;
}
table
.altrowstable
th
{
border-width
:
0px
;
padding
:
5px
;
border-style
:
solid
;
border-color
:
#a9c6c9
;
background-color
:
#dedede
;
word-break
:
break-all
;
}
table
.altrowstable
td
{
border-width
:
0px
;
padding
:
5px
;
/*border-style: solid;*/
/*border-color: #a9c6c9;*/
word-break
:
break-all
;
word-wrap
:
break-word
;
border-bottom
:
1px
solid
#bebebe
;
}
.oddrowcolor
{
background-color
:
#fff
;
}
.evenrowcolor
{
background-color
:
#fafafa
;
}
/*tr:nth-child(odd) {*/
/* background: #fafafa;*/
/*}*/
</style>
</head>
<body>
<div
class=
"returnTablePrint"
>
<div
class=
"content"
>
<div>
<div
class=
"listWrapper"
>
<div
class=
"list"
>
<div
class=
"title"
>
<div
class=
"main-title"
>
<span>
工作交接单2
</span>
</div>
<div
style=
"width:100%;text-align:left"
>
<div
style=
"text-align:left;display: inline-block; width: 32%"
class=
"number"
>
<span
class=
"number"
>
时间:${time}
</span>
</div>
<div
style=
"text-align:center;display: inline-block; width: 32%"
class=
"number"
>
<span></span>
</div>
<div
style=
"text-align:right;display: inline-block; width: 28%"
class=
"number"
>
<span>
机密
</span>
</div>
</div>
</div>
<div
class=
"listCon"
>
<div
class=
"line2 tableList"
>
<table
class=
"altrowstable"
id=
"alternatecolor"
>
<tr>
<th>
序号
</th><th>
型号
</th><th>
名称
</th><th>
在库
</th><th>
维修
</th><th>
报废
</th><th>
清退
</th><th>
其他
</th><th
style=
"width: 420px;"
>
装备序列号
</th>
</tr>
<
#
list
documentDevices
as
dev
>
<tr>
<td>
<
#
if
dev
.
code
!=
0
>
${dev.code}
</
#
if>
</td>
<td>
${dev.model}
</td><td>
${dev.name}
</td><td>
${dev.inLibraryNum}
</td><td>
${dev.repairNum}
</td><td>
${dev.scrappedNum}
</td><td>
${dev.retiredNum}
</td><td>
${dev.otherNum}
</td><td>
${dev.seqs}
</td>
</tr>
</
#
list>
</table>
</div>
<div
class=
"line3"
style=
"position: relative;"
>
<span
class=
"left"
>
<span>
<span
style=
"position: absolute; top: -20px; left: 8px;"
class=
"label"
>
交接人:
</span>
<span
class=
"value"
></span>
</span>
</span>
<span
class=
"left"
>
<span>
<span
style=
"position: absolute; top: -20px; left: 8px;"
class=
"label"
>
移交人:
</span>
<span
class=
"value"
></span>
</span>
</span>
<span
class=
"left"
style=
"width: 23%;"
>
<span>
<span
style=
"position: absolute; top: -20px; left: 8px;"
class=
"label"
>
监交人:
</span>
<span
class=
"value"
></span>
</span>
</span>
<span
class=
"left"
style=
"width: 23%;"
>
<span>
<span
style=
"position: absolute; top: -20px; left: 8px;"
class=
"label"
>
上级领导:
</span>
<span
class=
"value"
></span>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<p
class=
"bottomTxt"
>
第${page}页/共${count}页
</p>
</div>
<!--<script type="text/javascript">-->
<!--function altRows(id){-->
<!--if(document.getElementsByTagName){-->
<!--var table = document.getElementById(id);-->
<!--var rows = table.getElementsByTagName("tr");-->
<!--for(i = 0; i < rows.length; i++){-->
<!--if(i % 2 == 0){-->
<!--rows[i].className = "evenrowcolor";-->
<!--}else{-->
<!--rows[i].className = "oddrowcolor";-->
<!--}-->
<!--}-->
<!--}-->
<!--}-->
<!--window.onload=function(){-->
<!--altRows('alternatecolor');-->
<!--}-->
<!--</script>-->
</body>
</html>
\ No newline at end of file
dev-user/src/main/java/com/tykj/dev/device/user/subject/entity/User.java
浏览文件 @
d09d3dc3
...
...
@@ -130,7 +130,7 @@ public class User {
private
Integer
position
;
/**
* 培训状态 0.已培训 1.已过期 2.未培训 3.快过期
* 培训状态 0.已培训 1.已过期 2.未培训 3.快过期
5.不是专管员
*/
private
Integer
trainStatus
=
2
;
/**
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/UserService.java
浏览文件 @
d09d3dc3
...
...
@@ -42,6 +42,12 @@ public interface UserService extends PublicService<User> {
List
<
UserShenRe
>
findByUniteId
(
Integer
unitsId
);
/**
* 根据单位ID查询人员列表(包括自己)
*/
List
<
UserShenRe
>
findByUniteId1
(
Integer
unitsId
);
/**
* 根据单位id查询用户
*/
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UserServiceImpl.java
浏览文件 @
d09d3dc3
...
...
@@ -168,6 +168,11 @@ public class UserServiceImpl implements UserService {
return
userDao
.
findAllByUnitsId
(
unitsId
).
stream
().
map
(
User:
:
toRe
).
sorted
(
Comparator
.
comparing
(
UserShenRe:
:
getShowOrder
)).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
UserShenRe
>
findByUniteId1
(
Integer
unitsId
)
{
return
userDao
.
findAllByUnitsId
(
unitsId
).
stream
().
map
(
User:
:
toRe
).
sorted
(
Comparator
.
comparing
(
UserShenRe:
:
getShowOrder
)).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
User
>
findAllByUnite
(
Integer
unitsId
)
{
return
userDao
.
findAllByUnitsId
(
unitsId
);
...
...
@@ -189,6 +194,7 @@ public class UserServiceImpl implements UserService {
List
<
MemberThat
>
memberThats
=
new
ArrayList
<>();
userDao
.
findAllByUnitsId
(
userConditionsVo
.
getUnitsId
())
.
stream
()
.
filter
(
user
->
user
.
getTrainStatus
()!=
5
)
.
filter
(
user
->{
boolean
isNull
=
userConditionsVo
.
getDim
()!=
null
;
if
(
isNull
)
{
...
...
@@ -448,8 +454,8 @@ public class UserServiceImpl implements UserService {
user
.
setName
(
notIsUser
.
getName
());
user
.
setUnitsId
(
notIsUser
.
getUnitId
());
user
.
setShowOrder
(
3
);
user
.
setTrainStatus
(
2
);
return
user
;
user
.
setTrainStatus
(
5
);
return
user
Dao
.
save
(
user
)
;
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论