This commit is contained in:
parent
badecc17e6
commit
341b25b2f7
|
|
@ -171,7 +171,7 @@ public class APIHazardRegisterSyncService
|
|||
JsonConvert.DeserializeObject<List<HazardRegisterSyncItem>>(obj["data"].ToString());
|
||||
if (getData.Count() > 0)
|
||||
{
|
||||
ProcessHazardRegisterData(getData, project.ProjectId, unitId, WebUrl);
|
||||
ProcessHazardRegisterData(getData, project.ProjectId, unitId, WebUrl,"pull");
|
||||
}
|
||||
message = "获取成功:同步安全检查数" + getData.Count().ToString() + "条";
|
||||
}
|
||||
|
|
@ -293,7 +293,7 @@ public class APIHazardRegisterSyncService
|
|||
}
|
||||
else
|
||||
{
|
||||
ProcessHazardRegisterData(items.Items, ProjectId, unit.UnitId, UnitDomain);
|
||||
ProcessHazardRegisterData(items.Items, ProjectId, unit.UnitId, UnitDomain,"push");
|
||||
message = "数据推送成功!";
|
||||
}
|
||||
}
|
||||
|
|
@ -324,7 +324,7 @@ public class APIHazardRegisterSyncService
|
|||
/// <param name="unitId">单位ID</param>
|
||||
/// <param name="WebUrl">Web地址</param>
|
||||
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))
|
||||
{
|
||||
|
|
@ -379,8 +379,11 @@ public class APIHazardRegisterSyncService
|
|||
Requirements = item.Requirements,
|
||||
Risk_Level = item.Risk_Level,
|
||||
//ControlId = item.ControlId,
|
||||
DataSource = item.DataSource,
|
||||
};
|
||||
if (type == "pull")
|
||||
{
|
||||
newModel.DataSource = item.DataSource;
|
||||
}
|
||||
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
|
@ -429,7 +432,10 @@ public class APIHazardRegisterSyncService
|
|||
model.Requirements = item.Requirements;
|
||||
model.Risk_Level = item.Risk_Level;
|
||||
//model.ControlId = item.ControlId;
|
||||
if (type == "pull")
|
||||
{
|
||||
model.DataSource = item.DataSource;
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue