| | |
| | | }; |
| | | |
| | | // 数据库操作 |
| | | if (db.Insertable<TN_Record_Table>(record).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(record).ExecuteCommand() <= 0) { |
| | | info = "插入出入库记录表失败:" + JsonConvert.SerializeObject(record); |
| | | LogHelper.Info(info); |
| | | return; |
| | |
| | | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | |
| | | 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}"; |
| | |
| | | } |
| | | } |
| | | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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); |