This commit is contained in:
2024-11-27 15:21:28 +08:00
30 changed files with 355 additions and 198 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ namespace BLL
};
public static Dictionary<string, int> PlanPrintMap = new Dictionary<string, int>
{
{ "采购通知单" ,(int)TypeInt.},
{ "退料通知单" ,(int)TypeInt.退},
{ "采购入库申请单" ,(int)TypeInt.},
{ "退料入库申请单" ,(int)TypeInt.退},
{ "其他入库通知单" ,(int)TypeInt.},
{ "材料领用申请单" ,(int)TypeInt.},
{ "补料申请单" ,(int)TypeInt.},
+8 -2
View File
@@ -30,13 +30,14 @@ namespace BLL
from mat in mm.DefaultIfEmpty()
join master in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals master.Id into masters
from master in masters.DefaultIfEmpty()
join stock in Funs.DB.Tw_MaterialStock on new { x.MaterialCode, master.WarehouseCode } equals new { MaterialCode = stock.PipeLineMatCode, stock.WarehouseCode } into st
join stock in Funs.DB.Tw_MaterialStock on new { x.MaterialCode, master.WarehouseCode,master.ProjectId } equals new { MaterialCode = stock.PipeLineMatCode, stock.WarehouseCode, stock .ProjectId} into st
from stock in st.DefaultIfEmpty()
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) &&
(string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) &&
(string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode))
orderby x.SortIndex
select new Model.Tw_InOutDetailOutput
{
Id = x.Id,
@@ -49,7 +50,7 @@ namespace BLL
MaterialName = mat.MaterialName,
MaterialDef= mat.MaterialDef,
StockNum = stock.StockNum ?? 0,
}
}
;
return q;
@@ -94,6 +95,7 @@ namespace BLL
MaterialCode = newtable.MaterialCode,
PlanNum = newtable.PlanNum,
ActNum = newtable.ActNum,
SortIndex = newtable.SortIndex
};
Funs.DB.Tw_InOutPlanDetail.InsertOnSubmit(table);
Funs.DB.SubmitChanges();
@@ -106,11 +108,14 @@ namespace BLL
/// <param name="inoutPlanMasterId"></param>
public static void AddList(IEnumerable<Model.Tw_InOutPlanDetail> list, string inoutPlanMasterId)
{
int sortIndex = 1;
foreach (var item in list)
{
item.Id= SQLHelper.GetNewID();
item.SortIndex= sortIndex;
item.InOutPlanMasterId = inoutPlanMasterId;
Add(item);
sortIndex++;
}
}
public static void Update(Model.Tw_InOutPlanDetail newtable)
@@ -125,6 +130,7 @@ namespace BLL
table.MaterialCode = newtable.MaterialCode;
table.PlanNum = newtable.PlanNum;
table.ActNum = newtable.ActNum;
table.SortIndex= newtable.SortIndex;
Funs.DB.SubmitChanges();
}
@@ -43,6 +43,7 @@ namespace BLL
from warehouseperson in warehousepersons.DefaultIfEmpty()
join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units
from unit in units.DefaultIfEmpty()
orderby x.CreateDate descending
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
@@ -157,6 +158,7 @@ namespace BLL
var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in result
select new Model.Tw_InOutMasterOutput
{
Id = x.Id,
+24 -1
View File
@@ -35,6 +35,7 @@ namespace BLL
(string.IsNullOrEmpty(table.InputMasterId) || x.InputMasterId.Contains(table.InputMasterId)) &&
(string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) &&
(string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode))
orderby x.SortIndex
select new Model.Tw_InOutDetailOutput
{
Id = x.Id,
@@ -45,7 +46,8 @@ namespace BLL
ActNum = x.ActNum,
PipelineComponentCode = y.PipelineComponentCode,
MaterialName = mat.MaterialName,
MaterialDef = mat.MaterialDef
MaterialDef = mat.MaterialDef,
SortIndex = x.SortIndex
}
;
@@ -88,6 +90,7 @@ namespace BLL
MaterialCode = newtable.MaterialCode,
PlanNum = newtable.PlanNum,
ActNum = newtable.ActNum,
SortIndex = newtable.SortIndex
};
Funs.DB.Tw_InputDetail.InsertOnSubmit(table);
Funs.DB.SubmitChanges();
@@ -105,6 +108,7 @@ namespace BLL
table.MaterialCode = newtable.MaterialCode;
table.PlanNum = newtable.PlanNum;
table.ActNum = newtable.ActNum;
table.SortIndex = newtable.SortIndex;
Funs.DB.SubmitChanges();
}
@@ -121,5 +125,24 @@ namespace BLL
}
public static IEnumerable GePrintListByInputMasterIds(List<string> inputMasterIds)
{
var q = from x in Funs.DB.Tw_InputDetail
join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm
from mat in mm.DefaultIfEmpty()
join y in Funs.DB.Tw_InputMaster on x.InputMasterId equals y.Id
where inputMasterIds.Contains(x.InputMasterId)
orderby y.CusBillCode,x.SortIndex
select new
{
= y.CusBillCode,
= x.MaterialCode,
= mat.MaterialName,
= mat.MaterialDef,
= x.PlanNum,
= x.ActNum,
};
return q;
}
}
}
+1
View File
@@ -294,6 +294,7 @@ namespace BLL
MaterialCode = detail.MaterialCode,
PlanNum = detail.PlanNum,
ActNum = detail.ActNum,
SortIndex = detail.SortIndex,
};
TwInputdetailService.Add(detailTable);
TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType., detailTable.ActNum);
+1 -1
View File
@@ -31,7 +31,7 @@ namespace BLL
from mat in mm.DefaultIfEmpty()
join master in Funs.DB.Tw_OutputMaster on x.OutputMasterId equals master.Id into masters
from master in masters.DefaultIfEmpty()
join stock in Funs.DB.Tw_MaterialStock on new { x.MaterialCode,master.WarehouseCode} equals new { MaterialCode=stock.PipeLineMatCode,stock.WarehouseCode } into st
join stock in Funs.DB.Tw_MaterialStock on new { x.MaterialCode, master.WarehouseCode, master.ProjectId } equals new { MaterialCode = stock.PipeLineMatCode, stock.WarehouseCode, stock.ProjectId } into st
from stock in st.DefaultIfEmpty()
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
@@ -237,11 +237,12 @@ namespace BLL
/// <summary>
/// 根据管线code获取管线信息
/// </summary>
/// <param name="projectId"></param>
/// <param name="pipelineCode"></param>
/// <returns></returns>
public static Model.HJGL_Pipeline GetPipelineByPipelineCode(string pipelineCode)
public static Model.HJGL_Pipeline GetPipelineByPipelineCode(string projectId, string pipelineCode)
{
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineCode == pipelineCode);
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineCode == pipelineCode&&e.ProjectId==projectId );
}
/// <summary>
/// 根据管线信息筛选管线