From cfcc23abae7aeb0ae2674d5035cb163815dd6398 Mon Sep 17 00:00:00 2001 From: "DESKTOP-QD1SU79\\Xfu" Date: Tue, 22 Oct 2024 14:08:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E8=B7=AF=E7=BA=BF=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=96=B0=E5=A2=9E=E4=B8=A4=E4=B8=AA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ICSSoft.FromERP/IcsOp.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ICSSoft.FromERP/IcsOp.cs b/ICSSoft.FromERP/IcsOp.cs index 934acce..b0599f1 100644 --- a/ICSSoft.FromERP/IcsOp.cs +++ b/ICSSoft.FromERP/IcsOp.cs @@ -52,7 +52,7 @@ namespace ICSSoft.FromERP case AlternateType when '0' then '主制造' when '1' then '委外' when '2001' then '试制' end as AlternateType, ITEM.Code+'_'+RoutingVersionCode+'_'+(case AlternateType when '0' then '主制造' when '1' then '委外' when '2001' then '试制' end ) AS RouteDesc,RoutingVersionCode,RoutingVersion, u9route.CreatedOn as RouteCreateTime,u9route.ModifiedOn as RouteModifiedTime,opu9.Sequence as opseq, -opu9trl.Description+'_'+OPU9.Sequence as U9Opcode,opu9.CreatedOn as opCreateTime,opu9.ModifiedOn as OpModifiedTime,opu9trl.Description as OpDesc, +opu9trl.Description+'_'+OPU9.Sequence as U9Opcode,opu9.CreatedOn as opCreateTime,opu9.ModifiedOn as OpModifiedTime,opu9trl.Description as OpDesc,opu9.DescFlexField_PrivateDescSeg1 AS HourRate,opu9.DescFlexField_PrivateDescSeg2 as EqpCalcType, u9route.ID as routeID,opu9.ID as OPID,work.Code AS SegCode,u9Group.Code as CrewCode,u9route.Lot,u9Line.Code as LineCode,'' as MesOpcode, case when timeuom.Name='小时' then cast (opu9.RunTime as decimal(18,6)) when timeuom.Name='秒' then cast (opu9.RunTime/3600 as decimal(18,6)) @@ -206,15 +206,15 @@ WHERE u9route.org='{0}' And u9route.ModifiedOn>='{1}' and u9route.ApproveDate i #region 途程关联工序 string routeOpSql = ""; count = 0; - var RouteOpObj = table.AsEnumerable().Select(a => new { RouteCode = a["ROUTECODE"].ToString(), Opcode = a["MesOpcode"].ToString(), Opseq = a["opseq"].ToString(), ParallelOp = a["IsSubcOperation"].ToString(), ItemCode = a["ItemCode"].ToString(), RouteVersion = a["RoutingVersion"].ToString(), Stime = a["Stime"].ToString(), Rtime = a["Rtime"].ToString(), SEGCODE = a["SegCode"].ToString(), SegName = a["SegNAME"].ToString(), CrewCode = a["CrewCode"].ToString(), CREWName = a["CREWName"].ToString() }). + var RouteOpObj = table.AsEnumerable().Select(a => new { RouteCode = a["ROUTECODE"].ToString(), Opcode = a["MesOpcode"].ToString(), Opseq = a["opseq"].ToString(), ParallelOp = a["IsSubcOperation"].ToString(), ItemCode = a["ItemCode"].ToString(), RouteVersion = a["RoutingVersion"].ToString(), Stime = a["Stime"].ToString(), Rtime = a["Rtime"].ToString(), SEGCODE = a["SegCode"].ToString(), SegName = a["SegNAME"].ToString(), CrewCode = a["CrewCode"].ToString(), CREWName = a["CREWName"].ToString(), HourRate = a["HourRate"].ToString(),EqpCalcType=a["EqpCalcType"].ToString() }). Distinct().ToList(); RouteOpObj.ForEach(b => { count++; if (count != RouteOpObj.Count) - routeOpSql += $" SELECT '{b.RouteCode}' as RouteCode,'{b.Opcode}' as Opcode,'{b.Opseq}' as Opseq,'{b.ParallelOp}' as ParallelOp,'{b.ItemCode}' as ItemCode,{b.Rtime} as Rtime,{b.Stime} as Stime,'{b.SEGCODE}' as SEGCODE,'{b.SegName}' as SegName,'{b.CrewCode}' as CrewCode,'{b.CREWName}' as CREWName union all"; + routeOpSql += $" SELECT '{b.RouteCode}' as RouteCode,'{b.Opcode}' as Opcode,'{b.Opseq}' as Opseq,'{b.ParallelOp}' as ParallelOp,'{b.ItemCode}' as ItemCode,{b.Rtime} as Rtime,{b.Stime} as Stime,'{b.SEGCODE}' as SEGCODE,'{b.SegName}' as SegName,'{b.CrewCode}' as CrewCode,'{b.CREWName}' as CREWName,'{b.HourRate}' AS HourDate,'{b.EqpCalcType}' as EqpCalcType union all"; else - routeOpSql += $" SELECT '{b.RouteCode}' as RouteCode,'{b.Opcode}' as Opcode,'{b.Opseq}' as Opseq,'{b.ParallelOp}' as ParallelOp,'{b.ItemCode}' as ItemCode,{b.Rtime} as Rtime,{b.Stime} as Stime,'{b.SEGCODE}' as SEGCODE,'{b.SegName}' as SegName,'{b.CrewCode}' as CrewCode,'{b.CREWName}' as CREWName "; + routeOpSql += $" SELECT '{b.RouteCode}' as RouteCode,'{b.Opcode}' as Opcode,'{b.Opseq}' as Opseq,'{b.ParallelOp}' as ParallelOp,'{b.ItemCode}' as ItemCode,{b.Rtime} as Rtime,{b.Stime} as Stime,'{b.SEGCODE}' as SEGCODE,'{b.SegName}' as SegName,'{b.CrewCode}' as CrewCode,'{b.CREWName}' as CREWName,'{b.HourRate}' AS HourDate,'{b.EqpCalcType}' as EqpCalcType "; }); var itemOpSql = routeOpSql; @@ -329,6 +329,8 @@ WHERE u9route.org='{0}' And u9route.ModifiedOn>='{1}' and u9route.ApproveDate i ItemOpDic.Add("Default2", "A.SEGNAME"); ItemOpDic.Add("Default3", "A.CREWCODE"); ItemOpDic.Add("Default4", "A.CREWNAME"); + ItemOpDic.Add("HourRate", "A.HourRate"); + ItemOpDic.Add("EqpCalcType", "A.EqpCalcType"); ItemOpDic.Add("LastModificationTime", "GETDATE()");//操作时间 ItemOpDic.Add("LastModifierUserId", "'" + ConstWorkPoint.Muser + "'");//操作人 ItemOpDic.Add("LastModifierUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称