This commit is contained in:
parent
5e3df582da
commit
24cbcc97f8
|
|
@ -935,5 +935,23 @@ namespace BLL
|
|||
return items;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取焊接位置
|
||||
/// <summary>
|
||||
/// 获取焊接位置
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> GetWeldingLocationList()
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Base_WeldingLocation
|
||||
orderby x.WeldingLocationCode
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.WeldingLocationId, BaseInfoCode = x.WeldingLocationCode, BaseInfoName = x.WeldingLocationName }).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,6 +308,74 @@ namespace BLL
|
|||
return res;
|
||||
}
|
||||
|
||||
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time, string weldingLocation)
|
||||
{
|
||||
string res = "";
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
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 weldingLocationModel = db.Base_WeldingLocation.FirstOrDefault(x => x.WeldingLocationId == weldingLocation);
|
||||
if (weldingLocationModel == null)
|
||||
{
|
||||
res = "焊口位置不存在";
|
||||
return res;
|
||||
}
|
||||
var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
|
||||
var weldTask = db.HJGL_WeldTask.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
|
||||
var weldJoint = db.HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
|
||||
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 = weldTask?.UnitId;
|
||||
weldingDaily.Tabler = Personid;
|
||||
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
|
||||
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//更新焊口位置
|
||||
if (weldingDaily != null)
|
||||
{
|
||||
weldJoint.WeldingLocationId= weldingLocation;
|
||||
WeldJointService.UpdateWeldJoint(weldJoint);
|
||||
}
|
||||
BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
|
||||
PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
|
||||
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);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
APICommonService.SaveSysAPILog("erro", ex.ToString(), "-1");
|
||||
}
|
||||
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
#region 保存焊接日报明细
|
||||
/// <summary>
|
||||
/// 保存焊接日报明细
|
||||
|
|
|
|||
|
|
@ -1248,5 +1248,26 @@ namespace WebAPI.Controllers
|
|||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取焊接位置
|
||||
/// <summary>
|
||||
/// 获取焊接位置
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getWeldingLocation()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.GetWeldingLocationList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,6 +169,38 @@ namespace WebAPI.Controllers
|
|||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊口id保存到日报(增加焊接位置参数)
|
||||
/// </summary>
|
||||
/// <param name="WeldJointId"></param>
|
||||
/// <param name="Personid"></param>
|
||||
/// <param name="time"></param>
|
||||
/// <param name="weldingLocation"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public Model.ResponeData SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time,string weldingLocation)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
string res = APIPreWeldingDailyService.SaveWeldingDailyByWeldJointId(WeldJointId, Personid, time, weldingLocation);
|
||||
|
||||
if (!string.IsNullOrEmpty(res))
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = res;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 更新焊接日报焊口信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue