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

Loading…
Cancel
Save