0818-1400
This commit is contained in:
parent
33835b762e
commit
a3031f2003
|
@ -225,44 +225,10 @@ namespace BLL
|
|||
/// <param name="inspectionManagement"></param>
|
||||
public static void AddInspectionManagement(Model.ProcessControl_InspectionManagement inspectionManagement)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ProcessControl_InspectionManagement newInspectionManagement = new Model.ProcessControl_InspectionManagement();
|
||||
newInspectionManagement.InspectionId = inspectionManagement.InspectionId;
|
||||
newInspectionManagement.ProjectId = inspectionManagement.ProjectId;
|
||||
newInspectionManagement.UnitId = inspectionManagement.UnitId;
|
||||
newInspectionManagement.CNProfessionalId = inspectionManagement.CNProfessionalId;
|
||||
newInspectionManagement.InspectionCode = inspectionManagement.InspectionCode;
|
||||
newInspectionManagement.UnitWorkId = inspectionManagement.UnitWorkId;
|
||||
newInspectionManagement.Branch = inspectionManagement.Branch;
|
||||
newInspectionManagement.ControlPointType = inspectionManagement.ControlPointType;
|
||||
newInspectionManagement.AcceptanceSite = inspectionManagement.AcceptanceSite;
|
||||
newInspectionManagement.IsOnceQualified = inspectionManagement.IsOnceQualified;
|
||||
newInspectionManagement.InspectionDate = inspectionManagement.InspectionDate;
|
||||
newInspectionManagement.AttachUrl = inspectionManagement.AttachUrl;
|
||||
newInspectionManagement.AttachUrl2 = inspectionManagement.AttachUrl2;
|
||||
newInspectionManagement.NoticeCode = inspectionManagement.NoticeCode;
|
||||
newInspectionManagement.ParentDivisionProjectId = inspectionManagement.ParentDivisionProjectId;
|
||||
newInspectionManagement.CheckDate = inspectionManagement.CheckDate;
|
||||
newInspectionManagement.CheckMan = inspectionManagement.CheckMan;
|
||||
newInspectionManagement.CompileMan = inspectionManagement.CompileMan;
|
||||
newInspectionManagement.CompileDate = inspectionManagement.CompileDate;
|
||||
newInspectionManagement.UnqualifiedReason = inspectionManagement.UnqualifiedReason;
|
||||
newInspectionManagement.AcceptanceCheckMan = inspectionManagement.AcceptanceCheckMan;
|
||||
newInspectionManagement.FileType = inspectionManagement.FileType;
|
||||
db.ProcessControl_InspectionManagement.InsertOnSubmit(newInspectionManagement);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检验批管理
|
||||
/// </summary>
|
||||
/// <param name="inspectionManagement"></param>
|
||||
public static void UpdateInspectionManagement(Model.ProcessControl_InspectionManagement inspectionManagement)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ProcessControl_InspectionManagement newInspectionManagement = db.ProcessControl_InspectionManagement.FirstOrDefault(e => e.InspectionId == inspectionManagement.InspectionId);
|
||||
if (newInspectionManagement != null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ProcessControl_InspectionManagement newInspectionManagement = new Model.ProcessControl_InspectionManagement();
|
||||
newInspectionManagement.InspectionId = inspectionManagement.InspectionId;
|
||||
newInspectionManagement.ProjectId = inspectionManagement.ProjectId;
|
||||
newInspectionManagement.UnitId = inspectionManagement.UnitId;
|
||||
newInspectionManagement.CNProfessionalId = inspectionManagement.CNProfessionalId;
|
||||
|
@ -277,12 +243,50 @@ namespace BLL
|
|||
newInspectionManagement.AttachUrl2 = inspectionManagement.AttachUrl2;
|
||||
newInspectionManagement.NoticeCode = inspectionManagement.NoticeCode;
|
||||
newInspectionManagement.ParentDivisionProjectId = inspectionManagement.ParentDivisionProjectId;
|
||||
newInspectionManagement.CheckDate = inspectionManagement.CheckDate;
|
||||
newInspectionManagement.CheckMan = inspectionManagement.CheckMan;
|
||||
newInspectionManagement.CompileMan = inspectionManagement.CompileMan;
|
||||
newInspectionManagement.CompileDate = inspectionManagement.CompileDate;
|
||||
newInspectionManagement.UnqualifiedReason = inspectionManagement.UnqualifiedReason;
|
||||
newInspectionManagement.AcceptanceCheckMan = inspectionManagement.AcceptanceCheckMan;
|
||||
newInspectionManagement.FileType = inspectionManagement.FileType;
|
||||
db.ProcessControl_InspectionManagement.InsertOnSubmit(newInspectionManagement);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检验批管理
|
||||
/// </summary>
|
||||
/// <param name="inspectionManagement"></param>
|
||||
public static void UpdateInspectionManagement(Model.ProcessControl_InspectionManagement inspectionManagement)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ProcessControl_InspectionManagement newInspectionManagement = db.ProcessControl_InspectionManagement.FirstOrDefault(e => e.InspectionId == inspectionManagement.InspectionId);
|
||||
if (newInspectionManagement != null)
|
||||
{
|
||||
newInspectionManagement.ProjectId = inspectionManagement.ProjectId;
|
||||
newInspectionManagement.UnitId = inspectionManagement.UnitId;
|
||||
newInspectionManagement.CNProfessionalId = inspectionManagement.CNProfessionalId;
|
||||
newInspectionManagement.InspectionCode = inspectionManagement.InspectionCode;
|
||||
newInspectionManagement.UnitWorkId = inspectionManagement.UnitWorkId;
|
||||
newInspectionManagement.Branch = inspectionManagement.Branch;
|
||||
newInspectionManagement.ControlPointType = inspectionManagement.ControlPointType;
|
||||
newInspectionManagement.AcceptanceSite = inspectionManagement.AcceptanceSite;
|
||||
newInspectionManagement.IsOnceQualified = inspectionManagement.IsOnceQualified;
|
||||
newInspectionManagement.InspectionDate = inspectionManagement.InspectionDate;
|
||||
newInspectionManagement.AttachUrl = inspectionManagement.AttachUrl;
|
||||
newInspectionManagement.AttachUrl2 = inspectionManagement.AttachUrl2;
|
||||
newInspectionManagement.NoticeCode = inspectionManagement.NoticeCode;
|
||||
newInspectionManagement.ParentDivisionProjectId = inspectionManagement.ParentDivisionProjectId;
|
||||
newInspectionManagement.UnqualifiedReason = inspectionManagement.UnqualifiedReason;
|
||||
newInspectionManagement.AcceptanceCheckMan = inspectionManagement.AcceptanceCheckMan;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除检验批管理
|
||||
/// </summary>
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
|
@ -165,84 +165,106 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
select x;
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
var installations = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
var installations = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row0))
|
||||
if (string.IsNullOrEmpty(row0))
|
||||
{
|
||||
var cn = cns.Where(x => x.ProfessionalName == row0.Trim()).FirstOrDefault();
|
||||
if (cn == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row0 + "]不存在!" + "|";
|
||||
}
|
||||
result += (i + 2).ToString() + "," + "文件编号为必填项!" + "|";
|
||||
}
|
||||
string row1 = pds.Rows[i][1].ToString();
|
||||
if (!string.IsNullOrEmpty(row1))
|
||||
|
||||
string row1 = pds.Rows[i][1].ToString().Trim();
|
||||
if (string.IsNullOrEmpty(row1))
|
||||
{
|
||||
var ins = installations.Where(x => x.UnitWorkName == row1.Trim()).FirstOrDefault();
|
||||
if (ins == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "装置/单元名称" + "," + "[" + row1 + "]不存在!" + "|";
|
||||
}
|
||||
result += (i + 2).ToString() + "," + "文件名称为必填项!" + "|";
|
||||
}
|
||||
|
||||
string row2 = pds.Rows[i][2].ToString();
|
||||
if (string.IsNullOrEmpty(row2))
|
||||
if (!string.IsNullOrEmpty(row2))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "变更单号" + "," + "此项为必填项!" + "|";
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row2.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "发放日期" + "," + "[" + row2 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "发放日期为必填项!" + "|";
|
||||
}
|
||||
|
||||
string row3 = pds.Rows[i][3].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row3))
|
||||
{
|
||||
var cn = cns.Where(x => x.ProfessionalName == row3.Trim()).FirstOrDefault();
|
||||
if (cn == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row3 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
string row5 = pds.Rows[i][5].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
try
|
||||
string[] reunit = row5.Split(',');
|
||||
foreach (string unit in reunit)
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row5.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "下发日期" + "," + "[" + row5 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row6 = pds.Rows[i][6].ToString();
|
||||
if (!string.IsNullOrEmpty(row6))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row6.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "业主批准时间" + "," + "[" + row6 + "]错误!" + "|";
|
||||
var u = units.Where(x => x.UnitName == unit).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "发件单位" + "," + "[" + unit + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string row7 = pds.Rows[i][7].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row7))
|
||||
{
|
||||
string[] reunit = row7.Split(',');
|
||||
foreach (string unit in reunit)
|
||||
if (row7 != "纸质" && row7 != "电子")
|
||||
{
|
||||
var u = units.Where(x => x.UnitName == unit).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位名称" + "," + "[" + unit + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
string row9 = pds.Rows[i][9].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
{
|
||||
if (row9 != "未实施" && row9 != "进行中" && row9 != "已完成")
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "处理状态" + "," + "[" + row9 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "文件形式" + "," + "[" + row7 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row8 = pds.Rows[i][8].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row8))
|
||||
{
|
||||
try
|
||||
{
|
||||
int a = Convert.ToInt32(row8.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "份数" + "," + "[" + row8 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
{
|
||||
if (row9 != "是" && row9 != "否")
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "是否需回复" + "," + "[" + row9 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row11 = pds.Rows[i][11].ToString();
|
||||
if (!string.IsNullOrEmpty(row11))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row11.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "回复日期" + "," + "[" + row11 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
|
@ -390,63 +412,50 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
var oldViewInfo = oldViewInfos.Where(x => x.ChangeOrderCode == pds.Rows[i][2].ToString().Trim()).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
Model.Comprehensive_DesignChangeOrder Ins = new Model.Comprehensive_DesignChangeOrder();
|
||||
Model.Comprehensive_DataDistribution Ins = new Model.Comprehensive_DataDistribution();
|
||||
Ins.FileCode = pds.Rows[i][0].ToString().Trim();
|
||||
Ins.FileName = pds.Rows[i][1].ToString().Trim();
|
||||
Ins.SendDate = Funs.GetNewDateTime(pds.Rows[i][2].ToString().Trim());
|
||||
Ins.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
|
||||
{
|
||||
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][0].ToString().Trim()).CNProfessionalId;
|
||||
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][3].ToString().Trim()).CNProfessionalId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][1].ToString().Trim()))
|
||||
{
|
||||
Ins.UnitWorkId = Funs.DB.WBS_UnitWork.First(e => e.UnitWorkName == pds.Rows[i][1].ToString().Trim()).UnitWorkId;
|
||||
}
|
||||
|
||||
Ins.ChangeOrderCode = pds.Rows[i][2].ToString().Trim();
|
||||
Ins.ChangeReason = pds.Rows[i][3].ToString().Trim();
|
||||
Ins.Contents = pds.Rows[i][4].ToString().Trim();
|
||||
|
||||
Ins.SendMan = pds.Rows[i][4].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][5].ToString().Trim()))
|
||||
{
|
||||
Ins.IssuedDate = Convert.ToDateTime(pds.Rows[i][5].ToString().Trim());
|
||||
Ins.ReceivingUnit = BLL.UnitService.GetUnitIds(pds.Rows[i][5].ToString().Trim());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
|
||||
Ins.ReceivingMan = pds.Rows[i][6].ToString().Trim();
|
||||
string row7 = pds.Rows[i][7].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row7))
|
||||
{
|
||||
Ins.ApprovalDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());
|
||||
Ins.FileType = row7 == "纸质" ? "1" : "2";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][7].ToString().Trim()))
|
||||
string row8 = pds.Rows[i][8].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row8))
|
||||
{
|
||||
Ins.UnitId = BLL.UnitService.GetUnitIds(pds.Rows[i][7].ToString().Trim());
|
||||
Ins.CopiesCount = Funs.GetNewInt(row8);
|
||||
}
|
||||
|
||||
Ins.ImplementationFrontState = pds.Rows[i][8].ToString().Trim();
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
{
|
||||
if (row9 == "未实施")
|
||||
{
|
||||
Ins.HandleState = "1";
|
||||
}
|
||||
if (row9 == "进行中")
|
||||
{
|
||||
Ins.HandleState = "2";
|
||||
}
|
||||
if (row9 == "已完成")
|
||||
{
|
||||
Ins.HandleState = "3";
|
||||
}
|
||||
Ins.IsReply = row9 == "是" ? true : false;
|
||||
}
|
||||
Ins.ReplyCode = pds.Rows[i][10].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
|
||||
{
|
||||
Ins.ReplyDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
|
||||
}
|
||||
Ins.Remark = pds.Rows[i][12].ToString().Trim();
|
||||
|
||||
Ins.DesignChangeOrderId = SQLHelper.GetNewID(typeof(Model.Comprehensive_DesignChangeOrder));
|
||||
Ins.DataDistributionId = SQLHelper.GetNewID(typeof(Model.Comprehensive_DataDistribution));
|
||||
Ins.CompileMan = this.CurrUser.UserId;
|
||||
Ins.CompileDate = DateTime.Now.Date;
|
||||
BLL.DesignChangeOrderService.AddDesignChangeOrder(Ins);
|
||||
BLL.DataDistributionService.AddDataDistribution(Ins);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2.8 MiB |
Binary file not shown.
Before Width: | Height: | Size: 2.8 MiB |
Loading…
Reference in New Issue