获取初始日期代码修改
This commit is contained in:
parent
8a9176549a
commit
18938c7baf
@ -132,7 +132,7 @@ namespace ZR.Service.mes.qc
|
||||
public int WriteProcessFlow_first(string workorderID, DateTime time)
|
||||
{
|
||||
ProWorkordertimeStep step = new ProWorkordertimeStep();
|
||||
step.FirstInspectTime = time;
|
||||
step.FirstInspectTime = time.ToLocalTime();
|
||||
step.CreatedTime = DateTime.Now;
|
||||
step.WorkoderId = workorderID;
|
||||
|
||||
@ -1563,11 +1563,6 @@ namespace ZR.Service.mes.qc
|
||||
first.ProgramOther = firstrecordList[i].Counter;
|
||||
paoguang_total = paoguang_total + (int)firstrecordList[i].Counter;
|
||||
}
|
||||
if (firstrecordList[i].FKInpectionId == "415")
|
||||
{
|
||||
first.ProgramOther = firstrecordList[i].Counter;
|
||||
paoguang_total = paoguang_total + (int)firstrecordList[i].Counter;
|
||||
}
|
||||
if (firstrecordList[i].FKInpectionId == "511")
|
||||
{
|
||||
first.TeamTuoluocanshuang = firstrecordList[i].Counter;
|
||||
@ -1786,11 +1781,6 @@ namespace ZR.Service.mes.qc
|
||||
first2.ProgramOther = firstrecordList2[i].Counter;
|
||||
damo_total = damo_total + (int)firstrecordList2[i].Counter;
|
||||
}
|
||||
if (firstrecordList2[i].FKInpectionId == "425")
|
||||
{
|
||||
first2.ProgramOther = firstrecordList2[i].Counter;
|
||||
damo_total = damo_total + (int)firstrecordList2[i].Counter;
|
||||
}
|
||||
if (firstrecordList2[i].FKInpectionId == "521")
|
||||
{
|
||||
first2.TeamTuoluocanshuang = firstrecordList2[i].Counter;
|
||||
@ -1994,11 +1984,6 @@ namespace ZR.Service.mes.qc
|
||||
first3.ProgramOther = firstrecordList3[i].Counter;
|
||||
baofei_total = baofei_total + (int)firstrecordList3[i].Counter;
|
||||
}
|
||||
if (firstrecordList3[i].FKInpectionId == "435")
|
||||
{
|
||||
first3.ProgramOther = firstrecordList3[i].Counter;
|
||||
baofei_total = baofei_total + (int)firstrecordList3[i].Counter;
|
||||
}
|
||||
if (firstrecordList3[i].FKInpectionId == "531")
|
||||
{
|
||||
first3.TeamTuoluocanshuang = firstrecordList3[i].Counter;
|
||||
@ -2270,11 +2255,6 @@ namespace ZR.Service.mes.qc
|
||||
again2.ProgramOther = againrecordList2[i].Counter;
|
||||
damo_total_again = damo_total_again + (int)againrecordList2[i].Counter;
|
||||
}
|
||||
if (againrecordList2[i].FkInpectionId == "425")
|
||||
{
|
||||
again2.ProgramOther = againrecordList2[i].Counter;
|
||||
damo_total_again = damo_total_again + (int)againrecordList2[i].Counter;
|
||||
}
|
||||
if (againrecordList2[i].FkInpectionId == "521")
|
||||
{
|
||||
again2.TeamTuoluocanshuang = againrecordList2[i].Counter;
|
||||
@ -2489,11 +2469,6 @@ namespace ZR.Service.mes.qc
|
||||
again3.ProgramOther = againrecordList3[i].Counter;
|
||||
baofei_total_again3 = baofei_total_again3 + (int)againrecordList3[i].Counter;
|
||||
}
|
||||
if (againrecordList3[i].FkInpectionId == "435")
|
||||
{
|
||||
again3.ProgramOther = againrecordList3[i].Counter;
|
||||
baofei_total_again3 = baofei_total_again3 + (int)againrecordList3[i].Counter;
|
||||
}
|
||||
if (againrecordList3[i].FkInpectionId == "531")
|
||||
{
|
||||
again3.TeamTuoluocanshuang = againrecordList3[i].Counter;
|
||||
@ -2591,8 +2566,8 @@ namespace ZR.Service.mes.qc
|
||||
final2.FinishedPartNumber = workorder_final2.FinishedPartNumber;
|
||||
final2.ProductDescription = workorder_final2.ProductDescription;
|
||||
|
||||
// XXX:三检(包装),生产投入数为(一检投入数 - (一检报废数 + 二检报废数))
|
||||
final2.RequireNumber = workorder_final2.PreviousNumber - (baofei_total + baofei_total_again3);
|
||||
// XXX:三检(包装),生产投入数为(首检合格数 + 抛光合格数)
|
||||
final2.RequireNumber = first.QualifiedNumber + again2.QualifiedNumber;
|
||||
if (step != null)
|
||||
{
|
||||
final2.StartTime = step.FirstInspectTime;//这地方是不妥的
|
||||
@ -2756,11 +2731,6 @@ namespace ZR.Service.mes.qc
|
||||
final2.ProgramOther = finalrecordList2[i].Counter;
|
||||
damo_total_final = damo_total_final + (int)finalrecordList2[i].Counter;
|
||||
}
|
||||
if (finalrecordList2[i].FkInpectionId == "425")
|
||||
{
|
||||
final2.ProgramOther = finalrecordList2[i].Counter;
|
||||
damo_total_final = damo_total_final + (int)finalrecordList2[i].Counter;
|
||||
}
|
||||
if (finalrecordList2[i].FkInpectionId == "521")
|
||||
{
|
||||
final2.TeamTuoluocanshuang = finalrecordList2[i].Counter;
|
||||
@ -2814,8 +2784,8 @@ namespace ZR.Service.mes.qc
|
||||
{
|
||||
final3.FinishedPartNumber = workorder_final3.FinishedPartNumber;
|
||||
final3.ProductDescription = workorder_final3.ProductDescription;
|
||||
// XXX:三检(包装-投入数)
|
||||
final3.RequireNumber = workorder_final3.PreviousNumber - (baofei_total + baofei_total_again3);
|
||||
// XXX:三检(包装投入数)生产投入数为(首检合格数 + 抛光合格数)
|
||||
final3.RequireNumber = first.QualifiedNumber + again2.QualifiedNumber;
|
||||
//final3.RequireNumber = workorder_final3.PreviousNumber;
|
||||
if (step != null)
|
||||
{
|
||||
@ -2975,11 +2945,6 @@ namespace ZR.Service.mes.qc
|
||||
final3.ProgramOther = finalrecordList3[i].Counter;
|
||||
baofei_total_final = baofei_total_final + (int)finalrecordList3[i].Counter;
|
||||
}
|
||||
if (finalrecordList3[i].FkInpectionId == "435")
|
||||
{
|
||||
final3.ProgramOther = finalrecordList3[i].Counter;
|
||||
baofei_total_final = baofei_total_final + (int)finalrecordList3[i].Counter;
|
||||
}
|
||||
if (finalrecordList3[i].FkInpectionId == "531")
|
||||
{
|
||||
final3.TeamTuoluocanshuang = finalrecordList3[i].Counter;
|
||||
@ -3067,7 +3032,9 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
total2.FinishedPartNumber = again2.FinishedPartNumber;
|
||||
total2.ProductDescription = again2.ProductDescription;
|
||||
total2.RequireNumber = again2.RequireNumber;
|
||||
//XXX:修改生产投入数为首检生产投入数 workorder_item
|
||||
// total2.RequireNumber = again2.RequireNumber;
|
||||
total2.RequireNumber = workorder_item.PreviousNumber;
|
||||
if (step != null)
|
||||
{
|
||||
total2.StartTime = step.FirstInspectTime;//这地方是不妥的
|
||||
@ -3130,7 +3097,9 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
total3.FinishedPartNumber = again3.FinishedPartNumber;
|
||||
total3.ProductDescription = again3.ProductDescription;
|
||||
total3.RequireNumber = again3.RequireNumber;
|
||||
// XXX:修改生产投入数
|
||||
// total3.RequireNumber = again3.RequireNumber;
|
||||
total3.RequireNumber = workorder_item.PreviousNumber;
|
||||
if (step != null)
|
||||
{
|
||||
total3.StartTime = step.FirstInspectTime;//这地方是不妥的
|
||||
@ -3156,7 +3125,7 @@ namespace ZR.Service.mes.qc
|
||||
total3.PaintDianzi = (again3.PaintDianzi ?? 0) + (final3.PaintDianzi ?? 0) + (first3.PaintDianzi ?? 0);
|
||||
total3.DeviceShuiban = (again3.DeviceShuiban ?? 0) + (final3.DeviceShuiban ?? 0) + (first3.DeviceShuiban ?? 0);
|
||||
total3.PaintOther = (again3.PaintOther ?? 0) + (final3.PaintOther ?? 0) + (first3.PaintOther ?? 0);
|
||||
total3.DeviceZandian = again3.DeviceZandian ?? 0 + final3.PaintOther ?? 0 + first3.PaintOther ?? 0;
|
||||
total3.DeviceZandian = again3.DeviceZandian ?? 0 + final3.DeviceZandian ?? 0 + first3.DeviceZandian ?? 0;
|
||||
total3.DeviceBianxing = (again3.DeviceBianxing ?? 0) + (final3.DeviceBianxing ?? 0) + (first3.DeviceBianxing ?? 0);
|
||||
total3.DeviceYouzhu = (again3.DeviceYouzhu ?? 0) + (final3.DeviceYouzhu ?? 0) + (first3.DeviceYouzhu ?? 0);
|
||||
total3.DeviceTuoluo = (again3.DeviceTuoluo ?? 0) + (final3.DeviceTuoluo ?? 0) + (first3.DeviceTuoluo ?? 0);
|
||||
@ -3189,33 +3158,39 @@ namespace ZR.Service.mes.qc
|
||||
#endregion
|
||||
#region 计算汇总
|
||||
int qualifiedNumber_No_all_total = qualifiedNumber_No_all + qualifiedNumber_No_all_again + qualifiedNumber_No_all_final;
|
||||
|
||||
total2.QualifiedNumber = (again2.RequireNumber ?? 0) - qualifiedNumber_No_all_total;
|
||||
//XXX:修改合格数公式:包装数
|
||||
// total2.QualifiedNumber = (again2.RequireNumber ?? 0) - qualifiedNumber_No_all_total;
|
||||
total2.QualifiedNumber = final2.QualifiedNumber;
|
||||
if (total2.RequireNumber == 0)
|
||||
{
|
||||
total2.QualifiedRate = 0;
|
||||
}
|
||||
else
|
||||
total2.QualifiedRate = Math.Round(((decimal)total2.QualifiedNumber / (decimal)total2.RequireNumber) * 100, 3);
|
||||
|
||||
total2.DamoTotal = damo_total_again + damo_total_final;
|
||||
total2.BaofeiTotal = baofei_total_again3 + baofei_total_final;
|
||||
// XXX:修改总报表打磨,报废数计算公式
|
||||
total2.DamoTotal = damo_total + damo_total_again + damo_total_final;
|
||||
total2.BaofeiTotal = baofei_total + baofei_total_again3 + baofei_total_final;
|
||||
// total2.DamoTotal = damo_total_again + damo_total_final;
|
||||
// total2.BaofeiTotal = baofei_total_again3 + baofei_total_final;
|
||||
|
||||
|
||||
var x_total_2 = Context.Storageable(total2).WhereColumns(it => new { it.WorkorderId, it.Remark2 }).ToStorage();
|
||||
x_total_2.AsInsertable.ExecuteCommand();//不存在插入
|
||||
x_total_2.AsUpdateable.IgnoreColumns(z => z.CreatedTime).ExecuteCommand();//存在更新
|
||||
|
||||
total3.QualifiedNumber = again3.RequireNumber ?? 0 - qualifiedNumber_No_all_total;
|
||||
//XXX:修改合格数公式
|
||||
// total3.QualifiedNumber = again3.RequireNumber ?? 0 - qualifiedNumber_No_all_total;
|
||||
total3.QualifiedNumber = final2.QualifiedNumber;
|
||||
if (total3.RequireNumber == 0)
|
||||
{
|
||||
total3.QualifiedRate = 0;
|
||||
}
|
||||
else
|
||||
total3.QualifiedRate = Math.Round(((decimal)total3.QualifiedNumber / (decimal)total3.RequireNumber) * 100, 3);
|
||||
|
||||
total3.DamoTotal = damo_total_again + damo_total_final;
|
||||
total3.BaofeiTotal = baofei_total_again3 + baofei_total_final;
|
||||
// XXX:修改总报表打磨,报废数计算公式
|
||||
total3.DamoTotal = damo_total + damo_total_again + damo_total_final;
|
||||
total3.BaofeiTotal = baofei_total + baofei_total_again3 + baofei_total_final;
|
||||
// total3.DamoTotal = damo_total_again + damo_total_final;
|
||||
// total3.BaofeiTotal = baofei_total_again3 + baofei_total_final;
|
||||
|
||||
|
||||
var x_total_3 = Context.Storageable(total3).WhereColumns(it => new { it.WorkorderId, it.Remark2 }).ToStorage();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user