Browse Source

修改打托

training
caoyizhong 1 year ago
parent
commit
3c98e7f0b0
  1. 22
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

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

@ -49,6 +49,7 @@ import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -309,7 +310,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
BasicdataTrayEntity trayByTrayCode = basicdataTrayClient.getTrayByTrayCode(taskSearchDTO.getTrayCode());
Optional<BasicdataTrayEntity> trayByTrayCode1 = Optional.ofNullable(trayByTrayCode);
if(!trayByTrayCode1.isPresent()){
Resp.scanFail("托盘码不存在!","托盘码不存在!");
return Resp.scanFail("托盘码不存在!","托盘码不存在!");
}
@ -397,7 +398,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
* 托盘ID信息货物处理
* @return
*/
private TaskTrayVO getTaskTrayInfoOwn(List<QuestDetailEntity> list1,String type){
private TaskTrayVO getTaskTrayInfoOwn(List<QuestDetailEntity> list1,String type,Long warehouseId){
TaskTrayVO taskTrayVO = new TaskTrayVO();
list1.stream().collect(Collectors.groupingBy(QuestDetailEntity::getTrayId))
.forEach((k,v) ->{
@ -409,7 +410,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
taskTrayVO.setTrayCode(p.getTrayCode());
num.set(num.get() + p.getStockNum());
if(p.getQuestStatus().equals(1)){
unTotal.set(unTotal.get() + p.getQuestStatus());
List<QuestDetailChildEntity> list = questDetailChildService.list(Wrappers.<QuestDetailChildEntity>query().lambda()
.eq(QuestDetailChildEntity::getQuestDetailId, p.getId())
.eq(QuestDetailChildEntity::getWarehouseId, warehouseId)
);
if(!list.isEmpty()){
int sum = list.stream().mapToInt(QuestDetailChildEntity::getQuestNum).sum();
unTotal.set(unTotal.get() + sum);
}else{
throw new ServiceException("未找到对应的处理数据!!");
}
}
QuestDetailVO questDetailVO = new QuestDetailVO();
switch (p.getQuestTarget()){
@ -417,10 +427,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
taskTrayVO.setGoodsType("定制品");
break;
case 2:
taskTrayVO.setGoodsType("零担");
break;
case 3:
taskTrayVO.setGoodsType("库存品");
break;
}
@ -473,7 +487,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return R.data(getTaskTrayInfoOwn(questDetailList,taskSearchDTO.getGoodsType()));
return R.data(getTaskTrayInfoOwn(questDetailList,taskSearchDTO.getGoodsType(),myCurrentWarehouse.getId()));
}

Loading…
Cancel
Save