|
|
|
@ -78,20 +78,44 @@ public class SyncWarehouseDataToNew {
|
|
|
|
|
return ReturnT.FAIL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存托盘信息
|
|
|
|
|
log.info("###############syncWarehouseToNew: 保存仓库id为{}的托盘开始",oldWarehouseId); |
|
|
|
|
} |
|
|
|
|
return ReturnT.SUCCESS; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@XxlJob("syncWarehouseTrayToNew") |
|
|
|
|
public ReturnT<String> syncWarehouseTrayToNew(String param) { |
|
|
|
|
log.info("############syncWarehouseTrayToNew: 同步仓库及货位托盘信息开始 param={}", param); |
|
|
|
|
|
|
|
|
|
//查询所有仓库
|
|
|
|
|
List<Integer> allWarehouseIds = warehouseClient.getAllWarehouseIds(); |
|
|
|
|
for (Integer oldWarehouseId:allWarehouseIds){ |
|
|
|
|
WarehouseEntity oldWarehouse = warehouseClient.selectEntityById(oldWarehouseId); |
|
|
|
|
if(Objects.isNull(oldWarehouse)){ |
|
|
|
|
log.warn("###############syncWarehouseTrayToNew: 未查询到老系统仓库信息 oldWarehouseId={}",oldWarehouseId); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
String no = oldWarehouse.getNo(); |
|
|
|
|
String title = oldWarehouse.getTitle(); |
|
|
|
|
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouse(title, no); |
|
|
|
|
if(Objects.isNull(basicdataWarehouseEntity)){ |
|
|
|
|
log.warn("###############syncWarehouseTrayToNew: 未查询到新系统仓库信息 title={} no={}",title,no); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
Long newWarehouseId = basicdataWarehouseEntity.getId(); |
|
|
|
|
//同步所有托盘信息
|
|
|
|
|
log.info("###############syncWarehouseTrayToNew: 同步所有托盘开始"); |
|
|
|
|
boolean trayFlag = saveTrayData(newWarehouseId,oldWarehouseId); |
|
|
|
|
if(trayFlag){ |
|
|
|
|
log.info("###############syncWarehouseToNew: 保存仓库id为{}的托盘成功",oldWarehouseId); |
|
|
|
|
log.info("###############syncWarehouseTrayToNew: 保存仓库id为{}的托盘成功",oldWarehouseId); |
|
|
|
|
}else { |
|
|
|
|
log.info("###############syncWarehouseToNew: 保存仓库id为{}的托盘失败",oldWarehouseId); |
|
|
|
|
log.info("###############syncWarehouseTrayToNew: 保存仓库id为{}的托盘失败",oldWarehouseId); |
|
|
|
|
return ReturnT.FAIL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return ReturnT.SUCCESS; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean saveTrayData(Long newWarehouseId, Integer oldWarehouseId) { |
|
|
|
|
//通过老系统仓库id查询所有托盘信息
|
|
|
|
|
List<TrayEntity> trayEntityList = trayClient.getAllTrayByWarehouseId(oldWarehouseId); |
|
|
|
@ -106,7 +130,7 @@ public class SyncWarehouseDataToNew {
|
|
|
|
|
basicdataTrayEntity.setUpdateUser(1649331096967450625L); |
|
|
|
|
basicdataTrayEntity.setCreateDept(1649331096241836033L); |
|
|
|
|
basicdataTrayEntity.setPalletName(trayEntity.getTrayNo()); |
|
|
|
|
basicdataTrayEntity.setPalletCode(trayEntity.getTrayNo()); |
|
|
|
|
basicdataTrayEntity.setPalletCode("T"+trayEntity.getId()); |
|
|
|
|
basicdataTrayEntity.setWarehouseId(newWarehouseId); |
|
|
|
|
basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+""); |
|
|
|
|
basicdataTrayEntity.setType(1); |
|
|
|
|