Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
48376a10
提交
48376a10
authored
10月 22, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备申请,装备入库,缓存): 新增了一个申请的业务状态,入库将装备从试用改为正式,缓存维护
新增了一个申请的业务状态,入库将装备从试用改为正式,缓存维护
上级
57a8a597
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
332 行增加
和
61 行删除
+332
-61
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+146
-11
DeviceApplyBill.java
.../tykj/dev/device/apply/subject/domin/DeviceApplyBill.java
+1
-1
ApplyBillDetailVo.java
...m/tykj/dev/device/apply/subject/vo/ApplyBillDetailVo.java
+11
-1
ApplyTaskToEnd.java
.../com/tykj/dev/device/apply/subject/vo/ApplyTaskToEnd.java
+28
-0
ApplyTryVo.java
...java/com/tykj/dev/device/apply/subject/vo/ApplyTryVo.java
+28
-0
DeviceApplySaveVo.java
...m/tykj/dev/device/apply/subject/vo/DeviceApplySaveVo.java
+3
-0
DevideTask.java
...ain/java/com/tykj/dev/device/library/task/DevideTask.java
+29
-29
StatusEnum.java
...misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
+6
-0
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+15
-8
PackingLibrary.java
...tykj/dev/device/packing/subject/domin/PackingLibrary.java
+4
-0
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+38
-1
StorageBillSaveVo.java
...tykj/dev/device/storage/subject/vo/StorageBillSaveVo.java
+2
-0
TaskSelectController.java
...ev/device/taskselect/controller/TaskSelectController.java
+21
-10
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
48376a10
...
...
@@ -45,12 +45,15 @@ import lombok.extern.slf4j.Slf4j;
import
org.modelmapper.ModelMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.concurrent.Executor
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
groupingBy
;
...
...
@@ -114,6 +117,10 @@ public class DeviceApplyController {
@Autowired
private
PackingController
packingController
;
@Autowired
@Qualifier
(
"taskExecutor"
)
private
Executor
executor
;
// @Autowired
// private DeviceLibraryDao deviceLibraryDao;
...
...
@@ -133,6 +140,7 @@ public class DeviceApplyController {
}
//添加申请单
// DeviceApplyBill deviceApplyBillEntity = deviceApplyBillService.addEntity(deviceApplySaveVo.toDo());
DeviceApplyBill
deviceApplyBillEntity
=
deviceApplyBillService
.
addEntity
(
toDo
(
deviceApplySaveVo
));
Integer
userId
=
userUtils
.
getCurrentUserId
();
...
...
@@ -461,16 +469,34 @@ public class DeviceApplyController {
}
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.getSeqInterval());
ResponseEntity
responseEntity
=
packingController
.
seqsNotExist
(
a
.
getPackingId
(),
a
.
getWaitNum
()-
a
.
getCompleteCount
(),
a
.
getSeqInterval
());
if
(!
"ok"
.
equals
(
responseEntity
.
getBody
()))
{
return
responseEntity
;
}
}
}
taskService
.
moveToNext
(
taskBto
);
//判断是入库还是显示业务待办结
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
if
(
uploadApplyFile
.
getApplyBillDetailVos
()
!=
null
&&
uploadApplyFile
.
getApplyBillDetailVos
().
size
()
>
0
){
boolean
b
=
uploadApplyFile
.
getApplyBillDetailVos
().
stream
()
.
allMatch
(
applyBillDetailVo
->
applyBillDetailVo
.
getReplyNum
()
-
applyBillDetailVo
.
getSelectApplyNum
()
==
0
);
if
(
b
){
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
WAITAPPLYTASKTOEND
);
deviceApplyBill
.
setApplyStatus
(
6
);
}
else
{
taskService
.
moveToNext
(
taskBto
);
deviceApplyBill
.
setApplyStatus
(
4
);
}
}
// taskService.moveToNext(taskBto);
// DeviceApplyBill deviceApplyBill = deviceApplyBillService.getOne(taskBto.getBillId());
// deviceApplyBill.setApplyStatus(4);
deviceApplyBill
.
setBackFiles
(
FilesUtil
.
stringFileToList
(
uploadApplyFile
.
getBackFiles
()));
if
(
uploadApplyFile
.
getReplyVos
()
!=
null
&&
uploadApplyFile
.
getReplyVos
().
size
()
>
0
)
{
deviceApplyBill
.
setReplyVos
(
JacksonUtil
.
toJSon
(
uploadApplyFile
.
getReplyVos
()));
...
...
@@ -482,6 +508,11 @@ public class DeviceApplyController {
deviceApplyBill
.
setReplyFiles
(
FilesUtil
.
stringFileToList
(
uploadApplyFile
.
getReplyFiles
()));
}
if
(
uploadApplyFile
.
getApplyBillDetailVos
()
!=
null
&&
uploadApplyFile
.
getApplyBillDetailVos
().
size
()
>
0
)
{
//自己算可入库数量
uploadApplyFile
.
getApplyBillDetailVos
().
forEach
(
applyBillDetailVo
->
{
applyBillDetailVo
.
setWaitNum
(
applyBillDetailVo
.
getReplyNum
()-
applyBillDetailVo
.
getSelectApplyNum
());
});
deviceApplyBill
.
setApplyStat
(
JacksonUtil
.
toJSon
(
uploadApplyFile
.
getApplyBillDetailVos
()));
}
//add
...
...
@@ -655,6 +686,39 @@ public class DeviceApplyController {
return
ResponseEntity
.
ok
(
deviceLibraries
);
}
@ApiOperation
(
value
=
"申请任务完结"
,
notes
=
"从业务待办结推到申请任务完结"
)
@PostMapping
(
"/applyTaskToEnd"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
applyTaskToEnd
(
@RequestBody
ApplyTaskToEnd
applyTaskToEnd
)
{
Integer
taskId
=
applyTaskToEnd
.
getTaskId
();
List
<
Integer
>
deviceIds
=
applyTaskToEnd
.
getDeviceIds
();
//更新装备
deviceLibraryService
.
updateTry
(
deviceLibraryService
.
findByIds
(
deviceIds
));
//添加装备日志
List
<
DeviceLogDto
>
deviceLogDtoList
=
new
ArrayList
<>();
deviceIds
.
forEach
(
integer
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"装备从试用修改为正式"
,
null
);
deviceLogDtoList
.
add
(
deviceLogDto
);
});
executor
.
execute
(()->{
deviceLogService
.
addAllLog
(
deviceLogDtoList
);
});
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
deviceApplyBill
.
setApplyStatus
(
4
);
deviceApplyBillService
.
update
(
deviceApplyBill
);
//发送阅知信息
MessageBto
messageBto
=
new
MessageBto
();
messageBto
.
setContent
(
"申请任务已办结"
);
messageBto
.
setTaskId
(
taskBto
.
getId
());
messageBto
.
setIsHighLight
(
0
);
messageBto
.
setInvolveUserIdList
(
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
()));
messageBto
.
setBusinessType
(
taskBto
.
getBusinessType
());
messageService
.
add
(
messageBto
);
taskService
.
moveToEnd
(
taskBto
);
return
ResponseEntity
.
ok
(
"申请任务完成"
);
}
/**
* 转实体
...
...
@@ -673,22 +737,29 @@ public class DeviceApplyController {
ApplyBillDetailVo:
:
getChilds
,
ApplyBillDetailVo:
:
setChildNull
);
//拼接列装id和申请数量字符串
//选择试用装备数量
List
<
ApplyTryVo
>
applyTryVos
=
deviceApplySaveVo
.
getApplyTryVos
();
Map
<
Integer
,
ApplyTryVo
>
tryVoMap
=
applyTryVos
.
stream
().
collect
(
Collectors
.
toMap
(
ApplyTryVo:
:
getPackingId
,
Function
.
identity
()));
for
(
ApplyBillDetailVo
s
:
applyBillDetailVos
)
{
stringBuffer
.
append
(
s
.
getPackingId
()).
append
(
"x"
);
//遍历集合 List<ApplyTryVo> applyTryVos;
//zsp
Integer
packingId
=
s
.
getPackingId
();
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryService
.
findAllByPackingId
(
packingId
);
deviceLibraries
=
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getTryOutDevice
()
==
1
)
.
collect
(
Collectors
.
toList
());
if
(
deviceLibraries
.
size
()>
0
){
s
.
setCompleteCount
(
deviceLibraries
.
size
()
+
s
.
getCompleteCount
())
;
}
if
(
s
.
getStorageCount
()!=
null
)
{
s
.
setCompleteCount
(
s
.
getCompleteCount
());
if
(
s
.
getStorageCount
()
!=
null
)
{
stringBuffer
.
append
(
s
.
getStorageCount
()).
append
(
"x"
);
}
else
{
}
else
{
stringBuffer
.
append
(
0
).
append
(
"x"
);
}
if
(
tryVoMap
.
containsKey
(
packingId
)){
s
.
setSelectApplyNum
(
tryVoMap
.
get
(
packingId
).
getDeviceIds
().
size
());
s
.
setDeviceIds
(
tryVoMap
.
get
(
packingId
).
getDeviceIds
());
}
else
{
s
.
setSelectApplyNum
(
0
);
s
.
setDeviceIds
(
null
);
}
}
//转为json存储
deviceApplyBillEntity
.
setApplyStat
(
JacksonUtil
.
toJSon
(
applyBillDetailVos
));
...
...
@@ -720,4 +791,68 @@ public class DeviceApplyController {
}
return
deviceApplyBillEntity
;
}
// public DeviceApplyBill toDo(DeviceApplySaveVo deviceApplySaveVo) {
// ModelMapper mapper = BeanHelper.getUserMapper();
// DeviceApplyBill deviceApplyBillEntity = mapper.map(deviceApplySaveVo, DeviceApplyBill.class);
// deviceApplyBillEntity.setApplyStatus(0);
// StringBuffer stringBuffer = new StringBuffer();
// stringBuffer.append("x");
// //申请详情
// if (deviceApplySaveVo.getStorageBillDetailVoList()!=null&&deviceApplySaveVo.getStorageBillDetailVoList().size() > 0) {
// //分解父子结构
// List<ApplyBillDetailVo> applyBillDetailVos = GetTreeUtils.splitTree(
// deviceApplySaveVo.getStorageBillDetailVoList(),
// ApplyBillDetailVo::getChilds,
// ApplyBillDetailVo::setChildNull);
// //拼接列装id和申请数量字符串
// for (ApplyBillDetailVo s : applyBillDetailVos) {
// stringBuffer.append(s.getPackingId()).append("x");
// //zsp
// Integer packingId = s.getPackingId();
// List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(packingId);
// deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> deviceLibrary.getTryOutDevice() == 1)
// .collect(Collectors.toList());
// if (deviceLibraries.size()>0){
// s.setCompleteCount(deviceLibraries.size() + s.getCompleteCount()) ;
// }
// if (s.getStorageCount()!=null) {
// stringBuffer.append(s.getStorageCount()).append("x");
// }
// else {
// stringBuffer.append(0).append("x");
// }
// }
// //转为json存储
// deviceApplyBillEntity.setApplyStat(JacksonUtil.toJSon(applyBillDetailVos));
// //如果不是装备申请,添加replyVo
// if (deviceApplySaveVo.getApplyType()!=1){
// List<ReplyVo> replyVos = new ArrayList<>();
// for (ApplyBillDetailVo applyBillDetailVo : applyBillDetailVos){
// ReplyVo replyVo = new ReplyVo();
// replyVo.setId(applyBillDetailVo.getPackingId());
// replyVo.setNum(applyBillDetailVo.getStorageCount());
// replyVo.setSeqInterval(applyBillDetailVo.getSeqInterval());
// replyVos.add(replyVo);
// }
// //转为json存储
// deviceApplyBillEntity.setReplyVos(JacksonUtil.toJSon(replyVos));
// }
// }
// //set组合字符串
// deviceApplyBillEntity.setApplyDetail(stringBuffer.toString());
// //单据转换
// if(deviceApplySaveVo.getApplyFiles()!=null&&deviceApplySaveVo.getApplyFiles().size()>0){
// deviceApplyBillEntity.setApplyFiles(FilesUtil.stringFileToList(deviceApplySaveVo.getApplyFiles()));
// }
// if(deviceApplySaveVo.getApplyNumFiles()!=null&&deviceApplySaveVo.getApplyNumFiles().size()>0){
// deviceApplyBillEntity.setApplyNumFiles(FilesUtil.stringFileToList(deviceApplySaveVo.getApplyNumFiles()));
// }
// if(deviceApplySaveVo.getReplyFiles()!=null&&deviceApplySaveVo.getReplyFiles().size()>0){
// deviceApplyBillEntity.setReplyFiles(FilesUtil.stringFileToList(deviceApplySaveVo.getReplyFiles()));
// }
// return deviceApplyBillEntity;
// }
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/domin/DeviceApplyBill.java
浏览文件 @
48376a10
...
...
@@ -88,7 +88,7 @@ public class DeviceApplyBill {
/**
* 申请状态(0:申请待审核,1:申请审核失败,2:申请中,3:已批复待审核,4:批复审核失败,5:申请成功)
*/
@ApiModelProperty
(
value
=
"申请状态(0:申请待审核,1:申请审核失败,2:申请完结,3:等待中办批复,4:批复后待执行)"
)
@ApiModelProperty
(
value
=
"申请状态(0:申请待审核,1:申请审核失败,2:申请完结,3:等待中办批复,4:批复后待执行
,6:业务待完结
)"
)
private
Integer
applyStatus
;
/**
* 列装库主键idx数量(,作为分隔符),例如1x2,2x3,意为列装库id为1的申请2件,id为2的申请3件
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/ApplyBillDetailVo.java
浏览文件 @
48376a10
...
...
@@ -27,12 +27,22 @@ public class ApplyBillDetailVo {
@ApiModelProperty
(
value
=
"申请数量"
)
private
Integer
storageCount
;
@ApiModelProperty
(
value
=
"
批复
数量"
)
@ApiModelProperty
(
value
=
"
可入库
数量"
)
private
Integer
waitNum
;
@ApiModelProperty
(
value
=
"已入库数量"
)
private
Integer
completeCount
=
0
;
@ApiModelProperty
(
value
=
"批复数量"
)
private
Integer
replyNum
;
@ApiModelProperty
(
value
=
"已选中申请数量"
)
private
Integer
selectApplyNum
;
@ApiModelProperty
(
value
=
"装备id"
)
private
List
<
Integer
>
deviceIds
;
@ApiModelProperty
(
value
=
"序列号区间"
,
example
=
"1"
)
private
String
seqInterval
;
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/ApplyTaskToEnd.java
0 → 100644
浏览文件 @
48376a10
package
com
.
tykj
.
dev
.
device
.
apply
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zsp
*/
@Data
@ApiModel
(
"业务待办结vo"
)
@AllArgsConstructor
@NoArgsConstructor
public
class
ApplyTaskToEnd
{
@ApiModelProperty
(
value
=
"任务id"
)
private
Integer
taskId
;
@ApiModelProperty
(
value
=
"装备id的集合"
)
private
List
<
Integer
>
deviceIds
;
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/ApplyTryVo.java
0 → 100644
浏览文件 @
48376a10
package
com
.
tykj
.
dev
.
device
.
apply
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zsp
*/
@Data
@ApiModel
(
"选择试用装备详情类"
)
@AllArgsConstructor
@NoArgsConstructor
public
class
ApplyTryVo
{
@ApiModelProperty
(
value
=
"列装id"
)
private
Integer
packingId
;
@ApiModelProperty
(
value
=
"装备id的集合"
)
private
List
<
Integer
>
deviceIds
;
}
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/DeviceApplySaveVo.java
浏览文件 @
48376a10
...
...
@@ -71,6 +71,9 @@ public class DeviceApplySaveVo {
@ApiModelProperty
(
value
=
"申请类型(1:装备申请,2:退役申请,3:报废申请,4:销毁申请)"
)
private
Integer
applyType
;
@ApiModelProperty
(
value
=
"选择试用装备详情类"
)
private
List
<
ApplyTryVo
>
applyTryVos
;
/**
* 转实体
...
...
dev-library/src/main/java/com/tykj/dev/device/library/task/DevideTask.java
浏览文件 @
48376a10
package
com
.
tykj
.
dev
.
device
.
library
.
task
;
import
com.tykj.dev.device.library.service.DeviceLibraryCacheService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
/**
* @author zjm
* @version 1.0.0
* @ClassName TrainTask.java
* @Description 培训定时任务 主要是 判断报名截止以及培训开始、培训结束
* @createTime 2020年08月17日 23:20:00
*/
@Service
@Slf4j
public
class
DevideTask
{
@Autowired
DeviceLibraryCacheService
deviceLibraryCacheService
;
@Scheduled
(
cron
=
"30 * * * * ? "
)
private
void
signUpDeadline
()
{
log
.
info
(
"定时device更新缓存开始"
);
deviceLibraryCacheService
.
deletAllDeviceLibraryList
();
deviceLibraryCacheService
.
getAllDeviceLibraryList
();
log
.
info
(
"定时device更新缓存结束"
);
}
}
//
package com.tykj.dev.device.library.task;
//
//
import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
//
import lombok.extern.slf4j.Slf4j;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.scheduling.annotation.Scheduled;
//
import org.springframework.stereotype.Service;
//
/
//
**
//
* @author zjm
//
* @version 1.0.0
//
* @ClassName TrainTask.java
//
* @Description 培训定时任务 主要是 判断报名截止以及培训开始、培训结束
//
* @createTime 2020年08月17日 23:20:00
//
*/
//
@Service
//
@Slf4j
//
public class DevideTask {
//
@Autowired
//
DeviceLibraryCacheService deviceLibraryCacheService;
//
//
@Scheduled(cron = "30 * * * * ? ")
//
private void signUpDeadline() {
//
log.info("定时device更新缓存开始");
//
deviceLibraryCacheService.deletAllDeviceLibraryList();
//
deviceLibraryCacheService.getAllDeviceLibraryList();
//
log.info("定时device更新缓存结束");
//
}
//
}
dev-misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
浏览文件 @
48376a10
...
...
@@ -252,6 +252,12 @@ public enum StatusEnum {
*/
WAIT_CONFIRM_APPLY_DEVICE
(
511
,
"批复完成待执行"
),
/**
* 业务待办结
*/
WAITAPPLYTASKTOEND
(
512
,
"申请任务待办结"
),
// /**
// * 等待上传申请回执单
// */
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
48376a10
...
...
@@ -458,7 +458,8 @@ public class PackingController {
@ApiOperation
(
value
=
"判断序列号区间是否存在"
)
@PostMapping
(
"/seqsExist/{id}/{num}/{seq}"
)
public
ResponseEntity
seqsExist
(
@PathVariable
(
"id"
)
int
id
,
@PathVariable
(
"num"
)
int
num
,
@PathVariable
(
"seq"
)
String
seq
){
List
<
DeviceLibrary
>
deviceLibraries
=
packingLibraryService
.
getAllDevSeqs
(
id
);
// List<DeviceLibrary> deviceLibraries = packingLibraryService.getAllDevSeqs(id);
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryCacheService
.
getAllDeviceLibraryList
();
List
<
String
>
existSeqs
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
());
List
<
String
>
inputSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seq
);
List
<
String
>
hasApplySeqs
=
deviceLibraries
.
stream
()
...
...
@@ -468,6 +469,9 @@ public class PackingController {
if
(
inputSeqs
.
size
()!=
num
){
return
ResponseEntity
.
ok
(
"序列号区间总数为"
+
inputSeqs
.
size
()+
",与装备数量不匹配"
);
}
// if (inputSeqs.size()>num){
// return ResponseEntity.ok("序列号区间总数为"+inputSeqs.size()+",与装备数量不匹配");
// }
else
{
Set
<
String
>
seqSet
=
new
HashSet
<>(
inputSeqs
);
if
(
seqSet
.
size
()!=
inputSeqs
.
size
()){
...
...
@@ -511,7 +515,10 @@ public class PackingController {
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryCacheService
.
getAllDeviceLibraryList
();
List
<
String
>
existSeqs
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
());
List
<
String
>
inputSeqs
=
DeviceSeqUtil
.
selectDeviceSeqs
(
seq
);
if
(
inputSeqs
.
size
()>
0
&&
inputSeqs
.
size
()!=
num
){
// if (inputSeqs.size()>0&&inputSeqs.size()!=num){
// return ResponseEntity.ok("序列号区间总数为"+inputSeqs.size()+",与装备数量不匹配");
// }
if
(
inputSeqs
.
size
()>
0
&&
inputSeqs
.
size
()>
num
){
return
ResponseEntity
.
ok
(
"序列号区间总数为"
+
inputSeqs
.
size
()+
",与装备数量不匹配"
);
}
else
{
...
...
@@ -979,14 +986,14 @@ public class PackingController {
//进行过滤 退装的目录下面 回收站
// List<Integer> statuses = new ArrayList<>(Arrays.asList(3, 4));
//先过滤出child为空的
List
<
PackingLibrary
>
childs
=
resultList
.
stream
()
.
filter
(
packingLibrary
->
(
packingLibrary
.
getChilds
()
==
null
||
packingLibrary
.
getChilds
().
size
()
==
0
)
&&
packingLibrary
.
getIsRoot
()
==
1
)
.
collect
(
Collectors
.
toList
());
//
List<PackingLibrary> childs = resultList.stream()
//
.filter(packingLibrary -> (packingLibrary.getChilds() == null || packingLibrary.getChilds().size() == 0)
// && packingLibrary.getIsRoot() == 1
)
//
.collect(Collectors.toList());
//取出不为空的
List
<
Integer
>
ids
=
childs
.
stream
().
map
(
PackingLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
//
List<Integer> ids = childs.stream().map(PackingLibrary::getId).collect(Collectors.toList());
// resultList.removeAll(childs);
resultList
=
resultList
.
stream
().
filter
(
packingLibrary
->
!
ids
.
contains
(
packingLibrary
.
getId
())).
collect
(
Collectors
.
toList
());
//
resultList = resultList.stream().filter(packingLibrary -> !ids.contains(packingLibrary.getId())).collect(Collectors.toList());
// childs.forEach(packingLibrary -> {
// List<PackingLibrary> in = packingLibraryDao.findAllByPartParentIdAndPackingStatusIn(
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/subject/domin/PackingLibrary.java
浏览文件 @
48376a10
...
...
@@ -283,6 +283,10 @@ public class PackingLibrary {
@ApiModelProperty
(
value
=
"装备的数量"
)
private
Integer
deviceNum
;
@Transient
@ApiModelProperty
(
value
=
"装备id的集合"
)
private
List
<
Integer
>
deviceIds
;
@Transient
@ApiModelProperty
(
value
=
"序号"
)
private
Integer
seqOrderNumber
;
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
48376a10
...
...
@@ -584,6 +584,7 @@ public class StorageBillController {
}
}
}
if
(
isEnd
)
{
TaskBto
taskBto1
=
taskService
.
get
(
deviceApplyBill
.
getId
(),
9
);
taskService
.
addInvolveUser
(
taskBto1
,
userUtils
.
getCurrentUserId
());
...
...
@@ -601,6 +602,7 @@ public class StorageBillController {
deviceApplyBillService
.
update
(
deviceApplyBill
);
});
}
deviceLogService
.
addAllLog
(
deviceLogDtos
);
//4.更新入库单入库详情
storageBillEntity
.
setStorageDetail
(
stringBuffer
.
toString
());
...
...
@@ -654,7 +656,21 @@ public class StorageBillController {
}
//完成更新试用修改为正式
if
(
storageBillSaveVo
.
getTryOutDevice
()
==
0
){
if
(
storageBillSaveVo
.
getTryOutDevice
()
==
0
){
if
(
storageBillSaveVo
.
getDeviceIds
().
size
()>
0
){
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryService
.
findByIds
(
storageBillSaveVo
.
getDeviceIds
());
if
(
deviceLibraries
.
size
()>
0
){
deviceLibraryService
.
updateTry
(
deviceLibraries
);
List
<
DeviceLogDto
>
deviceLogDtoList
=
new
ArrayList
<>();
storageBillSaveVo
.
getDeviceIds
().
forEach
(
integer
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"试用装备改为正式装备"
,
null
);
deviceLogDtoList
.
add
(
deviceLogDto
);
});
executor
.
execute
(()->{
deviceLogService
.
addAllLog
(
deviceLogDtoList
);
});
}
}
List
<
DeviceLibrarySaveVo
>
deviceLibrarySaveVoList
=
storageBillSaveVo
.
getDeviceLibrarySaveVoList
();
deviceLibrarySaveVoList
.
forEach
(
deviceLibrarySaveVo
->
{
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryService
.
findAllByPackingId
(
deviceLibrarySaveVo
.
getPackingId
());
...
...
@@ -663,9 +679,30 @@ public class StorageBillController {
if
(
deviceLibraries
.
size
()>
0
){
//将装备试用的改为正式的
deviceLibraryService
.
updateTry
(
deviceLibraries
);
List
<
DeviceLogDto
>
deviceLogDtoList
=
new
ArrayList
<>();
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
()).
forEach
(
integer
->
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
integer
,
"试用装备改为正式装备"
,
null
);
deviceLogDtoList
.
add
(
deviceLogDto
);
});
executor
.
execute
(()->{
deviceLogService
.
addAllLog
(
deviceLogDtoList
);
});
}
});
}
// 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
(
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/subject/vo/StorageBillSaveVo.java
浏览文件 @
48376a10
...
...
@@ -121,6 +121,8 @@ public class StorageBillSaveVo {
@ApiModelProperty
(
value
=
"是否是试用装备"
,
notes
=
"0 是正式 1 是测试"
)
private
Integer
tryOutDevice
=
0
;
@ApiModelProperty
(
value
=
"试用装备id的集合"
)
private
List
<
Integer
>
deviceIds
;
public
StorageBill
toDo
()
{
...
...
dev-taskselect/src/main/java/com/tykj/dev/device/taskselect/controller/TaskSelectController.java
浏览文件 @
48376a10
...
...
@@ -387,20 +387,27 @@ public class TaskSelectController {
}
}
}
if
(
packingIdList
.
size
()
==
numList
.
size
())
{
for
(
int
i
=
0
;
i
<
packingIdList
.
size
();
i
++)
{
PackingLibrary
p
=
packingLibraryService
.
getOne
(
packingIdList
.
get
(
i
));
ApplyBillDetailVo
applyBillDetailVo
=
applyBillDetailVoMap
.
get
(
packingIdList
.
get
(
i
));
//zsp 进行试用装备数量的显示 和序列号
//查询出所有的试用装备
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryService
.
findAllByPackingId
(
packingIdList
.
get
(
i
));
if
(
deviceLibraries
.
size
()>
0
){
deviceLibraries
=
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getTryOutDevice
()
==
1
)
.
collect
(
Collectors
.
toList
());
p
.
setDeviceSeqNumberList
(
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
()));
}
// deviceLibraryList.addAll(deviceLibraries);
// List<String> stringList = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
// List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(packingIdList.get(i));
// if (deviceLibraries.size()>0){
// deviceLibraries = deviceLibraries.stream().filter(deviceLibrary -> deviceLibrary.getTryOutDevice() == 1)
// .collect(Collectors.toList());
// p.setDeviceSeqNumberList(deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList()));
// }
//根据申请数量进行展示
if
(
applyBillDetailVo
.
getDeviceIds
()!=
null
){
List
<
DeviceLibrary
>
deviceLibraryList
=
deviceLibraryService
.
findByIds
(
applyBillDetailVo
.
getDeviceIds
());
if
(
deviceLibraryList
.
size
()>
0
){
p
.
setDeviceSeqNumberList
(
deviceLibraryList
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
)
.
collect
(
Collectors
.
toList
()));
}
}
//截止
if
(
deviceApplyBillEntity
.
getApplyType
()==
1
)
{
p
.
setApplyNum
(
numList
.
get
(
i
));
...
...
@@ -410,12 +417,16 @@ public class TaskSelectController {
if
(
applyBillDetailVo
.
getWaitNum
()
==
null
){
p
.
setWaitNum
(
null
);
}
else
{
//zsp
p
.
setReplyNum
(
applyBillDetailVo
.
getWaitNum
());
// //zsp
// p.setReplyNum(applyBillDetailVo.getWaitNum());
// p.setWaitNum(applyBillDetailVo.getWaitNum()-p.getCompleteNum());
// p.setWaitNum(applyBillDetailVo.getWaitNum()-applyBillDetailVo.getSelectApplyNum());
p
.
setWaitNum
(
applyBillDetailVo
.
getWaitNum
()-
p
.
getCompleteNum
());
}
// p.setWaitNum(applyBillDetailVo.getWaitNum()-p.getCompleteNum());
p
.
setSeq
(
statMap
.
get
(
p
.
getId
()).
getSeqInterval
());
p
.
setDeviceIds
(
applyBillDetailVo
.
getDeviceIds
());
p
.
setReplyNum
(
applyBillDetailVo
.
getReplyNum
());
}
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论