代码无效引用清理,试压包资料界面看板修改
This commit is contained in:
@@ -4,7 +4,6 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
@@ -13,7 +12,7 @@ namespace BLL
|
||||
/// 入库单逻辑层
|
||||
/// </summary>
|
||||
public static class TwOutputmasterService
|
||||
{
|
||||
{
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
@@ -26,12 +25,12 @@ namespace BLL
|
||||
public static IQueryable<Model.Tw_InOutMasterOutput> GetModle(Model.Tw_InOutMasterOutput table)
|
||||
{
|
||||
var q = from x in Funs.DB.Tw_OutputMaster
|
||||
join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id into yy
|
||||
from y in yy.DefaultIfEmpty()
|
||||
//join z in Funs.DB.HJGL_WeldTask on y.WeldTaskId equals z.WeldTaskId into zz
|
||||
//from z in zz.DefaultIfEmpty()
|
||||
join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id into yy
|
||||
from y in yy.DefaultIfEmpty()
|
||||
//join z in Funs.DB.HJGL_WeldTask on y.WeldTaskId equals z.WeldTaskId into zz
|
||||
//from z in zz.DefaultIfEmpty()
|
||||
join person in Funs.DB.Person_Persons on x.CreateMan equals person.PersonId into persons
|
||||
from person in persons.DefaultIfEmpty()
|
||||
from person in persons.DefaultIfEmpty()
|
||||
join auditperson in Funs.DB.Person_Persons on x.AuditMan equals auditperson.PersonId into auditpersons
|
||||
from auditperson in auditpersons.DefaultIfEmpty()
|
||||
join auditperson2 in Funs.DB.Person_Persons on x.AuditMan2 equals auditperson2.PersonId into auditpersons2
|
||||
@@ -39,48 +38,48 @@ namespace BLL
|
||||
join warehouseperson in Funs.DB.Person_Persons on x.WarehouseMan equals warehouseperson.PersonId into warehousepersons
|
||||
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()
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId .Contains(table.InOutPlanMasterId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) &&
|
||||
(string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) &&
|
||||
(string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) &&
|
||||
(string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitWorkId) || y.WeldTaskId.Contains(table.UnitWorkId)) &&
|
||||
(table.TypeInt == null || x.TypeInt == table.TypeInt) &&
|
||||
(table.Category == null || x.Category == table.Category) &&
|
||||
(table.State == null || x.State == table.State)
|
||||
orderby x.CreateDate descending
|
||||
select new Model.Tw_InOutMasterOutput
|
||||
{
|
||||
Id = x.Id,
|
||||
ProjectId = x.ProjectId,
|
||||
CusBillCode = x.CusBillCode,
|
||||
InOutPlanMasterId = x.InOutPlanMasterId,
|
||||
WarehouseCode = x.WarehouseCode,
|
||||
Category = x.Category,
|
||||
Source = x.Source,
|
||||
TypeInt = x.TypeInt,
|
||||
State = x.State,
|
||||
CreateMan = x.CreateMan,
|
||||
CreateManName = person.PersonName,
|
||||
CreateDate = x.CreateDate,
|
||||
ReqUnitId = x.ReqUnitId,
|
||||
ReqUnitName = unit.UnitName,
|
||||
WeldTaskId = y.WeldTaskId,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = auditperson.PersonName,
|
||||
AuditDate = x.AuditDate,
|
||||
AuditMan2 = x.AuditMan2,
|
||||
AuditManName2 = auditperson2.PersonName,
|
||||
AuditDate2 = x.AuditDate2,
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseDate = x.WarehouseDate,
|
||||
WarehouseManName = warehouseperson.PersonName,
|
||||
Remark=y.Remark
|
||||
};
|
||||
from unit in units.DefaultIfEmpty()
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) &&
|
||||
(string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) &&
|
||||
(string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) &&
|
||||
(string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitWorkId) || y.WeldTaskId.Contains(table.UnitWorkId)) &&
|
||||
(table.TypeInt == null || x.TypeInt == table.TypeInt) &&
|
||||
(table.Category == null || x.Category == table.Category) &&
|
||||
(table.State == null || x.State == table.State)
|
||||
orderby x.CreateDate descending
|
||||
select new Model.Tw_InOutMasterOutput
|
||||
{
|
||||
Id = x.Id,
|
||||
ProjectId = x.ProjectId,
|
||||
CusBillCode = x.CusBillCode,
|
||||
InOutPlanMasterId = x.InOutPlanMasterId,
|
||||
WarehouseCode = x.WarehouseCode,
|
||||
Category = x.Category,
|
||||
Source = x.Source,
|
||||
TypeInt = x.TypeInt,
|
||||
State = x.State,
|
||||
CreateMan = x.CreateMan,
|
||||
CreateManName = person.PersonName,
|
||||
CreateDate = x.CreateDate,
|
||||
ReqUnitId = x.ReqUnitId,
|
||||
ReqUnitName = unit.UnitName,
|
||||
WeldTaskId = y.WeldTaskId,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = auditperson.PersonName,
|
||||
AuditDate = x.AuditDate,
|
||||
AuditMan2 = x.AuditMan2,
|
||||
AuditManName2 = auditperson2.PersonName,
|
||||
AuditDate2 = x.AuditDate2,
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseDate = x.WarehouseDate,
|
||||
WarehouseManName = warehouseperson.PersonName,
|
||||
Remark = y.Remark
|
||||
};
|
||||
|
||||
return q;
|
||||
}
|
||||
@@ -101,39 +100,39 @@ namespace BLL
|
||||
}
|
||||
var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
|
||||
return from x in result
|
||||
select new Model.Tw_InOutMasterOutput
|
||||
{
|
||||
Id = x.Id,
|
||||
ProjectId = x.ProjectId,
|
||||
CusBillCode = x.CusBillCode,
|
||||
WarehouseCode = x.WarehouseCode,
|
||||
InOutPlanMasterId = x.InOutPlanMasterId,
|
||||
Source = x.Source,
|
||||
TypeInt = x.TypeInt,
|
||||
State = x.State,
|
||||
Category= x.Category,
|
||||
CreateMan = x.CreateMan,
|
||||
CreateManName = x.CreateManName,
|
||||
CreateDate = x.CreateDate,
|
||||
ReqUnitId = x.ReqUnitId,
|
||||
ReqUnitName = x.ReqUnitName,
|
||||
TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key,
|
||||
StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key,
|
||||
CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key,
|
||||
WeldTaskId = x.WeldTaskId,
|
||||
WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == DateTime.ParseExact(x.WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null).Date)?.TaskCode : "" : "",
|
||||
UnitWorkId= x.WeldTaskId != null? x.WeldTaskId.Split('|')[0].ToString():null,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate,
|
||||
AuditMan2 = x.AuditMan2,
|
||||
AuditManName2 = x.AuditManName2,
|
||||
AuditDate2 = x.AuditDate2,
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseManName = x.WarehouseManName,
|
||||
WarehouseDate = x.WarehouseDate
|
||||
select new Model.Tw_InOutMasterOutput
|
||||
{
|
||||
Id = x.Id,
|
||||
ProjectId = x.ProjectId,
|
||||
CusBillCode = x.CusBillCode,
|
||||
WarehouseCode = x.WarehouseCode,
|
||||
InOutPlanMasterId = x.InOutPlanMasterId,
|
||||
Source = x.Source,
|
||||
TypeInt = x.TypeInt,
|
||||
State = x.State,
|
||||
Category = x.Category,
|
||||
CreateMan = x.CreateMan,
|
||||
CreateManName = x.CreateManName,
|
||||
CreateDate = x.CreateDate,
|
||||
ReqUnitId = x.ReqUnitId,
|
||||
ReqUnitName = x.ReqUnitName,
|
||||
TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key,
|
||||
StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key,
|
||||
CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key,
|
||||
WeldTaskId = x.WeldTaskId,
|
||||
WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == DateTime.ParseExact(x.WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null).Date)?.TaskCode : "" : "",
|
||||
UnitWorkId = x.WeldTaskId != null ? x.WeldTaskId.Split('|')[0].ToString() : null,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate,
|
||||
AuditMan2 = x.AuditMan2,
|
||||
AuditManName2 = x.AuditManName2,
|
||||
AuditDate2 = x.AuditDate2,
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseManName = x.WarehouseManName,
|
||||
WarehouseDate = x.WarehouseDate
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
public static List<Tw_InOutMasterOutput> GetListData(Model.Tw_InOutMasterOutput table)
|
||||
@@ -146,39 +145,39 @@ namespace BLL
|
||||
}
|
||||
var result = q.ToList();
|
||||
return (from x in result
|
||||
select new Model.Tw_InOutMasterOutput
|
||||
{
|
||||
Id = x.Id,
|
||||
ProjectId = x.ProjectId,
|
||||
CusBillCode = x.CusBillCode,
|
||||
InOutPlanMasterId = x.InOutPlanMasterId,
|
||||
WarehouseCode = x.WarehouseCode,
|
||||
Source = x.Source,
|
||||
TypeInt = x.TypeInt,
|
||||
State = x.State,
|
||||
Category = x.Category,
|
||||
CreateMan = x.CreateMan,
|
||||
CreateManName = x.CreateManName,
|
||||
CreateDate = x.CreateDate,
|
||||
ReqUnitId = x.ReqUnitId,
|
||||
ReqUnitName = x.ReqUnitName,
|
||||
TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key,
|
||||
StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key,
|
||||
CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key,
|
||||
WeldTaskId = x.WeldTaskId,
|
||||
WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == DateTime.ParseExact(x.WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null).Date)?.TaskCode : "" : "",
|
||||
UnitWorkId = x.WeldTaskId != null ? x.WeldTaskId.Split('|')[0].ToString() : null,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate,
|
||||
AuditMan2 = x.AuditMan2,
|
||||
AuditManName2 = x.AuditManName2,
|
||||
AuditDate2 = x.AuditDate2,
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseManName = x.WarehouseManName,
|
||||
WarehouseDate = x.WarehouseDate
|
||||
select new Model.Tw_InOutMasterOutput
|
||||
{
|
||||
Id = x.Id,
|
||||
ProjectId = x.ProjectId,
|
||||
CusBillCode = x.CusBillCode,
|
||||
InOutPlanMasterId = x.InOutPlanMasterId,
|
||||
WarehouseCode = x.WarehouseCode,
|
||||
Source = x.Source,
|
||||
TypeInt = x.TypeInt,
|
||||
State = x.State,
|
||||
Category = x.Category,
|
||||
CreateMan = x.CreateMan,
|
||||
CreateManName = x.CreateManName,
|
||||
CreateDate = x.CreateDate,
|
||||
ReqUnitId = x.ReqUnitId,
|
||||
ReqUnitName = x.ReqUnitName,
|
||||
TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key,
|
||||
StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key,
|
||||
CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key,
|
||||
WeldTaskId = x.WeldTaskId,
|
||||
WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == DateTime.ParseExact(x.WeldTaskId.Split('|')[2].ToString(), "yyyyMMdd", null).Date)?.TaskCode : "" : "",
|
||||
UnitWorkId = x.WeldTaskId != null ? x.WeldTaskId.Split('|')[0].ToString() : null,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate,
|
||||
AuditMan2 = x.AuditMan2,
|
||||
AuditManName2 = x.AuditManName2,
|
||||
AuditDate2 = x.AuditDate2,
|
||||
WarehouseMan = x.WarehouseMan,
|
||||
WarehouseManName = x.WarehouseManName,
|
||||
WarehouseDate = x.WarehouseDate
|
||||
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -204,7 +203,7 @@ namespace BLL
|
||||
State = newtable.State,
|
||||
CreateMan = newtable.CreateMan,
|
||||
CreateDate = newtable.CreateDate,
|
||||
ReqUnitId = newtable.ReqUnitId,
|
||||
ReqUnitId = newtable.ReqUnitId,
|
||||
AuditMan = newtable.AuditMan,
|
||||
AuditDate = newtable.AuditDate,
|
||||
AuditMan2 = newtable.AuditMan2,
|
||||
@@ -263,28 +262,28 @@ namespace BLL
|
||||
{
|
||||
//获取出库单
|
||||
var planQueryModel = new Tw_InOutMasterOutput();
|
||||
planQueryModel.Id = planId;
|
||||
var plan = TwInOutplanmasterService.GetListData(planQueryModel).FirstOrDefault();
|
||||
if (plan == null || plan.State != (int)TwConst.State.已审核)
|
||||
planQueryModel.Id = planId;
|
||||
var plan = TwInOutplanmasterService.GetListData(planQueryModel).FirstOrDefault();
|
||||
if (plan == null || plan.State != (int)TwConst.State.已审核)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//判断是否已经生成过出库单
|
||||
var queryIsExitInMaster = new Tw_InOutMasterOutput();
|
||||
queryIsExitInMaster.InOutPlanMasterId = planId;
|
||||
queryIsExitInMaster.TypeInt= plan.TypeInt;
|
||||
queryIsExitInMaster.TypeInt = plan.TypeInt;
|
||||
var IsExitInMaster = GetModle(queryIsExitInMaster).FirstOrDefault();
|
||||
if (IsExitInMaster != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
//生成出库单
|
||||
var master = new Model.Tw_OutputMaster()
|
||||
{
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
InOutPlanMasterId = plan.Id,
|
||||
ProjectId = plan.ProjectId,
|
||||
CusBillCode = GetCusBillCode(plan.WeldTaskCode, (TwConst.TypeInt)plan.TypeInt, (BLL.TwConst.Category)plan.Category,plan.CusBillCode),
|
||||
CusBillCode = GetCusBillCode(plan.WeldTaskCode, (TwConst.TypeInt)plan.TypeInt, (BLL.TwConst.Category)plan.Category, plan.CusBillCode),
|
||||
WarehouseCode = plan.WarehouseCode,
|
||||
Category = plan.Category,
|
||||
Source = plan.Source,
|
||||
@@ -299,8 +298,8 @@ namespace BLL
|
||||
AuditDate2 = plan.AuditDate2,
|
||||
WarehouseMan = plan.WarehouseMan,
|
||||
WarehouseDate = plan.WarehouseDate,
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
Add(master);
|
||||
//生成出库单明细
|
||||
foreach (var detail in detailLists)
|
||||
@@ -318,7 +317,7 @@ namespace BLL
|
||||
|
||||
}
|
||||
plan.State = (int)TwConst.State.已完成;
|
||||
TwInOutplanmasterService.Update(plan);
|
||||
TwInOutplanmasterService.Update(plan);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据计划单撤销出库单
|
||||
@@ -346,8 +345,8 @@ namespace BLL
|
||||
//撤销出库,即增加库存
|
||||
TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.入库, detail.ActNum);
|
||||
}
|
||||
var planModel= TwInOutplanmasterService.GetById(planId);
|
||||
planModel.State= (int)TwConst.State.已审核;
|
||||
var planModel = TwInOutplanmasterService.GetById(planId);
|
||||
planModel.State = (int)TwConst.State.已审核;
|
||||
planModel.WarehouseMan = null;
|
||||
planModel.WarehouseDate = null;
|
||||
TwInOutplanmasterService.Update(planModel);
|
||||
|
||||
Reference in New Issue
Block a user