| | |
| | | |
| | | 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(); |
| | | return NewSimpleResult(500, preLog + $"删除旧货位容器关系表失败!货位编码={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(); |
| | | return NewSimpleResult(500, preLog + $"插入[容器货位绑定表]失败!数据:{LogObject(locCntrRel)}"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, locCntrRel.S_CNTR_CODE, taskInfo.TaskName); |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (cgDetailOld != null && db.Deleteable<TN_CG_Detail>(cgDetailOld).ExecuteCommand() <= 0) { |
| | | if (cgDetailOld != null && db.Deleteable(cgDetailOld).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"删除[旧物料信息]失败!数据:{LogObject(cgDetailOld)}"); |
| | | } |
| | | |
| | | if (locCntrRelOld != null && db.Deleteable<TN_Loc_Container>(locCntrRelOld).ExecuteCommand() <= 0) { |
| | | if (locCntrRelOld != null && db.Deleteable(locCntrRelOld).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"删除[旧货位容器关系]失败!数据:{LogObject(locCntrRelOld)}"); |
| | | } |
| | | |
| | | if (locOld != null && db.Updateable<TN_Location>(locOld).UpdateColumns(l => new { l.N_CURRENT_NUM, l.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | if (locOld != null && db.Updateable(locOld).UpdateColumns(l => new { l.N_CURRENT_NUM, l.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[旧货位|当前容器数量]失败!货位='{locOld.S_CODE}',数量=>{locOld.N_CURRENT_NUM}"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Loc_Container>(locCntrRel).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(locCntrRel).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"插入[货位容器绑定表]失败!数据:{LogObject(locCntrRel)}"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, locCntrRel.S_CNTR_CODE, taskInfo.TaskName); |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (cgDetailOld != null && db.Deleteable<TN_CG_Detail>(cgDetailOld).ExecuteCommand() <= 0) { |
| | | if (cgDetailOld != null && db.Deleteable(cgDetailOld).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"删除[旧物料信息]失败!数据:{LogObject(cgDetailOld)}"); |
| | | } |
| | | |
| | | if (locCntrRelOld != null && db.Deleteable<TN_Loc_Container>(locCntrRelOld).ExecuteCommand() <= 0) { |
| | | if (locCntrRelOld != null && db.Deleteable(locCntrRelOld).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"删除[旧货位容器关系]失败!" + LogObject(locCntrRelOld)); |
| | | } |
| | | |
| | | if (locOld != null && db.Updateable<TN_Location>(locOld).UpdateColumns(l => new { l.N_CURRENT_NUM, l.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | if (locOld != null && db.Updateable(locOld).UpdateColumns(l => new { l.N_CURRENT_NUM, l.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[旧货位|容器数量]失败!" + LogObject(locOld)); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Loc_Container>(locCntrRel).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(locCntrRel).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"插入[货位容器关系]失败:" + LogObject(locCntrRel)); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | cntr.T_MODIFY = DateTime.Now; |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (needUpdateContainer && db.Updateable<TN_Container>(cntr).UpdateColumns(c => new { c.S_SPEC, c.S_SOURCE, c.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | if (needUpdateContainer && db.Updateable(cntr).UpdateColumns(c => new { c.S_SPEC, c.S_SOURCE, c.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | return NewSimpleResult(500, preLog + $"更新[容器表]失败!数据:{LogObject(cntr)}"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, model.CntId, taskInfo.TaskName); |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | WCSHelper.LockEndLoc(ref endLoc); |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Updateable<TN_CG_Detail>(cgDetail).UpdateColumns(it => new { it.N_ITEM_STATE, it.S_ITEM_STATE, it.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(cgDetail).UpdateColumns(it => new { it.N_ITEM_STATE, it.S_ITEM_STATE, it.T_MODIFY }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[物料明细表]失败!物料号='{cgDetail.S_ITEM_CODE}',物料状态=>'合格'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, locCntrRel.S_CNTR_CODE, taskInfo.TaskName); |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Updateable<TN_CG_Detail>(cgDetail).UpdateColumns(it => new { it.N_ITEM_STATE, it.S_ITEM_STATE }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(cgDetail).UpdateColumns(it => new { it.N_ITEM_STATE, it.S_ITEM_STATE }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[货品明细表]失败!物料号='{cgDetail}',物料状态=>'{cgDetail.S_ITEM_STATE}'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | var task = WCSHelper.BuildTask(startLoc, endLoc, cntId, taskInfo.TaskName); |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | //if (db.Insertable<TN_Loc_Container>(locCntrRel).ExecuteCommand() <= 0) { |
| | | //if (db.Insertable(locCntrRel).ExecuteCommand() <= 0) { |
| | | // tran.RollbackTran(); |
| | | // return NewSimpleResult(500, preLog + $"插入[容器货位绑定表]失败!数据:{LogObject(locCntrRel)}"); |
| | | //} |
| | | |
| | | if (db.Updateable<TN_Location>(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(startLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, it.N_CURRENT_NUM, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[起点货位锁状态]失败!起点='{startLoc.S_CODE}',锁状态=>'出库锁'"); |
| | | } |
| | | |
| | | if (db.Updateable<TN_Location>(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | if (db.Updateable(endLoc).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE, it.S_LOCK_OP, it.T_MODIFY, }).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"更新[终点货位锁状态]失败!终点='{endLoc.S_CODE}',锁状态=>'入库锁'"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Task>(task).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(task).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(500, preLog + $"生成任务'{task.S_TYPE}'失败!任务号={task.S_CODE},容器号={task.S_CNTR_CODE},起点={task.S_START_LOC},终点={task.S_END_LOC}"); |
| | | } |
| | |
| | | } |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Insertable<TN_Outbound_Order>(order).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(order).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(2, preLog + "生成出库单失败:" + LogObject(order)); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Outbound_Detail>(detailList).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(detailList).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(4, preLog + "生成出库单明细失败:" + LogObject(detailList)); |
| | | } |
| | |
| | | } |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Insertable<TN_Outbound_Order>(order).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(order).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(2, preLog + "生成出库单失败:" + LogObject(order)); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Outbound_Detail>(detailList).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(detailList).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewSimpleResult(4, preLog + "生成出库单明细失败:" + LogObject(detailList)); |
| | | } |
| | |
| | | // return NewMesResult(2, info); |
| | | //} |
| | | |
| | | if (db.Insertable<TN_CG_Detail>(detail).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(detail).ExecuteCommand() <= 0) { |
| | | return NewMesResult(500, preLog + $"插入[物料明细表]失败!数据:{LogObject(detail)}"); |
| | | } |
| | | |
| | |
| | | detailList.Add(detail); |
| | | |
| | | using (var tran = db.Ado.UseTran()) { |
| | | if (db.Insertable<TN_Outbound_Order>(order).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(order).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewErpResult(500, preLog + $"生成[出库单]失败!数据:{LogObject(order)}"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Outbound_Detail>(detailList).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(detailList).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewErpResult(500, preLog + $"生成[出库单明细]失败!数据:{LogObject(detailList)}"); |
| | | } |
| | | |
| | | if (db.Insertable<TN_Outbound_Plan>(outboundPlan).ExecuteCommand() <= 0) { |
| | | if (db.Insertable(outboundPlan).ExecuteCommand() <= 0) { |
| | | tran.RollbackTran(); |
| | | return NewErpResult(500, preLog + $"生成[出库单计划记录表]失败!数据:{LogObject(outboundPlan)}"); |
| | | } |