kazelee
2 天以前 e79700d34620c495667b7b8e7b852f23ed7d7e4e
core/WCSCore.cs
@@ -174,7 +174,7 @@
                };
                // 数据库操作
                if (db.Insertable<TN_Record_Table>(record).ExecuteCommand() <= 0) {
                if (db.Insertable(record).ExecuteCommand() <= 0) {
                    info = "插入出入库记录表失败:" + JsonConvert.SerializeObject(record);
                    LogHelper.Info(info);
                    return;
@@ -284,7 +284,7 @@
            using (var tran = db.Ado.UseTran()) {
                detail.N_B_STATE = spotStateCode;
                if (db.Updateable<TN_Outbound_Detail>(detail).UpdateColumns(it => it.N_B_STATE).ExecuteCommand() <= 0) {
                if (db.Updateable(detail).UpdateColumns(it => it.N_B_STATE).ExecuteCommand() <= 0) {
                    tran.RollbackTran();
                    LogHelper.Info($"{taskName}:AGV取货:修改明细单状态为【3任务执行完成】失败!");
                    return;
@@ -401,7 +401,7 @@
                plan.SFJS = model.sfjs;
                plan.SFSL = model.sfsl;
                plan.HWZT = model.hwzt;
                var success = db.Updateable<TN_Outbound_Plan>(plan).UpdateColumns(p => new { p.SFJS, p.SFSL, p.HWZT }).ExecuteCommand() > 0;
                var success = db.Updateable(plan).UpdateColumns(p => new { p.SFJS, p.SFSL, p.HWZT }).ExecuteCommand() > 0;
                info = "更新出库计划单记录表" + (success ? "成功" : "失败");
                LogHelper.Info(info);
            }
@@ -552,7 +552,7 @@
                using (var tran = db.Ado.UseTran()) {
                    if (locCntrRelOld != null) {
                        if (db.Deleteable<TN_Loc_Container>(locCntrRelOld).ExecuteCommand() <= 0 &&
                        if (db.Deleteable(locCntrRelOld).ExecuteCommand() <= 0 &&
                            db.Updateable<TN_Location>().SetColumns(l => l.N_CURRENT_NUM == 0).Where(l => l.S_CODE == locCntrRelOld.S_LOC_CODE).ExecuteCommand() <= 0) {
                            tran.RollbackTran();
                            info = $"删除旧货位容器关系表失败:货位编码{locCntrRelOld.S_LOC_CODE},容器编码{locCntrRelOld.S_CNTR_CODE}";
@@ -561,14 +561,14 @@
                        }
                    }
                    if (db.Insertable<TN_Loc_Container>(locCntrRel).ExecuteCommand() <= 0) {
                    if (db.Insertable(locCntrRel).ExecuteCommand() <= 0) {
                        tran.RollbackTran();
                        info = $"插入货位容器关系表失败:货位编码{locCntrRel.S_LOC_CODE},容器编码{locCntrRel.S_CNTR_CODE}";
                        LogHelper.Info(info);
                        return new Result<bool>(false, info);
                    }
                    if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new {
                    if (db.Updateable(startLoc).UpdateColumns(it => new {
                        it.N_LOCK_STATE,
                        it.S_LOCK_STATE,
                        it.S_LOCK_OP,
@@ -581,7 +581,7 @@
                        return new Result<bool>(false, info);
                    }
                    if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new {
                    if (db.Updateable(endLoc).UpdateColumns(it => new {
                        it.N_LOCK_STATE,
                        it.S_LOCK_STATE,
                        it.S_LOCK_OP,
@@ -593,7 +593,7 @@
                        return new Result<bool>(false, info);
                    }
                    if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) {
                    if (db.Insertable(task).ExecuteCommand() <= 0) {
                        tran.RollbackTran();
                        info = $"生成任务'{taskName}'失败,任务号={task.S_CODE},容器号={cntId},起点={startLoc.S_CODE},终点={endLoc.S_CODE}";
                        LogHelper.Info(info);