|
|
|
@ -16,14 +16,12 @@
|
|
|
|
|
*/ |
|
|
|
|
package com.logpm.warehouse.service.impl; |
|
|
|
|
|
|
|
|
|
import com.alibaba.nacos.plugin.auth.constant.Constants; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.BeanUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.logpm.basicdata.entity.*; |
|
|
|
|
import com.logpm.basicdata.feign.*; |
|
|
|
|
import com.logpm.distribution.entity.DistributionParcelListEntity; |
|
|
|
@ -47,7 +45,6 @@ import com.logpm.warehouse.service.*;
|
|
|
|
|
import com.logpm.warehouse.vo.*; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
|
import org.apache.ibatis.annotations.Param; |
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
@ -57,7 +54,6 @@ import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.AesUtil; |
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -602,7 +598,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<TaskContractVO> selectcontractList(IPage<TaskContractVO> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
public IPage<TaskContractVO> selectcontractList(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
List<Long> collect = this.getmyWarehouseList(); |
|
|
|
|
baseMapper.setSqlMode(); |
|
|
|
|
String goodsType = taskSearchDTO.getGoodsType(); |
|
|
|
@ -613,11 +609,13 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
TaskQuestEntity taskQuestEntity = baseMapper.selectById(taskSearchDTO.getTaskId()); |
|
|
|
|
QuestDetailEntity questDetail = new QuestDetailEntity(); |
|
|
|
|
questDetail.setQuestId( taskSearchDTO.getTaskId()); |
|
|
|
|
List<QuestDetailEntity> questDetailEntityList = baseMapper.selectTaskInfo(taskQuestEntity.getQuestNum(),questDetail); |
|
|
|
|
questDetail.setQuestType(3); |
|
|
|
|
IPage<TaskContractVO> taskPageList = new Page<>(); |
|
|
|
|
IPage<QuestDetailEntity> questDetailEntityList = baseMapper.selectTaskInfo(page,taskQuestEntity.getQuestNum(),questDetail); |
|
|
|
|
if (Func.isEmpty(questDetailEntityList)){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
Map<Integer, List<QuestDetailEntity>> questDetailMap = questDetailEntityList.stream().collect(Collectors.groupingBy(QuestDetailEntity::getQuestTarget)); |
|
|
|
|
Map<Integer, List<QuestDetailEntity>> questDetailMap = questDetailEntityList.getRecords().stream().collect(Collectors.groupingBy(QuestDetailEntity::getQuestTarget)); |
|
|
|
|
//订制品
|
|
|
|
|
List<QuestDetailEntity> questDetailEntities = questDetailMap.get(1); |
|
|
|
|
List<QuestDetailEntity> zeroQuestDetailEntities = questDetailMap.get(2); |
|
|
|
@ -677,12 +675,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return page.setRecords(list); |
|
|
|
|
return taskPageList.setRecords(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public R selecttrayList(IPage<TaskTrayVO> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
public R selecttrayList(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
|
|
|
|
|
//todo 验证盘点信息
|
|
|
|
|
//先判定盘点任务是否已结束
|
|
|
|
@ -707,7 +705,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询传入的托盘数据
|
|
|
|
|
List<QuestDetailEntity> list = getQuestDetailList(taskSearchDTO,myCurrentWarehouse.getId(),trayByTrayCode.getId()); |
|
|
|
|
List<QuestDetailEntity> list = getQuestDetailList( page,taskSearchDTO,myCurrentWarehouse.getId(),trayByTrayCode.getId()); |
|
|
|
|
// List<TaskTrayVO> list = getTaskTrayInfo(page,taskSearchDTO,collect);// 查询有没有当次盘点任务的托盘数据
|
|
|
|
|
if (!list.isEmpty()){ //有盘点数据
|
|
|
|
|
return R.data(getTaskTrayInfo(list)); |
|
|
|
@ -721,7 +719,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
//返回托盘信息
|
|
|
|
|
return getTrayInfo(trayByTrayCode.getId(),myCurrentWarehouse.getId(),trayByTrayCode.getPalletCode()); |
|
|
|
|
case 1: |
|
|
|
|
List<QuestDetailEntity> questDetailList = getQuestDetailList(taskSearchDTO,myCurrentWarehouse.getId(),trayByTrayCode.getId()); |
|
|
|
|
List<QuestDetailEntity> questDetailList = getQuestDetailList(page,taskSearchDTO,myCurrentWarehouse.getId(),trayByTrayCode.getId()); |
|
|
|
|
return R.data(getTaskTrayInfo(questDetailList)); |
|
|
|
|
case 2: |
|
|
|
|
//返回托盘信息
|
|
|
|
@ -735,7 +733,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
//查询有没有托盘的数据
|
|
|
|
|
List<QuestDetailEntity> list1 = getQuestDetailList(taskSearchDTO,myCurrentWarehouse.getId(),null); |
|
|
|
|
List<QuestDetailEntity> list1 = getQuestDetailList(page,taskSearchDTO,myCurrentWarehouse.getId(),null); |
|
|
|
|
if(!list1.isEmpty()){ |
|
|
|
|
// int sum = list1.stream().mapToInt(QuestDetailEntity::getStockNum).sum(); //总数
|
|
|
|
|
return R.data(getTaskTrayInfo(list1)); |
|
|
|
@ -903,7 +901,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
* @param trayId |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private List<QuestDetailEntity> getQuestDetailList(TaskSearchDTO taskSearchDTO,Long warehouseId,Long trayId){ |
|
|
|
|
private List<QuestDetailEntity> getQuestDetailList(IPage<Object> page,TaskSearchDTO taskSearchDTO,Long warehouseId,Long trayId){ |
|
|
|
|
TaskQuestEntity taskQuestEntity = baseMapper.selectById(taskSearchDTO.getTaskId()); |
|
|
|
|
// Wrappers.<QuestDetailEntity>query().lambda()
|
|
|
|
|
// .eq(QuestDetailEntity::getWarehouseId, warehouseId)
|
|
|
|
@ -913,10 +911,11 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
QuestDetailEntity questDetail = new QuestDetailEntity(); |
|
|
|
|
questDetail.setWarehouseId(warehouseId); |
|
|
|
|
questDetail.setQuestId(taskSearchDTO.getTaskId()); |
|
|
|
|
questDetail.setQuestType(4); |
|
|
|
|
if(ObjectUtils.isNotNull(trayId)){ |
|
|
|
|
questDetail.setTrayId(String.valueOf(trayId)); |
|
|
|
|
} |
|
|
|
|
return baseMapper.selectTaskTrayInfo(taskQuestEntity.getQuestNum(),questDetail); |
|
|
|
|
return baseMapper.selectTaskTrayInfo( page,taskQuestEntity.getQuestNum(),questDetail); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -929,7 +928,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
@Override |
|
|
|
|
public R trayListInfo(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
List<QuestDetailEntity> questDetailList = getQuestDetailList(taskSearchDTO, myCurrentWarehouse.getId(), taskSearchDTO.getTrayId()); |
|
|
|
|
List<QuestDetailEntity> questDetailList = getQuestDetailList(page,taskSearchDTO, myCurrentWarehouse.getId(), taskSearchDTO.getTrayId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1128,7 +1127,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<QuestDetailEntity> allocationDetailByPackage(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
public IPage<QuestDetailEntity> allocationDetailByPackage(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
|
|
|
|
|
Long allocationId = taskSearchDTO.getAllocationId(); |
|
|
|
|
Long warehouseId = taskSearchDTO.getWarehouseId(); |
|
|
|
@ -1165,12 +1164,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
questDetail.setQuestTarget(1); |
|
|
|
|
questDetail.setWarehouseId(warehouseId); |
|
|
|
|
questDetail.setAllocationId(String.valueOf(allocationId)); |
|
|
|
|
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(byId.getQuestNum(),questDetail); |
|
|
|
|
IPage<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(page,byId.getQuestNum(),questDetail); |
|
|
|
|
// List<QuestDetailEntity> questDetailEntities = questDetailService.list(questDetailEntityQueryWrapper);
|
|
|
|
|
if (!questDetailEntities.isEmpty()) { |
|
|
|
|
if (!questDetailEntities.getRecords().isEmpty()) { |
|
|
|
|
return questDetailEntities; |
|
|
|
|
} |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
return null; |
|
|
|
|
//如果还没有存入
|
|
|
|
|
//查询货位上的所有包条
|
|
|
|
|
//然后存入detail表
|
|
|
|
@ -1186,7 +1185,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<QuestDetailEntity> allocationDetailByZero(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
public IPage<QuestDetailEntity> allocationDetailByZero(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
Long questId = taskSearchDTO.getQuestId(); |
|
|
|
|
Long allocationId = taskSearchDTO.getAllocationId(); |
|
|
|
|
Long warehouseId = taskSearchDTO.getWarehouseId(); |
|
|
|
@ -1223,12 +1222,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
questDetail.setQuestTarget(2); |
|
|
|
|
questDetail.setWarehouseId(warehouseId); |
|
|
|
|
questDetail.setAllocationId(String.valueOf(allocationId)); |
|
|
|
|
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(byId.getQuestNum(),questDetail); |
|
|
|
|
IPage<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(page,byId.getQuestNum(),questDetail); |
|
|
|
|
// List<QuestDetailEntity> questDetailEntities = questDetailService.list(questDetailEntityQueryWrapper);
|
|
|
|
|
if (!questDetailEntities.isEmpty()) { |
|
|
|
|
if (!questDetailEntities.getRecords().isEmpty()) { |
|
|
|
|
return questDetailEntities; |
|
|
|
|
} |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
return null; |
|
|
|
|
//如果还没有存入
|
|
|
|
|
//查询货位上的所有包条
|
|
|
|
|
//然后存入detail表
|
|
|
|
@ -1244,7 +1243,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<QuestDetailEntity> allocationDetailByStock(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
public IPage<QuestDetailEntity> allocationDetailByStock(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
Long questId = taskSearchDTO.getQuestId(); |
|
|
|
|
Long allocationId = taskSearchDTO.getAllocationId(); |
|
|
|
|
Long warehouseId = taskSearchDTO.getWarehouseId(); |
|
|
|
@ -1281,11 +1280,11 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
questDetail.setQuestTarget(3); |
|
|
|
|
questDetail.setWarehouseId(warehouseId); |
|
|
|
|
questDetail.setAllocationId(String.valueOf(allocationId)); |
|
|
|
|
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(byId.getQuestNum(),questDetail); |
|
|
|
|
if (!questDetailEntities.isEmpty()) { |
|
|
|
|
IPage<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(page,byId.getQuestNum(),questDetail); |
|
|
|
|
if (!questDetailEntities.getRecords().isEmpty()) { |
|
|
|
|
return questDetailEntities; |
|
|
|
|
} |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
return null; |
|
|
|
|
//如果还没有存入
|
|
|
|
|
//查询货位上的所有包条
|
|
|
|
|
//然后存入detail表
|
|
|
|
@ -1588,7 +1587,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R contractQuestDetail(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
public R contractQuestDetail(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
if (Func.isEmpty(taskSearchDTO.getTaskId())){ |
|
|
|
|
log.error("#####################TaskId参数缺失:{}",taskSearchDTO.getTaskId()); |
|
|
|
|
return null; |
|
|
|
@ -1616,8 +1615,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
}else { |
|
|
|
|
detailEntity.setOrderCode(taskSearchDTO.getOrderCode()); |
|
|
|
|
} |
|
|
|
|
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(),detailEntity); |
|
|
|
|
List<Integer> type = questDetailEntities.stream().filter(f -> Func.isNotEmpty(f.getQuestTarget())).map(QuestDetailEntity::getQuestTarget).distinct().collect(Collectors.toList()); |
|
|
|
|
IPage<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),detailEntity); |
|
|
|
|
List<Integer> type = questDetailEntities.getRecords().stream().filter(f -> Func.isNotEmpty(f.getQuestTarget())).map(QuestDetailEntity::getQuestTarget).distinct().collect(Collectors.toList()); |
|
|
|
|
if (Func.isEmpty(type)){ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
@ -1629,12 +1628,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
AtomicInteger total = new AtomicInteger(); |
|
|
|
|
AtomicInteger operationNum = new AtomicInteger(); |
|
|
|
|
ArrayList<TaskPackagelistVO> taskPackagelistVOS = new ArrayList<>(); |
|
|
|
|
List<String> orderCode = questDetailEntities.stream().map(QuestDetailEntity::getOrderCode).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> orderCode = questDetailEntities.getRecords().stream().map(QuestDetailEntity::getOrderCode).distinct().collect(Collectors.toList()); |
|
|
|
|
if (orderCode.size() != 1){ |
|
|
|
|
log.error("###################orderId查询类型异常:{}",taskSearchDTO.getOrderId()); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
for (QuestDetailEntity questDetailEntity : questDetailEntities) { |
|
|
|
|
for (QuestDetailEntity questDetailEntity : questDetailEntities.getRecords()) { |
|
|
|
|
TaskPackagelistVO packagelistVO = new TaskPackagelistVO(); |
|
|
|
|
total.getAndAdd(questDetailEntity.getStockNum()); |
|
|
|
|
if (questDetailEntity.getQuestStatus().equals(1)){ |
|
|
|
@ -1663,20 +1662,20 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
packagelistVO.setCurrentStatus("1"); // 默认在库
|
|
|
|
|
taskPackagelistVOS.add(packagelistVO); |
|
|
|
|
} |
|
|
|
|
List<Long> orderId = questDetailEntities.stream().map(QuestDetailEntity::getOrderId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> orderId = questDetailEntities.getRecords().stream().map(QuestDetailEntity::getOrderId).distinct().collect(Collectors.toList()); |
|
|
|
|
if (type.get(0).equals(1)){ |
|
|
|
|
contractVO.setOrderId(orderId.get(0)); |
|
|
|
|
contractVO.setOrderCode(orderCode.get(0)); |
|
|
|
|
contractVO.setIsZero(0); |
|
|
|
|
contractVO.setIsInventory(0); |
|
|
|
|
}else if (type.get(0).equals(2)){ |
|
|
|
|
List<String> zeroOrderCode = questDetailEntities.stream().map(QuestDetailEntity::getOrderCode).distinct().collect(Collectors.toList()); |
|
|
|
|
List<String> zeroOrderCode = questDetailEntities.getRecords().stream().map(QuestDetailEntity::getOrderCode).distinct().collect(Collectors.toList()); |
|
|
|
|
contractVO.setOrderId(orderId.get(0)); |
|
|
|
|
contractVO.setOrderCode(zeroOrderCode.get(0)); |
|
|
|
|
contractVO.setIsZero(1); |
|
|
|
|
contractVO.setIsInventory(0); |
|
|
|
|
}else if (type.get(0).equals(3)){ |
|
|
|
|
List<Long> inventoryOrderId = questDetailEntities.stream().map(QuestDetailEntity::getStockId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<Long> inventoryOrderId = questDetailEntities.getRecords().stream().map(QuestDetailEntity::getStockId).distinct().collect(Collectors.toList()); |
|
|
|
|
contractVO.setOrderId(inventoryOrderId.get(0)); |
|
|
|
|
contractVO.setIsZero(0); |
|
|
|
|
contractVO.setIsInventory(1); |
|
|
|
@ -1817,13 +1816,15 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询盘点任务数据 |
|
|
|
|
* |
|
|
|
|
* @param page |
|
|
|
|
* @param questNum |
|
|
|
|
* @param questDetail |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<QuestDetailEntity> selectTaskInfo(String questNum, QuestDetailEntity questDetail) { |
|
|
|
|
return baseMapper.selectTaskInfo(questNum,questDetail); |
|
|
|
|
public IPage<QuestDetailEntity> selectTaskInfo(IPage<Object> page, String questNum, QuestDetailEntity questDetail) { |
|
|
|
|
return baseMapper.selectTaskInfo(page,questNum,questDetail); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1859,7 +1860,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public R queryContract(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
public R queryContract(IPage<Object> page, TaskSearchDTO taskSearchDTO) { |
|
|
|
|
// String goodsType = taskSearchDTO.getGoodsType();
|
|
|
|
|
Integer type = taskSearchDTO.getType(); |
|
|
|
|
if (Func.isEmpty(type)){ |
|
|
|
@ -1890,6 +1891,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
Long taskQuestId = taskSearchDTO.getTaskId(); |
|
|
|
|
verifyTask(taskQuestId, taskSearchDTO.getWarehouseId()); |
|
|
|
|
TaskQuestEntity taskQuestEntity = baseMapper.selectById(taskQuestId); |
|
|
|
|
taskSearchDTO.setQuestNum(taskQuestEntity.getQuestNum()); |
|
|
|
|
List<TaskQuestChildEntity> taskQuestChildEntityList = taskQuestChildService.list(Wrappers.<TaskQuestChildEntity>query().lambda() |
|
|
|
|
.eq(TaskQuestChildEntity::getQuestId, taskQuestId) |
|
|
|
|
.eq(TaskQuestChildEntity::getRefType, 1)); |
|
|
|
@ -1908,7 +1911,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
log.error("###################盘点任务查询失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<TaskContractVO> taskContractVOS = new ArrayList<>(); |
|
|
|
|
List<TaskContractVO> taskContractVOS = new ArrayList<>(); |
|
|
|
|
String goodsType = taskSearchDTO.getGoodsType(); |
|
|
|
|
if (Func.isEmpty(goodsType)){ |
|
|
|
|
log.error("####################参数异常:{}",goodsType); |
|
|
|
@ -1928,12 +1931,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
questDetail.setQuestType(3); |
|
|
|
|
questDetail.setWarehouseId(taskSearchDTO.getWarehouseId()); |
|
|
|
|
questDetail.setOrderCode(incomingBatch); |
|
|
|
|
List<QuestDetailEntity> questDetailEntityList = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(),questDetail); |
|
|
|
|
IPage<QuestDetailEntity> questDetailEntityList = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),questDetail); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(questDetailEntityList) && questDetailEntityList.size()>0){ |
|
|
|
|
if (Func.isNotEmpty(questDetailEntityList) && questDetailEntityList.getRecords().size()>0){ |
|
|
|
|
TaskContractVO taskContractVO = new TaskContractVO(); |
|
|
|
|
Map<String, List<QuestDetailEntity>> orderMap = questDetailEntityList.stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderCode)); |
|
|
|
|
Map<String, List<QuestDetailEntity>> orderMap = questDetailEntityList.getRecords().stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderCode)); |
|
|
|
|
orderMap.forEach((k,v)->{ |
|
|
|
|
List<QuestDetailEntity> questDetailEntities = orderMap.get(k); |
|
|
|
|
taskContractVO.setTotal(v.stream().mapToInt(QuestDetailEntity::getStockNum).sum()); |
|
|
|
@ -1984,7 +1987,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
if (distributionStockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) { |
|
|
|
|
AtomicInteger libNum = new AtomicInteger(); |
|
|
|
|
parcelList.forEach(p -> { |
|
|
|
|
/*parcelList.forEach(p -> { |
|
|
|
|
QuestDetailEntity questDetailEntity = new QuestDetailEntity(); |
|
|
|
|
if (!p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yichuku.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { |
|
|
|
|
WarehouseTrayEntity warehouseTrayEntity = baseMapper.selectTratInfo(p.getId(), taskSearchDTO.getWarehouseId()); |
|
|
|
@ -2013,7 +2016,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(),detailEntities); |
|
|
|
|
// questDetailService.save(questDetailEntity);
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
});*/ |
|
|
|
|
taskContractVO.setZktotal(libNum.get()); |
|
|
|
|
taskContractVO.setIsZero(0); |
|
|
|
|
taskContractVO.setIsInventory(0); |
|
|
|
@ -2051,7 +2054,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
taskContractVOS.add(contractVO); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
} |
|
|
|
|
/* else { |
|
|
|
|
AtomicInteger libNum = new AtomicInteger(); |
|
|
|
|
QuestDetailEntity questDetailEntity = new QuestDetailEntity(); |
|
|
|
|
DistributionStockArticleEntity stockArticleInfo = getStockArticleInfo(distributionStockArticleEntity.getId()); |
|
|
|
@ -2082,7 +2086,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
taskContractVO.setIsZero(1); |
|
|
|
|
taskContractVO.setIsInventory(0); |
|
|
|
|
taskContractVOS.add(taskContractVO); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2120,7 +2124,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
taskContractVO.setIsInventory(1); |
|
|
|
|
taskContractVOS.add(taskContractVO); |
|
|
|
|
}); |
|
|
|
|
}else { |
|
|
|
|
} |
|
|
|
|
/* else { |
|
|
|
|
List<DistributionStockListEntity> stockListByWarehouseIdAndMarketAndStockListInfo = distributionStockListClient.getStockListByWarehouseIdAndMarketAndStockListInfo(incomingBatch, marketNames, taskSearchDTO.getWarehouseId()); |
|
|
|
|
if (Func.isEmpty(stockListByWarehouseIdAndMarketAndStockListInfo)){ |
|
|
|
|
return Resp.scanFail("操作失败","该库存品不存在此任务中"); |
|
|
|
@ -2154,7 +2159,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
taskContractVO.setUnTotal(0); |
|
|
|
|
taskContractVOS.add(taskContractVO); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
log.error("####################缺少货物类型字段"); |
|
|
|
|