| | |
| | | |
| | | if (doingCount == allCount) { |
| | | order.N_B_STATE = 2; // 所有任务都已执行 |
| | | db.Updateable<TN_Outbound_Order>(order).UpdateColumns(it => new { it.N_B_STATE }).ExecuteCommand(); |
| | | db.Updateable(order).UpdateColumns(it => new { it.N_B_STATE }).ExecuteCommand(); |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | var cntId = detail.S_CNTR_CODE; |
| | | |
| | | var erp_no = string.IsNullOrEmpty(detail.S_BS_NO) ? "" : detail.S_BS_NO; |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, cntId, taskName, detail.S_OO_NO, erp_no); |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, cntId, taskName); |
| | | task.S_OP_CODE = detail.S_OO_NO; |
| | | if (string.IsNullOrEmpty(detail.S_BS_NO)) { |
| | | task.S_BS_NO = detail.S_BS_NO; |
| | | task.S_BS_TYPE = "ERP"; |
| | | } |
| | | |
| | | LocationHelper.LockStartLoc(ref startLoc); // 起点出库锁 |
| | | LocationHelper.LockEndLoc(ref endLoc); // 终点入库锁 |
| | | WCSHelper.LockStartLoc(ref startLoc); // 起点出库锁 |
| | | WCSHelper.LockEndLoc(ref endLoc); // 终点入库锁 |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | 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(); |
| | | info = $"轮询:{taskName}:修改明细表状态为完成--失败!"; |
| | | LogHelper.Info(info); |
| | | continue; |
| | | } |
| | | |
| | | 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, |
| | |
| | | continue; |
| | | } |
| | | |
| | | 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, |
| | |
| | | continue; |
| | | } |
| | | |
| | | 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); |
| | |
| | | |
| | | if (doingCount == allCount) { |
| | | order.N_B_STATE = 2; // 所有任务都已执行 |
| | | db.Updateable<TN_Spot_Check>(order).UpdateColumns(it => new { it.N_B_STATE }).ExecuteCommand(); |
| | | db.Updateable(order).UpdateColumns(it => new { it.N_B_STATE }).ExecuteCommand(); |
| | | continue; |
| | | } |
| | | |
| | |
| | | detail.N_B_STATE = 2; |
| | | |
| | | var cntId = detail.S_CNTR_CODE; |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, cntId, taskName, detail.S_OO_NO); |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, cntId, taskName); |
| | | task.S_OP_CODE = detail.S_OO_NO; |
| | | |
| | | LocationHelper.LockStartLoc(ref startLoc); // 起点出库锁 |
| | | LocationHelper.LockEndLoc(ref endLoc); // 终点入库锁 |
| | | WCSHelper.LockStartLoc(ref startLoc); // 起点出库锁 |
| | | WCSHelper.LockEndLoc(ref endLoc); // 终点入库锁 |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Updateable<TN_SpotCheck_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}:修改{taskName}单明细表状态为完成--失败!"); |
| | | continue; |
| | | } |
| | | |
| | | 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, |
| | |
| | | continue; |
| | | } |
| | | |
| | | 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, |
| | |
| | | continue; |
| | | } |
| | | |
| | | 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); |
| | |
| | | |
| | | if (doingCount == allCount) { |
| | | order.N_B_STATE = 2; // 所有任务都已执行 |
| | | db.Updateable<TN_Relocation_List>(order).UpdateColumns(it => new { it.N_B_STATE }).ExecuteCommand(); |
| | | db.Updateable(order).UpdateColumns(it => new { it.N_B_STATE }).ExecuteCommand(); |
| | | continue; |
| | | } |
| | | |
| | |
| | | detail.N_B_STATE = 2; |
| | | |
| | | var cntId = detail.S_CNTR_CODE; |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, cntId, taskName, detail.S_OO_NO); |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, cntId, taskName); |
| | | task.S_OP_CODE = detail.S_OO_NO; |
| | | |
| | | LocationHelper.LockStartLoc(ref startLoc); // 起点出库锁 |
| | | LocationHelper.LockEndLoc(ref endLoc); // 终点入库锁 |
| | | WCSHelper.LockStartLoc(ref startLoc); // 起点出库锁 |
| | | WCSHelper.LockEndLoc(ref endLoc); // 终点入库锁 |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Updateable<TN_RelocationList_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}:修改{taskName}单明细表状态为完成--失败!"); |
| | | continue; |
| | | } |
| | | |
| | | 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, |
| | |
| | | continue; |
| | | } |
| | | |
| | | 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, |
| | |
| | | continue; |
| | | } |
| | | |
| | | 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); |
| | |
| | | plan.HW = model.hw; |
| | | plan.HWZT = model.hwzt; |
| | | plan.PH = model.ph; |
| | | var success = db.Updateable<TN_Outbound_Plan>(plan).UpdateColumns(p => new { p.HW, p.HWZT, p.PH }).ExecuteCommand() > 0; |
| | | var success = db.Updateable(plan).UpdateColumns(p => new { p.HW, p.HWZT, p.PH }).ExecuteCommand() > 0; |
| | | info = "更新出库计划单记录表" + (success ? "成功" : "失败"); |
| | | LogHelper.Info(info); |
| | | } |