服务端的TigerApi 框架,基于.NET6 2024 版本
YangYuGang
2025-03-21 9984bb1eb673f4ea6d952e191040a674583d2f20
Tiger.Business.MES/LabelTemplate/BAS_LABEL_TEMP.cs
@@ -103,11 +103,16 @@
                {
                    //如果客户编码为空
                    prodTemp = input.Label;
                    if (ltemp != null && (ltemp.PROD_CODE.IsNullOrEmpty() || ltemp.PROD_CODE != input.Label.PROD_CODE))
                    if (ltemp != null && ltemp.PROD_CODE.IsNullOrEmpty() && ltemp.PROD_CODE != input.Label.PROD_CODE)
                    {
                        prodTemp.LABEL_CODE = GenerateCodeName(input.Label.LABEL_CODE, "_L");
                    }
                }
                var labelVarIds = input.LabelVars.Select(x => x.VAR_NAME).ToList();
                var labelVars = Biz.Db.Queryable<BAS_LABEL_VAR>()
                    .Where(q=> q.LABEL_ID == ltemp.ID)
                    .WhereIF(labelVarIds.Count>0, q=> !labelVarIds.Contains(q.VAR_NAME))
                    .ToList();
                var db = Biz.Db;
                var dbTran = db.UseTran(() =>
                {
@@ -131,6 +136,11 @@
                    x.LABEL_CODE == input.Label.LABEL_CODE &&
                    x.PROD_CODE == input.Label.PROD_CODE &&
                    x.CUST_CODE == input.Label.CUST_CODE).First();
                    //删除不在传入列表中的
                    if (labelVars.Count>0)
                    {
                        db.Deleteable(labelVars).ExecuteCommand();
                    }
                    if (input.LabelVars != null && input.LabelVars.Count > 0)
                    {
                        if (temp != null && temp.ID != input.LabelVars[0].LABEL_ID)
@@ -146,6 +156,10 @@
                        z.AsInsertable.ExecuteCommand();
                        z.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand();
                    }
                    if (!input.LabelVars.Any())
                    {
                        db.Deleteable(labelVars).ExecuteCommand();
                    }
                    if (input.LabelVarWos != null && input.LabelVarWos.Count > 0)
                    {
                        if (temp != null && temp.ID != input.LabelVarWos[0].LABEL_ID)