提交 205ebcb8 authored 作者: zhoushaopan's avatar zhoushaopan

新增了是否捆绑(状态)

上级 a0db30c5
......@@ -54,4 +54,7 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty(value = "货架位置")
private String position;
@ApiModelProperty(value = "是否需要绑定",notes = "0 是绑定, 1 是未绑定")
private Integer IsBinding = 0;
}
......@@ -386,6 +386,7 @@ public class StorageBillController {
taskEntity1 = taskService.start(taskBto);
}
else {
//从草稿进来的
taskEntity1 = taskService.get(storageBillSaveVo.getTaskId());
StorageBill storageBill = storageBillService.getOne(taskEntity1.getBillId());
StorageBill storageBill1 = storageBillSaveVo.toDo();
......@@ -422,29 +423,47 @@ public class StorageBillController {
PackingLibrary packingLibraryEntity = packingLibraryService.getOne(d.getPackingId());
BeanUtils.copyProperties(packingLibraryEntity, deviceLibraryEntity);
deviceLibraryEntity.setId(null);
deviceLibraryEntity.setLifeStatus(2);
deviceLibraryEntity.setLifeStatus(2);//设置为在库状态
BeanUtils.copyProperties(d, deviceLibraryEntity);
deviceLibraryEntity.setStorageBillId(storageBillId);
deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setPartParentId(null);
//如果不是单独的配件,设置父装备id为上一个装备的id
if (d.getIsSinglePart() == 0) {
if (deviceLibraryEntity.getIsPart() == 0) {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
}
if (deviceLibraryEntity.getIsPart() == 1) {
if (parentPackingId!=null) {
for (int i = saveDevices.size()-1;i>=0;i--){
if (packingLibraryEntity.getPartParentId().equals(saveDevices.get(i).getPackingId())){
deviceLibraryEntity.setPartParentId(saveDevices.get(i).getId());
break;
//如果不是单独的配件,设置父装备id为上一个装备的id 0-不是,1-是
if (d.getIsBinding() == 0){
if (d.getIsSinglePart() == 0) {
//0 不是,1:是
if (deviceLibraryEntity.getIsPart() == 0) {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
}
if (deviceLibraryEntity.getIsPart() == 1) {
if (parentPackingId!=null) {
for (int i = saveDevices.size()-1;i>=0;i--){
if (packingLibraryEntity.getPartParentId().equals(saveDevices.get(i).getPackingId())){
deviceLibraryEntity.setPartParentId(saveDevices.get(i).getId());
}
}
}
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
}
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
}
}
// if (d.getIsSinglePart() == 0) {
// //0 不是,1:是
// if (deviceLibraryEntity.getIsPart() == 0) {
// saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
// }
// if (deviceLibraryEntity.getIsPart() == 1) {
// if (parentPackingId!=null) {
// for (int i = saveDevices.size()-1;i>=0;i--){
// if (packingLibraryEntity.getPartParentId().equals(saveDevices.get(i).getPackingId())){
// deviceLibraryEntity.setPartParentId(saveDevices.get(i).getId());
// }
// }
// }
// saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
// }
// }
//如果是单独的配件,不用设置父装备id
else {
saveEntity = deviceLibraryService.addEntity(deviceLibraryEntity);
......@@ -523,7 +542,7 @@ public class StorageBillController {
messageBto.setInvolveUserIdList(userPublicService.findOtherUser(userId));
messageBto.setBusinessType(taskEntity1.getBusinessType());
messageService.add(messageBto);
//判断是否有申请任务序列号
//判断是否有申请任务序列号 未导入申请任务但是序列号是申请任务的序列号
if (storageBillSaveVo.getApplyTaskIds()==null||storageBillSaveVo.getApplyTaskIds().isEmpty()){
if (storageBillSaveVo.getHasTaskSeqs()!=null&&storageBillSaveVo.getHasTaskSeqs().size()>0){
List<String> hasTaskSeqs = storageBillSaveVo.getHasTaskSeqs();
......@@ -704,6 +723,7 @@ public class StorageBillController {
@GetMapping(value = "/selectUnPrintStorageTask")
@Transactional(rollbackFor = Exception.class)
public ResponseEntity selectUnPrintStorageTask() {
//storageStatus 入库状态(0:草稿,1:审核失败,2:已入库)
List<StorageBill> storageBills = storageBillDao.findAllByStorageStatusAndIsPrint(2,0);
List<Task> tasks = taskDao.findAllByBusinessTypeAndBillIdIn(2,storageBills.stream().map(StorageBill::getId).collect(Collectors.toList()));
return ResponseEntity.ok(tasks.stream().map(Task::parse2Bto).map(TaskBto::toVo).sorted(Comparator.comparing(TaskUserVo::getUpdateTime)).collect(Collectors.toList()));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论