修改BC数据
This commit is contained in:
parent
4e3e60950d
commit
4c1f2399af
Binary file not shown.
@ -38,7 +38,11 @@ bool UActorUEJSComponent::JsMessageDispatch(const FString& message)
|
||||
OnJsMessageCallbackDelegate.Broadcast(result);
|
||||
}
|
||||
});
|
||||
return Scenario->Load();
|
||||
|
||||
const FString rwbs = jsonObject->GetStringField(TEXT("rwbs"));
|
||||
const FString rq = jsonObject->GetStringField(TEXT("rq"));
|
||||
const FString bc = jsonObject->GetStringField(TEXT("bc"));
|
||||
return Scenario->LoadMissionData(rwbs, rq, bc);
|
||||
}
|
||||
else if (TEXT("LoadScenarioTask") == func) {
|
||||
|
||||
@ -52,7 +56,11 @@ bool UActorUEJSComponent::JsMessageDispatch(const FString& message)
|
||||
});
|
||||
|
||||
const FString year = jsonObject->GetStringField(TEXT("year"));
|
||||
return Scenario->LoadRWBS(TCHAR_TO_UTF8(*year));
|
||||
if (year.IsEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Scenario->LoadRWBS(year);
|
||||
}
|
||||
else if (TEXT("SelectScenarioTask") == func) {
|
||||
auto Scenario = TDMScenario::Create();
|
||||
@ -65,6 +73,10 @@ bool UActorUEJSComponent::JsMessageDispatch(const FString& message)
|
||||
});
|
||||
|
||||
const FString task = jsonObject->GetStringField(TEXT("task"));
|
||||
if (task.IsEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Scenario->LoadBCSJ(task);
|
||||
}
|
||||
|
||||
|
@ -12,11 +12,29 @@
|
||||
#include "DMRunnable.h"
|
||||
#include "UEDMPlugin.h"
|
||||
|
||||
struct SQLData
|
||||
struct BCData
|
||||
{
|
||||
int64 timestamp;
|
||||
int32 bc;
|
||||
std::string yxr;
|
||||
FString yxr;
|
||||
int32 count;
|
||||
FString jx;
|
||||
};
|
||||
|
||||
struct HKBData
|
||||
{
|
||||
FString bdid;
|
||||
FString jx; //型号
|
||||
FString jh; //机号
|
||||
FString qc_dh; //编号
|
||||
FString zy; //阵营
|
||||
FString dwjc; //单位简称
|
||||
FString dwdm; //单位代码
|
||||
FString fxsj_ly; //数据来源
|
||||
FString hc_dm; //后舱代号
|
||||
FString hc_xm; //后舱姓名
|
||||
FString txbg_sk; //体系摧毁时刻
|
||||
FString rwlx; //执行任务
|
||||
};
|
||||
|
||||
FString GBKToUTF8(const char* gbkStr)
|
||||
@ -68,22 +86,24 @@ std::string UTF8ToGBK(const FString& str)
|
||||
return std::string(gbkStr.begin(), gbkStr.end());
|
||||
}
|
||||
|
||||
TSharedPtr<FJsonObject> ConvertSQLDataToJson(const SQLData& data)
|
||||
TSharedPtr<FJsonObject> ConvertSQLDataToJson(const BCData& data)
|
||||
{
|
||||
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject());
|
||||
|
||||
JsonObject->SetNumberField("timestamp", data.timestamp);
|
||||
JsonObject->SetNumberField("bc", data.bc);
|
||||
JsonObject->SetStringField("yxr", FString(data.yxr.c_str()));
|
||||
JsonObject->SetStringField("yxr", data.yxr);
|
||||
JsonObject->SetNumberField("count", data.count);
|
||||
JsonObject->SetStringField("jx", data.jx);
|
||||
|
||||
return JsonObject;
|
||||
}
|
||||
|
||||
FString ConvertSQLDataVectorToJson(const FString& response, const std::vector<SQLData>& dataVector)
|
||||
FString ConvertSQLDataVectorToJson(const FString& response, const std::vector<BCData>& dataVector)
|
||||
{
|
||||
TArray<TSharedPtr<FJsonValue>> JsonArray;
|
||||
|
||||
for (const SQLData& data : dataVector)
|
||||
for (const BCData& data : dataVector)
|
||||
{
|
||||
TSharedPtr<FJsonObject> JsonObject = ConvertSQLDataToJson(data);
|
||||
JsonArray.Add(MakeShareable(new FJsonValueObject(JsonObject)));
|
||||
@ -100,8 +120,6 @@ FString ConvertSQLDataVectorToJson(const FString& response, const std::vector<SQ
|
||||
return JsonString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
FString ConvertRWBSVectorToJson(const FString& response, const std::vector<FString>& dataVector)
|
||||
{
|
||||
TArray<TSharedPtr<FJsonValue>> JsonArray;
|
||||
@ -122,6 +140,51 @@ FString ConvertRWBSVectorToJson(const FString& response, const std::vector<FStri
|
||||
return JsonString;
|
||||
}
|
||||
|
||||
FString ConvertHKBDataVectorToJson(const FString& response, const std::vector<HKBData>& dataVector)
|
||||
{
|
||||
TArray<TSharedPtr<FJsonValue>> JsonArray;
|
||||
|
||||
for (const HKBData& data : dataVector)
|
||||
{
|
||||
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject());
|
||||
|
||||
JsonObject->SetStringField(TEXT("BDID"), data.bdid);
|
||||
JsonObject->SetStringField(TEXT("型号"), data.jx);
|
||||
JsonObject->SetStringField(TEXT("机号"), data.jh);
|
||||
JsonObject->SetStringField(TEXT("编号"), data.qc_dh);
|
||||
JsonObject->SetStringField(TEXT("阵营"), data.zy);
|
||||
JsonObject->SetStringField(TEXT("单位简称"), data.dwjc);
|
||||
JsonObject->SetStringField(TEXT("单位代码"), data.dwdm);
|
||||
JsonObject->SetStringField(TEXT("数据来源"), data.fxsj_ly);
|
||||
JsonObject->SetStringField(TEXT("后舱代号"), data.hc_dm);
|
||||
JsonObject->SetStringField(TEXT("后舱姓名"), data.hc_xm);
|
||||
JsonObject->SetStringField(TEXT("体系摧毁时刻"), data.txbg_sk);
|
||||
JsonObject->SetStringField(TEXT("执行任务"), data.rwlx);
|
||||
|
||||
FString leftString;
|
||||
FString rightString;
|
||||
bool is = data.txbg_sk.Split(" ", &leftString, &rightString);
|
||||
if (is)
|
||||
{
|
||||
JsonObject->SetStringField(TEXT("体系摧毁文本信息"), rightString);
|
||||
}
|
||||
|
||||
JsonObject->SetStringField(TEXT("体系摧毁文本颜色"), FColor(255, 0, 0, 255).ToString());
|
||||
|
||||
JsonArray.Add(MakeShareable(new FJsonValueObject(JsonObject)));
|
||||
}
|
||||
|
||||
TSharedPtr<FJsonObject> RootObject = MakeShareable(new FJsonObject());
|
||||
RootObject->SetArrayField("data", JsonArray);
|
||||
RootObject->SetStringField("type", response);
|
||||
|
||||
FString JsonString;
|
||||
TSharedRef<TJsonWriter<TCHAR>> Writer = TJsonWriterFactory<TCHAR>::Create(&JsonString);
|
||||
FJsonSerializer::Serialize(RootObject.ToSharedRef(), Writer);
|
||||
|
||||
return JsonString;
|
||||
}
|
||||
|
||||
TDMScenario::TDMScenario()
|
||||
{
|
||||
}
|
||||
@ -136,11 +199,10 @@ TSharedPtr<TDMScenario> TDMScenario::Create()
|
||||
return self;
|
||||
}
|
||||
|
||||
bool TDMScenario::LoadRWBS(const std::string& year)
|
||||
bool TDMScenario::LoadRWBS(const FString& year)
|
||||
{
|
||||
std::string sSQL = "select distinct RWBS from kzdk.rw_jbqk where to_char(ksrq, 'yyyy') = '" + year + "'";
|
||||
|
||||
UE_LOG(LogUEDMPlugin, Log, TEXT("SQL=%s"), UTF8_TO_TCHAR(sSQL.c_str()));
|
||||
FString query = FString::Format(TEXT("select distinct RWBS from kzdk.rw_jbqk where to_char(ksrq, 'yyyy') ='{0}';"), { year });
|
||||
std::string sSQL = UTF8ToGBK(query);
|
||||
|
||||
TSharedPtr<FSQLCommand> sqlCommand = MakeShareable(new FSQLCommand);
|
||||
sqlCommand->Type = ESQLType::SELECT;
|
||||
@ -184,13 +246,14 @@ bool TDMScenario::LoadRWBS(const std::string& year)
|
||||
}
|
||||
dmRunnable->ExcuteSQL(sqlCommand);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
bool TDMScenario::LoadBCSJ(const FString& rwbs)
|
||||
{
|
||||
FString query = FString::Format(TEXT("select RQ, BC, YXR from kzdk.RW_BCSJ where RWBS = '{0}' order by rq, bc asc;"),
|
||||
{ rwbs });
|
||||
FString query = FString::Format(TEXT("select a.RQ,a.BC,a.YXR, "
|
||||
"(select count(b.bdid) from kzdk.rw_fxjc b where b.rwbs = '{0}' and b.rq = a.rq and b.bc = a.bc), "
|
||||
"(select LISTAGG(distinct c.jx, ',') from kzdk.rw_fxjc c where c.rwbs = '{0}' and c.rq = a.rq and c.bc = a.bc) "
|
||||
"from kzdk.RW_BCSJ a where a.RWBS = '{0}' order by a.rq, a.bc asc; "), { rwbs });
|
||||
std::string sSQL = UTF8ToGBK(query);
|
||||
|
||||
TSharedPtr<FSQLCommand> sqlCommand = MakeShareable(new FSQLCommand);
|
||||
@ -201,21 +264,27 @@ bool TDMScenario::LoadBCSJ(const FString& rwbs)
|
||||
sdint8 out_c1 = 0;
|
||||
sdint4 out_c2 = 0;
|
||||
sdbyte out_c3[20] = { 0 };
|
||||
sdint4 out_c4 = 0;
|
||||
sdbyte out_c5[128] = { 0 };
|
||||
slength out_c1_ind = 0;
|
||||
slength out_c2_ind = 0;
|
||||
slength out_c3_ind = 0;
|
||||
slength out_c4_ind = 0;
|
||||
slength out_c5_ind = 0;
|
||||
dpi_bind_col(content, 1, DSQL_C_TIMESTAMP, &out_c1, sizeof(out_c1), &out_c1_ind);
|
||||
dpi_bind_col(content, 2, DSQL_C_SLONG, &out_c2, sizeof(out_c2), &out_c2_ind);
|
||||
dpi_bind_col(content, 3, DSQL_C_NCHAR, &out_c3, sizeof(out_c3), &out_c3_ind);
|
||||
dpi_bind_col(content, 4, DSQL_C_SLONG, &out_c4, sizeof(out_c4), &out_c4_ind);
|
||||
dpi_bind_col(content, 5, DSQL_C_NCHAR, &out_c5, sizeof(out_c5), &out_c5_ind);
|
||||
ulength row_num = 0;
|
||||
|
||||
std::vector<SQLData> tables;
|
||||
std::vector<BCData> tables;
|
||||
while (dpi_fetch(content, &row_num) != DSQL_NO_DATA)
|
||||
{
|
||||
tables.push_back({ out_c1, out_c2, (char*)out_c3 });
|
||||
tables.push_back({ out_c1, out_c2, GBKToUTF8((const char*)out_c3), out_c4, GBKToUTF8((const char*)out_c5) });
|
||||
UE_LOG(LogUEDMPlugin, Log, TEXT("RQ=%llu, BC=%d YXR=%s"), out_c1, out_c2, UTF8_TO_TCHAR((char*)out_c3));
|
||||
}
|
||||
TSharedPtr<SQLResult> Result = MakeShareable(new SelectResult<SQLData>(std::move(tables)));
|
||||
TSharedPtr<SQLResult> Result = MakeShareable(new SelectResult<BCData>(std::move(tables)));
|
||||
return Result;
|
||||
};
|
||||
|
||||
@ -226,7 +295,7 @@ bool TDMScenario::LoadBCSJ(const FString& rwbs)
|
||||
{
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::LoadBCSJ failed, Result is nullptr"));
|
||||
}
|
||||
SelectResult<SQLData>* sqlData = static_cast<SelectResult<SQLData>*>(Result.Get());
|
||||
SelectResult<BCData>* sqlData = static_cast<SelectResult<BCData>*>(Result.Get());
|
||||
if (!sqlData->succes)
|
||||
{
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::LoadBCSJ failed"));
|
||||
@ -247,59 +316,7 @@ bool TDMScenario::LoadBCSJ(const FString& rwbs)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TDMScenario::Load()
|
||||
{
|
||||
TSharedPtr<FSQLCommand> sqlCommand = MakeShareable(new FSQLCommand);
|
||||
sqlCommand->Type = ESQLType::SELECT;
|
||||
sqlCommand->SQL = "select RQ,BC,YXR from kzdk.RW_BCSJ order by rq ,bc asc;";
|
||||
sqlCommand->select = [](void* content)
|
||||
{
|
||||
sdint8 out_c1 = 0;
|
||||
sdint4 out_c2 = 0;
|
||||
sdbyte out_c3[20] = { 0 };
|
||||
slength out_c1_ind = 0;
|
||||
slength out_c2_ind = 0;
|
||||
slength out_c3_ind = 0;
|
||||
dpi_bind_col(content, 1, DSQL_C_TIMESTAMP, &out_c1, sizeof(out_c1), &out_c1_ind);
|
||||
dpi_bind_col(content, 2, DSQL_C_SLONG, &out_c2, sizeof(out_c2), &out_c2_ind);
|
||||
dpi_bind_col(content, 3, DSQL_C_NCHAR, &out_c3, sizeof(out_c3), &out_c3_ind);
|
||||
ulength row_num = 0;
|
||||
|
||||
std::vector<SQLData> tables;
|
||||
while (dpi_fetch(content, &row_num) != DSQL_NO_DATA)
|
||||
{
|
||||
tables.push_back({ out_c1, out_c2, (char*)out_c3 });
|
||||
UE_LOG(LogUEDMPlugin, Log, TEXT("RQ=%llu, BC=%d YXR=%s"), out_c1, out_c2, UTF8_TO_TCHAR((char*)out_c3));
|
||||
}
|
||||
TSharedPtr<SQLResult> Result = MakeShareable(new SelectResult<SQLData>(std::move(tables)));
|
||||
return Result;
|
||||
};
|
||||
|
||||
TSharedPtr<TDMScenario> self = AsShared();
|
||||
sqlCommand->OnQueryCompleted.BindLambda([self](TSharedPtr<SQLResult> Result)
|
||||
{
|
||||
SelectResult<SQLData>* sqlData = static_cast<SelectResult<SQLData>*>(Result.Get());
|
||||
if (!sqlData->succes)
|
||||
{
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::Load failed"));
|
||||
return;
|
||||
}
|
||||
|
||||
FString jsonString = ConvertSQLDataVectorToJson(TEXT("LoadScenarioResponse"), sqlData->table);
|
||||
bool success = self->OnQueryCompleted.ExecuteIfBound(jsonString);
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::Query OnQueryCompleted.ExecuteIfBound %d"), success);
|
||||
});
|
||||
|
||||
auto dmRunnable = FUEDMPluginModule::GetDMRunnable();
|
||||
if (nullptr == dmRunnable)
|
||||
{
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::Query dm runnable is nullptr"));
|
||||
}
|
||||
dmRunnable->ExcuteSQL(sqlCommand);
|
||||
return true;
|
||||
}
|
||||
|
||||
void TDMScenario::LoadMissionData(const FString& rwbs, const FString& rq, const FString& bc)
|
||||
bool TDMScenario::LoadMissionData(const FString& rwbs, const FString& rq, const FString& bc)
|
||||
{
|
||||
UE_LOG(LogUEDMPlugin, Log, TEXT("LoadMissionData Begin"));
|
||||
|
||||
@ -308,20 +325,111 @@ void TDMScenario::LoadMissionData(const FString& rwbs, const FString& rq, const
|
||||
LoadDMMBData(rwbs, rq, bc);
|
||||
|
||||
UE_LOG(LogUEDMPlugin, Log, TEXT("LoadMissionData End"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TDMScenario::LoadHKBData(const FString& rwbs, const FString& rq, const FString& bc)
|
||||
{
|
||||
std::string sSQL = "select bdid, jx, jh, qc_dh, zy, dwjc, dwdm, fxsj_ly, hc_dm, hc_xm, txbg_sk, RWLX from kzdk.RW_FXJC where RWBS = " +
|
||||
std::string(TCHAR_TO_UTF8(*rwbs)) + " and RQ = to_date('" +
|
||||
std::string(TCHAR_TO_UTF8(*rq)) + "', 'yyyy-mm-dd') and BC = " + std::string(TCHAR_TO_UTF8(*bc));
|
||||
FString query = FString::Format(TEXT("select bdid, jx, jh, qc_dh, zy, dwjc, dwdm, fxsj_ly, hc_dm, hc_xm, txbg_sk, RWLX from kzdk.RW_FXJC"
|
||||
" where RWBS = '{0}' and RQ = to_date('{1}', 'yyyy-mm-dd') and BC = {2};"), { rwbs, rq, bc });
|
||||
std::string sSQL = UTF8ToGBK(query);
|
||||
|
||||
TSharedPtr<FSQLCommand> sqlCommand = MakeShareable(new FSQLCommand);
|
||||
sqlCommand->Type = ESQLType::SELECT;
|
||||
sqlCommand->SQL = sSQL;
|
||||
sqlCommand->select = [](void* content)
|
||||
{
|
||||
sdbyte out_c1[40] = { 0 };
|
||||
sdbyte out_c2[30] = { 0 };
|
||||
sdbyte out_c3[50] = { 0 };
|
||||
sdbyte out_c4[20] = { 0 };
|
||||
sdbyte out_c5[200] = { 0 };
|
||||
sdbyte out_c6[200] = { 0 };
|
||||
sdbyte out_c7[200] = { 0 };
|
||||
sdbyte out_c8[20] = { 0 };
|
||||
sdbyte out_c9[20] = { 0 };
|
||||
sdbyte out_c10[30] = { 0 };
|
||||
dpi_timestamp_t out_c11;
|
||||
sdbyte out_c12[20] = { 0 };
|
||||
slength out_c1_ind = 0;
|
||||
slength out_c2_ind = 0;
|
||||
slength out_c3_ind = 0;
|
||||
slength out_c4_ind = 0;
|
||||
slength out_c5_ind = 0;
|
||||
slength out_c6_ind = 0;
|
||||
slength out_c7_ind = 0;
|
||||
slength out_c8_ind = 0;
|
||||
slength out_c9_ind = 0;
|
||||
slength out_c10_ind = 0;
|
||||
slength out_c11_ind = 0;
|
||||
slength out_c12_ind = 0;
|
||||
dpi_bind_col(content, 1, DSQL_C_NCHAR, &out_c1, sizeof(out_c1), &out_c1_ind);
|
||||
dpi_bind_col(content, 2, DSQL_C_NCHAR, &out_c2, sizeof(out_c2), &out_c2_ind);
|
||||
dpi_bind_col(content, 3, DSQL_C_NCHAR, &out_c3, sizeof(out_c3), &out_c3_ind);
|
||||
dpi_bind_col(content, 4, DSQL_C_NCHAR, &out_c4, sizeof(out_c4), &out_c4_ind);
|
||||
dpi_bind_col(content, 5, DSQL_C_NCHAR, &out_c5, sizeof(out_c5), &out_c5_ind);
|
||||
dpi_bind_col(content, 6, DSQL_C_NCHAR, &out_c6, sizeof(out_c6), &out_c6_ind);
|
||||
dpi_bind_col(content, 7, DSQL_C_NCHAR, &out_c7, sizeof(out_c7), &out_c7_ind);
|
||||
dpi_bind_col(content, 8, DSQL_C_NCHAR, &out_c8, sizeof(out_c8), &out_c8_ind);
|
||||
dpi_bind_col(content, 9, DSQL_C_NCHAR, &out_c9, sizeof(out_c9), &out_c9_ind);
|
||||
dpi_bind_col(content, 10, DSQL_C_NCHAR, &out_c10, sizeof(out_c10), &out_c10_ind);
|
||||
dpi_bind_col(content, 11, DSQL_C_TIMESTAMP, &out_c11, sizeof(out_c11), &out_c11_ind);
|
||||
dpi_bind_col(content, 12, DSQL_C_NCHAR, &out_c12, sizeof(out_c12), &out_c12_ind);
|
||||
ulength row_num = 0;
|
||||
|
||||
std::vector<HKBData> tables;
|
||||
while (dpi_fetch(content, &row_num) != DSQL_NO_DATA)
|
||||
{
|
||||
|
||||
FString st = FString::Format(TEXT("{0}-{1}-{2} {3}:{4}:{5}"), { out_c11.year, out_c11.month, out_c11.day, out_c11.hour, out_c11.minute, out_c11.second });
|
||||
|
||||
tables.push_back({ GBKToUTF8((char*)out_c1), GBKToUTF8((char*)out_c2), GBKToUTF8((char*)out_c3), GBKToUTF8((char*)out_c4),
|
||||
GBKToUTF8((char*)out_c5), GBKToUTF8((char*)out_c6), GBKToUTF8((char*)out_c7), GBKToUTF8((char*)out_c8),
|
||||
GBKToUTF8((char*)out_c9), GBKToUTF8((char*)out_c10), st, GBKToUTF8((char*)out_c12) });
|
||||
UE_LOG(LogUEDMPlugin, Log, TEXT("RQ=%llu, BC=%d YXR=%s"), out_c1, out_c2, UTF8_TO_TCHAR((char*)out_c3));
|
||||
}
|
||||
TSharedPtr<SQLResult> Result = MakeShareable(new SelectResult<HKBData>(std::move(tables)));
|
||||
return Result;
|
||||
};
|
||||
|
||||
TSharedPtr<TDMScenario> self = AsShared();
|
||||
sqlCommand->OnQueryCompleted.BindLambda([self](TSharedPtr<SQLResult> Result)
|
||||
{
|
||||
SelectResult<HKBData>* sqlData = static_cast<SelectResult<HKBData>*>(Result.Get());
|
||||
if (!sqlData->succes)
|
||||
{
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::Query failed"));
|
||||
return;
|
||||
}
|
||||
|
||||
FString jsonString = ConvertHKBDataVectorToJson(TEXT("HKB-Base"), sqlData->table);
|
||||
bool success = self->OnLoadCompleted.ExecuteIfBound(jsonString);
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::Query OnLoadCompleted.ExecuteIfBound %d"), success);
|
||||
});
|
||||
|
||||
auto dmRunnable = FUEDMPluginModule::GetDMRunnable();
|
||||
if (nullptr == dmRunnable)
|
||||
{
|
||||
UE_LOG(LogUEDMPlugin, Error, TEXT("TDMScenario::Query dm runnable is nullptr"));
|
||||
}
|
||||
dmRunnable->ExcuteSQL(sqlCommand);
|
||||
}
|
||||
|
||||
bool TDMScenario::LoadKkwqsyList(const FString& bdid, const FString& qrxg, const FString& qcdh, const FString& zy)
|
||||
{
|
||||
std::string sSQL = "select dx, fsbh, GJ_JL, GJ_FW, gj_sk, GJTS, DMZYSK, ZD_JSSK, gjxg_qrmb, dx, MZYXX, FS_JH from kzdk.rw_fxjc_wqsy where sjlx = '空空' and gjxg_qrxg = " +
|
||||
std::string(TCHAR_TO_UTF8(*qrxg)) + " and bdid = " +
|
||||
std::string(TCHAR_TO_UTF8(*bdid));
|
||||
//FString query = FString::Format(TEXT("select bdid, jx, jh, qc_dh, zy, dwjc, dwdm, fxsj_ly, hc_dm, hc_xm, txbg_sk, RWLX from kzdk.RW_FXJC"
|
||||
// " where RWBS = '{0}' and RQ = to_date('{1}', 'yyyy-mm-dd') and BC = {2};"), { rwbs, rq, bc });
|
||||
//std::string sSQL = UTF8ToGBK(query);
|
||||
|
||||
//TSharedPtr<FSQLCommand> sqlCommand = MakeShareable(new FSQLCommand);
|
||||
//sqlCommand->Type = ESQLType::SELECT;
|
||||
//sqlCommand->SQL = sSQL;
|
||||
//sqlCommand->select = [](void* content)
|
||||
|
||||
// std::string sSQL = "select dx, fsbh, GJ_JL, GJ_FW, gj_sk, GJTS, DMZYSK, ZD_JSSK, gjxg_qrmb, dx, MZYXX, FS_JH from kzdk.rw_fxjc_wqsy where sjlx = '空空' and gjxg_qrxg = " +
|
||||
// std::string(TCHAR_TO_UTF8(*qrxg)) + " and bdid = " +
|
||||
// std::string(TCHAR_TO_UTF8(*bdid));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -3,9 +3,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include <string>
|
||||
|
||||
DECLARE_DELEGATE_OneParam(FOnSQLCompleted, FString);
|
||||
DECLARE_DELEGATE_OneParam(FOnLoadCompleted, FString);
|
||||
|
||||
/**
|
||||
*
|
||||
@ -19,17 +19,16 @@ public:
|
||||
static TSharedPtr<TDMScenario> Create();
|
||||
|
||||
// 加载任务标识
|
||||
bool LoadRWBS(const std::string& year);
|
||||
bool LoadRWBS(const FString& year);
|
||||
|
||||
// 加载波次
|
||||
bool LoadBCSJ(const FString& rwbs);
|
||||
bool Load();
|
||||
|
||||
// 加载任务数据
|
||||
//rwbs:任务标识
|
||||
//rq:日期
|
||||
//bc:波次
|
||||
void LoadMissionData(const FString& rwbs, const FString& rq, const FString& bc);
|
||||
bool LoadMissionData(const FString& rwbs, const FString& rq, const FString& bc);
|
||||
|
||||
// 加载航空兵数据
|
||||
void LoadHKBData(const FString& rwbs, const FString& rq, const FString& bc);
|
||||
@ -49,4 +48,5 @@ public:
|
||||
|
||||
public:
|
||||
FOnSQLCompleted OnQueryCompleted;
|
||||
FOnLoadCompleted OnLoadCompleted;
|
||||
};
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include "DMRunnable.h"
|
||||
#include "DPI.h"
|
||||
|
||||
#include "DMScenario.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FUEDMPluginModule"
|
||||
|
||||
DEFINE_LOG_CATEGORY(LogUEDMPlugin);
|
||||
@ -18,6 +20,14 @@ void FUEDMPluginModule::StartupModule()
|
||||
{
|
||||
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
|
||||
dmRunnable_ = new FDMRunnable();
|
||||
|
||||
//auto Scenario = TDMScenario::Create();
|
||||
//Scenario->OnQueryCompleted.BindLambda([this](const FString& result)
|
||||
// {
|
||||
|
||||
// });
|
||||
|
||||
//Scenario->LoadRWBS("2019");
|
||||
}
|
||||
|
||||
void FUEDMPluginModule::ShutdownModule()
|
||||
|
@ -21,7 +21,7 @@ bool UUEJSBlueprintFunctionLibrary::JsMessageDispatch(const FString& message)
|
||||
if (TEXT("LoadTask") == func)
|
||||
{
|
||||
auto Scenario = TDMScenario::Create();
|
||||
Scenario->Load();
|
||||
//Scenario->Load();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -26,8 +26,6 @@ public:
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FJsMessageCallbackDelegate OnJsMessageCallbackDelegate;
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
@ -35,6 +33,4 @@ protected:
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user