新增管道颜色标识导入功能及API控制器
更新了多个服务和页面,增加了导入管道颜色标识数据的功能,并实现了包装管理、车次管理、管道组件和焊口信息的API控制器。修正了文件路径错误,优化了分页和排序逻辑,删除了不再使用的API方法。
This commit is contained in:
@@ -35,7 +35,12 @@ namespace BLL
|
||||
{ "预制散件" ,(int)TypeInt.预制散件},
|
||||
{ "其他材料" ,(int)TypeInt.其他材料},
|
||||
};
|
||||
|
||||
public static Dictionary<string, int> CategoryIntMap = new Dictionary<string, int>
|
||||
{
|
||||
{ "打捆" ,(int)CategoryInt.打捆},
|
||||
{ "装箱" ,(int)CategoryInt.装箱},
|
||||
{ "散装" ,(int)CategoryInt.散装},
|
||||
};
|
||||
#endregion Fields
|
||||
|
||||
#region Enums
|
||||
@@ -46,6 +51,12 @@ namespace BLL
|
||||
预制散件 = 20,
|
||||
其他材料 = 30,
|
||||
}
|
||||
public enum CategoryInt : int
|
||||
{
|
||||
打捆 = 10,
|
||||
装箱 = 20,
|
||||
散装 = 30,
|
||||
}
|
||||
|
||||
#endregion Enums
|
||||
|
||||
@@ -73,6 +84,7 @@ namespace BLL
|
||||
TrainNumber = newtable.TrainNumber,
|
||||
TrainNumberId = newtable.TrainNumberId,
|
||||
TypeInt = newtable.TypeInt,
|
||||
CategoryInt = newtable.CategoryInt,
|
||||
CompileMan = newtable.CompileMan,
|
||||
CompileDate = newtable.CompileDate
|
||||
};
|
||||
@@ -227,7 +239,9 @@ namespace BLL
|
||||
StackingPosition = x.StackingPosition,
|
||||
State = x.State,
|
||||
TypeInt = x.TypeInt,
|
||||
CategoryInt = x.CategoryInt,
|
||||
TypeString = GetTypeString(x.TypeInt),
|
||||
CategoryString = GetCategoryString(x.CategoryInt),
|
||||
ReceiveMan = train.ContactName,//t.PersonName,
|
||||
ReceiveDate = x.ReceiveDate.HasValue ? string.Format("{0:g}", x.ReceiveDate) : "",
|
||||
PlanStartDate = GetMinPlanStartDate(x.PackagingManageId),
|
||||
@@ -261,7 +275,10 @@ namespace BLL
|
||||
{
|
||||
return TypeIntMap.FirstOrDefault(c => c.Value == TypeInt).Key;
|
||||
}
|
||||
|
||||
public static string GetCategoryString(int? CategoryInt)
|
||||
{
|
||||
return CategoryIntMap.FirstOrDefault(c => c.Value == CategoryInt).Key;
|
||||
}
|
||||
/// <summary>
|
||||
/// 管线下拉框
|
||||
/// </summary>
|
||||
@@ -313,6 +330,7 @@ namespace BLL
|
||||
table.TrainNumber = newtable.TrainNumber;
|
||||
table.TrainNumberId = newtable.TrainNumberId;
|
||||
table.TypeInt = newtable.TypeInt;
|
||||
table.CategoryInt = newtable.CategoryInt;
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -344,6 +362,9 @@ namespace BLL
|
||||
public string TrainNumberOld { get; set; }
|
||||
public int? TypeInt { get; set; }
|
||||
public string TypeString { get; set; }
|
||||
public int? CategoryInt { get; set; }
|
||||
public string CategoryString { get; set; }
|
||||
|
||||
|
||||
#endregion Properties
|
||||
}
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class TrainNumberManageService
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int Count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
{
|
||||
private static IQueryable<Model.HJGL_TrainNumberManage> GetByQueryModle(Model.HJGL_TrainNumberManage table)
|
||||
{
|
||||
var q = from x in Funs.DB.HJGL_TrainNumberManage select x;
|
||||
@@ -71,11 +63,11 @@ namespace BLL
|
||||
return GetByQueryModle(table).ToList();
|
||||
}
|
||||
|
||||
public static (List<Model.HJGL_TrainNumberManage> Data, int Total) GetListByQueryModle(Model.HJGL_TrainNumberManage table, int pageIndex = 0, int pageSize = 20)
|
||||
public static (List<Model.HJGL_TrainNumberManage> Data, int Total) GetListByQueryModle(Model.HJGL_TrainNumberManage table, int pageIndex = 1, int pageSize = 20)
|
||||
{
|
||||
var baseQuery = GetByQueryModle(table);
|
||||
var pagedData = baseQuery
|
||||
.Skip((pageIndex) * pageSize)
|
||||
.Skip((pageIndex-1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
|
||||
@@ -94,10 +86,10 @@ namespace BLL
|
||||
public static string GetNewTrainNumber(string ProjectId)
|
||||
{
|
||||
var q = from x in Funs.DB.HJGL_TrainNumberManage
|
||||
where x.ProjectId == ProjectId
|
||||
where x.ProjectId == ProjectId
|
||||
select x.TrainNumber;
|
||||
var max = q.Count();
|
||||
var NewTrainNumber = (max + 1).ToString().PadLeft(2, '0');
|
||||
var NewTrainNumber = string.Format("{0:yyyyMMdd}", DateTime.Now)+"-"+(max + 1).ToString().PadLeft(3, '0');
|
||||
return NewTrainNumber;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user