焊接修改

This commit is contained in:
2025-05-08 18:38:55 +08:00
parent 23f7bfbb1d
commit 3a36b8e3ef
38 changed files with 3717 additions and 341 deletions
@@ -21,6 +21,9 @@ namespace BLL
public string PackagingCode { get; set; }
public string ProjectId { get; set; }
public string ProjectName { get; set; }
public string DriverName { get; set; }
public string DriverPhone { get; set; }
public string LicensePlateNumber { get; set; }
public string ContactName { get; set; }
public string ContactPhone { get; set; }
public string StackingPosition { get; set; }
@@ -32,6 +35,7 @@ namespace BLL
public string Code { get; set; }
public string TrainNumber { get; set; }
public string TrainNumberOld { get; set; }
}
@@ -56,56 +60,19 @@ namespace BLL
list[2] = new ListItem("已到场", state_2.ToString());
return list;
}
#region
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// 获取分页列表
/// </summary>
/// <param name="PageIndex">页码</param>
/// <param name="PageSize">每页数量</param>
/// <returns></returns>
public static IEnumerable getListData(string name, Grid Grid1)
public enum TypeInt : int
{
var db1 = Funs.DB;
IQueryable<Model.HJGL_PackagingManage> q1 = (from x in db1.HJGL_PackagingManage
join y in db1.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId
join z in db1.HJGL_Pipeline on y.PipelineId equals z.PipelineId
select x
);
if (!string.IsNullOrEmpty(name))
{
q1 = q1.Where(e => e.PackagingManageId.Contains(name));
}
count = q1.Count();
if (count == 0)
{
return null;
}
q1 = SortConditionHelper.SortingAndPaging(q1, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q1
select new
{
x.PackagingManageId,
x.PackagingCode,
x.ProjectId,
x.PipelineComponentId,
x.StackingPosition,
x.State,
x.ContactName,
x.ContactPhone,
x.Remark,
x.TrainNumber
};
= 10,
= 20,
= 30,
}
#endregion
public static Dictionary<string, int> TypeIntMap = new Dictionary<string, int>
{
{ "预制组件" ,(int)TypeInt.},
{ "预制散件" ,(int)TypeInt.},
{ "其他材料" ,(int)TypeInt.},
};
public static Model.HJGL_PackagingManage GetHJGL_PackagingManageById(string PackagingManageId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
@@ -128,37 +95,52 @@ namespace BLL
}
return PlanStartDate;
}
public static List<PackagingManageItem> GetPackagingManageList(string projectId, string PackagingCode, int pageIndex, int pageSize)
public static (List<PackagingManageItem> Data, int Total) GetPackagingManageList(string projectId, string PackagingCode, int pageIndex = 0, int pageSize = 20)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.HJGL_PackagingManage
var baseQuery = (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
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
from t in tt.DefaultIfEmpty()
where x.ProjectId == projectId
join train in db.HJGL_TrainNumberManage on x.TrainNumberId equals train.Id into trains
from train in trains.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,
ContactName = train.ContactName,
ContactPhone = train.ContactPhone,
DriverName = train.DriverName,
DriverPhone = train.DriverPhone,
LicensePlateNumber = train.LicensePlateNumber,
StackingPosition = x.StackingPosition,
State = x.State,
ReceiveMan = t.PersonName,
ReceiveDate = x.ReceiveDate.HasValue ? string.Format("{0:g}", x.ReceiveDate) : "",
PlanStartDate = GetMinPlanStartDate(x.PackagingManageId),
TrainNumber = x.TrainNumber,
TrainNumberOld = x.TrainNumber,
TrainNumber = train.TrainNumber,
Code = x.PackagingCode.Substring(0, x.PackagingCode.LastIndexOf("-")).Substring(x.PackagingCode.Substring(0, x.PackagingCode.LastIndexOf("-")).LastIndexOf("-") + 1),
}).Distinct();
return q.OrderByDescending(x => x.Code).Skip(pageIndex * pageSize).Take(pageSize).ToList();
var pagedData = baseQuery
.OrderByDescending(x => x.Code)
.Skip((pageIndex) * pageSize)
.Take(pageSize)
.ToList();
// 获取总记录数(延迟计数优化)
var totalCount = baseQuery.Count();
return (pagedData, totalCount);
}
}
}
/// <summary>
/// 形成出库单
/// </summary>
@@ -233,7 +215,9 @@ namespace BLL
Remark = newtable.Remark,
ReceiveDate = newtable.ReceiveDate,
ReceiveMan = newtable.ReceiveMan,
TrainNumber = newtable.TrainNumber
TrainNumber = newtable.TrainNumber,
TrainNumberId = newtable.TrainNumberId,
TypeInt = newtable.TypeInt,
};
var db1 = Funs.DB;
db1.HJGL_PackagingManage.InsertOnSubmit(table);
@@ -259,6 +243,8 @@ namespace BLL
table.ReceiveMan = newtable.ReceiveMan;
table.ReceiveDate = newtable.ReceiveDate;
table.TrainNumber = newtable.TrainNumber;
table.TrainNumberId = newtable.TrainNumberId;
table.TypeInt = newtable.TypeInt;
db1.SubmitChanges();
}