检查库 导入 检查项目分类 删除

This commit is contained in:
wyw 2024-07-15 14:29:50 +08:00
parent 79b1c6944f
commit 680b067bc3

View File

@ -148,7 +148,7 @@ namespace APT.BS.WebApi.Controllers.Api
Msg = "未获取到导入数据";
throw new Exception(Msg);
}
List<int> listNotEmpty = new List<int>() { 0, 1, 2, 3, 4, 5, 7, 8, 9 };
List<int> listNotEmpty = new List<int>() { 0, 1, 3, 4, 5, 7, 8, 9 };//2,
//BSMineTypeEnum
@ -176,12 +176,12 @@ namespace APT.BS.WebApi.Controllers.Api
//检查项目分类 3
List<int> listProjCate = new List<int>();
List<string> listStrProjCate = new List<string>();
var listModelProjCate = GetEntities<T_BS_CHECK_PROJECT_CATEGORY>(e => !e.IS_DELETED, null, null);
string strProjCate = string.Empty;
T_BS_CHECK_PROJECT_CATEGORY modelProjCate = new T_BS_CHECK_PROJECT_CATEGORY();
////检查项目分类 3
//List<int> listProjCate = new List<int>();
//List<string> listStrProjCate = new List<string>();
//var listModelProjCate = GetEntities<T_BS_CHECK_PROJECT_CATEGORY>(e => !e.IS_DELETED, null, null);
//string strProjCate = string.Empty;
//T_BS_CHECK_PROJECT_CATEGORY modelProjCate = new T_BS_CHECK_PROJECT_CATEGORY();
//检查层级 4
List<int> listTypeLevel = new List<int>();
@ -288,7 +288,7 @@ namespace APT.BS.WebApi.Controllers.Api
strArea = dtSource.Rows[i][0].ToString().Trim();
modelArea = listModelArea.FirstOrDefault(e => e.NAME == strArea);
if (modelArea == null && dicIndexEmpty.Count < 1 && listType.Count < 1 && listProjCate.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1)
if (modelArea == null && dicIndexEmpty.Count < 1 && listType.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1)//&& listProjCate.Count < 1
{
//检查区域
modelArea = new T_HM_RISK_AREA();
@ -356,18 +356,18 @@ namespace APT.BS.WebApi.Controllers.Api
#endregion
#region 2
#region //项目分类 2
strProjCate = dtSource.Rows[i][2].ToString().Trim();
modelProjCate = listModelProjCate.FirstOrDefault(e => e.NAME == strProjCate);
if (modelProjCate == null)
{
//检查项目分类
listProjCate.Add(i + rowIndex);
if (!listStrProjCate.Contains(strProjCate))
listStrProjCate.Add(strProjCate);
continue;
}
//strProjCate = dtSource.Rows[i][2].ToString().Trim();
//modelProjCate = listModelProjCate.FirstOrDefault(e => e.NAME == strProjCate);
//if (modelProjCate == null)
//{
// //检查项目分类
// listProjCate.Add(i + rowIndex);
// if (!listStrProjCate.Contains(strProjCate))
// listStrProjCate.Add(strProjCate);
// continue;
//}
#endregion
@ -470,7 +470,7 @@ namespace APT.BS.WebApi.Controllers.Api
strProject = dtSource.Rows[i][5].ToString().Trim();
modelProject = listModelProject.FirstOrDefault(e => e.NAME == strProject);
if (modelProject == null && dicIndexEmpty.Count < 1 && listType.Count < 1 && listProjCate.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1)
if (modelProject == null && dicIndexEmpty.Count < 1 && listType.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1)//&& listProjCate.Count < 1
{
//检查项目 listProject.Add(i);
modelProject = new T_BS_CHECK_PROJECT();
@ -542,7 +542,7 @@ namespace APT.BS.WebApi.Controllers.Api
strDescreption = dtSource.Rows[i][7].ToString().Trim();
modelQuestion = listCheckQuestion.FirstOrDefault(e => !e.IS_DELETED && e.DESCREPTION == strDescreption);// && e.DEMAND == strDemand 不报错
if (modelQuestion == null && dicIndexEmpty.Count < 1 && listType.Count < 1 && listProjCate.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1)
if (modelQuestion == null && dicIndexEmpty.Count < 1 && listType.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1)//&& listProjCate.Count < 1
{
strDemand = dtSource.Rows[i][9].ToString().Trim();
@ -575,7 +575,7 @@ namespace APT.BS.WebApi.Controllers.Api
#region listMain
if (dicIndexEmpty.Count < 1 && listType.Count < 1 && listProjCate.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1 && listDepartment.Count < 1)
if (dicIndexEmpty.Count < 1 && listType.Count < 1 && listTypeLevel.Count < 1 && listQuestionLevel.Count < 1 && listDepartment.Count < 1)// && listProjCate.Count < 1
{
T_BS_CHECK_MAIN modelAdd = new T_BS_CHECK_MAIN();
modelAdd.ID = Guid.NewGuid();
@ -603,7 +603,7 @@ namespace APT.BS.WebApi.Controllers.Api
//modelAdd.CREATER_ID = ;
//modelAdd.MODIFIER_ID = ;
modelAdd.ISRISK = false;
modelAdd.CHECK_PROJECT_CATEGORY_ID = modelProjCate.ID;
//modelAdd.CHECK_PROJECT_CATEGORY_ID = modelProjCate.ID;
//modelAdd.CHECK_PROJECT_PROJECT_CATEGORY_ID = ;
//wyw1114-1
//modelAdd.RESPONOBJECT = RESPONOBJECT.Value;
@ -662,11 +662,11 @@ namespace APT.BS.WebApi.Controllers.Api
{
strTypeError = "未找到检查类型:" + string.Join(",", listStrType) + ",行:" + string.Join(',', listType);
}
string strProjCateError = string.Empty;
if (listProjCate != null && listProjCate.Count > 0)
{
strProjCateError = "未找到检查项目分类:" + string.Join(",", listStrProjCate) + ",行:" + string.Join(',', listProjCate);
}
//string strProjCateError = string.Empty;
//if (listProjCate != null && listProjCate.Count > 0)
//{
// strProjCateError = "未找到检查项目分类:" + string.Join(",", listStrProjCate) + ",行:" + string.Join(',', listProjCate);
//}
//listStrProjCate listStrTypeLevel
string strTypeLevelError = string.Empty;
if (listTypeLevel != null && listTypeLevel.Count > 0)
@ -705,10 +705,10 @@ namespace APT.BS.WebApi.Controllers.Api
{
Msg += (Msg.Length > 0 ? "、\r\n" : "") + strTypeError;
}
if (!string.IsNullOrEmpty(strProjCateError))
{
Msg += (Msg.Length > 0 ? "、\r\n" : "") + strProjCateError;
}
//if (!string.IsNullOrEmpty(strProjCateError))
//{
// Msg += (Msg.Length > 0 ? "、\r\n" : "") + strProjCateError;
//}
if (!string.IsNullOrEmpty(strTypeLevelError))
{
Msg += (Msg.Length > 0 ? "、\r\n" : "") + strTypeLevelError;