|
@@ -469,13 +469,13 @@ SATHTTP_API int Heartbeat(std::string url, const SATHTTP::STHeartbeatReq &stHear
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- cJSON *pSomkingCycle = cJSON_GetObjectItem(pTask, "SomkingCycle");
|
|
|
|
|
|
+ cJSON *pSomkingCycle = cJSON_GetObjectItem(pTask, "cycle");
|
|
if ( pSomkingCycle ) {
|
|
if ( pSomkingCycle ) {
|
|
// 冒烟任务周期;
|
|
// 冒烟任务周期;
|
|
- stTask.taskInfo.stSomkingCycle.nType = cJSON_GetObjectItem(pSomkingCycle, "type")->valueint;
|
|
|
|
- stTask.taskInfo.stSomkingCycle.nWeek = cJSON_GetObjectItem(pSomkingCycle, "week")->valueint;
|
|
|
|
- stTask.taskInfo.stSomkingCycle.nDay = cJSON_GetObjectItem(pSomkingCycle, "day")->valueint;
|
|
|
|
- stTask.taskInfo.stSomkingCycle.strTime = cJSON_GetObjectItem(pSomkingCycle, "time")->valuestring;
|
|
|
|
|
|
+ stTask.taskInfo.stSomkingCycle.nType = cJSON_GetObjectItem(pSomkingCycle, "type") ? _tstoi(cJSON_GetObjectItem(pSomkingCycle, "type")->valuestring) : 1;
|
|
|
|
+ stTask.taskInfo.stSomkingCycle.nWeek = cJSON_GetObjectItem(pSomkingCycle, "week") ? _tstoi(cJSON_GetObjectItem(pSomkingCycle, "week")->valuestring) : 0;
|
|
|
|
+ stTask.taskInfo.stSomkingCycle.nDay = cJSON_GetObjectItem(pSomkingCycle, "day") ? _tstoi(cJSON_GetObjectItem(pSomkingCycle, "day")->valuestring) : 0;
|
|
|
|
+ stTask.taskInfo.stSomkingCycle.strTime = cJSON_GetObjectItem(pSomkingCycle, "time") ? cJSON_GetObjectItem(pSomkingCycle, "time")->valuestring : "05:00";
|
|
}
|
|
}
|
|
|
|
|
|
// Job内容;
|
|
// Job内容;
|
|
@@ -503,7 +503,8 @@ SATHTTP_API int Heartbeat(std::string url, const SATHTTP::STHeartbeatReq &stHear
|
|
stTask.Job.strPoweroff = cJSON_GetObjectItem(pJob, "poweroff") ? cJSON_GetObjectItem(pJob, "poweroff")->valuestring : "";
|
|
stTask.Job.strPoweroff = cJSON_GetObjectItem(pJob, "poweroff") ? cJSON_GetObjectItem(pJob, "poweroff")->valuestring : "";
|
|
stTask.Job.strFilePath = cJSON_GetObjectItem(pJob, "filePath") ? cJSON_GetObjectItem(pJob, "filePath")->valuestring : "";
|
|
stTask.Job.strFilePath = cJSON_GetObjectItem(pJob, "filePath") ? cJSON_GetObjectItem(pJob, "filePath")->valuestring : "";
|
|
stTask.Job.strScriptFailRepeart = cJSON_GetObjectItem(pJob, "scriptFailRepeat") ? cJSON_GetObjectItem(pJob, "scriptFailRepeat")->valuestring : "";
|
|
stTask.Job.strScriptFailRepeart = cJSON_GetObjectItem(pJob, "scriptFailRepeat") ? cJSON_GetObjectItem(pJob, "scriptFailRepeat")->valuestring : "";
|
|
- stTask.Job.strTaskInstanceId = cJSON_GetObjectItem(pJob, "taskInstanceId") ? cJSON_GetObjectItem(pJob, "taskInstanceId")->valuestring : "";
|
|
|
|
|
|
+ if (cJSON_GetObjectItem(pJob, "taskInstanceId") && !cJSON_IsNull(cJSON_GetObjectItem(pJob, "taskInstanceId")))
|
|
|
|
+ stTask.Job.strTaskInstanceId = cJSON_GetObjectItem(pJob, "taskInstanceId") ? cJSON_GetObjectItem(pJob, "taskInstanceId")->valuestring : "";
|
|
stTask.Job.strUserId = cJSON_GetObjectItem(pJob, "userId") ? cJSON_GetObjectItem(pJob, "userId")->valuestring : "";
|
|
stTask.Job.strUserId = cJSON_GetObjectItem(pJob, "userId") ? cJSON_GetObjectItem(pJob, "userId")->valuestring : "";
|
|
stTask.Job.strDiffTaskInstanceFlag = cJSON_GetObjectItem(pJob, "diffTaskInstanceFlag") ? cJSON_GetObjectItem(pJob, "diffTaskInstanceFlag")->valuestring : "";
|
|
stTask.Job.strDiffTaskInstanceFlag = cJSON_GetObjectItem(pJob, "diffTaskInstanceFlag") ? cJSON_GetObjectItem(pJob, "diffTaskInstanceFlag")->valuestring : "";
|
|
stTask.Job.strBusCode = cJSON_GetObjectItem(pJob, "busCode") ? cJSON_GetObjectItem(pJob, "busCode")->valuestring : "";
|
|
stTask.Job.strBusCode = cJSON_GetObjectItem(pJob, "busCode") ? cJSON_GetObjectItem(pJob, "busCode")->valuestring : "";
|
|
@@ -590,6 +591,7 @@ SATHTTP_API int SetResult(std::string url, const SATHTTP::STNotifyJobStartReq &s
|
|
cJSON_AddStringToObject(pData, "deviceId", stNotifyJobStartReq.strDeviceId.c_str());
|
|
cJSON_AddStringToObject(pData, "deviceId", stNotifyJobStartReq.strDeviceId.c_str());
|
|
cJSON_AddStringToObject(pData, "taskId", stNotifyJobStartReq.strTaskId.c_str());
|
|
cJSON_AddStringToObject(pData, "taskId", stNotifyJobStartReq.strTaskId.c_str());
|
|
cJSON_AddStringToObject(pData, "executeId", stNotifyJobStartReq.strExecuteId.c_str());
|
|
cJSON_AddStringToObject(pData, "executeId", stNotifyJobStartReq.strExecuteId.c_str());
|
|
|
|
+ cJSON_AddStringToObject(pData, "taskType", stNotifyJobStartReq.strTaskType.c_str());
|
|
|
|
|
|
// 添加到根结点中;
|
|
// 添加到根结点中;
|
|
cJSON_AddItemToObject(pRoot, "data", pData);
|
|
cJSON_AddItemToObject(pRoot, "data", pData);
|
|
@@ -630,8 +632,10 @@ SATHTTP_API int SetResult(std::string url, const SATHTTP::STNotifyJobStartReq &s
|
|
if ( pMsg )
|
|
if ( pMsg )
|
|
{
|
|
{
|
|
stNotifyJobStartResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
|
|
stNotifyJobStartResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
|
|
- stNotifyJobStartResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
|
|
|
|
- stNotifyJobStartResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
|
|
|
|
|
|
+ if ( cJSON_GetObjectItem(pMsg, "message") && !cJSON_IsNull(cJSON_GetObjectItem(pMsg, "message")) )
|
|
|
|
+ stNotifyJobStartResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
|
|
|
|
+ if ( cJSON_GetObjectItem(pMsg, "message") && !cJSON_IsNull(cJSON_GetObjectItem(pMsg, "message")) )
|
|
|
|
+ stNotifyJobStartResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
|
|
if ( stNotifyJobStartResp.strCode == "00" )
|
|
if ( stNotifyJobStartResp.strCode == "00" )
|
|
{
|
|
{
|
|
cJSON *pObj = cJSON_GetObjectItem(pMsg, "data");
|
|
cJSON *pObj = cJSON_GetObjectItem(pMsg, "data");
|
|
@@ -708,6 +712,7 @@ SATHTTP_API int SetResultList(std::string url, const SATHTTP::STJobProcessReq &s
|
|
cJSON_AddStringToObject(pData, "round_number", stJobProcessReq.strRoundNumber.c_str());
|
|
cJSON_AddStringToObject(pData, "round_number", stJobProcessReq.strRoundNumber.c_str());
|
|
cJSON_AddStringToObject(pData, "result_type", stJobProcessReq.strResultType.c_str());
|
|
cJSON_AddStringToObject(pData, "result_type", stJobProcessReq.strResultType.c_str());
|
|
cJSON_AddStringToObject(pData, "operation_step", stJobProcessReq.strOperationStep.c_str());
|
|
cJSON_AddStringToObject(pData, "operation_step", stJobProcessReq.strOperationStep.c_str());
|
|
|
|
+ cJSON_AddStringToObject(pData, "instance_type", stJobProcessReq.strInstanceType.c_str());
|
|
|
|
|
|
// 添加到根结点中;
|
|
// 添加到根结点中;
|
|
cJSON_AddItemToObject(pRoot, "data", pData);
|
|
cJSON_AddItemToObject(pRoot, "data", pData);
|
|
@@ -748,8 +753,10 @@ SATHTTP_API int SetResultList(std::string url, const SATHTTP::STJobProcessReq &s
|
|
if ( pMsg )
|
|
if ( pMsg )
|
|
{
|
|
{
|
|
stJobProcessResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
|
|
stJobProcessResp.strCode = cJSON_GetObjectItem(pMsg, "code") ? cJSON_GetObjectItem(pMsg, "code")->valuestring : "";
|
|
- stJobProcessResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
|
|
|
|
- stJobProcessResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
|
|
|
|
|
|
+ if ( cJSON_GetObjectItem(pMsg, "message") && !cJSON_IsNull(cJSON_GetObjectItem(pMsg, "message")) )
|
|
|
|
+ stJobProcessResp.strMessage = cJSON_GetObjectItem(pMsg, "message") ? cJSON_GetObjectItem(pMsg, "message")->valuestring : "";
|
|
|
|
+ if ( cJSON_GetObjectItem(pMsg, "str") && !cJSON_IsNull(cJSON_GetObjectItem(pMsg, "str")) )
|
|
|
|
+ stJobProcessResp.strStr = cJSON_GetObjectItem(pMsg, "str") ? (cJSON_GetObjectItem(pMsg, "str")->valuestring ? cJSON_GetObjectItem(pMsg, "str")->valuestring : "") : "";
|
|
if ( stJobProcessResp.strCode == "00" )
|
|
if ( stJobProcessResp.strCode == "00" )
|
|
{
|
|
{
|
|
cJSON *pObj = cJSON_GetObjectItem(pMsg, "data");
|
|
cJSON *pObj = cJSON_GetObjectItem(pMsg, "data");
|