This commit is contained in:
2024-09-27 18:17:21 +08:00
parent be070f85e2
commit 064a849b97
73 changed files with 3248 additions and 589 deletions
+50 -1
View File
@@ -1,8 +1,11 @@
using System;
using Microsoft.SqlServer.Dts.Runtime;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using static QRCoder.PayloadGenerator;
namespace BLL
{
@@ -254,6 +257,52 @@ namespace BLL
}
#endregion
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time)
{
string res = "";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var peson=db.Person_Persons.FirstOrDefault(x => x.PersonId == Personid);
if (peson == null)
{
res = "人员不存在";
return res;
}
var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
if (joint == null)
{
res = "焊口不存在";
return res;
}
var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date);
if (weldingDaily == null)
{
string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
weldingDaily = new Model.HJGL_WeldingDaily();
weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
weldingDaily.ProjectId = joint.ProjectId;
weldingDaily.UnitWorkId = joint.UnitWorkId;
weldingDaily.UnitId = joint.UnitId;
weldingDaily.Tabler = Personid;
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
db.SubmitChanges();
}
var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", joint.ProjectId);
if (batchC != null)
{
string batchCondition = batchC.SetValue;
InsertWeldingDailyItem(WeldJointId, Personid, Personid, joint.JointAttribute, weldingDaily.WeldingDate, batchCondition, true, weldingDaily.WeldingDailyId, joint.ProjectId);
}
BLL.WeldJointService.UpdateWeldJointAddG(WeldJointId, joint.JointAttribute, Const.BtnAdd);
}
return res;
}
#region
/// <summary>
/// 保存焊接日报明细