| | |
| | | /// <param name="loc"></param> |
| | | /// <param name="cntrs"></param> |
| | | /// <returns></returns> |
| | | public static string UnBindingLoc(string loc, List<string> cntrs) |
| | | public static string UnbindLocCntr(string loc, List<string> cntrs) |
| | | { |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | | var logs = $"货位:{loc},容器:{JsonConvert.SerializeObject(cntrs)}"; |
| | | try |
| | | { |
| | | var lcrList = db.Queryable<TN_Loc_Container>().Where(a => cntrs.Contains(a.S_CNTR_CODE) && a.S_LOC_CODE == loc).ToList(); |
| | | if (lcrList.Count == 0) |
| | | { |
| | | if (lcrList.Count == 0) { |
| | | LogHelper.Info($"货位无需解绑容器,在数据库中未找到{JsonConvert.SerializeObject(cntrs)}相关的货位容器关系表信息"); |
| | | } |
| | | cntrs = lcrList.Select(a => a.S_CNTR_CODE).ToList(); |
| | |
| | | } |
| | | |
| | | log = JsonConvert.SerializeObject(location); |
| | | if (db.Updateable(location).UpdateColumns(it => new { it.N_CURRENT_NUM, it.S_LOCK_STATE, it.N_LOCK_STATE }).ExecuteCommand() > 0) |
| | | { |
| | | if (db.Updateable(location).UpdateColumns(it => new { it.N_CURRENT_NUM, it.S_LOCK_STATE, it.N_LOCK_STATE }).ExecuteCommand() > 0) { |
| | | tran.CommitTran(); |
| | | |
| | | LogHelper.Info($"更新货位表成功,{log}"); |
| | | } |
| | | else |
| | | { |
| | | else { |
| | | tran.RollbackTran(); |
| | | |
| | | LogHelper.Info($"更新货位表失败,{log}"); |