|
|
|
@ -66,6 +66,9 @@ public class SyncWarehouseData {
|
|
|
|
|
|
|
|
|
|
//通过老系统仓库id去查有哪些货区
|
|
|
|
|
List<CargoEntity> cargoEntityList = cargoClient.getAllByWarehouseId(oldWarehouseId); |
|
|
|
|
Map<Integer,Integer> areaIsEmptyMap = new HashMap<>(); |
|
|
|
|
areaIsEmptyMap.put(1,1); |
|
|
|
|
areaIsEmptyMap.put(0,2); |
|
|
|
|
for (CargoEntity cargoEntity:cargoEntityList){ |
|
|
|
|
//货区数据存储
|
|
|
|
|
Integer cargoId = cargoEntity.getId();//老系统货区id
|
|
|
|
@ -76,7 +79,7 @@ public class SyncWarehouseData {
|
|
|
|
|
goodsAreaEntity.setCreateDept(1649331096241836033L); |
|
|
|
|
goodsAreaEntity.setWarehouseId(newWarehouseId); |
|
|
|
|
goodsAreaEntity.setHeadline(cargoEntity.getTitle()); |
|
|
|
|
goodsAreaEntity.setEnableStatus("1"); |
|
|
|
|
goodsAreaEntity.setEnableStatus(areaIsEmptyMap.get(cargoEntity.getStatus())+""); |
|
|
|
|
goodsAreaEntity.setAreaType("2"); |
|
|
|
|
goodsAreaEntity.setOldId(cargoId); |
|
|
|
|
Long newAreaId = basicdataGoodsAreaClient.addCargo(goodsAreaEntity); |
|
|
|
@ -105,7 +108,7 @@ public class SyncWarehouseData {
|
|
|
|
|
goodsShelfEntity.setWarehouseId(newWarehouseId); |
|
|
|
|
goodsShelfEntity.setWarehouseCode(warehouseEntity.getWarehouseCode()); |
|
|
|
|
goodsShelfEntity.setGoodsShelfStatus(2); |
|
|
|
|
goodsShelfEntity.setEnableStatus(1); |
|
|
|
|
goodsShelfEntity.setEnableStatus(shelfIsEmptyMap.get(shelfEntity.getStatus())); |
|
|
|
|
goodsShelfEntity.setStoreyNum(storeyAndRow.get("storey")); |
|
|
|
|
goodsShelfEntity.setRowNum(storeyAndRow.get("row")); |
|
|
|
|
goodsShelfEntity.setRemarks(""); |
|
|
|
@ -115,14 +118,26 @@ public class SyncWarehouseData {
|
|
|
|
|
log.warn("#################saveAllocationData: 保存货架信息失败oldShelfId={},oldWarehouseId={}",oldShelfId,oldWarehouseId); |
|
|
|
|
return false; |
|
|
|
|
}else{ |
|
|
|
|
int maxFloor = 0; |
|
|
|
|
int maxRow = 0; |
|
|
|
|
//货位数据存储
|
|
|
|
|
Map<Integer,Integer> locationIsEmptyMap = new HashMap<>(); |
|
|
|
|
locationIsEmptyMap.put(1,2); |
|
|
|
|
locationIsEmptyMap.put(0,1); |
|
|
|
|
locationIsEmptyMap.put(1,1); |
|
|
|
|
locationIsEmptyMap.put(0,2); |
|
|
|
|
List<LocationEntity> locationEntities = locationClient.getAllByShelfId(oldShelfId); |
|
|
|
|
// List<BasicdataGoodsAllocationEntity> newLocations = new ArrayList<>();
|
|
|
|
|
for (LocationEntity locationEntity:locationEntities){ |
|
|
|
|
Integer locationId = locationEntity.getId(); |
|
|
|
|
String title = locationEntity.getTitle(); |
|
|
|
|
String[] split = title.split("-"); |
|
|
|
|
int floor = Integer.parseInt(split[0]); |
|
|
|
|
int row = Integer.parseInt(split[1]); |
|
|
|
|
if(floor > maxFloor){ |
|
|
|
|
maxFloor = floor; |
|
|
|
|
} |
|
|
|
|
if(row > maxRow){ |
|
|
|
|
maxRow = row; |
|
|
|
|
} |
|
|
|
|
BasicdataGoodsAllocationEntity entity = new BasicdataGoodsAllocationEntity(); |
|
|
|
|
entity.setTenantId("627683"); |
|
|
|
|
entity.setId(locationId.longValue()); |
|
|
|
@ -133,11 +148,11 @@ public class SyncWarehouseData {
|
|
|
|
|
entity.setGoodsAllocationName(locationEntity.getTitle()); |
|
|
|
|
entity.setWarehouseId(newWarehouseId); |
|
|
|
|
entity.setGoodsShelfId(newShelfId); |
|
|
|
|
entity.setEnableStatus("1"); |
|
|
|
|
entity.setEnableStatus(locationIsEmptyMap.get(locationEntity.getStatus())+""); |
|
|
|
|
entity.setAllocationStatus("1"); |
|
|
|
|
entity.setLayerNum(locationEntity.getFloor()); |
|
|
|
|
entity.setColumnNum(locationEntity.getRow()); |
|
|
|
|
entity.setQrCode(shelfEntity.getTitle()+"排"+locationEntity.getFloor()+"层"+locationEntity.getRow()+"列"); |
|
|
|
|
entity.setLayerNum(floor); |
|
|
|
|
entity.setColumnNum(row); |
|
|
|
|
entity.setQrCode(shelfEntity.getTitle()+"排"+floor+"层"+row+"列"); |
|
|
|
|
entity.setOldId(locationId); |
|
|
|
|
Long newLocationId = basicdataGoodsAllocationClient.addLocation(entity); |
|
|
|
|
if(Objects.isNull(newLocationId)){ |
|
|
|
@ -147,6 +162,7 @@ public class SyncWarehouseData {
|
|
|
|
|
log.info("#################saveAllocationData: 保存货位信息成功locationId={},oldWarehouseId={}",locationId,oldWarehouseId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
basicdataGoodsShelfClient.updateRowAndFloorByShelfId(maxFloor,maxRow,newShelfId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|