|
@@ -2394,10 +2394,32 @@ int DealPutChangeZzjno(const char* body_ptr, const size_t body_len, const string
|
|
|
auto newNumber = yyjson_get_int(yyjson_obj_get(req_root, "newNumber"));
|
|
auto newNumber = yyjson_get_int(yyjson_obj_get(req_root, "newNumber"));
|
|
|
if (mo == nullptr || mp == nullptr || newNumber == 0) break;
|
|
if (mo == nullptr || mp == nullptr || newNumber == 0) break;
|
|
|
|
|
|
|
|
|
|
+ //бàºÅÒÑ´æÔÚ
|
|
|
|
|
+ if (CMonitorObjectMng::Instance()->GetMoMpInfoByZZJno(newNumber))
|
|
|
|
|
+ {
|
|
|
|
|
+ code = 400;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ auto pMoMp = CMonitorObjectMng::Instance()->GetMoMpInfo(string(mo) + "." + mp);
|
|
|
|
|
+ if (pMoMp == nullptr)
|
|
|
|
|
+ {
|
|
|
|
|
+ code = 404;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ CString sql = fmt::format("update rm_map set zzjno = {} where mo='{}' and mp = '{}';",
|
|
|
|
|
+ newNumber, mo, mp).c_str();
|
|
|
|
|
|
|
|
|
|
+ if (!CDBConnectPool::Instance()->DBExecuteSQL(sql))
|
|
|
|
|
+ {
|
|
|
|
|
+ code = 500;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ pMoMp->zzjno = newNumber;
|
|
|
code = 200;
|
|
code = 200;
|
|
|
|
|
+ break;
|
|
|
} while (false);
|
|
} while (false);
|
|
|
|
|
|
|
|
return code;
|
|
return code;
|