Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
caoyizhong 1 year ago
parent
commit
95be671328
  1. 56
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  2. 33
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

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

@ -30,7 +30,6 @@ import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.feign.IDistributionStockListClient;
import com.logpm.distribution.vo.DistributionPackadeliVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.QuestDetailDTO;
@ -241,15 +240,15 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<QuestDetailEntity> zeroQuestDetailEntities = questDetailMap.get(2);
List<QuestDetailEntity> inventoryQuestDetailEntities = questDetailMap.get(3);
if (Func.isNotEmpty(questDetailEntities)){
Map<Long, List<QuestDetailEntity>> orderMap = questDetailEntities.stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderId));
Map<String, List<QuestDetailEntity>> orderMap = questDetailEntities.stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderCode));
orderMap.forEach((k,v)->{
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findEntityByStockArticleId(k);
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(k,taskSearchDTO.getWarehouseId());
List<QuestDetailEntity> detailEntities = orderMap.get(k);
TaskContractVO taskContractVO = new TaskContractVO();
taskContractVO.setIsInventory(0);
taskContractVO.setIsZero(0);
taskContractVO.setOrderCode(detailEntities.get(0).getOrderCode());
taskContractVO.setOrderId(k);
taskContractVO.setOrderId(detailEntities.get(0).getOrderId());
taskContractVO.setTotal(detailEntities.stream().mapToInt(QuestDetailEntity::getStockNum).sum());
taskContractVO.setZktotal(detailEntities.stream().mapToInt(QuestDetailEntity::getStockNum).sum());
taskContractVO.setUnTotal(detailEntities.stream().filter(q->Func.equals(q.getQuestStatus(),1)).mapToInt(QuestDetailEntity::getStockNum).sum());
@ -991,24 +990,31 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
//判断库位是否有托盘
BasicdataTrayEntity trayEntity = taryAllocationService.getTrayByAllocationId(allocationId);
trayCode = trayEntity.getPalletCode();
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if (Objects.isNull(basicdataTrayEntity)) {
log.warn("###########saveNewQuestDetail: 托盘信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘信息不存在");
}
trayId = basicdataTrayEntity.getId();
if(!Objects.isNull(trayEntity)){
trayCode = trayEntity.getPalletCode();
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if (Objects.isNull(basicdataTrayEntity)) {
log.warn("###########saveNewQuestDetail: 托盘信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘信息不存在");
}
trayId = basicdataTrayEntity.getId();
TrayTypeDataVO trayTypeDataVO = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
if (Objects.isNull(trayTypeDataVO)) {
log.warn("###########saveNewQuestDetail: 托盘打托信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托信息不存在");
}
String type = trayTypeDataVO.getType();
if (questTarget != Integer.parseInt(type)) {
log.warn("###########saveNewQuestDetail: 托盘打托数据类型错误 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托数据类型错误");
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>();
trayTypeEntityQueryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = trayTypeService.getOne(trayTypeEntityQueryWrapper);
if (Objects.isNull(trayTypeEntity)) {
log.warn("###########saveNewQuestDetail: 托盘打托信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托信息不存在");
}
String type = trayTypeEntity.getType();
if (questTarget != Integer.parseInt(type)) {
log.warn("###########saveNewQuestDetail: 托盘打托数据类型错误 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托数据类型错误");
}
}
positionCode = goodsAreaEntity.getHeadline() + "-" + basicdataGoodsShelfEntity.getGoodsShelfName() + "-" + goodsAllocationEntity.getGoodsAllocationName();
} else if (questType == 4) {
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
@ -1017,12 +1023,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
throw new CustomerException(403, "托盘信息不存在");
}
trayId = basicdataTrayEntity.getId();
TrayTypeDataVO trayTypeDataVO = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
if (Objects.isNull(trayTypeDataVO)) {
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>();
trayTypeEntityQueryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = trayTypeService.getOne(trayTypeEntityQueryWrapper);
if (Objects.isNull(trayTypeEntity)) {
log.warn("###########saveNewQuestDetail: 托盘打托信息不存在 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托信息不存在");
}
String type = trayTypeDataVO.getType();
String type = trayTypeEntity.getType();
if (questTarget != Integer.parseInt(type)) {
log.warn("###########saveNewQuestDetail: 托盘打托数据类型错误 trayCode={}", trayCode);
throw new CustomerException(403, "托盘打托数据类型错误");

33
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -338,16 +338,24 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
qw.eq("association_value",orderPackageCode);
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(qw);
if(!Objects.isNull(trayGoodsEntity)){
String oldTrayCode = trayGoodsEntity.getTrayCode();
if(oldTrayCode.equals(trayCode)){
log.warn("##############orderScanOrderPackageCode: 该包条已打托 trayCode={}",trayCode);
return Resp.scanFail(2001,"该包条已打托","已扫描");
}
log.warn("#########orderScanOrderPackageCode: 包件已打托 orderPackageCode={}",orderPackageCode);
return Resp.scanFail(2001,"包件已打托","包件已打托");
return Resp.scanFail(2001,"包件已打托","已在"+oldTrayCode+"托盘绑定");
}
QueryWrapper<WarehouseUpdownGoodsEntity> updownGoodsEntityQueryWrapper = new QueryWrapper<>();
updownGoodsEntityQueryWrapper.eq("association_value",orderPackageCode);
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(updownGoodsEntityQueryWrapper);
if(!Objects.isNull(updownGoodsEntity)){
String positionCode = updownGoodsEntity.getPositionCode();
log.warn("#########orderScanOrderPackageCode: 包件已上架 orderPackageCode={}",orderPackageCode);
return Resp.scanFail(2001,"包件已上架","包件已上架");
return Resp.scanFail(2001,"包件已上架","包件已上架"+positionCode+",请先下架或进行移库绑定");
}
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
@ -364,7 +372,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode,warehouseId);
if(Objects.isNull(parcelListEntity)){
log.warn("##############orderScanOrderPackageCode: 包件不存在 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
return Resp.scanFail(2001,"包件不存在","包件不存在");
return Resp.scanFail(2001,"包件不存在","系统无编码");
}
String orderCode = parcelListEntity.getOrderCode();//订单自编码
Long wid = parcelListEntity.getWarehouseId();
@ -412,11 +420,6 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
//判断包件是否已存在托盘
if(!Objects.isNull(trayGoodsEntity)){
String oldTrayCode = trayGoodsEntity.getTrayCode();
if(oldTrayCode.equals(trayCode)){
log.warn("##############orderScanOrderPackageCode: 该包条已打托 trayCode={}",trayCode);
return Resp.scanFail(2001,"该包条已打托","该包条已打托");
}
//存入包件与托盘绑定关系表
downPackageByOrderPackageCode(orderPackageCode,"扫描分拣:下托",warehouseId);
@ -429,40 +432,40 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String serviceNumber = stockArticleEntity.getServiceNumber();
if(!filterValue.equals(serviceNumber)){
chuanFlag = true;
msg = "服务号";
msg = "服务号"+filterValue;
}
}else if("20".equals(tt)){//订单自编号
String oc = stockArticleEntity.getOrderCode();
if(!filterValue.equals(oc)){
chuanFlag = true;
msg = "订单自编号";
msg = "订单自编号"+filterValue;
}
}else if("30".equals(tt)){//商场
Long mallId = stockArticleEntity.getMallId();
String mallName = stockArticleEntity.getMallName();
if(!filterValue.equals(mallName)){
chuanFlag = true;
msg = "商场";
msg = "商场"+filterValue;
}
}else if("40".equals(tt)){//门店
Long storeId = stockArticleEntity.getStoreId();
String storeName = stockArticleEntity.getStoreName();
if(!filterValue.equals(storeName)){
chuanFlag = true;
msg = "门店";
msg = "门店"+filterValue;
}
}else if("50".equals(tt)){//客户
String customerName = stockArticleEntity.getCustomerName();
String customerTelephone = stockArticleEntity.getCustomerTelephone();
if(!filterValue.equals(customerName+customerTelephone)){
chuanFlag = true;
msg = "客户";
msg = "客户"+filterValue;
}
}else if("60".equals(tt)){//仓库
String warehouse = stockArticleEntity.getWarehouse();
if(!filterValue.equals(warehouse)){
chuanFlag = true;
msg = "仓库";
msg = "仓库"+filterValue;
}
}
//修改打托方式上的值
@ -482,7 +485,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(chuanFlag){
log.warn("#########orderScanOrderPackageCode: 不属于同一个"+msg+" 串货 filterValue={} orderPackageCode={}",filterValue,orderPackageCode);
return Resp.scanFail(2001,"不属于同一个"+msg,"串货");
return Resp.scanFail(2001,"不属于同一个"+msg,"窜货,扫描当前托盘"+msg+",窜货1件");
}else{
return R.success("扫描成功");
}

Loading…
Cancel
Save