Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
c35c8e1c
提交
c35c8e1c
authored
10月 26, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备申请模块): 上传批复单,统一进行校验
上传批复单,统一进行校验
上级
f690c5c3
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
93 行增加
和
3 行删除
+93
-3
DeviceApplyBillService.java
...tykj/dev/device/apply/service/DeviceApplyBillService.java
+3
-0
DeviceApplyBillServiceImpl.java
...device/apply/service/impl/DeviceApplyBillServiceImpl.java
+54
-0
ApplyTaskDeviceCheckVo.java
...j/dev/device/apply/subject/vo/ApplyTaskDeviceCheckVo.java
+36
-0
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+0
-3
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/service/DeviceApplyBillService.java
浏览文件 @
c35c8e1c
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.apply.service;
...
@@ -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.domin.DeviceApplyBill
;
import
com.tykj.dev.device.apply.subject.vo.ApplyTaskDeviceCheckVo
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -28,4 +29,6 @@ public interface DeviceApplyBillService {
...
@@ -28,4 +29,6 @@ public interface DeviceApplyBillService {
*/
*/
void
updateCompleteNum
(
Integer
applyType
,
List
<
ScriptSaveVo
>
scriptSaveVos
);
void
updateCompleteNum
(
Integer
applyType
,
List
<
ScriptSaveVo
>
scriptSaveVos
);
List
<
StringBuffer
>
checkNumAndSeqNumber
(
List
<
ApplyTaskDeviceCheckVo
>
applyTaskDeviceCheckVos
);
}
}
dev-apply/src/main/java/com/tykj/dev/device/apply/service/impl/DeviceApplyBillServiceImpl.java
浏览文件 @
c35c8e1c
...
@@ -7,8 +7,11 @@ import com.tykj.dev.config.TaskBeanConfig;
...
@@ -7,8 +7,11 @@ import com.tykj.dev.config.TaskBeanConfig;
import
com.tykj.dev.device.apply.repository.DeviceApplyBillDao
;
import
com.tykj.dev.device.apply.repository.DeviceApplyBillDao
;
import
com.tykj.dev.device.apply.service.DeviceApplyBillService
;
import
com.tykj.dev.device.apply.service.DeviceApplyBillService
;
import
com.tykj.dev.device.apply.subject.domin.DeviceApplyBill
;
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.ReplyVo
;
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
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.impl.CacheLibraryServiceImpl
;
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.ScriptSaveVo
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.device.task.repository.TaskDao
;
import
com.tykj.dev.device.task.repository.TaskDao
;
...
@@ -63,6 +66,9 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
...
@@ -63,6 +66,9 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Autowired
@Autowired
private
UserUtils
userUtils
;
private
UserUtils
userUtils
;
@Autowired
private
DeviceLibraryCacheService
deviceLibraryCacheService
;
@Override
@Override
public
DeviceApplyBill
addEntity
(
DeviceApplyBill
deviceApplyBillEntity
)
{
public
DeviceApplyBill
addEntity
(
DeviceApplyBill
deviceApplyBillEntity
)
{
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillDao
.
save
(
deviceApplyBillEntity
);
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillDao
.
save
(
deviceApplyBillEntity
);
...
@@ -202,4 +208,52 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
...
@@ -202,4 +208,52 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
}
}
}
}
}
}
@Override
public
List
<
StringBuffer
>
checkNumAndSeqNumber
(
List
<
ApplyTaskDeviceCheckVo
>
applyTaskDeviceCheckVos
)
{
List
<
StringBuffer
>
stringBufferList
=
new
ArrayList
<>();
applyTaskDeviceCheckVos
.
forEach
(
applyTaskDeviceCheckVo
->
{
StringBuffer
stringBuffer
=
new
StringBuffer
();
//先判断数量是否一致
//入库数量
Integer
storageCount
=
applyTaskDeviceCheckVo
.
getStorageCount
();
//批复数量
Integer
replyNum
=
applyTaskDeviceCheckVo
.
getReplyNum
();
//试用装备数量
Integer
tryOutNum
=
applyTaskDeviceCheckVo
.
getTryOutNum
();
stringBuffer
.
append
(
"序号为"
).
append
(
applyTaskDeviceCheckVo
.
getI
()+
1
).
append
(
":"
);
if
(
replyNum
<
tryOutNum
){
//提示 批复数量不能小于试用数量
stringBuffer
.
append
(
"批复数量不能小于试用数量"
).
append
(
","
);
}
if
(
replyNum
>
storageCount
){
//提示 批复数量不能大于申请数量
stringBuffer
.
append
(
"批复数量不能大于申请数量"
).
append
(
","
);
}
//获取序列号区间
String
seqNumInter
=
applyTaskDeviceCheckVo
.
getSeqNumInter
();
if
(
seqNumInter
!=
null
){
//然后进行拆分
//输入序列号的区间
List
<
String
>
inputSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seqNumInter
);
if
(!
replyNum
.
equals
(
inputSeqs
.
size
())){
//提示 批复数量跟输入区间不一致
stringBuffer
.
append
(
"批复数量与序列号区间不一致"
).
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
);
});
return
stringBufferList
;
}
}
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/ApplyTaskDeviceCheckVo.java
0 → 100644
浏览文件 @
c35c8e1c
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
ApplyTaskDeviceCheckVo
{
@ApiModelProperty
(
value
=
"序列号"
)
private
Integer
i
;
@ApiModelProperty
(
value
=
"申请数量"
)
private
Integer
storageCount
;
@ApiModelProperty
(
value
=
"试用数量"
)
private
Integer
tryOutNum
;
@ApiModelProperty
(
value
=
"批复数量"
)
private
Integer
replyNum
;
@ApiModelProperty
(
value
=
"序列号区间"
)
private
String
seqNumInter
;
}
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
c35c8e1c
...
@@ -469,9 +469,6 @@ public class PackingController {
...
@@ -469,9 +469,6 @@ public class PackingController {
if
(
inputSeqs
.
size
()!=
num
){
if
(
inputSeqs
.
size
()!=
num
){
return
ResponseEntity
.
ok
(
"序列号区间总数为"
+
inputSeqs
.
size
()+
",与装备数量不匹配"
);
return
ResponseEntity
.
ok
(
"序列号区间总数为"
+
inputSeqs
.
size
()+
",与装备数量不匹配"
);
}
}
// if (inputSeqs.size()>num){
// return ResponseEntity.ok("序列号区间总数为"+inputSeqs.size()+",与装备数量不匹配");
// }
else
{
else
{
Set
<
String
>
seqSet
=
new
HashSet
<>(
inputSeqs
);
Set
<
String
>
seqSet
=
new
HashSet
<>(
inputSeqs
);
if
(
seqSet
.
size
()!=
inputSeqs
.
size
()){
if
(
seqSet
.
size
()!=
inputSeqs
.
size
()){
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论