Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
9641bece
提交
9641bece
authored
10月 26, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备管理模块,列装模块): 新增装备修改序列号和父id的接口,优化了解绑速度
新增装备修改序列号和父id的接口,优化了解绑速度
上级
c163be52
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
98 行增加
和
23 行删除
+98
-23
ConfigCache.java
.../src/main/java/com/tykj/dev/config/cache/ConfigCache.java
+2
-0
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+14
-0
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+5
-5
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+18
-6
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+21
-4
DeviceForApplyVo.java
.../tykj/dev/device/library/subject/vo/DeviceForApplyVo.java
+28
-0
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+1
-4
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+9
-4
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/cache/ConfigCache.java
浏览文件 @
9641bece
...
@@ -2,12 +2,14 @@ package com.tykj.dev.config.cache;
...
@@ -2,12 +2,14 @@ package com.tykj.dev.config.cache;
import
com.tykj.dev.config.domin.SystemConfig
;
import
com.tykj.dev.config.domin.SystemConfig
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Data
@Data
@Component
public
class
ConfigCache
{
public
class
ConfigCache
{
private
Map
<
Integer
,
String
>
lifeStatusMap
;
private
Map
<
Integer
,
String
>
lifeStatusMap
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
9641bece
...
@@ -945,6 +945,13 @@ public class DeviceLibraryController {
...
@@ -945,6 +945,13 @@ public class DeviceLibraryController {
return
ResponseEntity
.
ok
(
map
);
return
ResponseEntity
.
ok
(
map
);
}
}
@ApiOperation
(
"入库修改试用装备的序列号"
)
@PostMapping
(
"updateSeq"
)
public
ResponseEntity
updateSeq
(
@RequestBody
DeviceForApplyVo
deviceForApplyVo
){
deviceLibraryService
.
updateSeqNumber
(
deviceForApplyVo
);
return
ResponseEntity
.
ok
(
"更新成功"
);
}
@ApiOperation
(
value
=
"根据装备id查询装备详情"
,
notes
=
"根据装备id查询装备详情"
)
@ApiOperation
(
value
=
"根据装备id查询装备详情"
,
notes
=
"根据装备id查询装备详情"
)
@PostMapping
(
"/selectByIds1"
)
@PostMapping
(
"/selectByIds1"
)
public
List
<
DeviceNewVo
>
selectByIds1
(
@RequestBody
DeviceSelectIdsVo
deviceSelectIdsVo
){
public
List
<
DeviceNewVo
>
selectByIds1
(
@RequestBody
DeviceSelectIdsVo
deviceSelectIdsVo
){
...
@@ -1100,6 +1107,13 @@ public class DeviceLibraryController {
...
@@ -1100,6 +1107,13 @@ public class DeviceLibraryController {
return
setOrderNumber
(
sortNum
,
allListAndParent
);
return
setOrderNumber
(
sortNum
,
allListAndParent
);
}
}
@ApiOperation
(
"测试婴喜爱"
)
@PostMapping
(
"test"
)
public
ResponseEntity
test
(
@RequestBody
List
<
Integer
>
deviceIds
){
deviceLibraryService
.
updatePartParentId
(
deviceIds
);
return
ResponseEntity
.
ok
(
"更新成功"
);
}
public
List
<
DeviceLibrary
>
getAllListAndParent
(){
public
List
<
DeviceLibrary
>
getAllListAndParent
(){
DeviceLibrarySelectVo
deviceLibrarySelectVo
=
new
DeviceLibrarySelectVo
();
DeviceLibrarySelectVo
deviceLibrarySelectVo
=
new
DeviceLibrarySelectVo
();
List
<
DeviceLibrary
>
deviceLibraryServiceAllList
=
deviceLibraryService
.
getAllList
(
deviceLibrarySelectVo
);
List
<
DeviceLibrary
>
deviceLibraryServiceAllList
=
deviceLibraryService
.
getAllList
(
deviceLibrarySelectVo
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
9641bece
...
@@ -217,10 +217,10 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
...
@@ -217,10 +217,10 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Param
(
"packingId"
)
Integer
packingId
,
@Param
(
"packingId"
)
Integer
packingId
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
//
@Transactional
@Transactional
//
@Modifying
@Modifying
//
@Query("update DeviceLibrary o set o.partParentId = null where o.id in :deviceIds")
@Query
(
"update DeviceLibrary o set o.partParentId = null where o.id in :deviceIds"
)
//
int updatePartParentId(
int
updatePartParentId
(
//
@Param("deviceIds") List<Integer> deviceIds);
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
9641bece
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.library.service;
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.library.service;
import
com.tykj.dev.config.UpdateCache
;
import
com.tykj.dev.config.UpdateCache
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.BindingDeviceVo
;
import
com.tykj.dev.device.library.subject.vo.BindingDeviceVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceForApplyVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceStatisticsVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceStatisticsVo
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
...
@@ -448,12 +449,12 @@ public interface DeviceLibraryService {
...
@@ -448,12 +449,12 @@ public interface DeviceLibraryService {
*/
*/
List
<
DeviceLibrary
>
findAllDevices
();
List
<
DeviceLibrary
>
findAllDevices
();
//
/**
/**
//
* 根据装备id的集合更新列装id
* 根据装备id的集合更新列装id
//
* @param deviceIds 装备id的集合
* @param deviceIds 装备id的集合
// * @return 影响行数
*/
// */
// int
updatePartParentId(List<Integer> deviceIds);
void
updatePartParentId
(
List
<
Integer
>
deviceIds
);
/**
/**
...
@@ -486,5 +487,16 @@ public interface DeviceLibraryService {
...
@@ -486,5 +487,16 @@ public interface DeviceLibraryService {
*/
*/
void
updateTry
(
List
<
DeviceLibrary
>
deviceLibraries
);
void
updateTry
(
List
<
DeviceLibrary
>
deviceLibraries
);
/**
* 获取所有装备的集合
* @param deviceLibrarySelectVo 查询装备的vo
* @return 所有装备
*/
List
<
DeviceLibrary
>
getAlldevList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
);
List
<
DeviceLibrary
>
getAlldevList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
);
/**
* 根据装备id更新装备
* @param deviceForApplyVo 更新试用装备序列号的vo
*/
void
updateSeqNumber
(
DeviceForApplyVo
deviceForApplyVo
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
9641bece
...
@@ -15,10 +15,7 @@ import com.tykj.dev.device.library.service.DeviceLibraryService;
...
@@ -15,10 +15,7 @@ import com.tykj.dev.device.library.service.DeviceLibraryService;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
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.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.BindingDeviceVo
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibraryCacheSelectVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.library.subject.vo.DeviceStatisticsVo
;
import
com.tykj.dev.device.library.utils.DeviceNumberUtils
;
import
com.tykj.dev.device.library.utils.DeviceNumberUtils
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
...
@@ -1003,6 +1000,12 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1003,6 +1000,12 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return
cacheLibraryService
.
getAllDeviceLibraryList
();
return
cacheLibraryService
.
getAllDeviceLibraryList
();
}
}
@Override
@UpdateCache
public
void
updatePartParentId
(
List
<
Integer
>
deviceIds
)
{
deviceLibraryDao
.
updatePartParentId
(
deviceIds
);
}
@Override
@Override
@UpdateCache
@UpdateCache
public
void
unboundDevice
(
List
<
DeviceLibrary
>
deviceLibraries
)
{
public
void
unboundDevice
(
List
<
DeviceLibrary
>
deviceLibraries
)
{
...
@@ -1085,6 +1088,20 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1085,6 +1088,20 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return
list
;
return
list
;
}
}
@Override
@UpdateCache
public
void
updateSeqNumber
(
DeviceForApplyVo
deviceForApplyVo
)
{
DeviceLibrary
library
=
getOne
(
deviceForApplyVo
.
getDeviceId
());
library
.
setSeqNumber
(
deviceForApplyVo
.
getSeqNumber
().
trim
());
//先判断序列号存不存在
DeviceLibrary
bySeqNumber
=
deviceLibraryDao
.
findBySeqNumber
(
deviceForApplyVo
.
getSeqNumber
().
trim
());
if
(
bySeqNumber
!=
null
){
throw
new
ApiException
(
"序列号已经存在,请更换序列号"
);
}
else
{
deviceLibraryDao
.
save
(
library
);
}
}
// @Override
// @Override
// @UpdateCache
// @UpdateCache
// public int updatePartParentId(List<Integer> deviceIds) {
// public int updatePartParentId(List<Integer> deviceIds) {
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceForApplyVo.java
0 → 100644
浏览文件 @
9641bece
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.stereotype.Repository
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* @author zsp
*/
@Repository
@Data
@ApiModel
(
"更新试用装备序列号的vo"
)
public
class
DeviceForApplyVo
{
@NotNull
(
message
=
"deviceId不能为空"
)
@Min
(
value
=
1
,
message
=
"deviceId不能小于1"
)
@ApiModelProperty
(
value
=
"装备id"
,
example
=
"1"
)
private
Integer
deviceId
;
@ApiModelProperty
(
value
=
"装备的序列号"
,
example
=
"12344"
)
private
String
seqNumber
;
}
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
9641bece
...
@@ -515,10 +515,7 @@ public class PackingController {
...
@@ -515,10 +515,7 @@ public class PackingController {
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryCacheService
.
getAllDeviceLibraryList
();
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryCacheService
.
getAllDeviceLibraryList
();
List
<
String
>
existSeqs
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
());
List
<
String
>
existSeqs
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
());
List
<
String
>
inputSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seq
);
List
<
String
>
inputSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seq
);
// if (inputSeqs.size()>0&&inputSeqs.size()!=num){
if
(
inputSeqs
.
size
()>
0
&&
inputSeqs
.
size
()!=
num
){
// return ResponseEntity.ok("序列号区间总数为"+inputSeqs.size()+",与装备数量不匹配");
// }
if
(
inputSeqs
.
size
()>
0
&&
inputSeqs
.
size
()>
num
){
return
ResponseEntity
.
ok
(
"序列号区间总数为"
+
inputSeqs
.
size
()+
",与装备数量不匹配"
);
return
ResponseEntity
.
ok
(
"序列号区间总数为"
+
inputSeqs
.
size
()+
",与装备数量不匹配"
);
}
}
else
{
else
{
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
9641bece
...
@@ -977,14 +977,19 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
...
@@ -977,14 +977,19 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
List
<
Integer
>
deviceIds
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
deviceIds
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
//将装备的父id全部置空
//将装备的父id全部置空
Integer
userId
=
userUtils
.
getCurrentUserId
();
Integer
userId
=
userUtils
.
getCurrentUserId
();
List
<
DeviceLogDto
>
deviceLogDtos
=
new
ArrayList
<>();
long
l
=
System
.
currentTimeMillis
();
deviceLibraryService
.
updatePartParentId
(
deviceIds
);
log
.
info
(
"更新父id时间为:{}"
,
System
.
currentTimeMillis
()-
l
);
deviceLibraries
.
forEach
(
deviceLibrary
->
{
deviceLibraries
.
forEach
(
deviceLibrary
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
();
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
();
deviceLibrary
.
setPartParentId
(
null
);
deviceLibraryService
.
update
(
deviceLibrary
);
deviceLogDto
.
setDeviceId
(
deviceLibrary
.
getId
());
deviceLogDto
.
setDeviceId
(
deviceLibrary
.
getId
());
deviceLogDto
.
setRemark
(
"由于列装进行了解绑,装备也
伴随着
解绑"
);
deviceLogDto
.
setRemark
(
"由于列装进行了解绑,装备也
需要进行
解绑"
);
deviceLogDto
.
setCreateUserId
(
userId
);
deviceLogDto
.
setCreateUserId
(
userId
);
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLogDtos
.
add
(
deviceLogDto
);
});
executor
.
execute
(()->{
deviceLogService
.
addAllLog
(
deviceLogDtos
);
});
});
//修改列装
//修改列装
packingLibrary
.
setPartParentId
(
null
);
packingLibrary
.
setPartParentId
(
null
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论