| | |
| | | using HH.WCS.Mobox3.AnGang.models; |
| | | using HH.WCS.Mobox3.AnGang.config; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | { |
| | | site = Location.S_AGV_SITE; |
| | | } |
| | | //if (Location.N_CURRENT_NUM == 1) |
| | | //{ |
| | | // site = Location.S_AGV_SITE2; |
| | | //} |
| | | //if (Location.N_CURRENT_NUM == 2) |
| | | //{ |
| | | // site = Location.S_AGV_SITE3; |
| | | //} |
| | | //if (Location.N_CURRENT_NUM == 3) |
| | | //{ |
| | | // site = Location.S_AGV_SITE4; |
| | | //} |
| | | //if (Location.N_CURRENT_NUM == 4) |
| | | //{ |
| | | // site = Location.S_AGV_SITE5; |
| | | //} |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 入库锁定终点,出库锁定起点 |
| | | /// 你创建任务锁定货位的时候,把锁的来源就是任务号也写上去(加锁的方法加个参数,可空的参数),解锁的时候把来源置空。 |
| | | /// 起点出库锁:2 --- 终点入库锁:1 |
| | | /// </summary> |
| | | /// <param name="loc"></param> |
| | | /// <param name="lockState">1:入库锁、2:出库锁、2:其它锁</param> |
| | | /// <param name="lockState">1:入库锁、2:出库锁、3:其它锁</param> |
| | | /// <param name="lockSource">锁的来源=任务号</param> |
| | | /// <returns></returns> |
| | | public static bool LockLoc(ref TN_Location loc, int lockState, string lockSource = "") { |
| | |
| | | /// 你创建任务锁定货位的时候,把锁的来源就是任务号也写上去(加锁的方法加个参数,可空的参数),解锁的时候把来源置空。 |
| | | /// </summary> |
| | | /// <param name="loc"></param> |
| | | /// <param name="lockState">1:入库锁、2:出库锁、2:其它锁</param> |
| | | /// <param name="lockState">1:入库锁、2:出库锁、3:其它锁</param> |
| | | /// <param name="lockSource">锁的来源=任务号</param> |
| | | /// <returns></returns> |
| | | public static bool LockLoc(string loc, int lockState, string lockSource = "") |
| | |
| | | |
| | | using (var tran = db.Ado.UseTran()) |
| | | { |
| | | if (db.Deleteable<TN_Loc_Container>().Where(it => cntrs.Contains(it.S_CNTR_CODE) && it.S_LOC_CODE == loc).ExecuteCommand() > 0) |
| | | if (db.Deleteable<TN_Loc_Container>().Where(it => cntrs.Contains(it.S_CNTR_CODE) && it.S_LOC_CODE == loc).ExecuteCommand() > 0 && |
| | | db.Updateable<TN_CG_Detail>().SetColumns(d => d.S_LOC_CODE == null).Where(d => cntrs.Contains(d.S_CNTR_CODE)).ExecuteCommand() > 0) // ADD:补充针对PDA分拣 |
| | | { |
| | | LogHelper.Info($"删除货位容器关系表成功,{log}"); |
| | | } |
| | |
| | | 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 }); |
| | | // 补充逻辑:避免解绑导致的信息丢失 (N_LOCK_STATE与CG_Detail保持一致所以直接赋值就行;IMGURL货位移动了就删除,也很合理) |
| | | var cgDetail = db.Queryable<TN_CG_Detail>().Where(d => d.S_CNTR_CODE == item).First(); |
| | | //bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item, S_IMG_URL = "", N_LOCK_STATE = cgDetail?.N_LOCK_STATE ?? 1 }); |
| | | bindLocCntList.Add(new TN_Loc_Container() { S_LOC_CODE = loc, S_CNTR_CODE = item, S_IMG_URL = "", N_LOCK_STATE = cgDetail?.N_LOCK_STATE ?? 0 }); |
| | | } |
| | | |
| | | |
| | | var log = JsonConvert.SerializeObject(bindLocCntList); |
| | | |
| | | using (var tran = db.Ado.UseTran()) |
| | | { |
| | | if (db.Insertable<TN_Loc_Container>(bindLocCntList).ExecuteCommand() > 0) |
| | | if (db.Insertable<TN_Loc_Container>(bindLocCntList).ExecuteCommand() > 0 && |
| | | db.Updateable<TN_CG_Detail>().SetColumns(d => d.S_LOC_CODE == loc).Where(d => cntrs.Contains(d.S_CNTR_CODE)).ExecuteCommand() > 0) // ADD:补充针对PDA分拣 |
| | | { |
| | | LogHelper.Info($"插入货位容器关系表成功,{log}"); |
| | | } |
| | |
| | | public class EmptyUnBindInfo |
| | | { |
| | | public string cntID { get; set; }//容器ID |
| | | } |
| | | |
| | | public class CancleTaskInfo |
| | | { |
| | | public string taskNO { get; set; }//任务号 |
| | | } |
| | | |
| | | public class PDAFullInAreaInfo |