2022-11-01 焊接包装管理绑值修改,三维传参修改

This commit is contained in:
2022-11-01 17:11:30 +08:00
parent 00dcb84b0a
commit eeddc36939
5 changed files with 125 additions and 63 deletions
@@ -12,8 +12,28 @@ using System.Text;
namespace BLL
{
public static class HJGL_PackagingmanageService
{
public class PackagingManageItem
{
public string PackagingManageId { get; set; }
public string PackagingCode { get; set; }
public string ProjectId { get; set; }
public string ProjectName { get; set; }
public string ContactName { get; set; }
public string ContactPhone { get; set; }
public string StackingPosition { get; set; }
public int? State { get; set; }
public string ReceiveMan { get; set; }
public string ReceiveDate { get; set; }
public string PlanStartDate { get; set; }
}
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 未到场
@@ -87,6 +107,46 @@ namespace BLL
{
return db.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == PackagingManageId);
}
public static string GetMinPlanStartDate(string PackagingManageId)
{
string PlanStartDate = "";
DataTable tb = BLL.HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
var dtTable = tb.AsEnumerable().OrderBy(o => o["PlanStartDate"]).CopyToDataTable();
if (dtTable.Rows != null && dtTable.Rows.Count > 0)
{
PlanStartDate = dtTable.Rows[0]["PlanStartDate"].ToString();
}
return PlanStartDate;
}
public static List<PackagingManageItem> GetPackagingManageList(string projectId,string PackagingCode)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.HJGL_PackagingManage
join n in db.Base_Project on x.ProjectId equals n.ProjectId
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
from t in tt.DefaultIfEmpty()
where x.ProjectId == projectId
&&(string.IsNullOrEmpty(PackagingCode)|| x.PackagingCode.Contains(PackagingCode) )
select new PackagingManageItem
{
PackagingManageId = x.PackagingManageId,
PackagingCode = x.PackagingCode,
ProjectName = n.ProjectName,
ContactName = x.ContactName,
ContactPhone = x.ContactPhone,
StackingPosition = x.StackingPosition,
State = x.State,
ReceiveMan = t.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
PlanStartDate = GetMinPlanStartDate(x.PackagingManageId),
}).Distinct();
return q.ToList();
}
}
/// <summary>
/// 形成出库单
/// </summary>
@@ -113,7 +173,7 @@ namespace BLL
if (!string .IsNullOrEmpty(model.PipelineComponentId))
{
var PipelineComponentIds = model.PipelineComponentId.Split(',');
string strSql = @"select com.PipelineComponentId, com.PipelineComponentCode,com.PlanStartDate,unitwork.UnitWorkName,'1' as num ,'个' as CU
string strSql = @"select com.PipelineComponentId, com.PipelineComponentCode,pipe.PlanStartDate,unitwork.UnitWorkName,'1' as num ,'个' as CU
from HJGL_Pipeline_Component com
left join HJGL_Pipeline pipe on com.PipelineId=pipe.PipelineId
left join WBS_UnitWork unitwork on pipe.UnitWorkId=unitwork.UnitWorkId