|
|
|
@ -50,6 +50,7 @@ import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
|
import org.mapstruct.factory.Mappers; |
|
|
|
|
import org.springblade.common.cache.CacheNames; |
|
|
|
|
import org.springblade.common.constant.RedisKeyConstant; |
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
@ -258,32 +259,24 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
detailEntity.setBrandName(i.getBrandName()); |
|
|
|
|
detailEntity.setHasData(1); |
|
|
|
|
// detailEntity.setQuestType();
|
|
|
|
|
//盘点对象;1.定制品 2零担 3 库存品
|
|
|
|
|
//盘点对象;1 定制品 2 库存品 3零担
|
|
|
|
|
//查询托盘名称
|
|
|
|
|
if (ObjectUtils.isNotNull(i.getTrayId())) { |
|
|
|
|
// boolean b = trayEntityList.stream().anyMatch(a -> i.getTrayId().equals(String.valueOf(a.getId()) ));
|
|
|
|
|
// log.info("托盘是否有值>>>>>>>>>>{}",b);
|
|
|
|
|
// Optional<BasicdataTrayEntity> first = trayEntityList.stream().filter(t -> i.getTrayId().equals(String.valueOf(t.getId()))).findFirst();
|
|
|
|
|
// if (first.isPresent()) {
|
|
|
|
|
// BasicdataTrayEntity basicdataTrayEntity = first.get();
|
|
|
|
|
// detailEntity.setTrayName(basicdataTrayEntity.getPalletName());
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer conditions = i.getConditions(); |
|
|
|
|
if (conditions.equals(1)) { |
|
|
|
|
if (1==conditions) { |
|
|
|
|
detailEntity.setQuestTarget(1); |
|
|
|
|
} else if (conditions.equals(2)) { |
|
|
|
|
|
|
|
|
|
} else if (2==conditions) { |
|
|
|
|
detailEntity.setQuestTarget(3); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(1)) { |
|
|
|
|
detailEntity.setQuestTarget(i.getConditions()); |
|
|
|
|
} else if (ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(2)) { |
|
|
|
|
detailEntity.setQuestTarget(3); // 库存品
|
|
|
|
|
}else if( 3==conditions){ |
|
|
|
|
detailEntity.setQuestTarget(2); |
|
|
|
|
}else{ |
|
|
|
|
log.info("包件信息!数据信息不存在!!"); |
|
|
|
|
log.warn(">>>>>>>>>>> 警告 错误的包件数据类型 ,{}",i); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// detailEntity.setQuestTarget(1);
|
|
|
|
|
detailEntity.setOrderPackageCode(i.getOrderPackageCode()); |
|
|
|
|
detailEntity.setWaybillNumber(i.getWaybillNumber()); |
|
|
|
@ -306,11 +299,32 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
|
|
|
|
|
detailEntity.setMaterialCode(i.getMaterialCode()); |
|
|
|
|
detailEntity.setMaterialName(i.getMaterialName()); |
|
|
|
|
detailEntity.setMarketName(i.getMallName()); |
|
|
|
|
if (ObjectUtils.isNull(i.getMallName())) { |
|
|
|
|
// 根据包件查询订单的上的商城信息
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = getCacheEntityByStockArticleId(i); |
|
|
|
|
if (ObjectUtils.isNotNull(stockArticleEntity)) { |
|
|
|
|
detailEntity.setMarketName(stockArticleEntity.getMallName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
detailEntity.setIncomingBatch(i.getOrderCode()); |
|
|
|
|
return detailEntity; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private DistributionStockArticleEntity getCacheEntityByStockArticleId(DistributionParcelListEntity i) { |
|
|
|
|
|
|
|
|
|
String key = CacheNames.tenantKeyObj(AuthUtil.getTenantId(),"getEntityByStockArticleId", i.getStockArticleId()); |
|
|
|
|
DistributionStockArticleEntity temp = bladeRedis.get(key); |
|
|
|
|
if(ObjectUtils.isNotNull(temp)){ |
|
|
|
|
temp = distributionStockArticleClient.findEntityByStockArticleId(i.getStockArticleId()); |
|
|
|
|
if(ObjectUtils.isNotNull(temp)){ |
|
|
|
|
// 设定该条数据的缓存时间 10分钟
|
|
|
|
|
bladeRedis.setEx(key,temp,600L); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return temp; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取用户部门最大的部门ID |
|
|
|
|
* |
|
|
|
@ -768,7 +782,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
|
|
|
|
|
public R addDataInfo(TaskSearchDTO taskSearchDTO) { |
|
|
|
|
log.info("开始添加数据{}", taskSearchDTO.toString()); |
|
|
|
|
String questNum = taskSearchDTO.getQuestNum(); |
|
|
|
@ -790,7 +803,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
// 在库包件状态修改
|
|
|
|
|
if (ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds()) && ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds().get(0))) { |
|
|
|
|
QuestDetailEntity quest = new QuestDetailEntity(); |
|
|
|
|
List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfoForIds(questNum, quest, taskSearchDTO.getQuestDetailIds()); |
|
|
|
|
// List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfoForIds(questNum, quest, taskSearchDTO.getQuestDetailIds());
|
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 1); |
|
|
|
|
List<QuestDetailEntity> list = new ArrayList<>(); |
|
|
|
@ -2084,7 +2097,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
// questDetail.setAllocationId(String.valueOf(warehouseUpdownGoodsEntity.getAllocationId()));
|
|
|
|
|
// }
|
|
|
|
|
// questDetail.setIsNew(0);//是否新增
|
|
|
|
|
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(i.getAssociationValue(), warehouseId); |
|
|
|
|
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(taskSearchDTO.getCode(), warehouseId); |
|
|
|
|
questDetail = buildQuestDetailEntity(taskSearchDTO.getQuestId(), byPacketBarCodeAndWarehouseId, user, null); |
|
|
|
|
break; |
|
|
|
|
case "4": //4库存品
|
|
|
|
@ -2123,7 +2136,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
questDetail.setQuestType(4);//托盘
|
|
|
|
|
questDetail.setQuestStatus(0); //包件盘点状态
|
|
|
|
|
questDetail.setStockNum(i.getNum()); //数量
|
|
|
|
@ -2950,11 +2962,9 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
for (QuestDetailEntity i : questDetailEntityList) { |
|
|
|
|
if (i.getQuestStatus().equals(1)) { |
|
|
|
|