fix:升级

This commit is contained in:
geh
2025-06-19 19:23:01 +08:00
parent 0cb37e2c02
commit 7aa8baadbb
111 changed files with 14465 additions and 1480 deletions
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using FineUIPro;
namespace BLL
{
@@ -227,11 +228,16 @@ namespace BLL
newHazardSelectedItem.State = hazardSelectedItem.State;
newHazardSelectedItem.PlanExistDate = hazardSelectedItem.PlanExistDate;
newHazardSelectedItem.QRCodeAttachUrl = hazardSelectedItem.QRCodeAttachUrl;
newHazardSelectedItem.IsUpdate = null;
db.SubmitChanges();
}
}
/// <summary>
/// 根据危险源类别主键删除对应的所有危险源信息
/// </summary>
/// <param name="hazardListCode">危险源类别主键</param>
/// <summary>
/// 根据危险源类别主键删除对应的所有危险源信息
/// </summary>
@@ -244,23 +250,56 @@ namespace BLL
{
foreach (var item in q)
{
var h = db.Hazard_RiskEvaluationRecord.Where(x => x.DataId == item.HazardSelectedItemId);
if (h.Count() > 0)
if (item.IsUpdate == true)
{
db.Hazard_RiskEvaluationRecord.DeleteAllOnSubmit(h);
db.SubmitChanges();
var returndata = Project_HSSEData_HSSEService.DeleteProjectSecurityRiskData(item.HazardSelectedItemId);
if (returndata.code == 1)
{
var h = db.Hazard_RiskEvaluationRecord.Where(x => x.DataId == item.HazardSelectedItemId);
if (h.Count() > 0)
{
db.Hazard_RiskEvaluationRecord.DeleteAllOnSubmit(h);
db.SubmitChanges();
}
var p = db.Hazard_PatrolPlan.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
if (p.Count() > 0)
{
db.Hazard_PatrolPlan.DeleteAllOnSubmit(p);
db.SubmitChanges();
}
var r = db.Hazard_RoutingInspection.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
if (r.Count() > 0)
{
db.Hazard_RoutingInspection.DeleteAllOnSubmit(r);
db.SubmitChanges();
}
}
else
{
Alert.ShowInTop("记录已上报集团,集团删除失败,无法删除本地数据!", MessageBoxIcon.Warning);
return;
}
}
var p = db.Hazard_PatrolPlan.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
if (p.Count() > 0)
else
{
db.Hazard_PatrolPlan.DeleteAllOnSubmit(p);
db.SubmitChanges();
}
var r = db.Hazard_RoutingInspection.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
if (r.Count() > 0)
{
db.Hazard_RoutingInspection.DeleteAllOnSubmit(r);
db.SubmitChanges();
var h = db.Hazard_RiskEvaluationRecord.Where(x => x.DataId == item.HazardSelectedItemId);
if (h.Count() > 0)
{
db.Hazard_RiskEvaluationRecord.DeleteAllOnSubmit(h);
db.SubmitChanges();
}
var p = db.Hazard_PatrolPlan.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
if (p.Count() > 0)
{
db.Hazard_PatrolPlan.DeleteAllOnSubmit(p);
db.SubmitChanges();
}
var r = db.Hazard_RoutingInspection.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
if (r.Count() > 0)
{
db.Hazard_RoutingInspection.DeleteAllOnSubmit(r);
db.SubmitChanges();
}
}
}
db.Hazard_HazardSelectedItem.DeleteAllOnSubmit(q);
@@ -118,7 +118,7 @@ namespace BLL
newHazardRegister.RegisterTypesId = hazardRegister.RegisterTypesId;
newHazardRegister.Risk_Level = hazardRegister.Risk_Level;
newHazardRegister.Requirements = hazardRegister.Requirements;
newHazardRegister.IsUpdate = null;
//把附件表的路径复制过来
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
if (file != null)
@@ -97,6 +97,7 @@ namespace BLL
newLicenseManager.IsHighRisk = licenseManager.IsHighRisk;
newLicenseManager.LicenseCodes = licenseManager.LicenseCodes;
newLicenseManager.IsUpdate = null;
db.SubmitChanges();
}
}
@@ -75,7 +75,7 @@ namespace BLL
newLargerHazard.TrainPersonNum = largerHazard.TrainPersonNum;
newLargerHazard.IsSuperLargerHazard = largerHazard.IsSuperLargerHazard;
newLargerHazard.Descriptions = largerHazard.Descriptions;
newLargerHazard.RecordTime = largerHazard.RecordTime;
newLargerHazard.IsUpdate = null;
db.SubmitChanges();
}
}
+6 -3
View File
@@ -26,10 +26,11 @@ namespace BLL
/// 根据上一节点id获取安全隐患
/// </summary>
/// <param name="supRectifyId"></param>
/// <param name="type"></param>
/// <returns></returns>
public static List<Model.Technique_Rectify> GetRectifyBySupRectifyId(string supRectifyId)
public static List<Model.Technique_Rectify> GetRectifyBySupRectifyId(string supRectifyId, string type)
{
return (from x in Funs.DB.Technique_Rectify where x.SupRectifyId == supRectifyId select x).ToList();
return (from x in Funs.DB.Technique_Rectify where x.SupRectifyId == supRectifyId && x.RectifyType == type select x).ToList();
}
/// <summary>
@@ -42,6 +43,7 @@ namespace BLL
Model.Technique_Rectify newRectify = new Model.Technique_Rectify
{
RectifyId = rectify.RectifyId,
RectifyType = rectify.RectifyType,
RectifyCode = rectify.RectifyCode,
RectifyName = rectify.RectifyName,
SupRectifyId = rectify.SupRectifyId,
@@ -62,6 +64,7 @@ namespace BLL
Model.Technique_Rectify newRectify = db.Technique_Rectify.FirstOrDefault(e => e.RectifyId == rectify.RectifyId);
if (newRectify != null)
{
newRectify.RectifyType = rectify.RectifyType;
newRectify.RectifyCode = rectify.RectifyCode;
newRectify.RectifyName = rectify.RectifyName;
newRectify.SupRectifyId = rectify.SupRectifyId;
@@ -111,7 +114,7 @@ namespace BLL
}
else
{
var supItemSetCount = BLL.RectifyService.GetRectifyBySupRectifyId(rectifyId);
var supItemSetCount = BLL.RectifyService.GetRectifyBySupRectifyId(rectifyId, rectify.RectifyType);
if (supItemSetCount.Count() > 0)
{
isDelete = false;