Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
c13c58d5
提交
c13c58d5
authored
3月 16, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
920d18a9
全部展开
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
151 行增加
和
7 行删除
+151
-7
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+14
-0
AllotBillSelectController.java
...ev/device/allot/controller/AllotBillSelectController.java
+2
-0
AllotBillSaveVo.java
...com/tykj/dev/device/allot/subject/vo/AllotBillSaveVo.java
+1
-1
AllotType.java
...fig/src/main/java/com/tykj/dev/config/base/AllotType.java
+35
-0
ConfigCache.java
.../src/main/java/com/tykj/dev/config/cache/ConfigCache.java
+8
-0
SystemConfigRun.java
...c/main/java/com/tykj/dev/config/task/SystemConfigRun.java
+3
-0
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+0
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+4
-5
DeviceLibrary.java
.../tykj/dev/device/library/subject/domin/DeviceLibrary.java
+8
-0
DeviceLibrarySaveVo.java
...kj/dev/device/library/subject/vo/DeviceLibrarySaveVo.java
+3
-0
DeviceVo.java
...java/com/tykj/dev/device/library/subject/vo/DeviceVo.java
+4
-0
Script.java
...n/java/com/tykj/dev/device/library/subject/vo/Script.java
+4
-0
ScriptSaveVo.java
.../com/tykj/dev/device/library/subject/vo/ScriptSaveVo.java
+3
-0
CustomPage.java
...misc/src/main/java/com/tykj/dev/misc/base/CustomPage.java
+1
-1
PageUtil.java
dev-misc/src/main/java/com/tykj/dev/misc/utils/PageUtil.java
+9
-0
PackingLibraryController.java
...v/device/packing/controller/PackingLibraryController.java
+6
-0
PackingLibraryService.java
...ykj/dev/device/packing/service/PackingLibraryService.java
+2
-0
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+44
-0
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
c13c58d5
package
com
.
tykj
.
dev
.
device
.
allot
.
controller
;
import
com.tykj.dev.config.cache.ConfigCache
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.allot.service.AllotBackBillService
;
import
com.tykj.dev.device.allot.service.AllotBillService
;
...
...
@@ -105,6 +106,9 @@ public class AllotBillController {
@Autowired
private
UserPublicService
userService
;
@Autowired
private
ConfigCache
configCache
;
@ApiOperation
(
value
=
"导入二维码获取配发装备"
,
notes
=
"可以通过这个接口导入二维码获取配发装备"
)
@PostMapping
(
value
=
"/load"
)
public
ResponseEntity
loadDevice
(
@RequestBody
RfidVo
rfidVo
)
{
...
...
@@ -197,10 +201,20 @@ public class AllotBillController {
//改变装备状态
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
id
);
if
(
allotBillSaveVo
.
getAllotType
()
==
2
){
if
(
deviceLibraryEntity
.
getAllotType
()!=
2
){
deviceLibraryEntity
.
setAllotType
(
2
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"将配发类型由"
+
deviceLibraryEntity
.
getAllotTypeName
()
+
"改为"
+
configCache
.
getAllotTypeMap
().
get
(
2
),
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
deviceLibraryEntity
.
setLifeStatus
(
3
);
deviceLibraryEntity
.
setManageStatus
(
0
);
}
else
{
if
(
deviceLibraryEntity
.
getAllotType
()!=
1
){
deviceLibraryEntity
.
setAllotType
(
1
);
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
id
,
"将配发类型由"
+
deviceLibraryEntity
.
getAllotTypeName
()
+
"改为"
+
configCache
.
getAllotTypeMap
().
get
(
1
),
fileVoList
);
deviceLogService
.
addLog
(
deviceLogDto
);
}
deviceLibraryEntity
.
setLocationUnit
(
allotBillSaveVo
.
getReceiveUnit
());
deviceLibraryEntity
.
setOwnUnit
(
allotBillSaveVo
.
getReceiveUnit
());
}
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillSelectController.java
浏览文件 @
c13c58d5
...
...
@@ -81,6 +81,7 @@ public class AllotBillSelectController {
}
allotBillEntity
.
setSendFileList
(
FilesUtil
.
stringFileToList
(
allotBillEntity
.
getSendFiles
()));
allotBillEntity
.
setReplyFileList
(
FilesUtil
.
stringFileToList
(
allotBillEntity
.
getReplyFiles
()));
allotBillEntity
.
setApplyFileList
(
FilesUtil
.
stringFileToList
(
allotBillEntity
.
getApplyFiles
()));
if
(
allotBillEntity
.
getScriptJson
()!=
null
){
allotBillEntity
.
setScripts
(
JacksonUtil
.
readValue
(
allotBillEntity
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{}));
}
...
...
@@ -113,6 +114,7 @@ public class AllotBillSelectController {
}
allotBillEntity
.
setSendFileList
(
FilesUtil
.
stringFileToList
(
allotBillEntity
.
getSendFiles
()));
allotBillEntity
.
setReplyFileList
(
FilesUtil
.
stringFileToList
(
allotBillEntity
.
getReplyFiles
()));
allotBillEntity
.
setApplyFileList
(
FilesUtil
.
stringFileToList
(
allotBillEntity
.
getApplyFiles
()));
if
(
allotBillEntity
.
getScriptJson
()!=
null
){
allotBillEntity
.
setScripts
(
JacksonUtil
.
readValue
(
allotBillEntity
.
getScriptJson
(),
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{}));
}
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/subject/vo/AllotBillSaveVo.java
浏览文件 @
c13c58d5
...
...
@@ -84,7 +84,7 @@ public class AllotBillSaveVo {
private
String
agent
;
@NotNull
(
message
=
"allotType不能为空"
)
@ApiModelProperty
(
value
=
"
入库
类型"
)
@ApiModelProperty
(
value
=
"
配发
类型"
)
private
Integer
allotType
;
@ApiModelProperty
(
value
=
"申请文号附件名"
)
...
...
dev-config/src/main/java/com/tykj/dev/config/base/AllotType.java
0 → 100644
浏览文件 @
c13c58d5
package
com
.
tykj
.
dev
.
config
.
base
;
import
com.tykj.dev.config.domin.SystemConfig
;
import
lombok.AllArgsConstructor
;
/**
* @author dengdiyi
* 配发类型枚举
*/
@AllArgsConstructor
public
enum
AllotType
{
/**
* 横向
*/
HORIZONTAL
(
1
,
"省直属横向"
),
/**
* 纵向
*/
VERTICAL
(
2
,
"省对下纵向"
);
public
Integer
id
;
public
String
name
;
public
SystemConfig
toDo
(){
SystemConfig
systemConfig
=
new
SystemConfig
();
systemConfig
.
setValue
(
id
);
systemConfig
.
setLabel
(
name
);
systemConfig
.
setChineseName
(
"配发类型"
);
systemConfig
.
setEnglishName
(
"allotType"
);
return
systemConfig
;
}
}
dev-config/src/main/java/com/tykj/dev/config/cache/ConfigCache.java
浏览文件 @
c13c58d5
...
...
@@ -16,6 +16,8 @@ public class ConfigCache {
private
Map
<
Integer
,
String
>
storageTypeMap
;
private
Map
<
Integer
,
String
>
allotTypeMap
;
private
Map
<
Integer
,
String
>
applyTypeMap
;
private
Map
<
Integer
,
String
>
invisibleRangeMap
;
...
...
@@ -38,6 +40,7 @@ public class ConfigCache {
this
.
styleMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"style"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
natureMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"nature"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
}
public
Map
<
Integer
,
String
>
getMatchingRangeMap
()
{
...
...
@@ -76,6 +79,10 @@ public class ConfigCache {
return
positionMap
;
}
public
Map
<
Integer
,
String
>
getAllotTypeMap
()
{
return
allotTypeMap
;
}
public
ConfigCache
refresh
(
List
<
SystemConfig
>
systemConfigs
){
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
matchingRangeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"matchingRange"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
...
...
@@ -86,6 +93,7 @@ public class ConfigCache {
this
.
styleMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"style"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
natureMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"nature"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
return
this
;
}
}
dev-config/src/main/java/com/tykj/dev/config/task/SystemConfigRun.java
浏览文件 @
c13c58d5
...
...
@@ -38,6 +38,9 @@ public class SystemConfigRun implements CommandLineRunner {
for
(
StorageType
d:
StorageType
.
values
())
{
systemConfigDao
.
save
(
d
.
toDo
());
}
for
(
AllotType
d:
AllotType
.
values
())
{
systemConfigDao
.
save
(
d
.
toDo
());
}
for
(
DeviceApplyType
d:
DeviceApplyType
.
values
())
{
systemConfigDao
.
save
(
d
.
toDo
());
}
...
...
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
c13c58d5
差异被折叠。
点击展开。
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
c13c58d5
...
...
@@ -306,7 +306,6 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Override
public
List
<
DeviceLibrary
>
getList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryDao
.
findAll
(
getSelectSpecification
(
deviceLibrarySelectVo
));
//返回父子结构
// Map<Integer, DeviceLibrary> nodeCollect =
// deviceLibraryEntities.stream().collect(Collectors.toMap(DeviceLibrary::getId, deviceLibraryEntity -> deviceLibraryEntity));
...
...
@@ -316,11 +315,11 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
// deviceLibraryEntity -> Optional.ofNullable(nodeCollect.get(deviceLibraryEntity.getPartParentId())),
// DeviceLibrary::addChildNode
// );
return
deviceLibrary
Entities
.
stream
().
sorted
(
Comparator
.
comparing
(
DeviceLibrary:
:
getLifeStatus
,
Comparator
.
nullsLast
(
Integer:
:
compareTo
))).
collect
(
Collectors
.
toLis
t
());
return
deviceLibrary
Dao
.
findAll
(
getSelectSpecification
(
deviceLibrarySelectVo
),
deviceLibrarySelectVo
.
getPageable
().
getSor
t
());
}
public
List
<
DeviceLibrary
>
getList2
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryDao
.
findAll
(
getSelectSpecification6
(
deviceLibrarySelectVo
));
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryDao
.
findAll
(
getSelectSpecification6
(
deviceLibrarySelectVo
)
,
deviceLibrarySelectVo
.
getPageable
().
getSort
()
);
//返回父子结构
Map
<
Integer
,
DeviceLibrary
>
nodeCollect
=
deviceLibraryEntities
.
stream
().
collect
(
Collectors
.
toMap
(
DeviceLibrary:
:
getId
,
deviceLibraryEntity
->
deviceLibraryEntity
));
...
...
@@ -333,7 +332,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
}
public
List
<
DeviceLibrary
>
getList3
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
,
String
name
)
{
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryDao
.
findAll
(
getSelectSpecification2
(
deviceLibrarySelectVo
,
name
));
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryDao
.
findAll
(
getSelectSpecification2
(
deviceLibrarySelectVo
,
name
)
,
deviceLibrarySelectVo
.
getPageable
().
getSort
()
);
//返回父子结构
Map
<
Integer
,
DeviceLibrary
>
nodeCollect
=
deviceLibraryEntities
.
stream
().
collect
(
Collectors
.
toMap
(
DeviceLibrary:
:
getId
,
deviceLibraryEntity
->
deviceLibraryEntity
));
...
...
@@ -481,7 +480,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Override
public
List
<
DeviceLibrary
>
getAllList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
return
deviceLibraryDao
.
findAll
(
getSelectSpecification4
(
deviceLibrarySelectVo
));
return
deviceLibraryDao
.
findAll
(
getSelectSpecification4
(
deviceLibrarySelectVo
)
,
deviceLibrarySelectVo
.
getPageable
().
getSort
()
);
}
@Override
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/domin/DeviceLibrary.java
浏览文件 @
c13c58d5
...
...
@@ -127,6 +127,9 @@ public class DeviceLibrary {
*/
@ApiModelProperty
(
value
=
"入库类型,1-横向,2-纵向"
)
private
Integer
storageType
;
@ApiModelProperty
(
value
=
"配发类型,1-横向,2-纵向"
)
private
Integer
allotType
;
/**
* 管理状态,0-不再所属单位,1-在所属单位
*/
...
...
@@ -251,6 +254,10 @@ public class DeviceLibrary {
@Transient
private
String
storageTypeName
;
@ApiModelProperty
(
value
=
"配发类型"
)
@Transient
private
String
allotTypeName
;
public
void
addChildNode
(
DeviceLibrary
deviceLibraryEntity
)
{
childs
.
add
(
deviceLibraryEntity
);
}
...
...
@@ -271,6 +278,7 @@ public class DeviceLibrary {
setInvisibleRangeName
(
configCache
.
getInvisibleRangeMap
().
get
(
this
.
invisibleRange
)==
null
?
"-"
:
configCache
.
getInvisibleRangeMap
().
get
(
this
.
invisibleRange
));
setTypeName
(
configCache
.
getStyleMap
().
get
(
this
.
type
)==
null
?
"-"
:
configCache
.
getStyleMap
().
get
(
this
.
type
));
setStorageTypeName
(
configCache
.
getStorageTypeMap
().
get
(
this
.
storageType
)==
null
?
"-"
:
configCache
.
getStorageTypeMap
().
get
(
this
.
storageType
));
setAllotTypeName
(
configCache
.
getAllotTypeMap
().
get
(
this
.
allotType
)==
null
?
"-"
:
configCache
.
getAllotTypeMap
().
get
(
this
.
allotType
));
}
return
this
;
}
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceLibrarySaveVo.java
浏览文件 @
c13c58d5
...
...
@@ -41,6 +41,9 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty
(
value
=
"入库类型,1-横向,2-纵向"
)
private
Integer
storageType
;
@ApiModelProperty
(
value
=
"配发类型,1-横向,2-纵向"
)
private
Integer
allotType
;
@NotNull
(
message
=
"manageStatus不能为空"
)
@ApiModelProperty
(
value
=
"管理状态,0-不再所属单位,1-在所属单位"
)
private
Integer
manageStatus
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceVo.java
浏览文件 @
c13c58d5
...
...
@@ -27,6 +27,8 @@ public class DeviceVo {
private
Integer
secretLevel
;
private
Integer
allotType
;
/**
* 型号
*/
...
...
@@ -81,5 +83,7 @@ public class DeviceVo {
@ApiModelProperty
(
value
=
"入库类型"
)
private
String
storageTypeName
;
private
String
allotTypeName
;
private
List
<
DeviceLibrary
>
childs
;
}
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/Script.java
浏览文件 @
c13c58d5
...
...
@@ -32,6 +32,10 @@ public class Script {
@ApiModelProperty
(
value
=
"可见范围"
)
private
String
invisibleRange
;
private
String
allotType
;
private
Integer
allotTypeNum
;
@ApiModelProperty
(
value
=
"数量"
)
private
Integer
num
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/ScriptSaveVo.java
浏览文件 @
c13c58d5
...
...
@@ -30,6 +30,9 @@ public class ScriptSaveVo {
@ApiModelProperty
(
value
=
"可见范围"
)
private
String
invisibleRange
;
@ApiModelProperty
(
value
=
"配发类型"
)
private
String
allotType
;
@ApiModelProperty
(
value
=
"数量"
)
private
Integer
num
;
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/CustomPage.java
浏览文件 @
c13c58d5
...
...
@@ -67,7 +67,7 @@ public class CustomPage {
public
PageRequest
getPageable
()
{
if
(
orders
.
size
()
!=
0
)
{
List
<
Sort
.
Order
>
orders
=
new
ArrayList
<>();
this
.
orders
.
stream
().
forEach
(
item
->
{
this
.
orders
.
forEach
(
item
->
{
if
(
"ASC"
.
equals
(
item
.
getDirection
()))
{
orders
.
add
(
new
Sort
.
Order
(
Sort
.
Direction
.
ASC
,
item
.
getCoulmn
()));
}
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/PageUtil.java
浏览文件 @
c13c58d5
...
...
@@ -40,4 +40,13 @@ public class PageUtil {
}
}
}
// public static <T> List<Comparator<T>> getSortComparator(List<T> list, List<CustomOrder> customOrders){
// if (customOrders!=null&&customOrders.size()>0){
//
// }
// else {
// return new ArrayList<>();
// }
// }
}
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingLibraryController.java
浏览文件 @
c13c58d5
...
...
@@ -41,6 +41,12 @@ public class PackingLibraryController {
@Autowired
DeviceLibraryService
deviceLibraryService
;
@ApiOperation
(
value
=
"获取装备单据显示"
,
notes
=
"获取装备单据显示"
)
@PostMapping
(
"/getAllotScript"
)
public
ResponseEntity
getAllotScript
(
@RequestBody
List
<
Integer
>
ids
){
return
ResponseEntity
.
ok
(
packingLibraryService
.
getDevcieAllotScript
(
ids
));
}
@ApiOperation
(
value
=
"获取装备单据显示"
,
notes
=
"获取装备单据显示"
)
@PostMapping
(
"/getScript"
)
public
ResponseEntity
setRecord
(
@RequestBody
List
<
Integer
>
ids
){
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/PackingLibraryService.java
浏览文件 @
c13c58d5
...
...
@@ -108,6 +108,8 @@ public interface PackingLibraryService {
List
<
Script
>
getDevcieScript
(
List
<
Integer
>
ids
);
List
<
Script
>
getDevcieAllotScript
(
List
<
Integer
>
ids
);
/**
* @param packingId 列装id
* @param num 配发数量
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
c13c58d5
...
...
@@ -328,6 +328,50 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
return
scriptList
;
}
@Override
public
List
<
Script
>
getDevcieAllotScript
(
List
<
Integer
>
ids
)
{
Map
<
Integer
,
DeviceLibrary
>
deviceLibraryMap
=
deviceLibraryService
.
getAllDeviceMap
();
List
<
Script
>
scripts
=
new
ArrayList
<>();
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
ids
.
forEach
(
integer
->
deviceLibraries
.
add
(
deviceLibraryMap
.
get
(
integer
)));
Map
<
String
,
List
<
DeviceLibrary
>>
map
=
deviceLibraries
.
stream
().
collect
(
groupingBy
(
deviceLibrary
->
deviceLibrary
.
getPackingId
()+
"Ǵ"
+
deviceLibrary
.
getAllotTypeName
()));
for
(
String
s:
map
.
keySet
()){
String
[]
strings
=
s
.
split
(
"Ǵ"
);
if
(
strings
.
length
==
2
)
{
Integer
packingId
=
Integer
.
valueOf
(
strings
[
0
]);
String
allotType
=
strings
[
1
];
List
<
DeviceLibrary
>
deviceLibraryList
=
map
.
get
(
s
);
PackingLibrary
packingLibrary
=
getOne
(
packingId
);
Script
script
=
new
Script
();
script
.
setId
(
packingId
);
script
.
setPartParentId
(
packingLibrary
.
getPartParentId
());
script
.
setInvisibleRange
(
packingLibrary
.
getInvisibleRangeName
());
script
.
setModel
(
packingLibrary
.
getModel
());
script
.
setName
(
packingLibrary
.
getName
());
script
.
setSecretLevel
(
packingLibrary
.
getSecretLevelName
());
script
.
setType
(
packingLibrary
.
getTypeName
());
script
.
setNum
(
deviceLibraryList
.
size
());
script
.
setAllotType
(
allotType
);
script
.
setAllotTypeNum
(
deviceLibraryList
.
get
(
0
).
getAllotType
());
script
.
setSeqNumber
(
StringSplitUtil
.
stringListToString
(
DeviceSeqUtil
.
getContinuousSeqs
(
deviceLibraryList
.
stream
().
map
(
DeviceLibrary:
:
getSeqNumber
).
collect
(
Collectors
.
toList
()))));
scripts
.
add
(
script
);
}
}
Map
<
Integer
,
Script
>
nodeCollect
=
scripts
.
stream
().
collect
(
Collectors
.
toMap
(
Script:
:
getId
,
script
->
script
));
List
<
Script
>
scriptList
=
new
ArrayList
<>();
List
<
Script
>
conList
=
GetTreeUtils
.
parseTreeFromDown
(
scripts
,
Script:
:
getId
,
script
->
Optional
.
ofNullable
(
nodeCollect
.
get
(
script
.
getPartParentId
())),
Script:
:
addChildNode
);
for
(
Script
s:
conList
)
{
addScript
(
scriptList
,
s
);
}
return
scriptList
;
}
private
void
addScript
(
List
<
Script
>
scripts
,
Script
script
){
scripts
.
add
(
script
);
if
(
script
.
getChilds
()!=
null
&&
script
.
getChilds
().
size
()>
0
){
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论