合并最新

This commit is contained in:
2022-12-20 09:32:32 +08:00
parent 844e9f1488
commit 1abdaa9476
654 changed files with 73563 additions and 9746 deletions
@@ -343,6 +343,56 @@ namespace BLL
}
}
#region
/// <summary>
/// 批量删除
/// </summary>
/// <returns></returns>
public static Model.ResponeData DelAllJots(string projectId, string isoId,string JointNo)
{
var responeData = new Model.ResponeData();
try
{
int pcount = 0;
IQueryable<Model.PW_JointInfo> getDataList = Funs.DB.PW_JointInfo.Where(x => x.ProjectId == projectId && x.ISO_ID == isoId);
if (!string.IsNullOrEmpty(JointNo))
{
getDataList = getDataList.Where(x => x.JOT_JointNo.Contains(JointNo));
}
pcount = getDataList.Count();
if (pcount == 0)
{
responeData.code = 0;
responeData.message = "没有符合条件数据!";
}
else
{
var getDJot = getDataList.FirstOrDefault(x => x.DReportID != null);
if (getDJot != null)
{
responeData.code = 0;
responeData.message = "存在已做日报的焊口!";
}
else
{
Funs.DB.PW_JointInfo.DeleteAllOnSubmit(getDataList);
Funs.DB.SubmitChanges();
responeData.code = 1;
responeData.message = "删除焊口:" + pcount.ToString() + "个。";
}
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
/// <summary>
/// 修改
/// </summary>
+221 -5
View File
@@ -1,14 +1,230 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FineUIPro;
using System;
using System.Collections;
using System.Web.UI.WebControls;
using System.Linq;
namespace BLL
{
public static class PipelineService
{
public static Model.SGGLDB db = Funs.DB;
#region 线
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.HJGL_View_IsoInfoList> getDataLists = from x in db.HJGL_View_IsoInfoList
select x;
/// <summary>
/// 数据列表
/// </summary>
/// <param name="unitId"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string projectId,string workAreaId,string unitId,string standard, string isoNo, string testMediumId
,string detectionTypeId,string isoNumber,string materialId,string specification,Grid Grid1)
{
IQueryable<Model.HJGL_View_IsoInfoList> getDataList = getDataLists.Where(x=>x.ProjectId == projectId);
if (!string.IsNullOrEmpty(workAreaId))
{
getDataList = getDataList.Where(x => x.WorkAreaId == workAreaId);
}
if (!string.IsNullOrEmpty(unitId))
{
getDataList = getDataList.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(standard))
{
getDataList = getDataList.Where(x => x.Is_Standard == standard);
}
if (!string.IsNullOrEmpty(isoNo))
{
getDataList = getDataList.Where(x => x.ISO_IsoNo.Contains(isoNo));
}
if (!string.IsNullOrEmpty(testMediumId) && testMediumId != Const._Null)
{
getDataList = getDataList.Where(x => x.TestMediumId == testMediumId);
}
if (!string.IsNullOrEmpty(detectionTypeId) && detectionTypeId != Const._Null)
{
getDataList = getDataList.Where(x => x.DetectionTypeId == detectionTypeId);
}
if (!string.IsNullOrEmpty(isoNumber))
{
getDataList = getDataList.Where(x => x.ISO_IsoNumber.Contains(isoNumber));
}
if (!string.IsNullOrEmpty(materialId) && materialId != Const._Null)
{
getDataList = getDataList.Where(x => x.MaterialId == materialId);
}
if (!string.IsNullOrEmpty(specification))
{
// getDataList = getDataList.Where(x => x.ISO_Specification.Contains(specification));
}
count = getDataList.Count();
if (count == 0)
{
return null;
}
if (Grid1.PageSize > count)
{
Grid1.PageSize = count;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getDataList
select new
{
x.ISO_ID,
x.ProjectId,
x.ISO_IsoNo,
x.UnitId,
x.UnitName,
x.TestMediumId,
x.MediumName,
x.DetectionRateId,
x.DetectionRateValue,
x.DetectionTypeId,
x.DetectionTypeName,
x.WorkAreaId,
x.WorkAreaCode,
//x.ISO_SysNo,
//x.ISO_SubSysNo,
//x.ISO_CwpNo,
x.ISO_IsoNumber,
//x.ISO_Rev,
//x.ISO_Sheet,
//x.ISO_PipeQty,
//x.ISO_Paint,
//x.ISO_Insulator,
x.MaterialId,
x.MaterialType,
//x.ISO_Executive,
//x.ISO_Modifier,
//x.ISO_ModifyDate,
//x.ISO_Creator,
//x.ISO_CreateDate,
//x.ISO_DesignPress,
//x.ISO_DesignTemperature,
//x.ISO_TestPress,
//x.ISO_TestTemperature,
x.ISO_NDTClass,
x.ISO_PTRate,
x.Is_Standard,
x.PipingClassId,
x.PipingClassName,
// x.ISO_PTClass,
//ISO_IfPickling = (x.ISO_IfPickling == true ? "是" : "否"),
//ISO_IfChasing = (x.ISO_IfChasing == true ? "是" : "否"),
//x.ISO_Remark,
x.TotalDin,
x.JointCount
};
}
#endregion
#region
/// <summary>
/// 批量删除
/// </summary>
/// <returns></returns>
public static Model.ResponeData DelAllPopeline(string projectId, string workAreaId, string unitId, string standard, string isoNo, string testMediumId
, string detectionTypeId, string isoNumber, string materialId, string specification)
{
var responeData = new Model.ResponeData();
try
{
int pcount = 0;
IQueryable<Model.PW_IsoInfo> getDataList = Funs.DB.PW_IsoInfo.Where(x => x.ProjectId == projectId);
if (!string.IsNullOrEmpty(workAreaId))
{
getDataList = getDataList.Where(x => x.WorkAreaId == workAreaId);
}
if (!string.IsNullOrEmpty(unitId))
{
getDataList = getDataList.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(standard))
{
getDataList = getDataList.Where(x => x.Is_Standard == Convert.ToBoolean(standard));
}
if (!string.IsNullOrEmpty(isoNo))
{
getDataList = getDataList.Where(x => x.ISO_IsoNo.Contains(isoNo));
}
if (!string.IsNullOrEmpty(testMediumId) && testMediumId != Const._Null)
{
getDataList = getDataList.Where(x => x.TestMediumId == testMediumId);
}
if (!string.IsNullOrEmpty(detectionTypeId) && testMediumId != Const._Null)
{
getDataList = getDataList.Where(x => x.DetectionTypeId == detectionTypeId);
}
if (!string.IsNullOrEmpty(isoNumber))
{
getDataList = getDataList.Where(x => x.ISO_IsoNumber.Contains(isoNumber));
}
if (!string.IsNullOrEmpty(materialId) && testMediumId != Const._Null)
{
getDataList = getDataList.Where(x => x.MaterialId == materialId);
}
if (!string.IsNullOrEmpty(specification))
{
getDataList = getDataList.Where(x => x.ISO_Specification.Contains(specification));
}
pcount = getDataList.Count();
if (pcount == 0)
{
responeData.code = 0;
responeData.message = "没有符合条件数据!";
}
else
{
var getJots = from x in Funs.DB.PW_JointInfo
join y in getDataList on x.ISO_ID equals y.ISO_ID
select x;
var getDJot = getJots.FirstOrDefault(x => x.DReportID != null);
if (getDJot != null)
{
responeData.code = 0;
responeData.message = "当前管线中,存在已做日报的焊口!";
}
else
{
int jcount = getJots.Count();
Funs.DB.PW_JointInfo.DeleteAllOnSubmit(getJots);
Funs.DB.PW_IsoInfo.DeleteAllOnSubmit(getDataList);
Funs.DB.SubmitChanges();
responeData.code = 1;
responeData.message = "删除管线:"+ pcount.ToString()+"条;焊口:"+ jcount .ToString()+ "个。";
}
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
/// <summary>
/// 根据管线ID获取管线信息
/// </summary>