小程序接口修改
This commit is contained in:
@@ -120,12 +120,36 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据专项检查ID 更新专项检查状态
|
||||
/// </summary>
|
||||
/// <param name="checkSpecialDetailId"></param>
|
||||
public static void UpdateCheckSpecialStates(string checkSpecialId)
|
||||
public static void UpdateCheckSpecialForApi(Model.Check_CheckSpecial checkSpecial)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Check_CheckSpecial newCheckSpecial = db.Check_CheckSpecial.FirstOrDefault(e => e.CheckSpecialId == checkSpecial.CheckSpecialId);
|
||||
if (newCheckSpecial != null)
|
||||
{
|
||||
newCheckSpecial.CheckSpecialCode = checkSpecial.CheckSpecialCode;
|
||||
//newCheckSpecial.ProjectId = checkSpecial.ProjectId;
|
||||
newCheckSpecial.CheckPerson = checkSpecial.CheckPerson;
|
||||
newCheckSpecial.CheckTime = checkSpecial.CheckTime;
|
||||
newCheckSpecial.ScanUrl = checkSpecial.ScanUrl;
|
||||
newCheckSpecial.DaySummary = checkSpecial.DaySummary;
|
||||
newCheckSpecial.PartInUnits = checkSpecial.PartInUnits;
|
||||
newCheckSpecial.PartInPersons = checkSpecial.PartInPersons;
|
||||
newCheckSpecial.PartInPersonIds = checkSpecial.PartInPersonIds;
|
||||
newCheckSpecial.PartInPersonNames = checkSpecial.PartInPersonNames;
|
||||
newCheckSpecial.CheckAreas = checkSpecial.CheckAreas;
|
||||
newCheckSpecial.States = checkSpecial.States;
|
||||
newCheckSpecial.CheckType = checkSpecial.CheckType;
|
||||
newCheckSpecial.CheckItemSetId = checkSpecial.CheckItemSetId;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据专项检查ID 更新专项检查状态
|
||||
/// </summary>
|
||||
/// <param name="checkSpecialDetailId"></param>
|
||||
public static void UpdateCheckSpecialStates(string checkSpecialId)
|
||||
{
|
||||
var getS = Funs.DB.Check_CheckSpecial.FirstOrDefault(x => x.CheckSpecialId == checkSpecialId);
|
||||
if (getS != null && getS.States == Const.State_1)
|
||||
@@ -137,13 +161,29 @@ namespace BLL
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void UpdateCheckSpecialStatesForApi(string checkSpecialId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getS = db.Check_CheckSpecial.FirstOrDefault(x => x.CheckSpecialId == checkSpecialId);
|
||||
if (getS != null && getS.States == Const.State_1)
|
||||
{
|
||||
var getNCDetail = db.Check_CheckSpecialDetail.FirstOrDefault(x => x.CheckSpecialId == getS.CheckSpecialId && x.CompleteStatus == false);
|
||||
if (getNCDetail == null)
|
||||
{
|
||||
getS.States = Const.State_2;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据专项检查ID删除对应专项检查记录信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
public static void DeleteCheckSpecial(string checkSpecialId)
|
||||
/// <summary>
|
||||
/// 根据专项检查ID删除对应专项检查记录信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
public static void DeleteCheckSpecial(string checkSpecialId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.Check_CheckSpecial where x.CheckSpecialId == checkSpecialId select x).FirstOrDefault();
|
||||
@@ -205,84 +245,160 @@ namespace BLL
|
||||
return name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="detailLists"></param>
|
||||
/// <param name="checkSpecial"></param>
|
||||
/// <returns></returns>
|
||||
public static string IssueRectification(List<Model.Check_CheckSpecialDetail> detailLists, Model.Check_CheckSpecial checkSpecial)
|
||||
{
|
||||
string info = string.Empty;
|
||||
if (detailLists.Count() > 0 && checkSpecial != null)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="detailLists"></param>
|
||||
/// <param name="checkSpecial"></param>
|
||||
/// <returns></returns>
|
||||
public static string IssueRectification(List<Model.Check_CheckSpecialDetail> detailLists, Model.Check_CheckSpecial checkSpecial)
|
||||
{
|
||||
////隐患整改单
|
||||
var getDetail1 = detailLists.Where(x => x.CompleteStatus==false);
|
||||
if (getDetail1.Count() > 0)
|
||||
{
|
||||
var getUnitList = getDetail1.Select(x => x.UnitId).Distinct();
|
||||
foreach (var unitItem in getUnitList)
|
||||
{
|
||||
var getUnitItemList = getDetail1.Where(x => x.UnitId == unitItem);
|
||||
foreach (var item in getUnitItemList)
|
||||
string info = string.Empty;
|
||||
if (detailLists.Count() > 0 && checkSpecial != null)
|
||||
{
|
||||
////隐患整改单
|
||||
var getDetail1 = detailLists.Where(x => x.CompleteStatus == false);
|
||||
if (getDetail1.Count() > 0)
|
||||
{
|
||||
Model.HSSE_Hazard_HazardRegister register = Funs.DB.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.CheckItemDetailId == item.CheckSpecialDetailId);
|
||||
if (register == null)
|
||||
{
|
||||
register = new Model.HSSE_Hazard_HazardRegister();
|
||||
}
|
||||
register.ProjectId = checkSpecial.ProjectId;
|
||||
register.CheckItemDetailId = item.CheckSpecialDetailId;
|
||||
register.ProblemTypes = "2"; //1 安全问题 2 专项巡检
|
||||
register.RegisterTypesId = item.CheckItem;
|
||||
// register.CheckCycle = this.ckType.SelectedValue;
|
||||
register.IsEffective = "1";
|
||||
register.RegisterDate = checkSpecial.CheckTime;
|
||||
register.CheckTime = checkSpecial.CheckTime;
|
||||
register.ResponsibleUnit = item.UnitId;
|
||||
var getUnitList = getDetail1.Select(x => x.UnitId).Distinct();
|
||||
foreach (var unitItem in getUnitList)
|
||||
{
|
||||
var getUnitItemList = getDetail1.Where(x => x.UnitId == unitItem);
|
||||
foreach (var item in getUnitItemList)
|
||||
{
|
||||
Model.HSSE_Hazard_HazardRegister register = Funs.DB.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.CheckItemDetailId == item.CheckSpecialDetailId);
|
||||
if (register == null)
|
||||
{
|
||||
register = new Model.HSSE_Hazard_HazardRegister();
|
||||
}
|
||||
register.ProjectId = checkSpecial.ProjectId;
|
||||
register.CheckItemDetailId = item.CheckSpecialDetailId;
|
||||
register.ProblemTypes = "2"; //1 安全问题 2 专项巡检
|
||||
register.RegisterTypesId = item.CheckItem;
|
||||
// register.CheckCycle = this.ckType.SelectedValue;
|
||||
register.IsEffective = "1";
|
||||
register.RegisterDate = checkSpecial.CheckTime;
|
||||
register.CheckTime = checkSpecial.CheckTime;
|
||||
register.ResponsibleUnit = item.UnitId;
|
||||
|
||||
register.Place = item.WorkArea;
|
||||
register.Place = item.WorkArea;
|
||||
|
||||
register.RegisterDef = item.Unqualified;
|
||||
// register.HandleIdea = item.Suggestions;
|
||||
register.ResponsibleMan = item.HSEManage;
|
||||
register.Risk_Level = item.RiskLevel;
|
||||
register.Requirements = item.Suggestions;
|
||||
register.RegisterDef = item.Unqualified;
|
||||
// register.HandleIdea = item.Suggestions;
|
||||
register.ResponsibleMan = item.HSEManage;
|
||||
register.Risk_Level = item.RiskLevel;
|
||||
register.Requirements = item.Suggestions;
|
||||
|
||||
register.RectificationPeriod = item.LimitedDate;
|
||||
register.CheckManId = checkSpecial.CompileMan;
|
||||
//register.CutPayment = Funs.GetNewIntOrZero(this.txtCutPayment.Text.Trim());
|
||||
register.States = "1"; //待整改
|
||||
if (string.IsNullOrEmpty(register.HazardRegisterId))
|
||||
{
|
||||
register.HazardRegisterId = Guid.NewGuid().ToString();
|
||||
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
|
||||
register.ImageUrl = url;
|
||||
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
|
||||
BLL.HSSE_Hazard_HazardRegisterService.AddHazardRegister(register);
|
||||
}
|
||||
else
|
||||
{
|
||||
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
|
||||
register.ImageUrl = url;
|
||||
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
|
||||
BLL.HSSE_Hazard_HazardRegisterService.UpdateHazardRegister(register);
|
||||
}
|
||||
register.RectificationPeriod = item.LimitedDate;
|
||||
register.CheckManId = checkSpecial.CompileMan;
|
||||
//register.CutPayment = Funs.GetNewIntOrZero(this.txtCutPayment.Text.Trim());
|
||||
register.States = "1"; //待整改
|
||||
if (string.IsNullOrEmpty(register.HazardRegisterId))
|
||||
{
|
||||
register.HazardRegisterId = Guid.NewGuid().ToString();
|
||||
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
|
||||
register.ImageUrl = url;
|
||||
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
|
||||
BLL.HSSE_Hazard_HazardRegisterService.AddHazardRegister(register);
|
||||
}
|
||||
else
|
||||
{
|
||||
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
|
||||
register.ImageUrl = url;
|
||||
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
|
||||
BLL.HSSE_Hazard_HazardRegisterService.UpdateHazardRegister(register);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
info += "整改已下发。";
|
||||
}
|
||||
}
|
||||
info += "整改已下发。";
|
||||
}
|
||||
Check_CheckSpecialService.UpdateCheckSpecial(checkSpecial);
|
||||
}
|
||||
Check_CheckSpecialService.UpdateCheckSpecial(checkSpecial);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(info))
|
||||
{
|
||||
info += "请在相应办理页面提交!";
|
||||
if (!string.IsNullOrEmpty(info))
|
||||
{
|
||||
info += "请在相应办理页面提交!";
|
||||
}
|
||||
return info;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
public static void SaveAttachFile(string dataId, string menuId, string url)
|
||||
public static string IssueRectificationForApi(List<Model.Check_CheckSpecialDetail> detailLists, Model.Check_CheckSpecial checkSpecial)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string info = string.Empty;
|
||||
if (detailLists.Count() > 0 && checkSpecial != null)
|
||||
{
|
||||
////隐患整改单
|
||||
var getDetail1 = detailLists.Where(x => x.CompleteStatus == false);
|
||||
if (getDetail1.Count() > 0)
|
||||
{
|
||||
var getUnitList = getDetail1.Select(x => x.UnitId).Distinct();
|
||||
foreach (var unitItem in getUnitList)
|
||||
{
|
||||
var getUnitItemList = getDetail1.Where(x => x.UnitId == unitItem);
|
||||
foreach (var item in getUnitItemList)
|
||||
{
|
||||
Model.HSSE_Hazard_HazardRegister register = db.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.CheckItemDetailId == item.CheckSpecialDetailId);
|
||||
if (register == null)
|
||||
{
|
||||
register = new Model.HSSE_Hazard_HazardRegister();
|
||||
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(register);
|
||||
|
||||
}
|
||||
register.ProjectId = checkSpecial.ProjectId;
|
||||
register.CheckItemDetailId = item.CheckSpecialDetailId;
|
||||
register.ProblemTypes = "2"; //1 安全问题 2 专项巡检
|
||||
register.RegisterTypesId = item.CheckItem;
|
||||
// register.CheckCycle = this.ckType.SelectedValue;
|
||||
register.IsEffective = "1";
|
||||
register.RegisterDate = checkSpecial.CheckTime;
|
||||
register.CheckTime = checkSpecial.CheckTime;
|
||||
register.ResponsibleUnit = item.UnitId;
|
||||
|
||||
register.Place = item.WorkArea;
|
||||
|
||||
register.RegisterDef = item.Unqualified;
|
||||
// register.HandleIdea = item.Suggestions;
|
||||
register.ResponsibleMan = item.HSEManage;
|
||||
register.Risk_Level = item.RiskLevel;
|
||||
register.Requirements = item.Suggestions;
|
||||
|
||||
register.RectificationPeriod = item.LimitedDate;
|
||||
register.CheckManId = checkSpecial.CompileMan;
|
||||
//register.CutPayment = Funs.GetNewIntOrZero(this.txtCutPayment.Text.Trim());
|
||||
register.States = "1"; //待整改
|
||||
if (string.IsNullOrEmpty(register.HazardRegisterId))
|
||||
{
|
||||
register.HazardRegisterId = Guid.NewGuid().ToString();
|
||||
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
|
||||
register.ImageUrl = url;
|
||||
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
var url = AttachFileService.getFileUrl(item.CheckSpecialDetailId);
|
||||
register.ImageUrl = url;
|
||||
SaveAttachFile(register.HazardRegisterId, BLL.Const.HSSE_HiddenRectificationListMenuId, url);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
info += "整改已下发。";
|
||||
}
|
||||
Check_CheckSpecialService.UpdateCheckSpecialForApi(checkSpecial);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(info))
|
||||
{
|
||||
info += "请在相应办理页面提交!";
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}
|
||||
public static void SaveAttachFile(string dataId, string menuId, string url)
|
||||
{
|
||||
Model.ToDoItem toDoItem = new Model.ToDoItem
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user