Browse Source

派纳物料同步修改

Branch_PaiNaWeiSJob
DESKTOP-QD1SU79\Xfu 4 days ago
parent
commit
2a7398ac1f
  1. 14
      ICSSoft.FromERP/ICSInventory_PaiNaWeiS.cs
  2. 6
      ICSSoft.FromERP/ICSMo.cs

14
ICSSoft.FromERP/ICSInventory_PaiNaWeiS.cs

@ -267,12 +267,14 @@ a.DescFlexField_PrivateDescSeg2 ItemDrawingNo
ItemOpDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
bindSql += ICSHelper.InsertSQL("ICSITEMROUTE2OP", ItemOpDic)
+ $@"(select a.ItemCode,a.Id as ItemId,c.id as RouteId,c.RouteCode,d.OpCode,d.OpId,d.OpSeq from IcsInventory a
left join IcsRoute c on c.routeCode='{route}' and c.TenantId=a.TenantId
left join IcsRoute2Op d on d.RouteCode=c.RouteCode and d.TenantId=a.TenantId
where a.TenantId='{TenantId}') a
LEFT JOIN ICSITEMROUTE2OP b on a.ROUTECODE=b.ROUTECODE and A.ITEMCODE=B.ITEMCODE AND A.OPCODE=B.OPCODE AND b.TenantId='{0}'
WHERE 1=1 and b.ID is null";
+ $@"(select a.ItemCode,a.Id as ItemId,c.id as RouteId,c.RouteCode,d.OpCode,d.OpId,d.OpSeq
from IcsInventory a
inner join IcsRoute c on c.routeCode='{route}' and c.TenantId=a.TenantId
inner join IcsRoute2Op d on d.RouteCode=c.RouteCode and d.TenantId=a.TenantId
where a.TenantId='{TenantId}'
and not exists (select 1 from ICSITEMROUTE2OP b where c.ROUTECODE=b.ROUTECODE and A.ITEMCODE=B.ITEMCODE
AND d.OPCODE=B.OPCODE AND b.TenantId='{TenantId}')) a
";
log.Info(bindSql);
ICSHelper.ExecuteDate(conStr, bindSql);
#endregion

6
ICSSoft.FromERP/ICSMo.cs

@ -116,7 +116,7 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate
left join {1}.dbo.[CBO_Department_Trl] as A14 With(NoLock) on (A14.SysMlFlag = 'zh-CN') and (A13.[ID] = A14.[ID])
LEFT JOIN {1}.dbo.[CBO_Wh] AS A22 With(NoLock) ON A22.ID=A.CompleteWh
where (A.DocState=2 OR A.DocState=3) and A.[BusinessType] != 50 and (A.[BusinessType] != 52)
where (A.DocState=2) and A.[BusinessType] != 50 and (A.[BusinessType] != 52)
and (A.[BusinessType] != 2417) and (A.[IsMultiRouting] != 1) and A.[ItemMaster] is not null --and (A.[IsStartMO] != 1)
and ISNULL(A.ModifiedOn,A.BusinessCreatedOn)>=@LastTime AND A12.id='{0}'
@ -184,10 +184,10 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate
INNER JOIN ICSMO b ON a.Mocode=b.Mocode
WHERE b.TenantId='{0}' and a.Org={2} ";
// values.Add("ID", "NEWID()");
// values.Add("ID", "NEWID()");.
values.Add("MoType", "'normal'");//辅机数量
values.Add("MOVER", "'1'");//辅机数量
values.Add("ProjectCode", "a.ProjectCode");//辅机数量
values.Add("ProjectCode", "a.NeedType");//需求分类
values.Add("MOINPUTQTY", "0");//辅机数量
values.Add("MOSCRAPQTY", "0");//辅机数量

Loading…
Cancel
Save