Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
c95250e2
提交
c95250e2
authored
9月 03, 2021
作者:
133
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git.yfzx.zjtys.com.cn:matrix/device-back into dev
上级
f79dca3b
24f8bc90
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
50 行增加
和
11 行删除
+50
-11
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+1
-1
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+0
-1
pom.xml
dev-packing/pom.xml
+5
-0
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+33
-7
PackingSortService.java
.../com/tykj/dev/device/packing/task/PackingSortService.java
+1
-1
RepairDetailDao.java
...om/tykj/dev/device/repair/repository/RepairDetailDao.java
+7
-0
TaskLogServiceImpl.java
...tykj/dev/device/task/service/impl/TaskLogServiceImpl.java
+3
-1
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
c95250e2
...
...
@@ -165,7 +165,7 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Modifying
@Query
(
"update DeviceLibrary d set d.model = :newModel where d.
id in(select d.id from d where d.model = :oldModel)
"
)
@Query
(
"update DeviceLibrary d set d.model = :newModel where d.
model = :oldModel
"
)
int
batchUpdateDevices
(
String
oldModel
,
String
newModel
);
List
<
DeviceLibrary
>
findAllByModel
(
String
model
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
c95250e2
...
...
@@ -673,7 +673,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return
deviceLibraryDao
.
findAllByModel
(
model
);
}
@Override
public
void
isNotLoss
(
List
<
Integer
>
ids
)
{
ids
.
forEach
(
integer
->
{
...
...
dev-packing/pom.xml
浏览文件 @
c95250e2
...
...
@@ -41,6 +41,10 @@
<groupId>
com.tykj.dev
</groupId>
<artifactId>
blockcha
</artifactId>
</dependency>
<dependency>
<groupId>
com.tykj
</groupId>
<artifactId>
dev-repair
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
c95250e2
...
...
@@ -5,7 +5,10 @@ import com.tykj.dev.config.swagger.AutoDocument;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLogUserVo
;
import
com.tykj.dev.device.packing.repository.PackingLibraryDao
;
...
...
@@ -15,6 +18,8 @@ import com.tykj.dev.device.packing.service.PackingLogService;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.packing.subject.domin.PackingLog
;
import
com.tykj.dev.device.packing.subject.vo.*
;
import
com.tykj.dev.device.repair.repository.RepairDetailDao
;
import
com.tykj.dev.device.repair.subject.domin.RepairDetail
;
import
com.tykj.dev.device.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.user.read.service.MessageService
;
...
...
@@ -92,6 +97,11 @@ public class PackingController {
@Autowired
DeviceLibraryDao
deviceLibraryDao
;
@Autowired
private
RepairDetailDao
repairDetailDao
;
@Autowired
private
DeviceLogService
deviceLogService
;
@Autowired
@Qualifier
(
"taskExecutor"
)
Executor
executor
;
...
...
@@ -517,6 +527,7 @@ public class PackingController {
@PostMapping
(
"/update/model"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
updateModel
(
@RequestBody
PackingModelEdit
packingModelEdit
){
Integer
userId
=
userUtils
.
getCurrentUserId
();
PackingLibrary
packingLibrary
=
packingLibraryService
.
getOne
(
packingModelEdit
.
getPackingId
());
if
(!
packingLibrary
.
getModel
().
equals
(
packingModelEdit
.
getModel
())
&&
packingLibraryService
.
modelIsExist
(
packingModelEdit
.
getModel
()))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -528,24 +539,39 @@ public class PackingController {
if
(
packingLibrary
.
getIsRoot
()
==
1
)
{
if
(
packingModelEdit
.
getModel
()
!=
null
&&
!
packingModelEdit
.
getModel
().
equals
(
packingLibrary
.
getModel
()))
{
//判断该列装下有没有入库装备 有装备则进行装备的型号的修改
//通过型号查询装备
// long l = System.currentTimeMillis();
// List<DeviceLibrary> storagePackingDevices = deviceLibraryService.findAllByModel(packingLibrary.getModel());
// log.info("findAllByModel时间:{}", System.currentTimeMillis() - l);
// if (storagePackingDevices.size() > 0) {
//取出所有的装备id
// List<Integer> ids = storagePackingDevices.stream().map(DeviceLibrary::getId).collect(Collectors.toList());
//更新装备
long
l2
=
System
.
currentTimeMillis
();
List
<
DeviceLibrary
>
storagePackingDevices
=
deviceLibraryService
.
findAllByModel
(
packingLibrary
.
getModel
());
if
(
storagePackingDevices
.
size
()>
0
){
deviceLibraryService
.
batchUpdateDevices
(
packingLibrary
.
getModel
(),
packingModelEdit
.
getModel
());
//添加装备日志
String
remark
=
"将原型号"
+
packingLibrary
.
getModel
()+
"修改型号为"
+
packingModelEdit
.
getModel
();
List
<
Integer
>
deviceIds
=
storagePackingDevices
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
DeviceLog
>
logDtos
=
new
ArrayList
<>();
deviceIds
.
forEach
(
integer
->
{
logDtos
.
add
(
new
DeviceLogDto
(
integer
,
remark
,
null
,
userId
,
null
).
toDo
());
});
executor
.
execute
(()->{
long
start
=
System
.
currentTimeMillis
();
deviceLogService
.
saveAllLog
(
logDtos
);
log
.
info
(
"saveAllLog时间:{}"
,
System
.
currentTimeMillis
()
-
start
);
});
List
<
RepairDetail
>
allByModel
=
repairDetailDao
.
findAllByModel
(
packingLibrary
.
getModel
());
List
<
Integer
>
ids
=
allByModel
.
stream
().
map
(
RepairDetail:
:
getDeviceId
).
collect
(
Collectors
.
toList
());
if
(
ids
.
size
()>
0
){
repairDetailDao
.
updateModel
(
packingModelEdit
.
getModel
(),
ids
);
}
}
log
.
info
(
"batchUpdateDevices时间:{}"
,
System
.
currentTimeMillis
()
-
l2
);
// }
packingLibrary
.
setModel
(
packingModelEdit
.
getModel
());
packingLibrary
.
setName
(
packingModelEdit
.
getModel
());
packingLibraryService
.
changeAllModel
(
packingLibrary
.
getId
(),
packingModelEdit
.
getModel
());
//添加列装日志
PackingLog
packingLog
=
new
PackingLog
();
packingLog
.
setRemark
(
"将原型号"
+
packingLibrary
.
getModel
()+
"修改型号为"
+
packingModelEdit
.
getModel
());
packingLog
.
setPackingId
(
packingLibrary
.
getId
());
packingLogService
.
add
(
packingLog
);
}
BeanUtils
.
copyProperties
(
packingModelEdit
,
packingLibrary
);
packingLibraryService
.
update
(
packingLibrary
);
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/task/PackingSortService.java
浏览文件 @
c95250e2
...
...
@@ -16,11 +16,11 @@ import org.springframework.stereotype.Service;
public
class
PackingSortService
implements
CommandLineRunner
{
@Autowired
private
PackingLibraryService
packingLibraryService
;
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
//取到所有的列装model的顺序 放进缓存中 也就是DeviceModelSort.mapModelSort
packingLibraryService
.
getSortMap
();
log
.
info
(
"初始化更新型号和排序号的对应map"
);
}
}
dev-repair/src/main/java/com/tykj/dev/device/repair/repository/RepairDetailDao.java
浏览文件 @
c95250e2
...
...
@@ -37,4 +37,11 @@ public interface RepairDetailDao extends JpaRepository<RepairDetail, Integer>, J
void
updateRecord3
(
String
record
,
Integer
id
);
List
<
RepairDetail
>
findAllByIdIn
(
List
<
Integer
>
ids
);
@Transactional
@Modifying
@Query
(
"update RepairDetail r set r.model = :model where r.deviceId in :ids"
)
void
updateModel
(
String
model
,
List
<
Integer
>
ids
);
List
<
RepairDetail
>
findAllByModel
(
String
model
);
}
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskLogServiceImpl.java
浏览文件 @
c95250e2
...
...
@@ -96,7 +96,9 @@ public class TaskLogServiceImpl implements TaskLogService {
*/
@Override
public
List
<
TaskLogUserVo
>
getAllByTime
(
TaskLogSelectVo
taskLogSelectVo
)
{
List
<
TaskLogUserVo
>
taskLogUserVos
=
taskLogDao
.
findAll
().
stream
().
map
(
TaskLog:
:
parse2bto
).
map
(
TaskLogBto:
:
toVo
).
collect
(
Collectors
.
toList
());
//过滤掉培训
List
<
TaskLogUserVo
>
taskLogUserVos
=
taskLogDao
.
findAll
().
stream
().
filter
(
taskLog
->
taskLog
.
getCreateUserId
()!=
null
).
map
(
TaskLog:
:
parse2bto
).
map
(
TaskLogBto:
:
toVo
).
collect
(
Collectors
.
toList
());
if
(
taskLogSelectVo
!=
null
&&
taskLogSelectVo
.
getStartTime
()!=
null
&&
taskLogSelectVo
.
getEndTime
()!=
null
){
return
taskLogUserVos
.
stream
()
.
filter
(
taskLogUserVo
->
taskLogUserVo
.
getCreateTime
().
after
(
taskLogSelectVo
.
getStartTime
())&&
taskLogUserVo
.
getCreateTime
().
before
(
taskLogSelectVo
.
getEndTime
()))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论