Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
74f70dc9
提交
74f70dc9
authored
11月 23, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(装备模块,配套设备模块,自查模块,列装模块): 解决了配套设备库的入库数量和序列号区间的验证,装备新增根据存放位置查询,自查根据库房位置查询装备,列装修改阅知
解决了配套设备库的入库数量和序列号区间的验证,装备新增根据存放位置查询,自查根据库房位置查询装备,列装修改阅知
上级
c6f20d5e
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
105 行增加
和
5 行删除
+105
-5
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+4
-2
SelfCheckVo.java
...a/com/tykj/dev/device/library/subject/vo/SelfCheckVo.java
+22
-0
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+3
-1
DeviceSeqUtil.java
.../src/main/java/com/tykj/dev/misc/utils/DeviceSeqUtil.java
+73
-1
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+3
-1
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
74f70dc9
...
...
@@ -183,11 +183,12 @@ public class DeviceLibraryController {
}
@ApiOperation
(
value
=
"查询检查装备列表"
,
notes
=
"可以通过这个接口查询装备列表"
)
@
Ge
tMapping
(
"/selectCheckDeviceList"
)
public
ResponseEntity
selectDeviceList
()
{
@
Pos
tMapping
(
"/selectCheckDeviceList"
)
public
ResponseEntity
selectDeviceList
(
@RequestBody
SelfCheckVo
selfCheckVo
)
{
String
unit
=
userUtils
.
getCurrentUserUnitName
();
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
Specifications
.
and
();
predicateBuilder
.
eq
(
"ownUnit"
,
unit
);
predicateBuilder
.
eq
(
selfCheckVo
.
getStorageLocationId
()!=
null
,
"storageLocationId"
,
selfCheckVo
.
getStorageLocationId
());
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
findAll
(
predicateBuilder
.
build
());
deviceLibraries
.
forEach
(
DeviceLibrary:
:
setConfigName
);
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraries
.
stream
()
...
...
@@ -456,6 +457,7 @@ public class DeviceLibraryController {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getList
(
deviceLibrarySelectVo
);
map
.
put
(
"resultList"
,
resultList
);
// List<DeviceLibrary> resultList = new ArrayList<>();
// resultList = deviceLibraryService.getAlldevList(deviceLibrarySelectVo);
// List<DeviceLibrary> resultList = deviceLibraryService.getList(deviceLibrarySelectVo);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/SelfCheckVo.java
0 → 100644
浏览文件 @
74f70dc9
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author zsp
* @create 2021/11/23 14:37
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"自查装备的vo"
)
public
class
SelfCheckVo
{
@ApiModelProperty
(
value
=
"库存位置的id"
)
private
Integer
storageLocationId
;
}
dev-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
74f70dc9
...
...
@@ -122,7 +122,9 @@ public class MatchingDeviceController {
//当手动输入序列号的时候 需要进行遍历成集合
matchingDeviceSaveVos
.
forEach
(
matchingDeviceSaveVo
->
{
// List<String> deviceSeqs = DeviceSeqUtil.createDeviceSeqs(matchingDeviceSaveVo.getSeqNumber(), matchingDeviceSaveVo.getStorageCount());
List
<
String
>
deviceSeqs
=
DeviceSeqUtil
.
getIntervalSeqsForMatchingDevice
(
matchingDeviceSaveVo
.
getSeqNumber
());
// List<String> deviceSeqs = DeviceSeqUtil.getIntervalSeqsForMatchingDevice(matchingDeviceSaveVo.getSeqNumber());
List
<
String
>
deviceSeqs
=
DeviceSeqUtil
.
selectDeviceSeqsForMatchingDevice
(
matchingDeviceSaveVo
.
getSeqNumber
());
// List<String> deviceSeqs = DeviceSeqUtil.selectDeviceSeqs(matchingDeviceSaveVo.getSeqNumber());
matchingDeviceSaveVo
.
setSeqList
(
deviceSeqs
);
});
//做校验 数量跟序列号
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/DeviceSeqUtil.java
浏览文件 @
74f70dc9
...
...
@@ -221,6 +221,49 @@ public class DeviceSeqUtil {
return
seqs
;
}
public
static
List
<
String
>
selectDeviceSeqsForMatchingDevice
(
String
s
){
List
<
String
>
seqs
=
new
ArrayList
<>();
if
(
s
!=
null
&&
s
.
length
()>
0
)
{
//按,分隔多个区间
String
[]
strings
=
s
.
split
(
","
);
if
(
strings
.
length
==
1
){
if
(
isSingle
(
strings
[
0
]))
{
String
num1
=
strings
[
0
].
replaceAll
(
".*[^\\d](?=(\\d+))"
,
""
);
if
(
num1
.
equals
(
strings
[
0
])){
seqs
.
add
(
num1
);
return
seqs
;
}
BigInteger
minSeq
=
new
BigInteger
(
num1
);
for
(
int
i
=
0
;
i
<
1
;
i
++)
{
StringBuffer
stringBuffer
=
new
StringBuffer
();
//拼接数字之前的字符串
stringBuffer
.
append
(
s
,
0
,
s
.
length
()
-
num1
.
length
());
//将数字按长度格式化,缺位补0
String
codeFormat
=
"%0"
+
num1
.
length
()
+
"d"
;
stringBuffer
.
append
(
String
.
format
(
codeFormat
,
minSeq
));
seqs
.
add
(
stringBuffer
.
toString
());
minSeq
=
minSeq
.
add
(
new
BigInteger
(
"1"
));
}
}
else
{
seqs
.
addAll
(
getIntervalSeqsForMatchingDevice
(
strings
[
0
]));
}
}
else
{
for
(
String
str
:
strings
)
{
if
(
str
.
length
()
>
0
)
{
if
(
isSingle
(
str
))
{
seqs
.
add
(
str
);
}
else
{
seqs
.
addAll
(
getIntervalSeqsForMatchingDevice
(
str
));
}
}
}
}
}
return
seqs
;
}
/**
* @param s 区间字符串
* 判断是单个序列号还是序列号区间,若是单个序列号返回true,否则返回false
...
...
@@ -292,6 +335,12 @@ public class DeviceSeqUtil {
List
<
String
>
stringList
=
new
ArrayList
<>();
//根据-分隔
String
[]
strings
=
s
.
split
(
"-"
);
//先判断是不是区间
//1.是否有多个-
int
count
=
getCount
(
s
);
if
(
count
>
1
){
throw
new
ApiException
(
"序列号区间包含多个-,或者输入不是序列号区间"
);
}
if
(
strings
.
length
==
2
){
//左区间字符串
String
s1
=
strings
[
0
];
...
...
@@ -302,9 +351,18 @@ public class DeviceSeqUtil {
// }
// else {
//获得左区间最后几位的数字
//2.区间如果含有字母 判断区间前后字母是否一样
String
num1
=
s1
.
replaceAll
(
".*[^\\d](?=(\\d+))"
,
""
);
//获取索引 然后截取
int
i
=
s1
.
indexOf
(
num1
);
String
substring1
=
s1
.
substring
(
0
,
i
);
//获得右区间最后几位的数字
String
num2
=
s2
.
replaceAll
(
".*[^\\d](?=(\\d+))"
,
""
);
int
i2
=
s2
.
indexOf
(
num2
);
String
substring2
=
s2
.
substring
(
0
,
i2
);
if
(!
substring1
.
equals
(
substring2
)){
throw
new
ApiException
(
"输入的序列号区间有误"
);
}
// if (num1.length() != num2.length()){
//// throw new ApiException("序列号区间后面数字位数不相同");
// }
...
...
@@ -334,7 +392,9 @@ public class DeviceSeqUtil {
}
// }
else
{
throw
new
ApiException
(
"序列号区间包含多个-,或者输入不是序列号区间"
);
// throw new ApiException("序列号区间包含多个-,或者输入不是序列号区间");
stringList
.
add
(
s
);
return
stringList
;
}
return
stringList
;
}
...
...
@@ -488,4 +548,16 @@ public class DeviceSeqUtil {
return
s
.
substring
(
0
,
s
.
length
()-
s1
.
length
());
}
private
static
int
getCount
(
String
s
){
char
searchChar
=
'-'
;
int
count
=
0
;
char
[]
charArray
=
s
.
toCharArray
();
for
(
char
item
:
charArray
)
{
if
(
item
==
searchChar
)
{
count
++;
}
}
return
count
;
}
}
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
74f70dc9
...
...
@@ -320,7 +320,9 @@ public class PackingController {
@PostMapping
(
"/clean"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
clean
(
@RequestBody
List
<
Integer
>
ids
){
packingLibraryService
.
cleanAll
(
ids
);
if
(!
ids
.
isEmpty
()){
packingLibraryService
.
cleanAll
(
ids
);
}
return
ResponseEntity
.
ok
(
"删除成功"
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论