Merge branch 'master' of http://47.104.102.122:3000/lpf/CNCEC_SUBQHSE_WUHUAN
This commit is contained in:
commit
bdf83e0509
|
|
@ -171,7 +171,7 @@ public class APIHazardRegisterSyncService
|
||||||
JsonConvert.DeserializeObject<List<HazardRegisterSyncItem>>(obj["data"].ToString());
|
JsonConvert.DeserializeObject<List<HazardRegisterSyncItem>>(obj["data"].ToString());
|
||||||
if (getData.Count() > 0)
|
if (getData.Count() > 0)
|
||||||
{
|
{
|
||||||
ProcessHazardRegisterData(getData, project.ProjectId, unitId, WebUrl);
|
ProcessHazardRegisterData(getData, project.ProjectId, unitId, WebUrl,"pull");
|
||||||
}
|
}
|
||||||
message = "获取成功:同步安全检查数" + getData.Count().ToString() + "条";
|
message = "获取成功:同步安全检查数" + getData.Count().ToString() + "条";
|
||||||
}
|
}
|
||||||
|
|
@ -293,7 +293,7 @@ public class APIHazardRegisterSyncService
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ProcessHazardRegisterData(items.Items, ProjectId, unit.UnitId, UnitDomain);
|
ProcessHazardRegisterData(items.Items, ProjectId, unit.UnitId, UnitDomain,"push");
|
||||||
message = "数据推送成功!";
|
message = "数据推送成功!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -324,7 +324,7 @@ public class APIHazardRegisterSyncService
|
||||||
/// <param name="unitId">单位ID</param>
|
/// <param name="unitId">单位ID</param>
|
||||||
/// <param name="WebUrl">Web地址</param>
|
/// <param name="WebUrl">Web地址</param>
|
||||||
private static void ProcessHazardRegisterData(List<Model.HazardRegisterSyncItem> getData, string projectId,
|
private static void ProcessHazardRegisterData(List<Model.HazardRegisterSyncItem> getData, string projectId,
|
||||||
string unitId, string WebUrl)
|
string unitId, string WebUrl, string type)
|
||||||
{
|
{
|
||||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
{
|
{
|
||||||
|
|
@ -379,8 +379,11 @@ public class APIHazardRegisterSyncService
|
||||||
Requirements = item.Requirements,
|
Requirements = item.Requirements,
|
||||||
Risk_Level = item.Risk_Level,
|
Risk_Level = item.Risk_Level,
|
||||||
//ControlId = item.ControlId,
|
//ControlId = item.ControlId,
|
||||||
DataSource = item.DataSource,
|
|
||||||
};
|
};
|
||||||
|
if (type == "pull")
|
||||||
|
{
|
||||||
|
newModel.DataSource = item.DataSource;
|
||||||
|
}
|
||||||
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newModel);
|
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newModel);
|
||||||
db.SubmitChanges();
|
db.SubmitChanges();
|
||||||
}
|
}
|
||||||
|
|
@ -429,7 +432,10 @@ public class APIHazardRegisterSyncService
|
||||||
model.Requirements = item.Requirements;
|
model.Requirements = item.Requirements;
|
||||||
model.Risk_Level = item.Risk_Level;
|
model.Risk_Level = item.Risk_Level;
|
||||||
//model.ControlId = item.ControlId;
|
//model.ControlId = item.ControlId;
|
||||||
|
if (type == "pull")
|
||||||
|
{
|
||||||
model.DataSource = item.DataSource;
|
model.DataSource = item.DataSource;
|
||||||
|
}
|
||||||
|
|
||||||
db.SubmitChanges();
|
db.SubmitChanges();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue