提交 09fb0e41 authored 作者: 邓砥奕's avatar 邓砥奕

更新

上级 952d78a6
...@@ -287,7 +287,7 @@ public class PackingController { ...@@ -287,7 +287,7 @@ public class PackingController {
@ApiOperation(value = "配发设置区间") @ApiOperation(value = "配发设置区间")
@PostMapping("/setAllotSeqs/{id}/{num}/{seq}") @PostMapping("/setAllotSeqs/{id}/{num}/{seq}")
public ResponseEntity setAllotSeqs(@PathVariable("id") int id,@PathVariable("num") int num,@PathVariable("seq") String seq){ public ResponseEntity setAllotSeqs(@PathVariable("id") int id,@PathVariable("num") int num,@PathVariable("seq") String seq){
List<DeviceLibrary> deviceLibraries = packingLibraryService.getAllDevSeqs(id); List<DeviceLibrary> deviceLibraries = packingLibraryService.getAllotDevSeqs(id);
List<String> existSeqs = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList()); List<String> existSeqs = deviceLibraries.stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(seq); List<String> inputSeqs = DeviceSeqUtil.selectDeviceSeqs(seq);
if (existSeqs.containsAll(inputSeqs)){ if (existSeqs.containsAll(inputSeqs)){
......
...@@ -136,6 +136,8 @@ public interface PackingLibraryService { ...@@ -136,6 +136,8 @@ public interface PackingLibraryService {
List<DeviceLibrary> getAllDevSeqs(Integer packingId); List<DeviceLibrary> getAllDevSeqs(Integer packingId);
List<DeviceLibrary> getAllotDevSeqs(Integer packingId);
Boolean modelIsExist(String model); Boolean modelIsExist(String model);
/** /**
......
...@@ -525,6 +525,15 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -525,6 +525,15 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
return deviceLibraryDao.findAll(predicateBuilder.build()); return deviceLibraryDao.findAll(predicateBuilder.build());
} }
@Override
public List<DeviceLibrary> getAllotDevSeqs(Integer packingId) {
PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
predicateBuilder.eq("ownUnit", userUtils.getCurrentUserUnitName());
predicateBuilder.eq("lifeStatus", 2);
predicateBuilder.eq("packingId", packingId);
return deviceLibraryDao.findAll(predicateBuilder.build());
}
@Override @Override
public Boolean modelIsExist(String model) { public Boolean modelIsExist(String model) {
PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and(); PredicateBuilder<PackingLibrary> predicateBuilder = Specifications.and();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论