提交代码
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
|
||||
foreach (var q in welders)
|
||||
{
|
||||
var s = from x in Funs.DB.HJGL_BS_Welder where x.WED_Code == q.MID_Code select x;
|
||||
var s = from x in Funs.DB.HJGL_BS_Welder where x.IdentityCard == q.MID_IdentityCard select x;
|
||||
var u = BLL.Base_UnitService.GetUnit2(q.MID_Unit);
|
||||
if (u != null)
|
||||
{
|
||||
@@ -103,6 +103,19 @@
|
||||
BLL.HJGL_WelderQualifiedProjectService.UpdateOAWelder(identityCard, isSync);
|
||||
}
|
||||
}
|
||||
//更新单位变更情况
|
||||
var allWelders = from x in Funs.DB.OAM_User select x;
|
||||
foreach (var q in allWelders)
|
||||
{
|
||||
var u = BLL.Base_UnitService.GetUnit2(q.MID_Unit);
|
||||
var w = BLL.HJGL_PersonManageService.GetWelderByIdentityCard(q.MID_IdentityCard);
|
||||
if (u != null && w != null)
|
||||
{
|
||||
w.WED_Unit = u.UnitId;
|
||||
w.WED_IfOnGuard = q.IsUsed;
|
||||
BLL.HJGL_PersonManageService.UpdateBSWelder(w);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var q in quas)
|
||||
{
|
||||
@@ -166,6 +179,39 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
//更新资质删除情况
|
||||
var allDeleteQuas = from x in Funs.DB.OAM_UesrQualified where x.IsDelete == true select x;
|
||||
var allWelders2 = from x in Funs.DB.HJGL_BS_Welder select x;
|
||||
foreach (var q in allDeleteQuas)
|
||||
{
|
||||
var s = allWelders2.FirstOrDefault(x => x.WED_Code == q.MIDWelder_Code);
|
||||
if (s != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(q.MIDWelder_QualifiedProjectCode))
|
||||
{
|
||||
if (q.MIDWelder_QualifiedProjectCode.Contains("+"))
|
||||
{
|
||||
string[] codes = q.MIDWelder_QualifiedProjectCode.Split('+');
|
||||
foreach (string c in codes)
|
||||
{
|
||||
var oldCode = (from x in Funs.DB.HJGL_BS_WelderQualifiedProject where x.WED_ID == s.WED_ID && x.QualifiedProjectCode == c && x.LimitDate.Value.Date == q.MIDWelder_LimitDate.Value.Date select x).FirstOrDefault();
|
||||
if (oldCode!=null)
|
||||
{
|
||||
BLL.HJGL_WelderQualifiedProjectService.DeleteWelderQualifiedProjectByWelderQualifiedProjectId(oldCode.WelderQualifiedProjectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldCode = (from x in Funs.DB.HJGL_BS_WelderQualifiedProject where x.WED_ID == s.WED_ID && x.QualifiedProjectCode == q.MIDWelder_QualifiedProjectCode && x.LimitDate.Value.Date == q.MIDWelder_LimitDate.Value.Date select x).FirstOrDefault();
|
||||
if (oldCode != null)
|
||||
{
|
||||
BLL.HJGL_WelderQualifiedProjectService.DeleteWelderQualifiedProjectByWelderQualifiedProjectId(oldCode.WelderQualifiedProjectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var que = from x in Funs.DB.HJGL_BS_WelderQualifiedProject select x;
|
||||
if (que.Count() > 0)
|
||||
|
||||
Reference in New Issue
Block a user