| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 起点出库锁 |
| | | /// 起点出库锁(只能对无锁货位上锁) |
| | | /// </summary> |
| | | /// <param name="loc"></param> |
| | | /// <param name="lockSource"></param> |
| | | /// <returns></returns> |
| | | public static bool LockStartLoc(ref TN_Location loc, string lockSource = "") { |
| | | if (loc == null || loc.N_LOCK_STATE != 0) { |
| | | if (loc == null) { |
| | | LogHelper.Info($"起点出库锁:传入的货位参数为null"); |
| | | return false; |
| | | } |
| | | |
| | | if (loc.N_LOCK_STATE != 0 || loc.S_LOCK_STATE != "无") { |
| | | LogHelper.Info($"起点出库锁:货位当前已有锁({loc.N_LOCK_STATE},{loc.S_LOCK_STATE})"); |
| | | return false; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | public static bool LockEndLoc(ref TN_Location loc, string lockSource = "") { |
| | | if (loc == null || loc.N_LOCK_STATE != 0) { |
| | | if (loc == null) { |
| | | LogHelper.Info($"终点入库锁:传入的货位参数为null"); |
| | | return false; |
| | | } |
| | | |
| | | if (loc.N_LOCK_STATE != 0 || loc.S_LOCK_STATE != "无") { |
| | | LogHelper.Info($"终点入库锁:货位当前已有锁({loc.N_LOCK_STATE},{loc.S_LOCK_STATE})"); |
| | | return false; |
| | | } |
| | | |
| | |
| | | var bindLocCntList = new List<TN_Loc_Container>(); |
| | | foreach (var item in cntrs) |
| | | { |
| | | bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item }); |
| | | // 针对容器类型添加的新逻辑 |
| | | var cntrItemRel = db.Queryable<TN_Container_ItemType>() |
| | | .Where(c => c.S_CNTR_CODE == item).First(); |
| | | if (cntrItemRel == null) { |
| | | LogHelper.Info($"货位解绑时,容器{item}没有在容器物料信息关系表中查到"); |
| | | bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item }); |
| | | } |
| | | else { |
| | | bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item, S_CNTR_TYPE = cntrItemRel.S_CNTR_TYPE }); |
| | | } |
| | | } |
| | | |
| | | |
| | | var log = JsonConvert.SerializeObject(bindLocCntList); |
| | | |