Browse Source

1.盘点-代码还原

chenglong
zhenghaoyu 1 year ago
parent
commit
34bd78e4c8
  1. 117
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

117
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -765,24 +765,21 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 1);
List<QuestDetailEntity> list = new ArrayList<>();
AtomicBoolean s = new AtomicBoolean(false);
taskSearchDTO.getQuestDetailIds().stream().forEach(i -> {
taskSearchDTO.getQuestDetailIds().forEach(i -> {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", i);
//查询当前包件盘点状态
// boolean b = questDetailList.stream().anyMatch(q -> q.getId().equals(i) && q.getQuestStatus().equals(1));
// if(b){
// s.set(true);
// }
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(Long.valueOf(i));
questDetail.setQuestStatus(1);
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setInventoryUser(user.getUserId());
questDetail.setInventoryTime(new Date());
// questDetail.setId(Long.valueOf(i));
// questDetail.setQuestStatus(1);
list.add(questDetail);
if(ObjectUtils.isNotNull(i)){
//查询当前包件盘点状态
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(Long.valueOf(i));
questDetail.setQuestStatus(1);
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setInventoryUser(user.getUserId());
questDetail.setInventoryTime(new Date());
list.add(questDetail);
}
});
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 1);
@ -854,29 +851,29 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
childList.add(addQuestDetailChild(noRepairNum, "40", taskID, warehouseId, questNum));
childList.add(addQuestDetailChild(deliveNum, "50", taskID, warehouseId, questNum));
childList.add(addQuestDetailChild(noReceivedNum, "60", taskID, warehouseId, questNum));
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if (b) {
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList);
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(1); //已盘
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if (ObjectUtils.isNotNull(i.getTrayId())) {
questDetail.setTrayId(i.getTrayId());
questDetail.setTrayCode(i.getTrayCode());
}
list.add(questDetail);
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(), list);
} else {
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum + "_child", collect);
}
}
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if (b) {
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList);
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(1); //已盘
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if (ObjectUtils.isNotNull(i.getTrayId())) {
questDetail.setTrayId(i.getTrayId());
questDetail.setTrayCode(i.getTrayCode());
}
list.add(questDetail);
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(), list);
} else {
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum + "_child", collect);
}
}
//是否修改库位
QuestDetailEntity questDetail = new QuestDetailEntity();
@ -1321,16 +1318,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
childList.add(addQuestDetailChild(i.getNoRepairNum(), "40", i.getId(), myCurrentWarehouse.getId(), i.getQuestNum()));
childList.add(addQuestDetailChild(i.getDeliveNum(), "50", i.getId(), myCurrentWarehouse.getId(), i.getQuestNum()));
childList.add(addQuestDetailChild(i.getNoReceivedNum(), "60", i.getId(), myCurrentWarehouse.getId(), i.getQuestNum()));
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if (b) {
//添加
baseMapper.insertQuestDetailChildList(i.getQuestNum() + "_child", childList);
} else {
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(i.getQuestNum() + "_child", collect);
}
}
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if (b) {
//添加
baseMapper.insertQuestDetailChildList(i.getQuestNum() + "_child", childList);
} else {
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(i.getQuestNum() + "_child", collect);
}
}
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
QuestDetailEntity questDetail = new QuestDetailEntity();
@ -1585,7 +1582,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return list;
} catch (Exception e) {
log.error(">>>>>>>>>>>>> 查询货 位异常报错",e);
log.error(">>>>>>>>>>>>> 查询货 位异常报错",e);
return new ArrayList<>();
}
@ -2382,16 +2379,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
childList.add(addQuestDetailChild(noRepairNum, "40", questDetaiId, warehouseId, taskQuestEntity.getQuestNum()));
childList.add(addQuestDetailChild(deliveNum, "50", questDetaiId, warehouseId, taskQuestEntity.getQuestNum()));
childList.add(addQuestDetailChild(noReceivedNum, "60", questDetaiId, warehouseId, taskQuestEntity.getQuestNum()));
boolean b = childList.stream().anyMatch(i -> ObjectUtils.isNull(i.getId()));
if (b) {
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList);
} else {
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter(i -> ObjectUtils.isNotNull(i.getQuestNum()) && i.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(taskQuestEntity.getQuestNum() + "_child", collect);
}
// questDetailChildService.saveOrUpdateBatch(childList);
boolean b = childList.stream().anyMatch(i -> ObjectUtils.isNull(i.getId()));
if (b) {
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList);
} else {
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter(i -> ObjectUtils.isNotNull(i.getQuestNum()) && i.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(taskQuestEntity.getQuestNum() + "_child", collect);
}
// questDetailChildService.saveOrUpdateBatch(childList);
detailEntity.setQuestStatus(1);
//修改状态
QuestDetailEntity q = new QuestDetailEntity();

Loading…
Cancel
Save