1
This commit is contained in:
@@ -32,7 +32,9 @@ namespace BLL
|
||||
//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()
|
||||
join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units
|
||||
join auditperson in Funs.DB.Person_Persons on x.AuditMan equals auditperson.PersonId into auditpersons
|
||||
from auditperson in auditpersons.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)) &&
|
||||
@@ -62,7 +64,10 @@ namespace BLL
|
||||
CreateDate = x.CreateDate,
|
||||
ReqUnitId = x.ReqUnitId,
|
||||
ReqUnitName = unit.UnitName,
|
||||
WeldTaskId = y.WeldTaskId,
|
||||
WeldTaskId = y.WeldTaskId,
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = auditperson.PersonName,
|
||||
AuditDate = x.AuditDate,
|
||||
};
|
||||
|
||||
return q;
|
||||
@@ -105,6 +110,9 @@ namespace BLL
|
||||
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 == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "",
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate
|
||||
|
||||
};
|
||||
}
|
||||
@@ -140,6 +148,9 @@ namespace BLL
|
||||
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 == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "",
|
||||
AuditMan = x.AuditMan,
|
||||
AuditManName = x.AuditManName,
|
||||
AuditDate = x.AuditDate
|
||||
|
||||
}).ToList();
|
||||
}
|
||||
@@ -167,7 +178,9 @@ namespace BLL
|
||||
State = newtable.State,
|
||||
CreateMan = newtable.CreateMan,
|
||||
CreateDate = newtable.CreateDate,
|
||||
ReqUnitId = newtable.ReqUnitId,
|
||||
ReqUnitId = newtable.ReqUnitId,
|
||||
AuditMan = newtable.AuditMan,
|
||||
AuditDate = newtable.AuditDate
|
||||
};
|
||||
Funs.DB.Tw_OutputMaster.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
@@ -191,6 +204,8 @@ namespace BLL
|
||||
table.CreateMan = newtable.CreateMan;
|
||||
table.CreateDate = newtable.CreateDate;
|
||||
table.ReqUnitId = newtable.ReqUnitId;
|
||||
table.AuditMan = newtable.AuditMan;
|
||||
table.AuditDate = newtable.AuditDate;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -244,6 +259,8 @@ namespace BLL
|
||||
CreateMan = plan.CreateMan,
|
||||
CreateDate = DateTime.Now,
|
||||
ReqUnitId = plan.ReqUnitId,
|
||||
AuditMan = plan.CreateMan,
|
||||
AuditDate = plan.AuditDate
|
||||
};
|
||||
Add(master);
|
||||
//生成出库单明细
|
||||
@@ -268,14 +285,16 @@ namespace BLL
|
||||
/// 根据计划单撤销出库单
|
||||
/// </summary>
|
||||
/// <param name="planId"></param>
|
||||
public static void RevokeGenOutMasterByPlanId(string planId)
|
||||
public static string RevokeGenOutMasterByPlanId(string planId)
|
||||
{
|
||||
string result = "";
|
||||
Tw_InOutMasterOutput query = new Tw_InOutMasterOutput();
|
||||
query.InOutPlanMasterId = planId;
|
||||
var master = GetModle(query).FirstOrDefault();
|
||||
if (master == null)
|
||||
{
|
||||
return;
|
||||
result = "未找到对应的出库单";
|
||||
return result;
|
||||
}
|
||||
DeleteById(master.Id); //删除出库单
|
||||
//删除明细
|
||||
@@ -288,8 +307,10 @@ namespace BLL
|
||||
//撤销出库,即增加库存
|
||||
TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.入库, detail.ActNum);
|
||||
}
|
||||
|
||||
|
||||
var planModel= TwInOutplanmasterService.GetById(planId);
|
||||
planModel.State= (int)TwConst.State.已审核;
|
||||
TwInOutplanmasterService.Update(planModel);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string GetCusBillCodeByTaskCode(string taskCode, TwConst.TypeInt typeInt, TwConst.Category category)
|
||||
|
||||
Reference in New Issue
Block a user