Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
36e16fd5
提交
36e16fd5
authored
3月 03, 2022
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(3d模块): 修改库房的时候,3D要随着变动
修改库房的时候,3D要随着变动
上级
a369b33b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
125 行增加
和
26 行删除
+125
-26
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+27
-9
DeviceLibraryPositionDao.java
...v/device/library/repository/DeviceLibraryPositionDao.java
+13
-2
DeviceLibraryPositionService.java
.../device/library/service/DeviceLibraryPositionService.java
+4
-0
DeviceLibraryPositionServiceImpl.java
...ibrary/service/impl/DeviceLibraryPositionServiceImpl.java
+7
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+38
-15
UpdateXyzVo.java
...tykj/dev/device/library/subject/model/vo/UpdateXyzVo.java
+36
-0
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
36e16fd5
...
@@ -14,6 +14,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
...
@@ -14,6 +14,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibraryPosition;
import
com.tykj.dev.device.library.subject.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.model.vo.QueryNotOnVo
;
import
com.tykj.dev.device.library.subject.model.vo.QueryNotOnVo
;
import
com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo
;
import
com.tykj.dev.device.library.subject.model.vo.QueryTheWarehouseVo
;
import
com.tykj.dev.device.library.subject.model.vo.UpdateXyzVo
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.user.cache.StoreCache
;
import
com.tykj.dev.device.user.cache.StoreCache
;
import
com.tykj.dev.device.user.cache.UnitsCache
;
import
com.tykj.dev.device.user.cache.UnitsCache
;
...
@@ -23,10 +24,7 @@ import com.tykj.dev.device.user.subject.service.UnitsService;
...
@@ -23,10 +24,7 @@ import com.tykj.dev.device.user.subject.service.UnitsService;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
//import com.tykj.dev.misc.base.DeviceLifeStatus;
//import com.tykj.dev.misc.base.DeviceLifeStatus;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.DeviceModelSort
;
import
com.tykj.dev.misc.utils.*
;
import
com.tykj.dev.misc.utils.GetTreeUtils
;
import
com.tykj.dev.misc.utils.PageUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Synchronized
;
import
lombok.Synchronized
;
...
@@ -96,8 +94,8 @@ public class DeviceLibraryController {
...
@@ -96,8 +94,8 @@ public class DeviceLibraryController {
@Resource
@Resource
private
StoreCache
storeCache
;
private
StoreCache
storeCache
;
//
@Resource
@Resource
//
private DeviceLibraryPositionService deviceLibraryPositionService;
private
DeviceLibraryPositionService
deviceLibraryPositionService
;
@ApiOperation
(
value
=
"修改装备备注"
,
notes
=
"修改装备备注"
)
@ApiOperation
(
value
=
"修改装备备注"
,
notes
=
"修改装备备注"
)
@PostMapping
(
"/setRecord"
)
@PostMapping
(
"/setRecord"
)
...
@@ -820,9 +818,29 @@ public class DeviceLibraryController {
...
@@ -820,9 +818,29 @@ public class DeviceLibraryController {
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLibraryEntity
.
setStorageLocation
(
libraryUpdateVo
.
getStorageLocation
());
deviceLibraryEntity
.
setStorageLocation
(
libraryUpdateVo
.
getStorageLocation
());
deviceLibraryEntity
.
setStorageLocationId
(
libraryUpdateVo
.
getStorageLocationId
());
deviceLibraryEntity
.
setStorageLocationId
(
libraryUpdateVo
.
getStorageLocationId
());
//从而修改3D的库房位置
//如果库房位置发生改变需要对3D中的位置信息重置
// deviceLibraryPositionService.onlyUpdateStorageLocation(libraryUpdateVo.getStorageLocationId(),
Integer
deviceId
=
deviceEditVo
.
getDeviceId
();
// libraryUpdateVo.getStorageLocation(), libraryUpdateVo.getDeviceId());
DeviceLibraryPosition
position
=
deviceLibraryPositionService
.
findByDeviceId
(
deviceId
);
position
.
setDeviceId
(
deviceId
);
position
.
setIfCabinet
(
0
);
position
.
setCabinetPosition
(
null
);
position
.
setUNum
(
null
);
position
.
setDeviceLibraryPositionName
(
null
);
RotationVo
rotationVo
=
JacksonUtil
.
readValue
(
position
.
getRotation
(),
RotationVo
.
class
);
assert
rotationVo
!=
null
;
rotationVo
.
setX
(
null
);
rotationVo
.
setY
(
null
);
rotationVo
.
setZ
(
null
);
DeviceLibraryPositionMessageVo
messageVo
=
JacksonUtil
.
readValue
(
position
.
getDeviceLibraryPositionMessage
(),
DeviceLibraryPositionMessageVo
.
class
);
assert
messageVo
!=
null
;
messageVo
.
setX
(
null
);
messageVo
.
setY
(
null
);
messageVo
.
setZ
(
null
);
position
.
setDeviceLibraryPositionMessage
(
messageVo
.
toJson
());
position
.
setRotation
(
messageVo
.
toJson
());
deviceLibraryPositionService
.
updateXyz
(
position
);
}
}
//add 备注
//add 备注
if
(
libraryUpdateVo
.
getRecord
()!=
null
&&
!
libraryUpdateVo
.
getRecord
().
equals
(
deviceLibraryEntity
.
getRecord
())){
if
(
libraryUpdateVo
.
getRecord
()!=
null
&&
!
libraryUpdateVo
.
getRecord
().
equals
(
deviceLibraryEntity
.
getRecord
())){
...
...
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryPositionDao.java
浏览文件 @
36e16fd5
...
@@ -22,7 +22,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
...
@@ -22,7 +22,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
void
deleteByDeviceId
(
Integer
deviceId
);
void
deleteByDeviceId
(
Integer
deviceId
);
@Transactional
@Transactional
(
rollbackOn
=
Exception
.
class
)
@Modifying
@Modifying
@Query
(
"update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, "
+
@Query
(
"update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, "
+
"d.uNum = :uNum where d.deviceId = :deviceId"
)
"d.uNum = :uNum where d.deviceId = :deviceId"
)
...
@@ -30,7 +30,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
...
@@ -30,7 +30,7 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
@Param
(
"uNum"
)
String
uNum
,
@Param
(
"uNum"
)
String
uNum
,
@Param
(
"deviceId"
)
Integer
deviceId
);
@Param
(
"deviceId"
)
Integer
deviceId
);
@Transactional
@Transactional
(
rollbackOn
=
Exception
.
class
)
@Modifying
@Modifying
@Query
(
"update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, "
+
@Query
(
"update DeviceLibraryPosition d set d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage, "
+
"d.rotation = :rotation,d.uNum = :uNum ,d.cabinetPosition = null ,d.ifCabinet =0 where d.deviceId in :deviceIds"
)
"d.rotation = :rotation,d.uNum = :uNum ,d.cabinetPosition = null ,d.ifCabinet =0 where d.deviceId in :deviceIds"
)
...
@@ -39,5 +39,16 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
...
@@ -39,5 +39,16 @@ public interface DeviceLibraryPositionDao extends JpaRepository<DeviceLibraryPos
@Param
(
"uNum"
)
String
uNum
,
@Param
(
"uNum"
)
String
uNum
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
// @Transactional(rollbackOn = Exception.class)
// @Modifying
// @Query("update DeviceLibraryPosition d set d.ifCabinet = :ifCabinet,d.cabinetPosition = :cabinetPosition " +
// ",d.deviceLibraryPositionMessage = :deviceLibraryPositionMessage ,d.rotation = :rotation where d.deviceId = :deviceId")
// int updateXyz(@Param("ifCabinet") Integer ifCabinet,
// @Param("cabinetPosition") Integer cabinetPosition,
// @Param("deviceLibraryPositionMessage") String deviceLibraryPositionMessage,
// @Param("rotation") String rotation,
// @Param("deviceId")Integer deviceId);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryPositionService.java
浏览文件 @
36e16fd5
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.library.service;
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.library.service;
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
com.tykj.dev.device.library.subject.model.vo.UpdateXyzVo
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -72,4 +73,7 @@ public interface DeviceLibraryPositionService {
...
@@ -72,4 +73,7 @@ public interface DeviceLibraryPositionService {
List
<
DeviceLibraryPosition
>
findAll
();
List
<
DeviceLibraryPosition
>
findAll
();
void
updateXyz
(
DeviceLibraryPosition
deviceLibraryPosition
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryPositionServiceImpl.java
浏览文件 @
36e16fd5
...
@@ -6,6 +6,7 @@ import com.tykj.dev.device.library.repository.DeviceLibraryPositionDao;
...
@@ -6,6 +6,7 @@ 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
com.tykj.dev.device.library.subject.model.vo.UpdateXyzVo
;
import
lombok.extern.slf4j.Slf4j
;
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
;
...
@@ -101,4 +102,10 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
...
@@ -101,4 +102,10 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
return
deviceLibraryPositionList
;
return
deviceLibraryPositionList
;
}
}
@Override
public
void
updateXyz
(
DeviceLibraryPosition
deviceLibraryPosition
)
{
deviceLibraryPositionDao
.
save
(
deviceLibraryPosition
);
}
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
36e16fd5
...
@@ -52,6 +52,7 @@ import java.lang.reflect.Field;
...
@@ -52,6 +52,7 @@ import java.lang.reflect.Field;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.Executor
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -1192,14 +1193,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1192,14 +1193,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if
(!
CollectionUtils
.
isEmpty
(
deviceIds
)){
if
(!
CollectionUtils
.
isEmpty
(
deviceIds
)){
//添加装备日志
//添加装备日志
deviceIds
.
forEach
(
integer
->
{
deviceIds
.
forEach
(
integer
->
{
// if (updateStorageLocationVo.getStorageLocationId() != (getOne(integer).getStorageLocationId())){
// DeviceLogDto deviceLogDto= new DeviceLogDto(integer,"将存放位置修改为"+
// updateStorageLocationVo.getStorageLocation(),null,userId);
// deviceLogDtos.add(deviceLogDto);
// }});
Integer
storageLocationId
=
updateStorageLocationVo
.
getStorageLocationId
();
Integer
storageLocationId
=
updateStorageLocationVo
.
getStorageLocationId
();
//数据库中的库房id
Integer
dataStorageLocationId
=
getOne
(
integer
).
getStorageLocationId
();
Integer
dataStorageLocationId
=
getOne
(
integer
).
getStorageLocationId
();
if
(
storageLocationId
==
null
?
dataStorageLocationId
==
null
:
storageLocationId
.
equals
(
dataStorageLocationId
)){
if
(
!
storageLocationId
.
equals
(
dataStorageLocationId
)){
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"将存放位置修改为"
+
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"将存放位置修改为"
+
updateStorageLocationVo
.
getStorageLocation
(),
null
,
userId
);
updateStorageLocationVo
.
getStorageLocation
(),
null
,
userId
);
deviceLogDtos
.
add
(
deviceLogDto
);
deviceLogDtos
.
add
(
deviceLogDto
);
...
@@ -1211,15 +1208,41 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1211,15 +1208,41 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceLibraryDao
.
updateStorageLocation
(
updateStorageLocationVo
.
getStorageLocation
(),
deviceLibraryDao
.
updateStorageLocation
(
updateStorageLocationVo
.
getStorageLocation
(),
updateStorageLocationVo
.
getStorageLocationId
(),
updateStorageLocationVo
.
getDeviceIds
());
updateStorageLocationVo
.
getStorageLocationId
(),
updateStorageLocationVo
.
getDeviceIds
());
//修改3d的部分字段
//修改3d的部分字段
DeviceLibraryPositionMessageVo
deviceLibraryPositionMessageVo
=
new
DeviceLibraryPositionMessageVo
();
// DeviceLibraryPositionMessageVo deviceLibraryPositionMessageVo = new DeviceLibraryPositionMessageVo();
UpdatePostionMessageVO
updatePostionMessageVO
=
new
UpdatePostionMessageVO
();
// UpdatePostionMessageVO updatePostionMessageVO = new UpdatePostionMessageVO();
updatePostionMessageVO
.
setDeviceLibraryPositionMessageVo
(
deviceLibraryPositionMessageVo
);
// updatePostionMessageVO.setDeviceLibraryPositionMessageVo(deviceLibraryPositionMessageVo);
RotationVo
rotationVo
=
new
RotationVo
();
// RotationVo rotationVo = new RotationVo();
updatePostionMessageVO
.
setRotationVo
(
rotationVo
);
// updatePostionMessageVO.setRotationVo(rotationVo);
updatePostionMessageVO
.
setDeviceIds
(
updateStorageLocationVo
.
getDeviceIds
());
// updatePostionMessageVO.setDeviceIds(updateStorageLocationVo.getDeviceIds());
updatePostionMessageVO
.
setUNum
(
null
);
// updatePostionMessageVO.setUNum(null);
//
deviceLibraryPositionService
.
fnUpdatePostionMessageList
(
updatePostionMessageVO
);
// deviceLibraryPositionService.fnUpdatePostionMessageList(updatePostionMessageVO);
CompletableFuture
.
runAsync
(()->{
deviceIds
.
forEach
(
deviceId
->{
DeviceLibraryPosition
position
=
deviceLibraryPositionService
.
findByDeviceId
(
deviceId
);
position
.
setDeviceId
(
deviceId
);
position
.
setIfCabinet
(
0
);
position
.
setCabinetPosition
(
null
);
position
.
setUNum
(
null
);
position
.
setDeviceLibraryPositionName
(
null
);
RotationVo
rotationVo
=
JacksonUtil
.
readValue
(
position
.
getRotation
(),
RotationVo
.
class
);
assert
rotationVo
!=
null
;
rotationVo
.
setX
(
null
);
rotationVo
.
setY
(
null
);
rotationVo
.
setZ
(
null
);
DeviceLibraryPositionMessageVo
messageVo
=
JacksonUtil
.
readValue
(
position
.
getDeviceLibraryPositionMessage
(),
DeviceLibraryPositionMessageVo
.
class
);
assert
messageVo
!=
null
;
messageVo
.
setX
(
null
);
messageVo
.
setY
(
null
);
messageVo
.
setZ
(
null
);
position
.
setDeviceLibraryPositionMessage
(
messageVo
.
toJson
());
position
.
setRotation
(
messageVo
.
toJson
());
deviceLibraryPositionService
.
updateXyz
(
position
);
});
});
CompletableFuture
.
runAsync
(()->{
CompletableFuture
.
runAsync
(()->{
deviceLogService
.
addAllLog
(
deviceLogDtos
);
deviceLogService
.
addAllLog
(
deviceLogDtos
);
});
});
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/model/vo/UpdateXyzVo.java
0 → 100644
浏览文件 @
36e16fd5
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
model
.
vo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibraryPositionMessageVo
;
import
com.tykj.dev.device.library.subject.vo.RotationVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
/**
* @author zsp
* @create 2021/12/30 13:05
*/
@Data
@ApiModel
(
"修改3D位置vo"
)
@AllArgsConstructor
public
class
UpdateXyzVo
{
@ApiModelProperty
(
value
=
"是否在机柜中 "
,
notes
=
"0 不在 1 在"
)
private
Integer
ifCabinet
=
0
;
@ApiModelProperty
(
value
=
"在几号机柜里"
,
notes
=
"1"
)
private
Integer
cabinetPosition
;
@ApiModelProperty
(
value
=
"位置信息"
,
notes
=
"{x, y, z}"
)
private
RotationVo
rotationVo
;
@ApiModelProperty
(
value
=
"位置信息vo"
,
notes
=
"{x, y, z}"
)
private
DeviceLibraryPositionMessageVo
deviceLibraryPositionMessageVo
;
@ApiModelProperty
(
value
=
"装备id"
)
private
Integer
deviceId
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论