杨张扬
13 小时以前 f9d7694d27475954449ce3073938af98a4798b07
wms/SpecHelper.cs
@@ -315,12 +315,11 @@
                                return;
                            }
                            var locCnt = db.Queryable<TN_Loc_Container>().First(a => a.S_LOC_CODE == endLoc.S_CODE);
                            var locCnt = db.Queryable<TN_Loc_Container>().First(a => a.S_CNTR_CODE == tN_Task.S_CNTR_CODE);
                            if (locCnt != null)
                            {
                                var cgInfo = db.Queryable<TN_CG_Detail>().First(a => a.S_CNTR_CODE == locCnt.S_CNTR_CODE);
                                if (db.Deleteable<TN_Loc_Container>(locCnt).ExecuteCommand() > 0)
                                {
                                    LogHelper.Info($"删除货位容器绑定关系成功,{JsonConvert.SerializeObject(locCnt)}");
@@ -332,6 +331,8 @@
                                    return;
                                }
                                var cgInfo = db.Queryable<TN_CG_Detail>().First(a => a.S_CNTR_CODE == tN_Task.S_CNTR_CODE);
                                if (cgInfo != null)
                                {
                                    if (db.Deleteable<TN_CG_Detail>(cgInfo).ExecuteCommand() > 0)
@@ -341,6 +342,21 @@
                                    else
                                    {
                                        LogHelper.Info($"删除容器货品明细失败,{JsonConvert.SerializeObject(cgInfo)}");
                                        tran.RollbackTran();
                                        return;
                                    }
                                }
                                var cnt = db.Queryable<TN_Container>().First(it => it.S_CODE == cgInfo.S_CNTR_CODE);
                                if (cnt != null)
                                {
                                    if (db.Deleteable<TN_Container>(cnt).ExecuteCommand() > 0)
                                    {
                                        LogHelper.Info($"删除容器成功,{JsonConvert.SerializeObject(cnt)}");
                                    }
                                    else
                                    {
                                        LogHelper.Info($"删除容器失败,{JsonConvert.SerializeObject(cnt)}");
                                        tran.RollbackTran();
                                        return;
                                    }
@@ -409,13 +425,8 @@
                if (model != null)
                {
                    var target = db.Queryable<TN_InventoryM>().First(o => o.RFID == model.RFID);
                    if (target != null)
                    {
                        db.Deleteable<TN_InventoryM>(target).ExecuteCommand();
                    }
                    model.EXPIRATION = System.DateTime.Now.AddHours(GetExportTime(model.SPEC));
                    if (db.Insertable<TN_InventoryM>(model).ExecuteCommand() > 0)
                    if (db.Storageable<TN_InventoryM>(model).ExecuteCommand() > 0)
                    {
                        LogHelper.Info($"插入WMS库存明细成功,{log}");
                    }