Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
d7778fcc
提交
d7778fcc
authored
10月 11, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(列装模块,配套设备模块,便签管理): 未打印标签查询,列装绑定,关联设备
未打印标签查询,列装绑定,关联设备
上级
75cb624c
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
353 行增加
和
53 行删除
+353
-53
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+10
-17
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+190
-15
MatchingDeviceLibraryService.java
...device/matching/service/MatchingDeviceLibraryService.java
+14
-0
MatchingDeviceLibraryServiceImpl.java
...tching/service/impl/MatchingDeviceLibraryServiceImpl.java
+71
-2
MatchingDeviceSaveVo.java
.../dev/device/matching/subject/vo/MatchingDeviceSaveVo.java
+1
-1
MatchingDeviceSelectVo.java
...ev/device/matching/subject/vo/MatchingDeviceSelectVo.java
+3
-0
RelationDeviceVo.java
...tykj/dev/device/matching/subject/vo/RelationDeviceVo.java
+22
-0
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+18
-12
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+24
-6
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
d7778fcc
...
@@ -238,7 +238,7 @@ public class DeviceLibraryController {
...
@@ -238,7 +238,7 @@ public class DeviceLibraryController {
Boolean
hasUpdateTimeDim
=
deviceLibrarySelectVo
.
getUpdateTimeDim
()!=
null
;
Boolean
hasUpdateTimeDim
=
deviceLibrarySelectVo
.
getUpdateTimeDim
()!=
null
;
Boolean
hasRfidCardDim
=
deviceLibrarySelectVo
.
getRfidCardDim
()!=
null
;
Boolean
hasRfidCardDim
=
deviceLibrarySelectVo
.
getRfidCardDim
()!=
null
;
//库存位置
//库存位置
Boolean
hasStorageLocationDim
=
deviceLibrarySelectVo
.
get
RfidCard
Dim
()!=
null
;
Boolean
hasStorageLocationDim
=
deviceLibrarySelectVo
.
get
LocationUnit
Dim
()!=
null
;
//形态
//形态
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
@@ -968,20 +968,6 @@ public class DeviceLibraryController {
...
@@ -968,20 +968,6 @@ public class DeviceLibraryController {
return
deviceLibraries
;
return
deviceLibraries
;
}
}
// @ApiOperation(value = "解除装备绑定", notes = "解除装备绑定")
// @GetMapping("/relieveDevice/{deviceId}")
// public ResponseEntity relieveDevice(@PathVariable("deviceId") Integer deviceId){
// deviceLibraryService.relieveDevice(deviceId);
// return ResponseEntity.ok("解除成功");
// }
// @ApiOperation(value = "进行装备绑定", notes = "进行装备绑定")
// @PostMapping("/bindingDevice")
// public ResponseEntity bindingDevice(BindingDeviceVo bindingDeviceVo){
// deviceLibraryService.bindingDevice(bindingDeviceVo);
// return ResponseEntity.ok("绑定成功");
// }
@ApiOperation
(
value
=
"进行装备绑定"
,
notes
=
"进行装备绑定"
)
@ApiOperation
(
value
=
"进行装备绑定"
,
notes
=
"进行装备绑定"
)
@PostMapping
(
"/boundDevice"
)
@PostMapping
(
"/boundDevice"
)
public
ResponseEntity
boundDevice
(
@RequestBody
BindingDeviceVo
bindingDeviceVo
){
public
ResponseEntity
boundDevice
(
@RequestBody
BindingDeviceVo
bindingDeviceVo
){
...
@@ -1014,11 +1000,18 @@ public class DeviceLibraryController {
...
@@ -1014,11 +1000,18 @@ public class DeviceLibraryController {
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
// Boolean hasTypeDim = deviceLibrarySelectVo.getTypeDim()!=null;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
);
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
);
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getIsPart
()
==
1
).
collect
(
Collectors
.
toList
());
// resultList = resultList.stream().filter(deviceLibrary -> deviceLibrary.getIsPart() == 1).collect(Collectors.toList());
//根据装备id查询附件 然后过滤
//根据装备id查询附件 然后过滤 0 装备 1 附件
if
(
deviceLibrarySelectVo
.
getIsPart
()
==
0
){
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
!
deviceLibrary
.
getId
().
equals
(
deviceLibrarySelectVo
.
getDeviceId
()))
.
collect
(
Collectors
.
toList
());
}
if
(
deviceLibrarySelectVo
.
getIsPart
()
==
1
){
List
<
DeviceLibrary
>
allByPartParentId
=
deviceLibraryService
.
findAllByPartParentId
(
deviceLibrarySelectVo
.
getDeviceId
());
List
<
DeviceLibrary
>
allByPartParentId
=
deviceLibraryService
.
findAllByPartParentId
(
deviceLibrarySelectVo
.
getDeviceId
());
List
<
Integer
>
ids
=
allByPartParentId
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
ids
=
allByPartParentId
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
!
ids
.
contains
(
deviceLibrary
.
getId
())).
collect
(
Collectors
.
toList
());
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
!
ids
.
contains
(
deviceLibrary
.
getId
())).
collect
(
Collectors
.
toList
());
}
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
{
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
{
Boolean
containModelDim
=
!
hasModelDim
||
deviceLibrary
.
getModel
().
contains
(
deviceLibrarySelectVo
.
getModelDim
());
Boolean
containModelDim
=
!
hasModelDim
||
deviceLibrary
.
getModel
().
contains
(
deviceLibrarySelectVo
.
getModelDim
());
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
d7778fcc
...
@@ -11,8 +11,7 @@ import com.tykj.dev.device.library.service.DeviceLogService;
...
@@ -11,8 +11,7 @@ import com.tykj.dev.device.library.service.DeviceLogService;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
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.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.vo.DeviceLogUserVo
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao
;
import
com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao
;
import
com.tykj.dev.device.matching.repository.MatchingRepairBillDao
;
import
com.tykj.dev.device.matching.repository.MatchingRepairBillDao
;
import
com.tykj.dev.device.matching.service.MatchingDeviceBillService
;
import
com.tykj.dev.device.matching.service.MatchingDeviceBillService
;
...
@@ -33,14 +32,13 @@ import com.tykj.dev.device.user.subject.service.UserPublicService;
...
@@ -33,14 +32,13 @@ import com.tykj.dev.device.user.subject.service.UserPublicService;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.DeviceSeqUtil
;
import
com.tykj.dev.misc.utils.*
;
import
com.tykj.dev.misc.utils.MapperUtils
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
com.tykj.dev.rfid.entity.vo.PrintVo
;
import
com.tykj.dev.rfid.entity.vo.PrintVo
;
import
com.tykj.dev.rfid.service.RfidService
;
import
com.tykj.dev.rfid.service.RfidService
;
import
com.tykj.dev.rfid.service.impl.RfidServiceImpl
;
import
com.tykj.dev.rfid.service.impl.RfidServiceImpl
;
import
com.tykj.dev.socket.MyWebSocket
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -52,6 +50,7 @@ import org.springframework.validation.annotation.Validated;
...
@@ -52,6 +50,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Min
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -328,17 +327,111 @@ public class MatchingDeviceController {
...
@@ -328,17 +327,111 @@ public class MatchingDeviceController {
@ApiOperation
(
value
=
"模糊查询配套装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@ApiOperation
(
value
=
"模糊查询配套装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@PostMapping
(
"/feature/summary"
)
@PostMapping
(
"/feature/summary"
)
public
ResponseEntity
getAll
(
@RequestBody
MatchingDeviceSelectVo
matchingDeviceSelectVo
)
{
public
ResponseEntity
getAll
(
@RequestBody
MatchingDeviceSelectVo
matchingDeviceSelectVo
)
{
Page
<
MatchingDeviceLibrary
>
page
=
matchingDeviceLibraryService
.
getPage
(
matchingDeviceSelectVo
,
matchingDeviceSelectVo
.
getPageable
());
// Page<MatchingDeviceLibrary> page = matchingDeviceLibraryService.getPage(matchingDeviceSelectVo, matchingDeviceSelectVo.getPageable());
//set关联装备的表面号
//set关联装备的表面号
for
(
MatchingDeviceLibrary
m
:
page
.
getContent
())
{
// for (MatchingDeviceLibrary m : page.getContent()) {
if
(
m
.
getDeviceId
()
>
0
)
{
// if (m.getDeviceId() > 0) {
m
.
setRelateDevice
(
deviceLibraryService
.
getOne
(
m
.
getDeviceId
()).
getRfidSurfaceId
());
// m.setRelateDevice(deviceLibraryService.getOne(m.getDeviceId()).getRfidSurfaceId());
}
// }
m
.
setConfigName
();
// m.setConfigName();
}
// }
return
ResponseEntity
.
ok
(
page
);
// return ResponseEntity.ok(page);
List
<
MatchingDeviceLibrary
>
matchingDeviceLibraryList
=
matchingDeviceLibraryService
.
getMatchingDevicePage
(
matchingDeviceSelectVo
);
Boolean
hasModelDim
=
matchingDeviceSelectVo
.
getModelDim
()!=
null
;
Boolean
hasNameDim
=
matchingDeviceSelectVo
.
getNameDim
()!=
null
;
Boolean
hasSeqDim
=
matchingDeviceSelectVo
.
getSeqDim
()!=
null
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
if
(
hasModelDim
||
hasNameDim
||
hasSeqDim
)
{
matchingDeviceLibraryList
=
matchingDeviceLibraryList
.
stream
().
filter
(
deviceLibrary
->
{
Boolean
containModelDim
=
!
hasModelDim
||
deviceLibrary
.
getModel
().
contains
(
matchingDeviceSelectVo
.
getModelDim
());
Boolean
containNameDim
=
!
hasNameDim
||
deviceLibrary
.
getName
().
contains
(
matchingDeviceSelectVo
.
getNameDim
());
Boolean
containSeqDim
=
!
hasSeqDim
||
deviceLibrary
.
getSeqNumber
().
contains
(
matchingDeviceSelectVo
.
getSeqDim
());
return
containModelDim
&&
containNameDim
&&
containSeqDim
;
}).
collect
(
Collectors
.
toList
());
}
// List<DeviceVo> deviceVos = matchingDeviceLibraryList.stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
Page
<
MatchingDeviceLibrary
>
deviceLibraryEntities
=
PageUtil
.
getPerPage
(
matchingDeviceSelectVo
.
getPage
(),
matchingDeviceSelectVo
.
getSize
(),
matchingDeviceLibraryList
,
matchingDeviceSelectVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pages"
,
deviceLibraryEntities
);
//修改 增加排序
//做一下去重
List
<
String
>
models
=
matchingDeviceLibraryList
.
stream
().
map
(
MatchingDeviceLibrary:
:
getModel
).
collect
(
Collectors
.
toList
());
List
<
String
>
finalModels
=
models
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
modelToSort
=
DeviceModelSort
.
modelToSort
(
finalModels
);
map
.
put
(
"models"
,
modelToSort
);
List
<
String
>
names
=
matchingDeviceLibraryList
.
stream
().
map
(
MatchingDeviceLibrary:
:
getName
).
collect
(
Collectors
.
toList
());
List
<
String
>
nameList
=
names
.
stream
().
distinct
().
sorted
(
Comparator
.
comparing
(
s
->
s
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"names"
,
nameList
);
// Page<MatchingDeviceLibrary> deviceLibraryEntities = PageUtil.getPerPage(matchingDeviceSelectVo.getPage(),
// matchingDeviceSelectVo.getSize(), matchingDeviceLibraryList, matchingDeviceSelectVo.getPageable());
return
ResponseEntity
.
ok
(
map
);
}
}
// @ApiOperation(value = "模糊查询核心装备分页", notes = "可以通过这个接口查询装备列表")
// @PostMapping("/feature/summary")
// public ResponseEntity getAll(@RequestBody MatchingDeviceSelectVo matchingDeviceSelectVo) {
//
// Boolean hasModelDim = matchingDeviceSelectVo.getModelDim()!=null;
// Boolean hasNameDim = matchingDeviceSelectVo.getNameDim()!=null;
// Boolean hasSeqDim = matchingDeviceSelectVo.getSeqDim()!=null;
//// Boolean hasLocationUnitDim = matchingDeviceSelectVo.getLocationUnitDim()!=null;
//// Boolean hasOwnUnitDim = matchingDeviceSelectVo.getOwnUnitDim()!=null;
//// Boolean hasLifeStatusDim = matchingDeviceSelectVo.getLifeStatusDim()!=null;
//// Boolean hasUpdateTimeDim = matchingDeviceSelectVo.getUpdateTimeDim()!=null;
//// Boolean hasRfidCardDim = matchingDeviceSelectVo.getRfidCardDim()!=null;
//
// SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
//
//// List<DeviceLibrary> resultList = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
// if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) {
// resultList = resultList.stream().filter(deviceLibrary -> {
// Boolean containModelDim = !hasModelDim||deviceLibrary.getModel().contains(deviceLibrarySelectVo.getModelDim());
// Boolean containNameDim = !hasNameDim||deviceLibrary.getName().contains(deviceLibrarySelectVo.getNameDim());
// Boolean containSeqDim = !hasSeqDim||deviceLibrary.getSeqNumber().contains(deviceLibrarySelectVo.getSeqDim());
// Boolean containLocationUnitDim = !hasLocationUnitDim||deviceLibrary.getLocationUnit().contains(deviceLibrarySelectVo.getLocationUnitDim());
// Boolean containOwnUnitDim = !hasOwnUnitDim||deviceLibrary.getOwnUnit().contains(deviceLibrarySelectVo.getOwnUnitDim());
// Boolean containLifeStatusDim = !hasLifeStatusDim||deviceLibrary.getLifeStatusName().contains(deviceLibrarySelectVo.getLifeStatusDim());
// Boolean containUpdateTimeDim = !hasUpdateTimeDim||sdf.format(deviceLibrary.getUpdateTime()).contains(deviceLibrarySelectVo.getUpdateTimeDim());
// Boolean containRfidCardDim = !hasRfidCardDim||(deviceLibrary.getRfidCardId()!=null&&deviceLibrary.getRfidCardId().contains(deviceLibrarySelectVo.getRfidCardDim()));
// Boolean containStorageLocationDim = !hasStorageLocationDim||deviceLibrary.getStorageLocation().contains(deviceLibrarySelectVo.getStorageLocationDim());
//// Boolean containTypeDim = !hasTypeDim||deviceLibrary.getType().contains(deviceLibrarySelectVo.getTypeDim());
// return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim&&containUpdateTimeDim&&containRfidCardDim&&containStorageLocationDim;
// }).collect(Collectors.toList());
// }
//// List<DeviceVo> deviceVos = resultList.stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
// Page<DeviceLibrary> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), resultList, deviceLibrarySelectVo.getPageable());
// Map<String,Object> map = new HashMap<>();
// Map<Integer,String> lifeStatusMap = configCache.getLifeStatusMap();
// //
// Map<Integer, String> styleMap = configCache.getStyleMap();
//
// Set<Integer> status = new HashSet<>();
// List<String> models = new ArrayList<>();
// List<String> names = new ArrayList<>();
//
// map.put("pages",deviceLibraryEntities);
// //修改 增加排序
// //做一下去重
// List<String> finalModels = models.stream().distinct().collect(Collectors.toList());
// List<String> modelToSort = DeviceModelSort.modelToSort(finalModels);
// map.put("models",modelToSort);
// List<String> nameList = names.stream().distinct().sorted(Comparator.comparing(s -> s)).collect(Collectors.toList());
// map.put("names",nameList);
//// List<String> finalOwnUnits = DeviceModelSort.unitToSort(ownUnits);
//// map.put("ownUnits",finalOwnUnits.stream().distinct().collect(Collectors.toList()));
//// List<String> finalLocationUnits = DeviceModelSort.unitToSort(locationUnits);
//// map.put("locationUnits",finalLocationUnits.stream().distinct().collect(Collectors.toList()));
// map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
//// map.put("storageLocation",storageLocation);
// //形态
//// List<TypeVo> typeVoList = types.stream().distinct().map(integer -> new TypeVo(integer, styleMap.get(integer))).sorted(Comparator.comparing(TypeVo::getType)).collect(Collectors.toList());
//// map.put("types",typeVoList);
// return ResultUtil.success(map);
// }
@ApiOperation
(
value
=
"查询配套装备详情"
,
notes
=
"可以通过这个接口查询配套装备详情"
)
@ApiOperation
(
value
=
"查询配套装备详情"
,
notes
=
"可以通过这个接口查询配套装备详情"
)
@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
)
{
...
@@ -462,7 +555,6 @@ public class MatchingDeviceController {
...
@@ -462,7 +555,6 @@ public class MatchingDeviceController {
return
ResponseEntity
.
ok
(
map
);
return
ResponseEntity
.
ok
(
map
);
}
}
@ApiOperation
(
value
=
"查询所有配套设备型号"
,
notes
=
"查询所有配套设备型号"
)
@ApiOperation
(
value
=
"查询所有配套设备型号"
,
notes
=
"查询所有配套设备型号"
)
@GetMapping
(
value
=
"/selectAllModel"
)
@GetMapping
(
value
=
"/selectAllModel"
)
public
ResponseEntity
selectAllModel
()
{
public
ResponseEntity
selectAllModel
()
{
...
@@ -576,7 +668,90 @@ public class MatchingDeviceController {
...
@@ -576,7 +668,90 @@ public class MatchingDeviceController {
return
ResponseEntity
.
ok
(
"更新成功"
+
taskBto
.
getId
());
return
ResponseEntity
.
ok
(
"更新成功"
+
taskBto
.
getId
());
}
}
}
}
@ApiOperation
(
value
=
"查询可绑定的装备"
,
notes
=
"查询可绑定的装备"
)
@PostMapping
(
"/selectDevices"
)
public
ResponseEntity
selectPartDevice
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
){
Boolean
hasModelDim
=
deviceLibrarySelectVo
.
getModelDim
()!=
null
;
Boolean
hasNameDim
=
deviceLibrarySelectVo
.
getNameDim
()!=
null
;
Boolean
hasSeqDim
=
deviceLibrarySelectVo
.
getSeqDim
()!=
null
;
Boolean
hasLocationUnitDim
=
deviceLibrarySelectVo
.
getLocationUnitDim
()!=
null
;
Boolean
hasOwnUnitDim
=
deviceLibrarySelectVo
.
getOwnUnitDim
()!=
null
;
Boolean
hasLifeStatusDim
=
deviceLibrarySelectVo
.
getLifeStatusDim
()!=
null
;
Boolean
hasUpdateTimeDim
=
deviceLibrarySelectVo
.
getUpdateTimeDim
()!=
null
;
Boolean
hasRfidCardDim
=
deviceLibrarySelectVo
.
getRfidCardDim
()!=
null
;
//库存位置
Boolean
hasStorageLocationDim
=
deviceLibrarySelectVo
.
getRfidCardDim
()!=
null
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
DeviceLibrary
>
resultList
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
);
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getIsPart
()
==
0
).
collect
(
Collectors
.
toList
());
if
(
hasModelDim
||
hasLifeStatusDim
||
hasLocationUnitDim
||
hasNameDim
||
hasOwnUnitDim
||
hasSeqDim
)
{
resultList
=
resultList
.
stream
().
filter
(
deviceLibrary
->
{
Boolean
containModelDim
=
!
hasModelDim
||
deviceLibrary
.
getModel
().
contains
(
deviceLibrarySelectVo
.
getModelDim
());
Boolean
containNameDim
=
!
hasNameDim
||
deviceLibrary
.
getName
().
contains
(
deviceLibrarySelectVo
.
getNameDim
());
Boolean
containSeqDim
=
!
hasSeqDim
||
deviceLibrary
.
getSeqNumber
().
contains
(
deviceLibrarySelectVo
.
getSeqDim
());
Boolean
containLocationUnitDim
=
!
hasLocationUnitDim
||
deviceLibrary
.
getLocationUnit
().
contains
(
deviceLibrarySelectVo
.
getLocationUnitDim
());
Boolean
containOwnUnitDim
=
!
hasOwnUnitDim
||
deviceLibrary
.
getOwnUnit
().
contains
(
deviceLibrarySelectVo
.
getOwnUnitDim
());
Boolean
containLifeStatusDim
=
!
hasLifeStatusDim
||
deviceLibrary
.
getLifeStatusName
().
contains
(
deviceLibrarySelectVo
.
getLifeStatusDim
());
Boolean
containUpdateTimeDim
=
!
hasUpdateTimeDim
||
sdf
.
format
(
deviceLibrary
.
getUpdateTime
()).
contains
(
deviceLibrarySelectVo
.
getUpdateTimeDim
());
Boolean
containRfidCardDim
=
!
hasRfidCardDim
||(
deviceLibrary
.
getRfidCardId
()!=
null
&&
deviceLibrary
.
getRfidCardId
().
contains
(
deviceLibrarySelectVo
.
getRfidCardDim
()));
Boolean
containStorageLocationDim
=
!
hasStorageLocationDim
||
deviceLibrary
.
getStorageLocation
().
contains
(
deviceLibrarySelectVo
.
getStorageLocationDim
());
// Boolean containTypeDim = !hasTypeDim||deviceLibrary.getType().contains(deviceLibrarySelectVo.getTypeDim());
return
containModelDim
&&
containNameDim
&&
containSeqDim
&&
containLocationUnitDim
&&
containOwnUnitDim
&&
containLifeStatusDim
&&
containUpdateTimeDim
&&
containRfidCardDim
&&
containStorageLocationDim
;
}).
collect
(
Collectors
.
toList
());
}
// List<DeviceVo> deviceVos = resultList.stream().map(DeviceLibrary::parseVo).collect(Collectors.toList());
Page
<
DeviceLibrary
>
deviceLibraryEntities
=
PageUtil
.
getPerPage
(
deviceLibrarySelectVo
.
getPage
(),
deviceLibrarySelectVo
.
getSize
(),
resultList
,
deviceLibrarySelectVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
Integer
,
String
>
lifeStatusMap
=
configCache
.
getLifeStatusMap
();
//
Map
<
Integer
,
String
>
styleMap
=
configCache
.
getStyleMap
();
Set
<
Integer
>
status
=
new
HashSet
<>();
List
<
String
>
models
=
new
ArrayList
<>();
List
<
String
>
names
=
new
ArrayList
<>();
List
<
String
>
ownUnits
=
new
ArrayList
<>();
List
<
String
>
locationUnits
=
new
ArrayList
<>();
Set
<
String
>
storageLocation
=
new
HashSet
<>();
//形态
List
<
Integer
>
types
=
new
ArrayList
<>();
resultList
.
forEach
(
deviceVo
->
{
deviceVo
.
setConfigName
();
status
.
add
(
deviceVo
.
getLifeStatus
());
models
.
add
(
deviceVo
.
getModel
());
names
.
add
(
deviceVo
.
getName
());
ownUnits
.
add
(
deviceVo
.
getOwnUnit
());
locationUnits
.
add
(
deviceVo
.
getLocationUnit
());
storageLocation
.
add
(
deviceVo
.
getStorageLocation
());
types
.
add
(
deviceVo
.
getType
());
});
map
.
put
(
"pages"
,
deviceLibraryEntities
);
//修改 增加排序
//做一下去重
List
<
String
>
finalModels
=
models
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
modelToSort
=
DeviceModelSort
.
modelToSort
(
finalModels
);
map
.
put
(
"models"
,
modelToSort
);
List
<
String
>
nameList
=
names
.
stream
().
distinct
().
sorted
(
Comparator
.
comparing
(
s
->
s
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"names"
,
nameList
);
List
<
String
>
finalOwnUnits
=
DeviceModelSort
.
unitToSort
(
ownUnits
);
map
.
put
(
"ownUnits"
,
finalOwnUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
List
<
String
>
finalLocationUnits
=
DeviceModelSort
.
unitToSort
(
locationUnits
);
map
.
put
(
"locationUnits"
,
finalLocationUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
map
.
put
(
"lifeStatus"
,
status
.
stream
().
map
(
integer
->
new
LifeStatusVo
(
integer
,
lifeStatusMap
.
get
(
integer
))).
collect
(
Collectors
.
toList
()));
map
.
put
(
"storageLocation"
,
storageLocation
);
//形态
List
<
TypeVo
>
typeVoList
=
types
.
stream
().
distinct
().
map
(
integer
->
new
TypeVo
(
integer
,
styleMap
.
get
(
integer
))).
sorted
(
Comparator
.
comparing
(
TypeVo:
:
getType
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"types"
,
typeVoList
);
return
ResultUtil
.
success
(
map
);
}
@ApiModelProperty
(
value
=
"关联装备"
,
notes
=
"关联装备"
)
@PostMapping
(
"/relationDevice"
)
private
ResponseEntity
relationDevice
(
@RequestBody
RelationDeviceVo
relationDeviceVo
){
matchingDeviceLibraryService
.
relationDevice
(
relationDeviceVo
);
return
ResponseEntity
.
ok
(
"关联成功"
);
}
/**
/**
* @return 生成配套设备附件的序列号
* @return 生成配套设备附件的序列号
*/
*/
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/service/MatchingDeviceLibraryService.java
浏览文件 @
d7778fcc
package
com
.
tykj
.
dev
.
device
.
matching
.
service
;
package
com
.
tykj
.
dev
.
device
.
matching
.
service
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary
;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.matching.subject.vo.RelationDeviceVo
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
...
@@ -43,6 +46,11 @@ public interface MatchingDeviceLibraryService {
...
@@ -43,6 +46,11 @@ public interface MatchingDeviceLibraryService {
*/
*/
Page
<
MatchingDeviceLibrary
>
getPage
(
MatchingDeviceSelectVo
matchingDeviceSelectVo
,
Pageable
pageable
);
Page
<
MatchingDeviceLibrary
>
getPage
(
MatchingDeviceSelectVo
matchingDeviceSelectVo
,
Pageable
pageable
);
/**
* @param matchingDeviceSelectVo 装备查询vo
*/
List
<
MatchingDeviceLibrary
>
getMatchingDevicePage
(
MatchingDeviceSelectVo
matchingDeviceSelectVo
);
/**
/**
* @return 所有类型
* @return 所有类型
*/
*/
...
@@ -60,4 +68,10 @@ public interface MatchingDeviceLibraryService {
...
@@ -60,4 +68,10 @@ public interface MatchingDeviceLibraryService {
* @return 返回值是序列号列表
* @return 返回值是序列号列表
*/
*/
List
<
String
>
findByModelForSeqNumber
(
String
model
);
List
<
String
>
findByModelForSeqNumber
(
String
model
);
/**
* 关联装备
* @param relationDeviceVo 关联装备的vo
*/
void
relationDevice
(
RelationDeviceVo
relationDeviceVo
);
}
}
dev-matching/src/main/java/com/tykj/dev/device/matching/service/impl/MatchingDeviceLibraryServiceImpl.java
浏览文件 @
d7778fcc
...
@@ -9,6 +9,7 @@ import com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao;
...
@@ -9,6 +9,7 @@ import com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao;
import
com.tykj.dev.device.matching.service.MatchingDeviceLibraryService
;
import
com.tykj.dev.device.matching.service.MatchingDeviceLibraryService
;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary
;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.matching.subject.vo.RelationDeviceVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
...
@@ -120,14 +121,19 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
...
@@ -120,14 +121,19 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
List
<
String
>
units
=
userPublicService
.
findAllUnitNameByAreaId
(
selectAreaId
);
List
<
String
>
units
=
userPublicService
.
findAllUnitNameByAreaId
(
selectAreaId
);
//如果是市或县,筛选出创建单位在units中的设备
//如果是市或县,筛选出创建单位在units中的设备
if
(
selectLevel
==
3
||
selectLevel
==
2
)
{
if
(
selectLevel
==
3
||
selectLevel
==
2
)
{
List
<
MatchingDeviceLibrary
>
resultList
=
matchingDeviceLibraryDao
.
findAll
().
stream
()
List
<
MatchingDeviceLibrary
>
resultList
=
matchingDeviceLibraryDao
.
findAll
(
getPredicate
(
matchingDeviceSelectVo
).
build
())
.
stream
()
.
filter
(
matchingDeviceLibraryEntity
->
units
.
contains
(
matchingDeviceLibraryEntity
.
getCreateUnit
()))
.
filter
(
matchingDeviceLibraryEntity
->
units
.
contains
(
matchingDeviceLibraryEntity
.
getCreateUnit
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
// List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll().stream()
// .filter(matchingDeviceLibraryEntity -> units.contains(matchingDeviceLibraryEntity.getCreateUnit()))
// .collect(Collectors.toList());
return
PageUtil
.
getPerPage
(
matchingDeviceSelectVo
.
getPage
(),
matchingDeviceSelectVo
.
getSize
(),
resultList
,
pageable
);
return
PageUtil
.
getPerPage
(
matchingDeviceSelectVo
.
getPage
(),
matchingDeviceSelectVo
.
getSize
(),
resultList
,
pageable
);
}
}
//如果是省,直接返回全部设备
//如果是省,直接返回全部设备
if
(
selectLevel
==
1
)
{
if
(
selectLevel
==
1
)
{
List
<
MatchingDeviceLibrary
>
resultList
=
matchingDeviceLibraryDao
.
findAll
();
// List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll();
List
<
MatchingDeviceLibrary
>
resultList
=
matchingDeviceLibraryDao
.
findAll
(
getPredicate
(
matchingDeviceSelectVo
).
build
());
return
PageUtil
.
getPerPage
(
matchingDeviceSelectVo
.
getPage
(),
matchingDeviceSelectVo
.
getSize
(),
resultList
,
pageable
);
return
PageUtil
.
getPerPage
(
matchingDeviceSelectVo
.
getPage
(),
matchingDeviceSelectVo
.
getSize
(),
resultList
,
pageable
);
}
else
{
}
else
{
throw
new
ApiException
(
ResultUtil
.
failed
(
"单位等级只能为1,2,3"
));
throw
new
ApiException
(
ResultUtil
.
failed
(
"单位等级只能为1,2,3"
));
...
@@ -135,6 +141,52 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
...
@@ -135,6 +141,52 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
}
}
}
}
@Override
public
List
<
MatchingDeviceLibrary
>
getMatchingDevicePage
(
MatchingDeviceSelectVo
matchingDeviceSelectVo
)
{
PredicateBuilder
<
MatchingDeviceLibrary
>
predicateBuilder
=
getPredicate
(
matchingDeviceSelectVo
);
Integer
selectUnitId
=
matchingDeviceSelectVo
.
getUnitId
();
Integer
selectAreaId
=
matchingDeviceSelectVo
.
getAreaId
();
if
(
selectAreaId
==
null
)
{
//如果areaId和unitId都传Null,返回当前单位的配套设备
if
(
selectUnitId
==
null
)
{
// predicateBuilder.eq("createUnit", userUtils.getCurrentUserUnitName());
return
matchingDeviceLibraryDao
.
findAll
(
predicateBuilder
.
build
());
}
//如果areaId为Null,unitId不为null,返回对应单位的配套设备
else
{
String
unitName
=
userPublicService
.
findByUnitsToname
(
selectUnitId
);
predicateBuilder
.
eq
(
"createUnit"
,
unitName
);
return
matchingDeviceLibraryDao
.
findAll
(
predicateBuilder
.
build
());
}
}
//areaId不为null,返回该区域下所有单位的配套设备
else
{
//获取区域等级
Integer
selectLevel
=
userPublicService
.
getArea
(
selectAreaId
).
getType
();
//获取区域下所有单位名称
List
<
String
>
units
=
userPublicService
.
findAllUnitNameByAreaId
(
selectAreaId
);
//如果是市或县,筛选出创建单位在units中的设备
if
(
selectLevel
==
3
||
selectLevel
==
2
)
{
List
<
MatchingDeviceLibrary
>
resultList
=
matchingDeviceLibraryDao
.
findAll
(
getPredicate
(
matchingDeviceSelectVo
).
build
())
.
stream
()
.
filter
(
matchingDeviceLibraryEntity
->
units
.
contains
(
matchingDeviceLibraryEntity
.
getCreateUnit
()))
.
collect
(
Collectors
.
toList
());
// List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll().stream()
// .filter(matchingDeviceLibraryEntity -> units.contains(matchingDeviceLibraryEntity.getCreateUnit()))
// .collect(Collectors.toList());
return
resultList
;
}
//如果是省,直接返回全部设备
if
(
selectLevel
==
1
)
{
// List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll();
List
<
MatchingDeviceLibrary
>
resultList
=
matchingDeviceLibraryDao
.
findAll
(
getPredicate
(
matchingDeviceSelectVo
).
build
());
return
resultList
;
}
else
{
throw
new
ApiException
(
ResultUtil
.
failed
(
"单位等级只能为1,2,3"
));
}
}
}
/**
/**
* @return 所有类型
* @return 所有类型
*/
*/
...
@@ -165,6 +217,14 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
...
@@ -165,6 +217,14 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
@Override
public
void
relationDevice
(
RelationDeviceVo
relationDeviceVo
)
{
Integer
matchingDeviceId
=
relationDeviceVo
.
getMatchingDeviceId
();
MatchingDeviceLibrary
matchingDeviceLibrary
=
getOne
(
matchingDeviceId
);
matchingDeviceLibrary
.
setDeviceId
(
relationDeviceVo
.
getDeviceId
());
update
(
matchingDeviceLibrary
);
}
/**
/**
* @param matchingDeviceSelectVo 配套设备查询vo
* @param matchingDeviceSelectVo 配套设备查询vo
* 创建通用查询条件筛选器
* 创建通用查询条件筛选器
...
@@ -205,6 +265,15 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
...
@@ -205,6 +265,15 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
if
(
matchingDeviceSelectVo
.
getTypeDim
()!=
null
){
if
(
matchingDeviceSelectVo
.
getTypeDim
()!=
null
){
predicateBuilder
.
like
(
"type"
,
"%"
+
matchingDeviceSelectVo
.
getTypeDim
()+
"%"
);
predicateBuilder
.
like
(
"type"
,
"%"
+
matchingDeviceSelectVo
.
getTypeDim
()+
"%"
);
}
}
if
(
matchingDeviceSelectVo
.
getIsPrint
()!=
null
){
if
(
matchingDeviceSelectVo
.
getIsPrint
()==
1
){
predicateBuilder
.
notIn
(
"rfidCardId"
,
""
);
}
else
if
(
matchingDeviceSelectVo
.
getIsPrint
()==
0
){
predicateBuilder
.
in
(
"rfidCardId"
,
""
);
}
}
return
predicateBuilder
;
return
predicateBuilder
;
}
}
}
}
dev-matching/src/main/java/com/tykj/dev/device/matching/subject/vo/MatchingDeviceSaveVo.java
浏览文件 @
d7778fcc
...
@@ -46,7 +46,7 @@ public class MatchingDeviceSaveVo {
...
@@ -46,7 +46,7 @@ public class MatchingDeviceSaveVo {
// @NotNull(message = "rfidCardId不能为空")
// @NotNull(message = "rfidCardId不能为空")
@ApiModelProperty
(
value
=
"rfid卡号"
)
@ApiModelProperty
(
value
=
"rfid卡号"
)
private
String
rfidCardId
;
private
String
rfidCardId
=
""
;
@ApiModelProperty
(
value
=
"入库的数量"
)
@ApiModelProperty
(
value
=
"入库的数量"
)
private
Integer
storageCount
;
private
Integer
storageCount
;
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/subject/vo/MatchingDeviceSelectVo.java
浏览文件 @
d7778fcc
...
@@ -30,6 +30,9 @@ public class MatchingDeviceSelectVo extends CustomPage {
...
@@ -30,6 +30,9 @@ public class MatchingDeviceSelectVo extends CustomPage {
@ApiModelProperty
(
value
=
"区域id"
)
@ApiModelProperty
(
value
=
"区域id"
)
private
Integer
areaId
;
private
Integer
areaId
;
@ApiModelProperty
(
value
=
"查询是否打印标签(有没有表面号)装备"
)
private
Integer
isPrint
;
private
String
typeDim
;
private
String
typeDim
;
private
String
modelDim
;
private
String
modelDim
;
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/subject/vo/RelationDeviceVo.java
0 → 100644
浏览文件 @
d7778fcc
package
com
.
tykj
.
dev
.
device
.
matching
.
subject
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author zsp
*/
@Data
@ApiModel
(
"关联装备的vo"
)
public
class
RelationDeviceVo
{
@ApiModelProperty
(
name
=
"关联装备的id"
)
private
Integer
deviceId
;
@ApiModelProperty
(
name
=
"配套设备的id"
)
private
Integer
matchingDeviceId
;
}
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
d7778fcc
...
@@ -963,21 +963,27 @@ public class PackingController {
...
@@ -963,21 +963,27 @@ public class PackingController {
List
<
PackingLibrary
>
resultList
=
packingLibraryService
.
getAllSelectPacking
(
selectPackingVo
.
getPackingIds
());
List
<
PackingLibrary
>
resultList
=
packingLibraryService
.
getAllSelectPacking
(
selectPackingVo
.
getPackingIds
());
//进行过滤 退装的目录下面 回收站
//进行过滤 退装的目录下面 回收站
List
<
Integer
>
statuses
=
new
ArrayList
<>(
Arrays
.
asList
(
3
,
4
));
//
List<Integer> statuses = new ArrayList<>(Arrays.asList(3, 4));
//先过滤出child为空的
//先过滤出child为空的
List
<
PackingLibrary
>
childs
=
resultList
.
stream
().
filter
(
packingLibrary
->
packingLibrary
.
getChilds
()
==
null
||
packingLibrary
.
getChilds
().
size
()
==
0
).
collect
(
Collectors
.
toList
());
List
<
PackingLibrary
>
childs
=
resultList
.
stream
()
.
filter
(
packingLibrary
->
(
packingLibrary
.
getChilds
()
==
null
||
packingLibrary
.
getChilds
().
size
()
==
0
)
&&
packingLibrary
.
getIsRoot
()
==
1
)
.
collect
(
Collectors
.
toList
());
//取出不为空的
//取出不为空的
resultList
.
removeAll
(
childs
);
List
<
Integer
>
ids
=
childs
.
stream
().
map
(
PackingLibrary:
:
getId
).
collect
(
Collectors
.
toList
());
childs
.
forEach
(
packingLibrary
->
{
// resultList.removeAll(childs);
List
<
PackingLibrary
>
in
=
packingLibraryDao
.
findAllByPartParentIdAndPackingStatusIn
(
resultList
=
resultList
.
stream
().
filter
(
packingLibrary
->
!
ids
.
contains
(
packingLibrary
.
getId
())).
collect
(
Collectors
.
toList
());
packingLibrary
.
getId
(),
statuses
);
if
(
in
==
null
||
in
.
size
()
==
0
)
{
// childs.forEach(packingLibrary -> {
resultList
.
add
(
packingLibrary
);
// List<PackingLibrary> in = packingLibraryDao.findAllByPartParentIdAndPackingStatusIn(
}
// packingLibrary.getId(), statuses);
});
// if (in == null || in.size() == 0) {
List
<
PackingLibrary
>
packingLibraries
=
resultList
.
stream
().
filter
(
packingLibrary
->
packingLibrary
.
getIsRoot
()
==
0
).
collect
(
Collectors
.
toList
());
// resultList.add(packingLibrary);
// }
// });
// List<PackingLibrary> packingLibraries = resultList.stream().filter(packingLibrary -> packingLibrary.getIsRoot() == 0).collect(Collectors.toList());
Page
<
PackingLibrary
>
perPage
=
PageUtil
.
getPerPage
(
selectPackingVo
.
getPage
(),
Page
<
PackingLibrary
>
perPage
=
PageUtil
.
getPerPage
(
selectPackingVo
.
getPage
(),
selectPackingVo
.
getSize
(),
packingLibraries
,
selectPackingVo
.
getPageable
());
selectPackingVo
.
getSize
(),
resultList
,
selectPackingVo
.
getPageable
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"page"
,
perPage
);
map
.
put
(
"page"
,
perPage
);
return
ResponseEntity
.
ok
(
map
);
return
ResponseEntity
.
ok
(
map
);
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
d7778fcc
...
@@ -949,12 +949,17 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
...
@@ -949,12 +949,17 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
PackingLibrary
originPacking
=
bindingPackingVo
.
getOriginPacking
();
PackingLibrary
originPacking
=
bindingPackingVo
.
getOriginPacking
();
//选择要绑定的列装
//选择要绑定的列装
PackingLibrary
selectPacking
=
bindingPackingVo
.
getSelectPacking
();
PackingLibrary
selectPacking
=
bindingPackingVo
.
getSelectPacking
();
//0 是装备目录 1 附件目录
if
(
originPacking
.
getIsPart
()
==
0
){
if
(
originPacking
.
getIsPart
()
==
0
){
//列装是装备
//如果是装备目录 则只可以绑在列装目录下
// 要考虑要绑定的列装的是不是装备
if
(
selectPacking
.
getIsPart
()!=
null
){
//如果是附件 不允许绑定
if
(
selectPacking
.
getIsPart
()
==
1
){
if
(
selectPacking
.
getIsPart
()
==
1
){
throw
new
ApiException
(
"附件下不可以绑定列装"
);
throw
new
ApiException
(
"附件下不可以绑定装备"
);
}
}
// 1 是列装目录 0不是
if
(
selectPacking
.
getIsRoot
()
==
0
){
throw
new
ApiException
(
"装备只能绑定在列装目录下面"
);
}
}
}
}
originPacking
.
setPartParentId
(
selectPacking
.
getId
());
originPacking
.
setPartParentId
(
selectPacking
.
getId
());
...
@@ -983,8 +988,9 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
...
@@ -983,8 +988,9 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
packingLibraryDao
.
findAll
(
getSelectSpecification22
(
new
PackingLibrarySelectVo
()));
packingLibraryDao
.
findAll
(
getSelectSpecification22
(
new
PackingLibrarySelectVo
()));
packingLibraryEntities
.
forEach
(
PackingLibrary:
:
setConfigName
);
packingLibraryEntities
.
forEach
(
PackingLibrary:
:
setConfigName
);
//查询列装
//查询列装
List
<
PackingLibrary
>
libraries
=
packingLibraryDao
.
findAllByIdIn
(
packingIds
);
// List<PackingLibrary> libraries = packingLibraryDao.findAllByIdIn(packingIds);
packingLibraryEntities
.
removeAll
(
libraries
);
packingLibraryEntities
=
packingLibraryEntities
.
stream
().
filter
(
packingLibrary
->
!
packingIds
.
contains
(
packingLibrary
.
getId
())).
collect
(
Collectors
.
toList
());
// packingLibraryEntities.removeAll(libraries);
Map
<
Integer
,
PackingLibrary
>
nodeCollect
=
Map
<
Integer
,
PackingLibrary
>
nodeCollect
=
packingLibraryEntities
.
stream
().
collect
(
Collectors
.
toMap
(
PackingLibrary:
:
getId
,
packingLibraryEntity
->
packingLibraryEntity
));
packingLibraryEntities
.
stream
().
collect
(
Collectors
.
toMap
(
PackingLibrary:
:
getId
,
packingLibraryEntity
->
packingLibraryEntity
));
return
GetTreeUtils
.
parseTreeFromDown
(
return
GetTreeUtils
.
parseTreeFromDown
(
...
@@ -1247,4 +1253,16 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
...
@@ -1247,4 +1253,16 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
return
packingLibraries
;
return
packingLibraries
;
}
}
//递归取出最大目录
public
PackingLibrary
getPackingLibrary
(
PackingLibrary
packingLibrary
)
{
Integer
partParentId
=
packingLibrary
.
getPartParentId
();
PackingLibrary
one
=
getOne
(
partParentId
);
if
(
one
.
getIsRoot
()
==
0
)
{
return
getPackingLibrary
(
one
);
}
else
{
return
packingLibrary
;
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论