|
@ -182,11 +182,11 @@ a.DescFlexField_PrivateDescSeg2 ItemDrawingNo |
|
|
opDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
opDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
opDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
|
|
|
opDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
|
|
|
bindSql += ICSHelper.InsertSQL("ICSOP", opDic) |
|
|
bindSql += ICSHelper.InsertSQL("ICSOP", opDic) |
|
|
+$@" #TempOp a
|
|
|
|
|
|
|
|
|
+ $@" #TempOp a
|
|
|
LEFT JOIN ICSOP b on a.OPCODE=b.OPCODE and b.TenantId='{TenantId}' |
|
|
LEFT JOIN ICSOP b on a.OPCODE=b.OPCODE and b.TenantId='{TenantId}' |
|
|
WHERE 1=1 and b.OPCODE is null";
|
|
|
WHERE 1=1 and b.OPCODE is null";
|
|
|
|
|
|
|
|
|
bindSql+=$"\r\n select '{route}' as RouteCode,'{routeDesc}' as RouteName Into #TempRoute "; |
|
|
|
|
|
|
|
|
bindSql += $"\r\n select '{route}' as RouteCode,'{routeDesc}' as RouteName Into #TempRoute "; |
|
|
Dictionary<string, string> routeDic = new Dictionary<string, string>(); |
|
|
Dictionary<string, string> routeDic = new Dictionary<string, string>(); |
|
|
routeDic.Add("RouteCode", "A.RouteCode"); |
|
|
routeDic.Add("RouteCode", "A.RouteCode"); |
|
|
routeDic.Add("RouteName", "A.RouteName"); |
|
|
routeDic.Add("RouteName", "A.RouteName"); |
|
@ -199,7 +199,7 @@ a.DescFlexField_PrivateDescSeg2 ItemDrawingNo |
|
|
routeDic.Add("CreationTime", "GETDATE()");//操作时间
|
|
|
routeDic.Add("CreationTime", "GETDATE()");//操作时间
|
|
|
routeDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
routeDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
routeDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
|
|
|
routeDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
|
|
|
bindSql+=ICSHelper.InsertSQL("ICSROUTE", routeDic) |
|
|
|
|
|
|
|
|
bindSql += ICSHelper.InsertSQL("ICSROUTE", routeDic) |
|
|
+ $@"#TempRoute a
|
|
|
+ $@"#TempRoute a
|
|
|
LEFT JOIN ICSROUTE b on a.ROUTECODE=b.ROUTECODE and b.TenantId='{TenantId}' |
|
|
LEFT JOIN ICSROUTE b on a.ROUTECODE=b.ROUTECODE and b.TenantId='{TenantId}' |
|
|
WHERE 1=1 and b.ID is null ";
|
|
|
WHERE 1=1 and b.ID is null ";
|
|
@ -237,7 +237,7 @@ a.DescFlexField_PrivateDescSeg2 ItemDrawingNo |
|
|
ItemRouteDic.Add("CreationTime", "GETDATE()");//操作时间
|
|
|
ItemRouteDic.Add("CreationTime", "GETDATE()");//操作时间
|
|
|
ItemRouteDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
ItemRouteDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
ItemRouteDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
|
|
|
ItemRouteDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
|
|
|
bindSql += ICSHelper.InsertSQL("ICSITEM2ROUTE",ItemRouteDic) |
|
|
|
|
|
|
|
|
bindSql += ICSHelper.InsertSQL("ICSITEM2ROUTE", ItemRouteDic) |
|
|
+ $@"(select a.ItemCode,a.Id as ItemId,c.id as ROUTEID,c.routeCode from IcsInventory a
|
|
|
+ $@"(select a.ItemCode,a.Id as ItemId,c.id as ROUTEID,c.routeCode from IcsInventory a
|
|
|
--left join IcsItem2Route b on a.ItemCode=b.ItemCode and a.TenantId=b.TenantId |
|
|
--left join IcsItem2Route b on a.ItemCode=b.ItemCode and a.TenantId=b.TenantId |
|
|
left join IcsRoute c on c.routeCode='{route}' and c.TenantId=a.TenantId |
|
|
left join IcsRoute c on c.routeCode='{route}' and c.TenantId=a.TenantId |
|
@ -266,13 +266,15 @@ a.DescFlexField_PrivateDescSeg2 ItemDrawingNo |
|
|
ItemOpDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
ItemOpDic.Add("CreatorUserId", "'" + ConstWorkPoint.Muser + "'");//操作人
|
|
|
ItemOpDic.Add("CreatorUserName", "'" + ConstWorkPoint.Musername + "'");//操作人名称
|
|
|
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";
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
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); |
|
|
log.Info(bindSql); |
|
|
ICSHelper.ExecuteDate(conStr, bindSql); |
|
|
ICSHelper.ExecuteDate(conStr, bindSql); |
|
|
#endregion
|
|
|
#endregion
|
|
|