diff --git a/SlnMesnac.Business/ProdCompletionBusiness.cs b/SlnMesnac.Business/ProdCompletionBusiness.cs index c6b50b5..719a3cd 100644 --- a/SlnMesnac.Business/ProdCompletionBusiness.cs +++ b/SlnMesnac.Business/ProdCompletionBusiness.cs @@ -80,12 +80,29 @@ namespace SlnMesnac.Business _mesProductOrderService = serviceProvider.GetRequiredService(); _baseMaterialInfoService = serviceProvider.GetRequiredService(); Init(); - + } private void test() { - + try + { + sqlSugarClient.AsTenant().BeginTran(); + string palletCode1 = ""; + + WmsBaseLocation source = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().Where(x => x.LocationCode == "3114").First(); + WmsBaseLocation target = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().Where(x => x.LocationCode == "3314").First(); + palletCode1 = source.ContainerCode; + + source.ContainerCode = target.ContainerCode; + target.ContainerCode = palletCode1; + sqlSugarClient.AsTenant().GetConnection("mes").Updateable(source).ExecuteCommand(); + sqlSugarClient.AsTenant().GetConnection("mes").Updateable(target).ExecuteCommand(); + sqlSugarClient.AsTenant().CommitTran(); + }catch(Exception ex) + { + sqlSugarClient.AsTenant().RollbackTran(); + } // MesProductPlanDetail? mesProductPlanDetail = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().First(x => x.PlanCode == "20240724144533JL001"); //sqlSugarClient.AsTenant().BeginTran(); //string epc = "JYHB01010102"; @@ -94,7 +111,7 @@ namespace SlnMesnac.Business //BindingBarCode(bigCode, epc, productPlanDto); //sqlSugarClient.AsTenant().BeginTran(); } - + // 3114 private static bool isEmptyPalletHandleRunning = false; public void Init()