数据穿透
This commit is contained in:
@@ -2149,7 +2149,15 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string SuperviseCheckRectifyMenuId = "A02E0365-383C-49A0-BF1A-B3E42052959B";
|
||||
|
||||
/// <summary>
|
||||
/// 企业安全检查菜单ID
|
||||
/// </summary>
|
||||
public const string UnitHazardRegisterMenu_Safety = "C46C007E-A100-4A52-9317-3B885442E130";
|
||||
|
||||
/// <summary>
|
||||
/// 企业质量检查菜单ID
|
||||
/// </summary>
|
||||
public const string UnitHazardRegisterMenu_Quality = "FDA7722C-383E-4BB1-B29D-BB0BF87AA942";
|
||||
/// <summary>
|
||||
/// 安全监督检查
|
||||
/// </summary>
|
||||
@@ -2589,7 +2597,10 @@ namespace BLL
|
||||
/// 危险性较大的工程清单
|
||||
/// </summary>
|
||||
public const string ProjectLargerHazardListMenuId = "5B3D3F7B-9B50-4927-B131-11D13D4D1C19";
|
||||
|
||||
/// <summary>
|
||||
/// 临时用电
|
||||
/// </summary>
|
||||
public const string ProjectTemporaryElectricityListMenuId = "09B2A0A6-A693-4F1D-A4F5-D5DEA803D771";
|
||||
/// <summary>
|
||||
/// 专家论证清单
|
||||
/// </summary>
|
||||
@@ -4004,6 +4015,11 @@ namespace BLL
|
||||
/// 专项检查导入模板
|
||||
/// </summary>
|
||||
public const string CheckSpecialTemplateUrl = "File\\Excel\\DataIn\\专项检查导入模板.xls";
|
||||
|
||||
/// <summary>
|
||||
/// 专项检查明细导入模板
|
||||
/// </summary>
|
||||
public const string CheckSpecialDetailTemplateUrl = "File\\Excel\\DataIn\\专项检查明细导入模板.xls";
|
||||
/// <summary>
|
||||
/// 综合检查导入模板
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据合并清理
|
||||
/// </summary>
|
||||
public class DataCleanupMergeHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据合并清理
|
||||
/// </summary>
|
||||
/// <param name="exTable">排除操作数据表</param>
|
||||
/// <param name="columType">替换字段(模糊匹配)</param>
|
||||
/// <param name="mergeDataIds">需要替换的数据值</param>
|
||||
/// <param name="dataId">新的字段数据值</param>
|
||||
/// <returns></returns>
|
||||
public static bool DataCleanupMerge(string exTable, string columType, List<string> mergeDataIds, string dataId, ref string msg)
|
||||
{
|
||||
bool result = false;
|
||||
try
|
||||
{
|
||||
Model.SUBQHSEDB db = Funs.DB;
|
||||
var clist = db.DataIdMove.Where(x => x.ColumType == columType && x.NewIds == dataId).ToList();
|
||||
db.DataIdMove.DeleteAllOnSubmit(clist);
|
||||
db.SubmitChanges();
|
||||
List<Model.DataIdMove> list = new List<Model.DataIdMove>();
|
||||
foreach (var mergeId in mergeDataIds)
|
||||
{
|
||||
list.Add(new Model.DataIdMove { OldId = mergeId.Trim(), NewIds = dataId.Trim(), ColumType = columType });
|
||||
}
|
||||
|
||||
db.DataIdMove.InsertAllOnSubmit(list);
|
||||
db.SubmitChanges();
|
||||
|
||||
|
||||
//SP_DataIdMove[排除操作数据表,替换字段(模糊匹配),字段数据值]
|
||||
string strSql = $"exec SP_DataIdMove '{exTable}','{columType}','{dataId}'";
|
||||
result = BLL.SQLHelper.ExecuteSql(strSql);
|
||||
|
||||
//SqlParameter[] parameters = {
|
||||
// new SqlParameter("@exTable", exTable),
|
||||
// new SqlParameter("@colums", columType),
|
||||
// new SqlParameter("@trueId", dataId),
|
||||
// new SqlParameter("@returnVal", SqlDbType.Int)
|
||||
//};
|
||||
//BLL.SQLHelper.ExecuteNonQueryStoredProcedure("SP_DataIdMove", parameters);
|
||||
//int succ = BLL.SQLHelper.ExecuteProcedure("SP_DataIdMove", parameters);
|
||||
//Thread.Sleep(30000); // 等待30秒,30000毫秒等于30秒
|
||||
if (result)
|
||||
{
|
||||
db.DataIdMove.DeleteAllOnSubmit(list);
|
||||
db.SubmitChanges();
|
||||
msg = "数据合并成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "数据合并失败,请稍后再试!";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
msg = ex.Message;
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -567,5 +567,19 @@ namespace BLL
|
||||
F_Stream.Close();
|
||||
return rx;
|
||||
}
|
||||
|
||||
public static string ConvertImageUrlByImage(object ToeyId)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (ToeyId != null)
|
||||
{
|
||||
var imhurl = BLL.AttachFileService.getFileUrl(ToeyId.ToString());
|
||||
if (imhurl != null)
|
||||
{
|
||||
url = ShowImage(Funs.SGGLUrl, imhurl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user