Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
024f55eb
提交
024f55eb
authored
12月 11, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
3f901863
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
43 行增加
和
18 行删除
+43
-18
LogType.java
dev-config/src/main/java/com/tykj/dev/config/LogType.java
+0
-0
FileController.java
...a/com/tykj/dev/device/file/Controller/FileController.java
+28
-7
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+9
-8
PackingLibrary.java
...tykj/dev/device/packing/subject/domin/PackingLibrary.java
+3
-0
LogAspect.java
dev-union/src/main/java/com/tykj/dev/union/LogAspect.java
+3
-3
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/LogType.java
浏览文件 @
024f55eb
差异被折叠。
点击展开。
dev-file/src/main/java/com/tykj/dev/device/file/Controller/FileController.java
浏览文件 @
024f55eb
package
com
.
tykj
.
dev
.
device
.
file
.
Controller
;
import
com.itextpdf.text.Document
;
import
com.itextpdf.text.DocumentException
;
import
com.itextpdf.text.Image
;
import
com.itextpdf.text.Rectangle
;
import
com.itextpdf.text.*
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.file.entity.FileRet
;
...
...
@@ -109,7 +106,7 @@ public class FileController {
File
file
=
new
File
(
url
+
"print/"
+
fileName
);
// 第一步:创建一个document对象。
Document
document
=
new
Document
();
Document
document
=
new
Document
(
PageSize
.
A4
.
rotate
()
);
document
.
setMargins
(
0
,
0
,
0
,
0
);
// 第二步:
// 创建一个PdfWriter实例,
...
...
@@ -121,10 +118,15 @@ public class FileController {
//转成
// Image.byte()
//多文件上传 图片专程byte 2进制
img
.
setAlignment
(
Image
.
ALIGN_CENTER
);
//
img.setAlignment(Image.ALIGN_CENTER);
// 根据图片大小设置页面,一定要先设置页面,再newPage(),否则无效
document
.
setPageSize
(
new
Rectangle
(
img
.
getWidth
(),
img
.
getHeight
()));
// document.setPageSize(new Rectangle(PageSize.A4.getWidth(), PageSize.A4
.getHeight()));
document
.
newPage
();
float
height
=
img
.
getHeight
();
float
width
=
img
.
getWidth
();
int
percent
=
getPercent
(
height
,
width
);
img
.
setAlignment
(
Image
.
MIDDLE
);
img
.
scalePercent
(
percent
);
document
.
add
(
img
);
}
...
...
@@ -190,4 +192,23 @@ public class FileController {
return
new
FileRet
(
originalFilename
,
url
+
newName
,
preview
+
newName
);
}
/**
* 等比压缩,获取压缩百分比
*
* @param height 图片的高度
* @param weight 图片的宽度
* @return 压缩百分比
*/
private
static
int
getPercent
(
float
height
,
float
weight
)
{
float
percent
=
0.0
F
;
if
(
height
>
weight
)
{
percent
=
PageSize
.
A4
.
rotate
().
getHeight
()
/
height
*
100
;
}
else
{
percent
=
PageSize
.
A4
.
rotate
().
getWidth
()
/
weight
*
100
;
}
return
Math
.
round
(
percent
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
024f55eb
...
...
@@ -262,14 +262,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
public
List
<
DeviceLibrary
>
getList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryDao
.
findAll
(
getSelectSpecification
(
deviceLibrarySelectVo
));
//返回父子结构
Map
<
Integer
,
DeviceLibrary
>
nodeCollect
=
deviceLibraryEntities
.
stream
().
collect
(
Collectors
.
toMap
(
DeviceLibrary:
:
getId
,
deviceLibraryEntity
->
deviceLibraryEntity
));
return
GetTreeUtils
.
parseTreeFromDown
(
deviceLibraryEntities
,
DeviceLibrary:
:
getId
,
deviceLibraryEntity
->
Optional
.
ofNullable
(
nodeCollect
.
get
(
deviceLibraryEntity
.
getPartParentId
())),
DeviceLibrary:
:
addChildNode
);
// Map<Integer, DeviceLibrary> nodeCollect =
// deviceLibraryEntities.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
// return GetTreeUtils.parseTreeFromDown(
// deviceLibraryEntities,
// DeviceLibrary::getId,
// deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
// DeviceLibrary::addChildNode
// );
return
deviceLibraryEntities
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceLibrary:
:
getLifeStatus
)).
collect
(
Collectors
.
toList
());
}
public
List
<
DeviceLibrary
>
getList2
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/subject/domin/PackingLibrary.java
浏览文件 @
024f55eb
...
...
@@ -203,6 +203,9 @@ public class PackingLibrary {
@ApiModelProperty
(
value
=
"申请数量"
)
@Transient
private
Integer
applyNum
;
@ApiModelProperty
(
value
=
"预分配的装备序列号"
)
@Transient
private
String
seq
;
public
void
addChildNode
(
PackingLibrary
packingLibraryEntity
)
{
childs
.
add
(
packingLibraryEntity
);
...
...
dev-union/src/main/java/com/tykj/dev/union/LogAspect.java
浏览文件 @
024f55eb
...
...
@@ -162,7 +162,7 @@ public class LogAspect {
this
.
newStatus
=
this
.
outPutTask
.
getBillStatus
();
if
(
this
.
inputTask
.
getId
()
!=
null
)
{
for
(
LogType
l
:
LogType
.
values
())
{
if
(
l
.
oldStatus
.
equals
(
oldStatus
)
&&
l
.
newStatus
.
equals
(
newStatus
))
{
if
(
l
.
oldStatus
.
equals
(
oldStatus
)
&&
l
.
newStatus
.
equals
(
newStatus
)
&&
l
.
businessType
.
equals
(
outPutTask
.
getBusinessType
())
)
{
this
.
opreation
=
l
.
getOperation
();
break
;
}
...
...
@@ -170,7 +170,7 @@ public class LogAspect {
}
else
{
this
.
oldStatus
=
0
;
for
(
LogType
l
:
LogType
.
values
())
{
if
(
l
.
oldStatus
==
0
&&
l
.
newStatus
.
equals
(
newStatus
))
{
if
(
l
.
oldStatus
==
0
&&
l
.
newStatus
.
equals
(
newStatus
)
&&
l
.
businessType
.
equals
(
outPutTask
.
getBusinessType
())
)
{
this
.
opreation
=
l
.
getOperation
();
break
;
}
...
...
@@ -184,7 +184,7 @@ public class LogAspect {
opreation
=
this
.
replaceParam
(
opreation
);
}
if
(
this
.
opreation
==
null
)
{
log
.
warn
(
"[业务操作日志]存储失败:找不到旧状态为"
+
this
.
oldStatus
+
",新状态为"
+
this
.
newStatus
+
"的日志模板"
);
log
.
warn
(
"[业务操作日志]存储失败:找不到
业务类型为+"
+
outPutTask
.
getBusinessType
()+
",
旧状态为"
+
this
.
oldStatus
+
",新状态为"
+
this
.
newStatus
+
"的日志模板"
);
}
else
{
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
this
.
outPutTask
.
getId
(),
this
.
opreation
,
this
.
fileVos
);
taskLogService
.
addLog
(
taskLogBto
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论