Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
0b70a385
提交
0b70a385
authored
10月 28, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备列装模块,装备管理模块,装备申请模块): 新增申请需求,新增数量接口
新增申请需求,新增数量接口
上级
ad153c2b
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
145 行增加
和
30 行删除
+145
-30
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+36
-2
DeviceApplyBillService.java
...tykj/dev/device/apply/service/DeviceApplyBillService.java
+2
-1
DeviceApplyBillServiceImpl.java
...device/apply/service/impl/DeviceApplyBillServiceImpl.java
+7
-9
ApplyRemoveSeqVo.java
...om/tykj/dev/device/apply/subject/vo/ApplyRemoveSeqVo.java
+27
-0
RemoveFromSeqListVo.java
...tykj/dev/device/apply/subject/vo/RemoveFromSeqListVo.java
+3
-1
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+2
-2
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+2
-2
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+41
-8
DeviceLibrary.java
.../tykj/dev/device/library/subject/domin/DeviceLibrary.java
+1
-2
DeviceForApplyVo.java
.../tykj/dev/device/library/subject/vo/DeviceForApplyVo.java
+3
-0
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+15
-2
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+6
-1
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
0b70a385
...
...
@@ -735,8 +735,42 @@ public class DeviceApplyController {
@PostMapping
(
"/removeSameSeq"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
removeSameSeq
(
@RequestBody
RemoveSameSeqVo
removeSameSeqVo
)
{
List
<
String
>
stringList
=
deviceApplyBillService
.
removeSameSeq
(
removeSameSeqVo
);
return
ResponseEntity
.
ok
(
stringList
);
ApplyRemoveSeqVo
applyRemoveSeqVo
=
deviceApplyBillService
.
removeSameSeq
(
removeSameSeqVo
);
return
ResponseEntity
.
ok
(
applyRemoveSeqVo
);
}
@ApiOperation
(
value
=
"返回区间数量"
,
notes
=
"返回区间数量"
)
@GetMapping
(
"/returnSeqCount/{seqList}"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
returnSeqCount
(
@PathVariable
(
"seqList"
)
String
seqList
)
{
String
[]
split
=
seqList
.
split
(
","
);
int
count
=
0
;
//判断里面有没有-
List
<
String
>
stringList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++)
{
if
(
split
[
i
].
contains
(
"-"
)){
stringList
.
add
(
split
[
i
]);
}
}
count
=
count
+
split
.
length
-
stringList
.
size
();
//计算集合的长度
List
<
Integer
>
list
=
new
ArrayList
<>();
if
(
stringList
.
size
()>
0
){
stringList
.
forEach
(
s
->
{
List
<
String
>
stringList1
=
DeviceSeqUtil
.
selectDeviceSeqs
(
s
);
int
size
=
stringList1
.
size
();
list
.
add
(
size
);
});
}
//集合中的元素想加
int
j
=
0
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
j
=
list
.
get
(
i
)+
j
;
}
count
=
count
+
j
;
return
ResponseEntity
.
ok
(
count
);
}
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/service/DeviceApplyBillService.java
浏览文件 @
0b70a385
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.apply.service;
import
com.tykj.dev.device.apply.subject.domin.DeviceApplyBill
;
import
com.tykj.dev.device.apply.subject.vo.ApplyRemoveSeqVo
;
import
com.tykj.dev.device.apply.subject.vo.ApplyTaskDeviceCheckVo
;
import
com.tykj.dev.device.apply.subject.vo.RemoveFromSeqListVo
;
import
com.tykj.dev.device.apply.subject.vo.RemoveSameSeqVo
;
...
...
@@ -39,6 +40,6 @@ public interface DeviceApplyBillService {
List
<
String
>
removeFromSeqList
(
RemoveFromSeqListVo
removeFromSeqListVo
);
List
<
String
>
removeSameSeq
(
RemoveSameSeqVo
removeSameSeqVo
);
ApplyRemoveSeqVo
removeSameSeq
(
RemoveSameSeqVo
removeSameSeqVo
);
}
dev-apply/src/main/java/com/tykj/dev/device/apply/service/impl/DeviceApplyBillServiceImpl.java
浏览文件 @
0b70a385
...
...
@@ -7,10 +7,7 @@ import com.tykj.dev.config.TaskBeanConfig;
import
com.tykj.dev.device.apply.repository.DeviceApplyBillDao
;
import
com.tykj.dev.device.apply.service.DeviceApplyBillService
;
import
com.tykj.dev.device.apply.subject.domin.DeviceApplyBill
;
import
com.tykj.dev.device.apply.subject.vo.ApplyTaskDeviceCheckVo
;
import
com.tykj.dev.device.apply.subject.vo.RemoveFromSeqListVo
;
import
com.tykj.dev.device.apply.subject.vo.RemoveSameSeqVo
;
import
com.tykj.dev.device.apply.subject.vo.ReplyVo
;
import
com.tykj.dev.device.apply.subject.vo.*
;
import
com.tykj.dev.device.library.service.DeviceLibraryCacheService
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.impl.CacheLibraryServiceImpl
;
...
...
@@ -267,16 +264,15 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
String
seqNumberList
=
removeFromSeqListVo
.
getSeqNumberList
();
//对序列号区间进行拆分
List
<
String
>
seqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seqNumberList
);
List
<
String
>
seq1
=
DeviceSeqUtil
.
selectDeviceSeqs
(
removeFromSeqListVo
.
getSeqNumber
());
seqs
.
removeAll
(
seq1
);
seqs
.
removeAll
(
removeFromSeqListVo
.
getRemoveSeqNumberList
());
//对原来的集合先进行排序
seqs
.
sort
(
Comparator
.
comparing
(
String:
:
toString
));
return
DeviceSeqUtil
.
getContinuousSeqs
(
seqs
);
}
@Override
public
List
<
String
>
removeSameSeq
(
RemoveSameSeqVo
removeSameSeqVo
)
{
public
ApplyRemoveSeqVo
removeSameSeq
(
RemoveSameSeqVo
removeSameSeqVo
)
{
ApplyRemoveSeqVo
applyRemoveSeqVo
=
new
ApplyRemoveSeqVo
();
String
seqNumberList
=
removeSameSeqVo
.
getSeqNumberList
();
List
<
String
>
selectDeviceSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seqNumberList
);
if
(
selectDeviceSeqs
.
size
()>
0
){
...
...
@@ -286,6 +282,8 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
}
}
List
<
String
>
continuousSeqs
=
DeviceSeqUtil
.
getContinuousSeqs
(
selectDeviceSeqs
);
return
continuousSeqs
;
applyRemoveSeqVo
.
setSeqList
(
continuousSeqs
);
applyRemoveSeqVo
.
setCount
(
selectDeviceSeqs
.
size
());
return
applyRemoveSeqVo
;
}
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/ApplyRemoveSeqVo.java
0 → 100644
浏览文件 @
0b70a385
package
com
.
tykj
.
dev
.
device
.
apply
.
subject
.
vo
;
import
com.tykj.dev.device.apply.subject.domin.DeviceApplyBill
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.task.subject.vo.TaskLogUserVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author zsp
*/
@Data
@ApiModel
(
"返回入库时候,如果试用装备的序列号在序列号区间,则进行去除vo"
)
public
class
ApplyRemoveSeqVo
{
@ApiModelProperty
(
value
=
"序列号区间"
)
private
List
<
String
>
seqList
;
@ApiModelProperty
(
name
=
"区间数量"
)
private
Integer
count
;
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/RemoveFromSeqListVo.java
浏览文件 @
0b70a385
...
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author zsp
*/
...
...
@@ -15,6 +17,6 @@ public class RemoveFromSeqListVo {
private
String
seqNumberList
;
@ApiModelProperty
(
value
=
"要移除的序列号"
)
private
String
seqNumber
;
private
List
<
String
>
removeSeqNumberList
;
}
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
0b70a385
...
...
@@ -947,8 +947,8 @@ public class DeviceLibraryController {
@ApiOperation
(
"入库修改试用装备的序列号"
)
@PostMapping
(
"updateSeq"
)
public
ResponseEntity
updateSeq
(
@RequestBody
DeviceForApplyVo
deviceForApplyVo
){
deviceLibraryService
.
updateSeqNumber
(
deviceForApplyVo
);
public
ResponseEntity
updateSeq
(
@RequestBody
List
<
DeviceForApplyVo
>
deviceForApplyVos
){
deviceLibraryService
.
updateSeqNumber
(
deviceForApplyVo
s
);
return
ResponseEntity
.
ok
(
"更新成功"
);
}
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
0b70a385
...
...
@@ -496,7 +496,7 @@ public interface DeviceLibraryService {
/**
* 根据装备id更新装备
* @param deviceForApplyVo 更新试用装备序列号的vo
* @param deviceForApplyVo
s
更新试用装备序列号的vo
*/
void
updateSeqNumber
(
DeviceForApplyVo
deviceForApplyVo
);
void
updateSeqNumber
(
List
<
DeviceForApplyVo
>
deviceForApplyVos
);
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
0b70a385
...
...
@@ -26,6 +26,7 @@ import com.tykj.dev.misc.utils.*;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
...
...
@@ -40,6 +41,7 @@ import java.lang.reflect.Field;
import
java.lang.reflect.Method
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.Executor
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -74,6 +76,10 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Autowired
private
DeviceLibraryCacheService
deviceLibraryCacheService
;
@Autowired
@Qualifier
(
"taskExecutor"
)
private
Executor
executor
;
@Override
@UpdateCache
public
DeviceLibrary
addEntity
(
DeviceLibrary
deviceLibraryEntity
)
{
...
...
@@ -1090,16 +1096,43 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@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
(
"序列号已经存在,请更换序列号"
);
public
void
updateSeqNumber
(
List
<
DeviceForApplyVo
>
deviceForApplyVos
)
{
List
<
String
>
inputSeq
=
deviceForApplyVos
.
stream
()
.
filter
(
deviceForApplyVo
->
deviceForApplyVo
.
getIsUpdate
()
==
0
)
.
map
(
DeviceForApplyVo:
:
getSeqNumber
)
.
collect
(
Collectors
.
toList
());
//数据库中的seq
List
<
String
>
existSeq
=
cacheLibraryService
.
getAllDeviceLibraryList
().
stream
()
.
map
(
DeviceLibrary:
:
getSeqNumber
)
.
collect
(
Collectors
.
toList
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
List
<
DeviceLogDto
>
deviceLogDtos
=
new
ArrayList
<>();
//取交集
inputSeq
.
retainAll
(
existSeq
);
if
(
inputSeq
.
size
()>
0
){
String
join
=
String
.
join
(
","
,
inputSeq
);
throw
new
ApiException
(
join
+
"序列号已经存在"
);
}
else
{
deviceLibraryDao
.
save
(
library
);
//进行更新装备
deviceForApplyVos
.
forEach
(
deviceForApplyVo
->
{
Integer
deviceId
=
deviceForApplyVo
.
getDeviceId
();
String
seqNumber
=
deviceForApplyVo
.
getSeqNumber
();
DeviceLibrary
one
=
getOne
(
deviceId
);
one
.
setSeqNumber
(
seqNumber
);
//添加装备日志
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
();
deviceLogDto
.
setDeviceId
(
deviceId
);
deviceLogDto
.
setRemark
(
"将原来的序列号"
+
one
.
getSeqNumber
()+
"修改为"
+
seqNumber
);
deviceLogDto
.
setCreateUserId
(
userId
);
update
(
one
);
deviceLogDtos
.
add
(
deviceLogDto
);
});
}
executor
.
execute
(()->{
deviceLogService
.
addAllLog
(
deviceLogDtos
);
});
}
// @Override
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/domin/DeviceLibrary.java
浏览文件 @
0b70a385
...
...
@@ -316,8 +316,7 @@ public class DeviceLibrary implements Serializable {
setTypeName
(
configCache
.
getStyleMap
().
get
(
this
.
type
)==
null
?
"-"
:
configCache
.
getStyleMap
().
get
(
this
.
type
));
setStorageTypeName
(
configCache
.
getStorageTypeMap
().
get
(
this
.
storageType
)==
null
?
"-"
:
configCache
.
getStorageTypeMap
().
get
(
this
.
storageType
));
setAllotTypeName
(
configCache
.
getAllotTypeMap
().
get
(
this
.
allotType
)==
null
?
"-"
:
configCache
.
getAllotTypeMap
().
get
(
this
.
allotType
));
childs
.
clear
();
// setChilds(new ArrayList<>());
// childs.clear();
}
return
this
;
}
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceForApplyVo.java
浏览文件 @
0b70a385
...
...
@@ -25,4 +25,7 @@ public class DeviceForApplyVo {
@ApiModelProperty
(
value
=
"装备的序列号"
,
example
=
"12344"
)
private
String
seqNumber
;
@ApiModelProperty
(
value
=
"是否修改 0 正式 1 试用"
,
example
=
"0"
)
private
Integer
isUpdate
;
}
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
0b70a385
...
...
@@ -360,7 +360,8 @@ public class PackingController {
// Page<PackingLibrary> packingLibraries = PageUtil.getPerPage(selectPack.getPage(), selectPack.getSize(), resultList, selectPack.getPageable());
Page
<
PackingLibrary
>
packingLibraries
=
PageUtil
.
getPerPage
(
selectPack
.
getPage
(),
selectPack
.
getSize
(),
orderNumbers
,
selectPack
.
getPageable
());
map
.
put
(
"pages"
,
packingLibraries
);
List
<
String
>
models
=
new
ArrayList
<>(
resultList
.
stream
().
filter
(
packingLibrary
->
packingLibrary
.
getIsRoot
()
==
1
).
map
(
PackingLibrary:
:
getModel
).
collect
(
Collectors
.
toList
()));
List
<
String
>
models
=
new
ArrayList
<>(
resultList
.
stream
().
filter
(
packingLibrary
->
packingLibrary
.
getIsRoot
()
==
1
).
map
(
PackingLibrary:
:
getModel
).
collect
(
Collectors
.
toList
()));
//去重
models
=
models
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
map
.
put
(
"models"
,
models
);
...
...
@@ -368,6 +369,17 @@ public class PackingController {
return
ResultUtil
.
success
(
map
);
}
@ApiOperation
(
value
=
"查询所有型号"
)
@GetMapping
(
"/findAllModel"
)
public
ResponseEntity
findAllModel
(){
List
<
PackingLibrary
>
resultList
=
getAllPackingExceptNull
(
new
SelectPack
());
List
<
String
>
models
=
new
ArrayList
<>(
resultList
.
stream
().
filter
(
packingLibrary
->
packingLibrary
.
getIsRoot
()
==
1
).
map
(
PackingLibrary:
:
getModel
).
collect
(
Collectors
.
toList
()));
//去重
models
=
models
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
return
ResultUtil
.
success
(
models
);
}
// @ApiOperation(value = "查询父子结构列装")
// @PostMapping("/select")
// public ResponseEntity selectPack(@RequestBody SelectPack selectPack){
...
...
@@ -1131,7 +1143,8 @@ public class PackingController {
resultList
.
add
(
packingLibrary
);
}
});
resultList
.
sort
(
Comparator
.
comparing
(
PackingLibrary:
:
getShowOrder
,
Comparator
.
nullsLast
(
Integer:
:
compareTo
)).
thenComparing
(
Comparator
.
comparing
(
PackingLibrary:
:
getModel
)));
resultList
.
sort
(
Comparator
.
comparing
(
PackingLibrary:
:
getShowOrder
,
Comparator
.
nullsLast
(
Integer:
:
compareTo
))
.
thenComparing
(
Comparator
.
comparing
(
PackingLibrary:
:
getModel
)));
return
resultList
;
}
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
0b70a385
...
...
@@ -965,7 +965,12 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
originPacking
.
setPartParentId
(
selectPacking
.
getId
());
PackingLog
packingLog
=
new
PackingLog
();
packingLog
.
setPackingId
(
originPacking
.
getId
());
packingLog
.
setRemark
(
"列装名称为"
+
originPacking
.
getName
()+
"与列装名称"
+
selectPacking
.
getName
()+
"进行绑定"
);
if
(
selectPacking
.
getIsRoot
()
==
0
){
packingLog
.
setRemark
(
"列装名称为"
+
originPacking
.
getName
()+
"与列装名称"
+
selectPacking
.
getName
()+
"进行绑定"
);
}
else
{
packingLog
.
setRemark
(
"列装名称为"
+
originPacking
.
getName
()+
"与列装目录型号"
+
selectPacking
.
getModel
()+
"进行绑定"
);
}
packingLogService
.
add
(
packingLog
);
update
(
originPacking
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论