Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
3a07e021
提交
3a07e021
authored
10月 27, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(申请模块): 新增去重序列号接口
新增去重序列号接口
上级
15377184
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
157 行增加
和
48 行删除
+157
-48
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+38
-20
DeviceApplyBillService.java
...tykj/dev/device/apply/service/DeviceApplyBillService.java
+10
-0
DeviceApplyBillServiceImpl.java
...device/apply/service/impl/DeviceApplyBillServiceImpl.java
+40
-8
RemoveFromSeqListVo.java
...tykj/dev/device/apply/subject/vo/RemoveFromSeqListVo.java
+20
-0
RemoveSameSeqVo.java
...com/tykj/dev/device/apply/subject/vo/RemoveSameSeqVo.java
+22
-0
PackingLibraryController.java
...v/device/packing/controller/PackingLibraryController.java
+8
-6
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+19
-14
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
3a07e021
...
...
@@ -459,25 +459,25 @@ public class DeviceApplyController {
deviceApplyBillService
.
update
(
deviceApplyBill
);
}
else
{
if
(
uploadApplyFile
.
getReplyVos
()
!=
null
&&
uploadApplyFile
.
getReplyVos
().
size
()
>
0
)
{
for
(
ReplyVo
replyVo
:
uploadApplyFile
.
getReplyVos
())
{
ResponseEntity
responseEntity
=
packingController
.
seqsExist
(
replyVo
.
getId
(),
replyVo
.
getNum
(),
replyVo
.
getSeqInterval
());
if
(!
"ok"
.
equals
(
responseEntity
.
getBody
()))
{
return
responseEntity
;
}
}
}
if
(
uploadApplyFile
.
getApplyBillDetailVos
()
!=
null
&&
uploadApplyFile
.
getApplyBillDetailVos
().
size
()
>
0
)
{
for
(
ApplyBillDetailVo
a
:
uploadApplyFile
.
getApplyBillDetailVos
())
{
// ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval());
// ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getWaitNum(), a.getSeqInterval());
ResponseEntity
responseEntity
=
packingController
.
seqsNotExist
(
a
.
getPackingId
(),
a
.
getWaitNum
()-
a
.
getCompleteCount
(),
a
.
getSeqInterval
());
if
(!
"ok"
.
equals
(
responseEntity
.
getBody
()))
{
return
responseEntity
;
}
}
}
//
if (uploadApplyFile.getReplyVos() != null && uploadApplyFile.getReplyVos().size() > 0) {
//
for (ReplyVo replyVo : uploadApplyFile.getReplyVos()) {
//
ResponseEntity responseEntity = packingController.seqsExist(replyVo.getId(), replyVo.getNum(), replyVo.getSeqInterval());
//
if (!"ok".equals(responseEntity.getBody())) {
//
return responseEntity;
//
}
//
}
//
}
//
if (uploadApplyFile.getApplyBillDetailVos() != null && uploadApplyFile.getApplyBillDetailVos().size() > 0) {
//
for (ApplyBillDetailVo a : uploadApplyFile.getApplyBillDetailVos()) {
//
//
ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval());
//
//
ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getWaitNum(), a.getSeqInterval());
//
ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(),
//
a.getWaitNum()-a.getCompleteCount(), a.getSeqInterval());
//
if (!"ok".equals(responseEntity.getBody())) {
//
return responseEntity;
//
}
//
}
//
}
//判断是入库还是显示业务待办结
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
...
...
@@ -689,9 +689,11 @@ public class DeviceApplyController {
//更新装备
deviceLibraryService
.
updateTry
(
deviceLibraryService
.
findByIds
(
deviceIds
));
//添加装备日志
Integer
userId
=
userUtils
.
getCurrentUserId
();
List
<
DeviceLogDto
>
deviceLogDtoList
=
new
ArrayList
<>();
deviceIds
.
forEach
(
integer
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"装备从试用修改为正式"
,
null
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"装备从试用修改为正式"
,
null
,
userId
,
null
);
deviceLogDtoList
.
add
(
deviceLogDto
);
});
executor
.
execute
(()->{
...
...
@@ -721,6 +723,22 @@ public class DeviceApplyController {
return
ResponseEntity
.
ok
(
stringBufferList
);
}
@ApiOperation
(
value
=
"当修改试用装备序列时,移除序列号区间中所在的序列号"
,
notes
=
"当修改试用装备序列时,移除序列号区间中所在的序列号"
)
@PostMapping
(
"/removeFromSeqList"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
removeFromSeqList
(
@RequestBody
RemoveFromSeqListVo
removeFromSeqListVo
)
{
List
<
String
>
stringList
=
deviceApplyBillService
.
removeFromSeqList
(
removeFromSeqListVo
);
return
ResponseEntity
.
ok
(
stringList
);
}
@ApiOperation
(
value
=
"入库时候,如果试用装备的序列号在序列号区间,则进行去除"
,
notes
=
"入库时候,如果试用装备的序列号在序列号区间,则进行去除"
)
@PostMapping
(
"/removeSameSeq"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
removeSameSeq
(
@RequestBody
RemoveSameSeqVo
removeSameSeqVo
)
{
List
<
String
>
stringList
=
deviceApplyBillService
.
removeSameSeq
(
removeSameSeqVo
);
return
ResponseEntity
.
ok
(
stringList
);
}
/**
* 转实体
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/service/DeviceApplyBillService.java
浏览文件 @
3a07e021
...
...
@@ -3,6 +3,8 @@ package com.tykj.dev.device.apply.service;
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.library.subject.vo.ScriptSaveVo
;
import
java.util.List
;
...
...
@@ -31,4 +33,12 @@ public interface DeviceApplyBillService {
List
<
StringBuffer
>
checkNumAndSeqNumber
(
List
<
ApplyTaskDeviceCheckVo
>
applyTaskDeviceCheckVos
);
/**
* 申请任务入库 当修改试用装备序列时,移除序列号区间中所在的序列号
*/
List
<
String
>
removeFromSeqList
(
RemoveFromSeqListVo
removeFromSeqListVo
);
List
<
String
>
removeSameSeq
(
RemoveSameSeqVo
removeSameSeqVo
);
}
dev-apply/src/main/java/com/tykj/dev/device/apply/service/impl/DeviceApplyBillServiceImpl.java
浏览文件 @
3a07e021
...
...
@@ -8,6 +8,8 @@ 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.library.service.DeviceLibraryCacheService
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
...
...
@@ -25,6 +27,8 @@ import com.tykj.dev.device.user.util.UserUtils;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.DeviceSeqUtil
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
com.tykj.dev.misc.utils.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
...
...
@@ -239,16 +243,16 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
List
<
String
>
inputSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seqNumInter
);
if
(!
replyNum
.
equals
(
inputSeqs
.
size
())){
//提示 批复数量跟输入区间不一致
stringBuffer
.
append
(
"批复数量与序列号区间不一致"
)
.
append
(
","
)
;
stringBuffer
.
append
(
"批复数量与序列号区间不一致"
);
}
//查询所有的序列号 检验是否重复
List
<
String
>
allSeqList
=
deviceLibraryCacheService
.
getAllDeviceLibraryList
().
stream
()
.
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
());
allSeqList
.
retainAll
(
inputSeqs
);
if
(
allSeqList
.
size
()>
0
){
//说明有重复的序列号
stringBuffer
.
append
(
"序列号"
).
append
(
allSeqList
).
append
(
"已存在"
);
}
//
List<String> allSeqList = deviceLibraryCacheService.getAllDeviceLibraryList().stream()
//
.map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
//
allSeqList.retainAll(inputSeqs);
//
if (allSeqList.size()>0){
//
//说明有重复的序列号
//
stringBuffer.append("序列号").append(allSeqList).append("已存在");
//
}
}
stringBufferList
.
add
(
stringBuffer
);
...
...
@@ -256,4 +260,32 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
return
stringBufferList
;
}
@Override
public
List
<
String
>
removeFromSeqList
(
RemoveFromSeqListVo
removeFromSeqListVo
)
{
//对区间进行拆分
String
seqNumberList
=
removeFromSeqListVo
.
getSeqNumberList
();
//对序列号区间进行拆分
List
<
String
>
seqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seqNumberList
);
List
<
String
>
seq1
=
DeviceSeqUtil
.
selectDeviceSeqs
(
removeFromSeqListVo
.
getSeqNumber
());
seqs
.
removeAll
(
seq1
);
//对原来的集合先进行排序
seqs
.
sort
(
Comparator
.
comparing
(
String:
:
toString
));
return
DeviceSeqUtil
.
getContinuousSeqs
(
seqs
);
}
@Override
public
List
<
String
>
removeSameSeq
(
RemoveSameSeqVo
removeSameSeqVo
)
{
String
seqNumberList
=
removeSameSeqVo
.
getSeqNumberList
();
List
<
String
>
selectDeviceSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seqNumberList
);
if
(
selectDeviceSeqs
.
size
()>
0
){
List
<
String
>
removeSameSeq
=
removeSameSeqVo
.
getRemoveSameSeq
();
if
(
removeSameSeq
.
size
()>
0
){
selectDeviceSeqs
.
removeAll
(
removeSameSeq
);
}
}
List
<
String
>
continuousSeqs
=
DeviceSeqUtil
.
getContinuousSeqs
(
selectDeviceSeqs
);
return
continuousSeqs
;
}
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/RemoveFromSeqListVo.java
0 → 100644
浏览文件 @
3a07e021
package
com
.
tykj
.
dev
.
device
.
apply
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author zsp
*/
@Data
@ApiModel
(
"当修改试用装备序列时,移除序列号区间中所在的序列号vo"
)
public
class
RemoveFromSeqListVo
{
@ApiModelProperty
(
value
=
"序列号区间"
)
private
String
seqNumberList
;
@ApiModelProperty
(
value
=
"要移除的序列号"
)
private
String
seqNumber
;
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/RemoveSameSeqVo.java
0 → 100644
浏览文件 @
3a07e021
package
com
.
tykj
.
dev
.
device
.
apply
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author zsp
*/
@Data
@ApiModel
(
"移除重复的序列号,在序列号区间中所在的序列号vo"
)
public
class
RemoveSameSeqVo
{
@ApiModelProperty
(
value
=
"序列号区间"
)
private
String
seqNumberList
;
@ApiModelProperty
(
value
=
"重复的序列号"
)
private
List
<
String
>
removeSameSeq
;
}
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingLibraryController.java
浏览文件 @
3a07e021
...
...
@@ -65,12 +65,14 @@ public class PackingLibraryController {
packingLibraries
.
forEach
(
packingLibrary
->
{
List
<
String
>
inputSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
packingLibrary
.
getSeq
());
List
<
String
>
outputSeqs
=
new
ArrayList
<>();
inputSeqs
.
forEach
(
s
->
{
if
(
map
.
get
(
s
)==
null
){
outputSeqs
.
add
(
s
);
}
});
packingLibrary
.
setSeq
(
StringSplitUtil
.
stringListToString
(
DeviceSeqUtil
.
getContinuousSeqs
(
outputSeqs
)));
// inputSeqs.forEach(s -> {
// if (map.get(s)==null){
// outputSeqs.add(s);
// }
// });
// packingLibrary.setSeq(StringSplitUtil.stringListToString(DeviceSeqUtil.getContinuousSeqs(outputSeqs)));
packingLibrary
.
setSeq
(
StringSplitUtil
.
stringListToString
(
DeviceSeqUtil
.
getContinuousSeqs
(
inputSeqs
)));
});
//返回父子结构
Map
<
Integer
,
PackingLibrary
>
nodeCollect
=
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
3a07e021
...
...
@@ -569,6 +569,7 @@ public class StorageBillController {
}
rfidService
.
printString
(
printVos
);
}
//更新申请业务入库数量
if
(
deviceApplyBills
.
size
()>
0
){
deviceApplyBills
.
forEach
(
deviceApplyBill
->
{
...
...
@@ -578,6 +579,21 @@ public class StorageBillController {
ApplyBillDetailVo
applyBillDetailVo
=
applyBillDetailVos
.
get
(
i
);
if
(
map
.
get
(
applyBillDetailVo
.
getPackingId
())!=
null
){
applyBillDetailVo
.
setCompleteCount
(
map
.
get
(
applyBillDetailVo
.
getPackingId
()).
getCompleteCount
());
//更新序列号
String
seqInterval
=
applyBillDetailVo
.
getSeqInterval
();
List
<
String
>
seqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seqInterval
);
List
<
DeviceLibrarySaveVo
>
deviceLibrarySaveVoList
=
storageBillSaveVo
.
getDeviceLibrarySaveVoList
();
List
<
String
>
storageSeq
=
deviceLibrarySaveVoList
.
stream
().
map
(
DeviceLibrarySaveVo:
:
getSeqNumber
).
collect
(
Collectors
.
toList
());
seqs
.
removeAll
(
storageSeq
);
//根据试用装备的id查询序列号
List
<
Integer
>
deviceIds
=
storageBillSaveVo
.
getDeviceIds
();
if
(
deviceIds
.
size
()>
0
){
List
<
DeviceLibrary
>
byIds
=
deviceLibraryService
.
findByIds
(
deviceIds
);
//获取序列号
List
<
String
>
seqNumbers
=
byIds
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
());
seqs
.
removeAll
(
seqNumbers
);
}
applyBillDetailVo
.
setSeqInterval
(
StringSplitUtil
.
stringListToString
(
seqs
));
applyBillDetailVos
.
set
(
i
,
applyBillDetailVo
);
if
(!
applyBillDetailVo
.
getWaitNum
().
equals
(
applyBillDetailVo
.
getCompleteCount
())){
isEnd
=
false
;
...
...
@@ -591,7 +607,7 @@ public class StorageBillController {
taskService
.
moveToEnd
(
taskBto1
);
//发送阅知信息
MessageBto
messageBto
=
new
MessageBto
();
messageBto
.
setContent
(
"
业务办
结"
);
messageBto
.
setContent
(
"
申请业务完
结"
);
messageBto
.
setTaskId
(
taskBto1
.
getId
());
messageBto
.
setIsHighLight
(
0
);
messageBto
.
setInvolveUserIdList
(
userPublicService
.
findOtherUser
(
userId
));
...
...
@@ -663,7 +679,8 @@ public class StorageBillController {
deviceLibraryService
.
updateTry
(
deviceLibraries
);
List
<
DeviceLogDto
>
deviceLogDtoList
=
new
ArrayList
<>();
storageBillSaveVo
.
getDeviceIds
().
forEach
(
integer
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"试用装备改为正式装备"
,
null
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"试用装备改为正式装备"
,
null
,
userId
,
null
);
deviceLogDtoList
.
add
(
deviceLogDto
);
});
executor
.
execute
(()->{
...
...
@@ -672,18 +689,6 @@ public class StorageBillController {
}
}
}
// if(storageBillSaveVo.getTryOutDevice() == 0){
// List<DeviceLibrarySaveVo> deviceLibrarySaveVoList = storageBillSaveVo.getDeviceLibrarySaveVoList();
// deviceLibrarySaveVoList.forEach(deviceLibrarySaveVo -> {
// List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(deviceLibrarySaveVo.getPackingId());
// deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> deviceLibrary.getTryOutDevice() == 1)
// .collect(Collectors.toList());
// if (deviceLibraries.size()>0){
// //将装备试用的改为正式的
// deviceLibraryService.updateTry(deviceLibraries);
// }
// });
// }
//异步去查询数据库
executor
.
execute
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论