Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
c2559c82
提交
c2559c82
authored
1月 24, 2022
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(装备模块,3d模块): 新增查询全部3D的接口。以及日志打印时间
新增查询全部3D的接口。以及日志打印时间
上级
09ac5319
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
32 行增加
和
3 行删除
+32
-3
DeviceLibraryPositionService.java
.../device/library/service/DeviceLibraryPositionService.java
+3
-0
DeviceLibraryPositionServiceImpl.java
...ibrary/service/impl/DeviceLibraryPositionServiceImpl.java
+16
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+13
-3
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryPositionService.java
浏览文件 @
c2559c82
...
@@ -4,6 +4,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
...
@@ -4,6 +4,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import
com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO
;
import
com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author zsp
* @author zsp
...
@@ -69,4 +70,6 @@ public interface DeviceLibraryPositionService {
...
@@ -69,4 +70,6 @@ public interface DeviceLibraryPositionService {
void
fnUpdatePostionMessageList
(
UpdatePostionMessageVO
updatePostionMessageVO
);
void
fnUpdatePostionMessageList
(
UpdatePostionMessageVO
updatePostionMessageVO
);
List
<
DeviceLibraryPosition
>
findAll
();
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryPositionServiceImpl.java
浏览文件 @
c2559c82
package
com
.
tykj
.
dev
.
device
.
library
.
service
.
impl
;
package
com
.
tykj
.
dev
.
device
.
library
.
service
.
impl
;
import
com.tykj.dev.config.Log
;
import
com.tykj.dev.device.library.repository.DeviceLibraryPositionDao
;
import
com.tykj.dev.device.library.repository.DeviceLibraryPositionDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryPositionService
;
import
com.tykj.dev.device.library.service.DeviceLibraryPositionService
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition
;
import
com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO
;
import
com.tykj.dev.device.library.subject.model.vo.UpdatePostionMessageVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StopWatch
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -16,6 +21,7 @@ import java.util.stream.Collectors;
...
@@ -16,6 +21,7 @@ import java.util.stream.Collectors;
* @create 2021/12/13 16:23
* @create 2021/12/13 16:23
*/
*/
@Service
@Service
@Slf4j
public
class
DeviceLibraryPositionServiceImpl
implements
DeviceLibraryPositionService
{
public
class
DeviceLibraryPositionServiceImpl
implements
DeviceLibraryPositionService
{
@Autowired
@Autowired
...
@@ -85,4 +91,14 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
...
@@ -85,4 +91,14 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
deviceLibraryPositionDao
.
fnUpdatePostionMessageList
(
json
,
json1
,
updatePostionMessageVO
.
getUNum
(),
deviceIds
);
deviceLibraryPositionDao
.
fnUpdatePostionMessageList
(
json
,
json1
,
updatePostionMessageVO
.
getUNum
(),
deviceIds
);
}
}
@Override
public
List
<
DeviceLibraryPosition
>
findAll
()
{
StopWatch
stopWatch
=
new
StopWatch
(
"查询3D库的时间"
);
stopWatch
.
start
();
List
<
DeviceLibraryPosition
>
deviceLibraryPositionList
=
deviceLibraryPositionDao
.
findAll
();
stopWatch
.
stop
();
log
.
info
(
"查询3D库的时间:{}"
,
stopWatch
.
getTotalTimeMillis
()+
"ms"
);
return
deviceLibraryPositionList
;
}
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
c2559c82
...
@@ -1327,10 +1327,16 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1327,10 +1327,16 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
stopWatch1
.
start
();
stopWatch1
.
start
();
StopWatch
stopWatch2
=
new
StopWatch
(
"转换map"
);
StopWatch
stopWatch2
=
new
StopWatch
(
"转换map"
);
stopWatch2
.
start
();
stopWatch2
.
start
();
Map
<
Integer
,
DeviceLibraryPosition
>
positionMap
=
// Map<Integer, DeviceLibraryPosition> positionMap =
deviceLibraryPositionService
.
findByDeviceIds
(
deviceIds
).
stream
()
// deviceLibraryPositionService.findByDeviceIds(deviceIds).stream()
.
collect
(
toMap
(
DeviceLibraryPosition:
:
getDeviceId
,
Function
.
identity
()));
// .collect(toMap(DeviceLibraryPosition::getDeviceId, Function.identity()));
List
<
DeviceLibraryPosition
>
deviceLibraryPositionList
=
deviceLibraryPositionService
.
findAll
();
deviceLibraryPositionList
=
deviceLibraryPositionList
.
stream
().
filter
(
deviceLibraryPosition
->
deviceIds
.
contains
(
deviceLibraryPosition
.
getDeviceId
()))
.
collect
(
Collectors
.
toList
());
stopWatch2
.
stop
();
stopWatch2
.
stop
();
Map
<
Integer
,
DeviceLibraryPosition
>
positionMap
=
deviceLibraryPositionList
.
stream
().
collect
(
toMap
(
DeviceLibraryPosition:
:
getDeviceId
,
Function
.
identity
()));
log
.
info
(
"转换map的时间:{}"
,
stopWatch2
.
getTotalTimeMillis
()+
"ms"
);
log
.
info
(
"转换map的时间:{}"
,
stopWatch2
.
getTotalTimeMillis
()+
"ms"
);
StopWatch
stopWatch3
=
new
StopWatch
(
"转换json"
);
StopWatch
stopWatch3
=
new
StopWatch
(
"转换json"
);
stopWatch3
.
start
();
stopWatch3
.
start
();
...
@@ -1380,6 +1386,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1380,6 +1386,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if
(
queryTheWarehouseVo
.
getStorageLocationId
()
!=
null
){
if
(
queryTheWarehouseVo
.
getStorageLocationId
()
!=
null
){
map
.
put
(
"pageAllVo"
,
pageAllVo
);
map
.
put
(
"pageAllVo"
,
pageAllVo
);
}
}
StopWatch
stopWatch4
=
new
StopWatch
(
"返回结果集map"
);
stopWatch4
.
start
();
List
<
DeviceLibrary
>
collect
=
pageAllVo
.
stream
().
map
(
AllVO:
:
getDeviceLibrary
).
collect
(
Collectors
.
toList
());
List
<
DeviceLibrary
>
collect
=
pageAllVo
.
stream
().
map
(
AllVO:
:
getDeviceLibrary
).
collect
(
Collectors
.
toList
());
List
<
String
>
models
=
List
<
String
>
models
=
collect
.
stream
().
map
(
DeviceLibrary:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
());
collect
.
stream
().
map
(
DeviceLibrary:
:
getModel
).
distinct
().
collect
(
Collectors
.
toList
());
...
@@ -1397,6 +1405,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1397,6 +1405,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
map
.
put
(
"ownUnits"
,
ownUnits
);
map
.
put
(
"ownUnits"
,
ownUnits
);
map
.
put
(
"storageLocation"
,
storageLocationIds
.
stream
().
map
(
integer
->
new
StorageLocationVo
(
integer
,
idMap
.
getOrDefault
(
integer
,
null
)))
map
.
put
(
"storageLocation"
,
storageLocationIds
.
stream
().
map
(
integer
->
new
StorageLocationVo
(
integer
,
idMap
.
getOrDefault
(
integer
,
null
)))
.
collect
(
Collectors
.
toList
()));
.
collect
(
Collectors
.
toList
()));
stopWatch4
.
stop
();
log
.
info
(
"返回结果集map时间:{}"
,
stopWatch4
.
getTotalTimeMillis
()+
"ms"
);
return
map
;
return
map
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论