|
|
@ -691,17 +691,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ |
|
|
|
//先判定盘点任务是否已结束
|
|
|
|
//先判定盘点任务是否已结束
|
|
|
|
verifyTask(questId, warehouseId); |
|
|
|
verifyTask(questId, warehouseId); |
|
|
|
|
|
|
|
|
|
|
|
//先判断库位是否有数据
|
|
|
|
|
|
|
|
List<QuestDetailEntity> lsPackage = warehouseUpdownGoodsMapper.allocationDetailByPackage(taskSearchDTO); |
|
|
|
|
|
|
|
List<QuestDetailEntity> lsZero = warehouseUpdownGoodsMapper.allocationDetailByZero(taskSearchDTO); |
|
|
|
|
|
|
|
List<QuestDetailEntity> lsStock = warehouseUpdownGoodsMapper.allocationDetailByStock(taskSearchDTO); |
|
|
|
|
|
|
|
Integer size = lsPackage.size() + lsZero.size() + lsStock.size(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(size == 0){ |
|
|
|
|
|
|
|
log.warn("###########allocationDetailByPackage: 未有数据在盘点计划中 questId={}",questId); |
|
|
|
|
|
|
|
throw new CustomerException(403,"未有数据在盘点计划中"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//先查询任务的过滤商场
|
|
|
|
//先查询任务的过滤商场
|
|
|
|
QueryWrapper<TaskQuestChildEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<TaskQuestChildEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("quest_id", questId) |
|
|
|
queryWrapper.eq("quest_id", questId) |
|
|
@ -1090,6 +1079,21 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ |
|
|
|
questDetailEntity.setGroundingPositionCode(positionCode); |
|
|
|
questDetailEntity.setGroundingPositionCode(positionCode); |
|
|
|
questDetailEntity.setIsNew(1); |
|
|
|
questDetailEntity.setIsNew(1); |
|
|
|
questDetailService.save(questDetailEntity); |
|
|
|
questDetailService.save(questDetailEntity); |
|
|
|
|
|
|
|
Long questDetailId = questDetailEntity.getId(); |
|
|
|
|
|
|
|
Integer stockNum = questDetailEntity.getStockNum(); |
|
|
|
|
|
|
|
Integer lossNum = 0; |
|
|
|
|
|
|
|
Integer deliveNum = 0; |
|
|
|
|
|
|
|
Integer wornNum = 0; |
|
|
|
|
|
|
|
Integer noReceivedNum = 0; |
|
|
|
|
|
|
|
Integer noRepairNum = 0; |
|
|
|
|
|
|
|
List<QuestDetailChildEntity> childList = new ArrayList<>(); |
|
|
|
|
|
|
|
childList.add(addQuestDetailChild(stockNum,"10",questDetailId,warehouseId)); |
|
|
|
|
|
|
|
childList.add(addQuestDetailChild(wornNum,"20",questDetailId,warehouseId)); |
|
|
|
|
|
|
|
childList.add(addQuestDetailChild(lossNum,"30",questDetailId,warehouseId)); |
|
|
|
|
|
|
|
childList.add(addQuestDetailChild(noRepairNum,"40",questDetailId,warehouseId)); |
|
|
|
|
|
|
|
childList.add(addQuestDetailChild(deliveNum,"50",questDetailId,warehouseId)); |
|
|
|
|
|
|
|
childList.add(addQuestDetailChild(noReceivedNum,"60",questDetailId,warehouseId)); |
|
|
|
|
|
|
|
questDetailChildService.saveOrUpdateBatch(childList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1214,6 +1218,77 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ |
|
|
|
return questDetailVOList; |
|
|
|
return questDetailVOList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R questScanAllcation(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
|
|
|
log.warn("###########questScanAllcation: 盘点扫码库位 "); |
|
|
|
|
|
|
|
Long warehouseId = taskSearchDTO.getWarehouseId(); |
|
|
|
|
|
|
|
Long allocationId = taskSearchDTO.getAllocationId(); |
|
|
|
|
|
|
|
Long questId = taskSearchDTO.getQuestId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
verifyTask(questId,warehouseId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//返回库位信息
|
|
|
|
|
|
|
|
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId); |
|
|
|
|
|
|
|
if (Objects.isNull(goodsAllocationEntity)) { |
|
|
|
|
|
|
|
log.warn("###########saveNewQuestDetail: 库位信息不存在 allocationId={}", allocationId); |
|
|
|
|
|
|
|
throw new CustomerException(403, "库位信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Long wid = goodsAllocationEntity.getWarehouseId(); |
|
|
|
|
|
|
|
if (!wid.equals(warehouseId)) { |
|
|
|
|
|
|
|
log.warn("###########saveNewQuestDetail: 库位不在当前仓 allocationId={}", allocationId); |
|
|
|
|
|
|
|
throw new CustomerException(403, "库位不在当前仓"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId(); |
|
|
|
|
|
|
|
BasicdataGoodsShelfEntity basicdataGoodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId); |
|
|
|
|
|
|
|
if (Objects.isNull(basicdataGoodsShelfEntity)) { |
|
|
|
|
|
|
|
log.warn("###########saveNewQuestDetail: 货架信息不存在 goodsShelfId={}", goodsShelfId); |
|
|
|
|
|
|
|
throw new CustomerException(403, "货架信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Long goodsAreaId = basicdataGoodsShelfEntity.getGoodsAreaId(); |
|
|
|
|
|
|
|
BasicdataGoodsAreaEntity goodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId); |
|
|
|
|
|
|
|
if (Objects.isNull(goodsAreaEntity)) { |
|
|
|
|
|
|
|
log.warn("###########saveNewQuestDetail: 货区信息不存在 goodsAreaId={}", goodsAreaId); |
|
|
|
|
|
|
|
throw new CustomerException(403, "货区信息不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String positionCode = goodsAreaEntity.getHeadline() + "-" + basicdataGoodsShelfEntity.getGoodsShelfName() + "-" + goodsAllocationEntity.getGoodsAllocationName(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
map.put("positionCode",positionCode); |
|
|
|
|
|
|
|
map.put("allocationId",allocationId); |
|
|
|
|
|
|
|
return R.data(map); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R selectPackageInfo(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
|
|
|
log.warn("###########selectPackageInfo: 盘点扫码库位 "); |
|
|
|
|
|
|
|
Long warehouseId = taskSearchDTO.getWarehouseId(); |
|
|
|
|
|
|
|
String orderPackageCode = taskSearchDTO.getOrderPackageCode(); |
|
|
|
|
|
|
|
Long questId = taskSearchDTO.getQuestId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
verifyTask(questId,warehouseId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//先查询任务的过滤商场
|
|
|
|
|
|
|
|
QueryWrapper<TaskQuestChildEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq("quest_id", questId) |
|
|
|
|
|
|
|
.eq("is_deleted", 0); |
|
|
|
|
|
|
|
List<TaskQuestChildEntity> questChildEntitys = taskQuestChildService.list(queryWrapper); |
|
|
|
|
|
|
|
List<String> marketNames = null; |
|
|
|
|
|
|
|
for (TaskQuestChildEntity childEntity : questChildEntitys) { |
|
|
|
|
|
|
|
if (Objects.isNull(marketNames)) { |
|
|
|
|
|
|
|
marketNames = new ArrayList<>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
marketNames.add(childEntity.getRefName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
taskSearchDTO.setMarketNames(marketNames); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QuestDetailEntity questDetailEntity = questDetailService.queryPackageInfo(taskSearchDTO); |
|
|
|
|
|
|
|
if(Objects.isNull(questDetailEntity)){ |
|
|
|
|
|
|
|
questDetailEntity = new QuestDetailEntity(); |
|
|
|
|
|
|
|
questDetailEntity.setOrdePackageCode(orderPackageCode); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return R.data(questDetailEntity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private QuestDetailChildEntity addQuestDetailChild(Integer num,String cargoName,Long questDetaiId,Long warehouseId){ |
|
|
|
private QuestDetailChildEntity addQuestDetailChild(Integer num,String cargoName,Long questDetaiId,Long warehouseId){ |
|
|
|
|
|
|
|
|
|
|
|