Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
02724ad5
提交
02724ad5
authored
10月 26, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备申请模块,配套设备模块): 配套设备进行解绑和绑定,装备申请新增校验接口
配套设备进行解绑和绑定,装备申请新增校验接口
上级
c35c8e1c
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
52 行增加
和
14 行删除
+52
-14
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+9
-8
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+36
-6
MatchingDeviceEditVo.java
.../dev/device/matching/subject/vo/MatchingDeviceEditVo.java
+7
-0
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
02724ad5
...
@@ -469,7 +469,6 @@ public class DeviceApplyController {
...
@@ -469,7 +469,6 @@ public class DeviceApplyController {
}
}
if
(
uploadApplyFile
.
getApplyBillDetailVos
()
!=
null
&&
uploadApplyFile
.
getApplyBillDetailVos
().
size
()
>
0
)
{
if
(
uploadApplyFile
.
getApplyBillDetailVos
()
!=
null
&&
uploadApplyFile
.
getApplyBillDetailVos
().
size
()
>
0
)
{
for
(
ApplyBillDetailVo
a
:
uploadApplyFile
.
getApplyBillDetailVos
())
{
for
(
ApplyBillDetailVo
a
:
uploadApplyFile
.
getApplyBillDetailVos
())
{
// ResponseEntity responseEntity = packingController.seqsNotExist(a.getPackingId(), a.getStorageCount(), a.getSeqInterval());
// 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.getSeqInterval());
ResponseEntity
responseEntity
=
packingController
.
seqsNotExist
(
a
.
getPackingId
(),
ResponseEntity
responseEntity
=
packingController
.
seqsNotExist
(
a
.
getPackingId
(),
...
@@ -519,13 +518,7 @@ public class DeviceApplyController {
...
@@ -519,13 +518,7 @@ public class DeviceApplyController {
deviceApplyBill
.
setAgent
(
uploadApplyFile
.
getAgent
());
deviceApplyBill
.
setAgent
(
uploadApplyFile
.
getAgent
());
deviceApplyBill
.
setReplyUnit
(
uploadApplyFile
.
getReplyUnit
());
deviceApplyBill
.
setReplyUnit
(
uploadApplyFile
.
getReplyUnit
());
DeviceApplyBill
deviceApplyBill1
=
deviceApplyBillService
.
update
(
deviceApplyBill
);
DeviceApplyBill
deviceApplyBill1
=
deviceApplyBillService
.
update
(
deviceApplyBill
);
//通过列装id查询列装
// List<ApplyBillDetailVo> applyBillDetailVos = uploadApplyFile.getApplyBillDetailVos();
// for (ApplyBillDetailVo applyBillDetailVo : applyBillDetailVos) {
// PackingLibrary packingLibrary = packingLibraryService.getOne(applyBillDetailVo.getPackingId());
// BeanUtils.copyProperties(applyBillDetailVo,packingLibrary);
// packingLibraryService.update(packingLibrary);
// }
if
(
deviceApplyBill
.
getApplyType
()
>
1
)
{
if
(
deviceApplyBill
.
getApplyType
()
>
1
)
{
List
<
String
>
seqs
=
new
ArrayList
<>();
List
<
String
>
seqs
=
new
ArrayList
<>();
List
<
ReplyVo
>
replyVos
=
JacksonUtil
.
readValue
(
deviceApplyBill1
.
getReplyVos
(),
new
TypeReference
<
List
<
ReplyVo
>>()
{
List
<
ReplyVo
>
replyVos
=
JacksonUtil
.
readValue
(
deviceApplyBill1
.
getReplyVos
(),
new
TypeReference
<
List
<
ReplyVo
>>()
{
...
@@ -720,6 +713,14 @@ public class DeviceApplyController {
...
@@ -720,6 +713,14 @@ public class DeviceApplyController {
return
ResponseEntity
.
ok
(
"申请任务完成"
);
return
ResponseEntity
.
ok
(
"申请任务完成"
);
}
}
@ApiOperation
(
value
=
"申请任务进行校验"
,
notes
=
"申请任务进行校验"
)
@PostMapping
(
"/checkNumAndSeqNumber"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
checkNumAndSeqNumber
(
@RequestBody
List
<
ApplyTaskDeviceCheckVo
>
applyTaskDeviceCheckVos
)
{
List
<
StringBuffer
>
stringBufferList
=
deviceApplyBillService
.
checkNumAndSeqNumber
(
applyTaskDeviceCheckVos
);
return
ResponseEntity
.
ok
(
stringBufferList
);
}
/**
/**
* 转实体
* 转实体
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
02724ad5
...
@@ -106,9 +106,6 @@ public class MatchingDeviceController {
...
@@ -106,9 +106,6 @@ public class MatchingDeviceController {
@Autowired
@Autowired
private
MessageService
messageService
;
private
MessageService
messageService
;
@Autowired
private
MatchingDeviceLibraryDao
matchingDeviceLibraryDao
;
@Autowired
@Autowired
private
RfidService
rfidService
;
private
RfidService
rfidService
;
...
@@ -164,6 +161,15 @@ public class MatchingDeviceController {
...
@@ -164,6 +161,15 @@ public class MatchingDeviceController {
if
(
matchingDeviceLibraryListSeqNumberList
.
size
()>
0
){
if
(
matchingDeviceLibraryListSeqNumberList
.
size
()>
0
){
throw
new
ApiException
(
"序列号"
+
matchingDeviceLibraryListSeqNumberList
+
"已存在"
);
throw
new
ApiException
(
"序列号"
+
matchingDeviceLibraryListSeqNumberList
+
"已存在"
);
}
}
//做校验 入库的配套设备的序列号不能一样
//先去重
List
<
String
>
distinctSeqNumList
=
seqNumList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
distinctSeqNumList
.
forEach
(
s
->
{
int
frequency
=
Collections
.
frequency
(
seqNumList
,
s
);
if
(
frequency
>
1
){
throw
new
ApiException
(
"序列号不能相同"
);
}
});
StringBuffer
stringBuffer
=
new
StringBuffer
();
StringBuffer
stringBuffer
=
new
StringBuffer
();
stringBuffer
.
append
(
"x"
);
stringBuffer
.
append
(
"x"
);
Integer
userId
=
userUtils
.
getCurrentUserId
();
Integer
userId
=
userUtils
.
getCurrentUserId
();
...
@@ -412,15 +418,19 @@ public class MatchingDeviceController {
...
@@ -412,15 +418,19 @@ public class MatchingDeviceController {
@GetMapping
(
"/feature/detail/{id}"
)
@GetMapping
(
"/feature/detail/{id}"
)
public
ResponseEntity
getDetail
(
@PathVariable
(
"id"
)
@Min
(
value
=
1
,
message
=
"id不能小于1"
)
int
id
)
{
public
ResponseEntity
getDetail
(
@PathVariable
(
"id"
)
@Min
(
value
=
1
,
message
=
"id不能小于1"
)
int
id
)
{
List
<
Object
>
list
=
new
ArrayList
<>();
List
<
Object
>
list
=
new
ArrayList
<>();
Map
<
String
,
List
<
Object
>>
map
=
new
HashMap
<>();
//添加配套设备详情
//添加配套设备详情
MatchingDeviceLibrary
m
=
matchingDeviceLibraryService
.
getOne
(
id
);
MatchingDeviceLibrary
m
=
matchingDeviceLibraryService
.
getOne
(
id
);
list
.
add
(
m
);
list
.
add
(
m
);
//添加关联装备详情
//添加关联装备详情
if
(
m
.
getDeviceId
()!=
null
){
if
(
m
.
getDeviceId
()!=
null
){
if
(
m
.
getDeviceId
()
!=
0
)
{
if
(
m
.
getDeviceId
()
!=
0
)
{
list
.
add
(
deviceLibraryService
.
getOne
(
m
.
getDeviceId
()));
List
<
Object
>
deviceLibraryList
=
new
ArrayList
<>();
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
m
.
getDeviceId
());
deviceLibraryList
.
add
(
deviceLibrary
);
map
.
put
(
"deviceLibrary"
,
deviceLibraryList
);
}
else
{
}
else
{
list
.
add
(
null
);
map
.
put
(
"deviceLibrary"
,
new
ArrayList
<>()
);
}
}
}
}
...
@@ -432,7 +442,8 @@ public class MatchingDeviceController {
...
@@ -432,7 +442,8 @@ public class MatchingDeviceController {
Comparator
.
nullsLast
(
Date:
:
compareTo
).
reversed
()))
Comparator
.
nullsLast
(
Date:
:
compareTo
).
reversed
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
list
.
add
(
deviceLogs
);
list
.
add
(
deviceLogs
);
return
ResponseEntity
.
ok
(
list
);
map
.
put
(
"list"
,
list
);
return
ResponseEntity
.
ok
(
map
);
}
}
...
@@ -497,6 +508,25 @@ public class MatchingDeviceController {
...
@@ -497,6 +508,25 @@ public class MatchingDeviceController {
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLogService
.
addLog
(
deviceLogDto
);
m
.
setType
(
matchingDeviceEditVo
.
getType
());
m
.
setType
(
matchingDeviceEditVo
.
getType
());
}
}
//添加绑定和解绑装备
//添加
if
(
matchingDeviceEditVo
.
getAddDeviceId
()
!=
null
&&
!
matchingDeviceEditVo
.
getAddDeviceId
().
equals
(
m
.
getDeviceId
())){
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
matchingDeviceEditVo
.
getAddDeviceId
());
String
remark
=
"将序列号为"
+
m
.
getSeqNumber
()
+
"的配套装备与序列号为"
+
deviceLibrary
.
getSeqNumber
()
+
"的装备绑定"
;
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
1
,
m
.
getId
(),
remark
,
null
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
m
.
setDeviceId
(
matchingDeviceEditVo
.
getAddDeviceId
());
}
//删除
if
(
matchingDeviceEditVo
.
getDeleteDeviceId
()
!=
null
){
DeviceLibrary
deviceLibrary
=
deviceLibraryService
.
getOne
(
matchingDeviceEditVo
.
getDeleteDeviceId
());
String
remark
=
"将序列号为"
+
m
.
getSeqNumber
()
+
"的配套装备与序列号为"
+
deviceLibrary
.
getSeqNumber
()
+
"的装备进行解除绑定"
;
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
1
,
m
.
getId
(),
remark
,
null
,
null
);
deviceLogService
.
addLog
(
deviceLogDto
);
m
.
setDeviceId
(
0
);
}
matchingDeviceLibraryService
.
update
(
m
);
matchingDeviceLibraryService
.
update
(
m
);
return
ResponseEntity
.
ok
(
"修改成功"
);
return
ResponseEntity
.
ok
(
"修改成功"
);
}
}
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/subject/vo/MatchingDeviceEditVo.java
浏览文件 @
02724ad5
...
@@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository;
...
@@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
/**
* @author dengdiyi
* @author dengdiyi
...
@@ -49,4 +50,10 @@ public class MatchingDeviceEditVo {
...
@@ -49,4 +50,10 @@ public class MatchingDeviceEditVo {
@ApiModelProperty
(
value
=
"生命状态"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"生命状态"
,
example
=
"1"
)
private
Integer
lifeStatus
;
private
Integer
lifeStatus
;
@ApiModelProperty
(
value
=
"新增装备信息列表"
)
private
Integer
addDeviceId
;
@ApiModelProperty
(
value
=
"删除相关装备id"
)
private
Integer
deleteDeviceId
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论