| | |
| | | try |
| | | { |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | | string CntrCode = "";//托盘编码 |
| | | string ItemCode = "";//物料编码 |
| | | if (partData != null) |
| | | { |
| | | CntrCode = partData.rfid;//托盘编码 |
| | | ItemCode = partData.partNumber;//物料编码 |
| | | } |
| | | string Start = ""; //取货点 |
| | | string CntrCode = partData.rfid;//托盘编码 |
| | | string ItemCode = partData.partNumber;//物料编码 |
| | | string End = ""; |
| | | string areacode = ""; |
| | | string note = ""; //立库下发任务需要通知mes接口物料到位,用备注自动进行区分 |
| | |
| | | // return result; |
| | | //} |
| | | int n_type = 0; //任务来源 1.钢丝立库 2.胶片库 3.预备库 ,4.原材料库,通过物料确认任务来源 |
| | | |
| | | string Source = ""; |
| | | switch (areacode) |
| | | { |
| | | case "ML": |
| | | n_type = 1; |
| | | Source = "密炼"; |
| | | break; |
| | | case "JP": |
| | | n_type = 2; |
| | | Source = "井松"; |
| | | break; |
| | | case "YBK": |
| | | n_type = 3; |
| | | Source = "预备库"; |
| | | break; |
| | | case "wmwhse1": |
| | | n_type = 4; |
| | | Source = "原材料"; |
| | | break; |
| | | } |
| | | LogHelper.Info($"Createtask==>任务类型:{n_type}"); |
| | |
| | | AddErrorInfo("物料库区未定义", result.msg); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | Location endloc = new Location(); |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"机台编码:{taskData.dropStation},未找到可用货位"; |
| | | AddErrorInfo("寻找出库货位失败", result.msg); |
| | | AddErrorInfo("寻找出库货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "创建托盘物料信息失败"; |
| | | AddErrorInfo("创建托盘失败", result.msg); |
| | | AddErrorInfo("创建托盘失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"Putin==> 任务起点:{taskData.pickStation}找不到对应货位,请检查货位表"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"Putin==> 任务起点:{taskData.pickStation}找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg); |
| | | LogHelper.Info($"Putin==> {result.msg}"); |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | } |
| | | } |
| | | else if (taskData.taskType == 2)//入库流程,直接使用起点货位和终点货位生成任务 |
| | | else if (taskData.taskType == 2)//入库流程,直接使用起点货位和终点货位生成任务,起点需要有托盘 |
| | | { |
| | | startloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == taskData.pickStation).First(); |
| | | if (startloc != null) |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据起点{Start},未找到托盘货位绑定关系"; |
| | | AddErrorInfo("托盘查找失败", result.msg); |
| | | AddErrorInfo("托盘查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据终点{End},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg); |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | Start = taskData.pickStation; |
| | | } |
| | | else |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据起点{taskData.pickStation},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | endloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == taskData.dropStation).First(); |
| | | if (endloc != null) |
| | | { |
| | | End = taskData.dropStation; |
| | | } |
| | | else |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据终点{taskData.dropStation},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | | else if (taskData.taskType == 4)//原材料库需要判断是否需要分配电梯任务,创建分档任务 |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,起点:{startloc.S_AREA_CODE},终点:{endloc.S_AREA_CODE}未找到对应库区"; |
| | | AddErrorInfo("货位查找失败", result.msg); |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | if (startArea.N_FLOOR == endArea.N_FLOOR) |
| | |
| | | return result; |
| | | } |
| | | } |
| | | else if (taskData.taskType == 5)//移库流程,直接使用起点货位和终点货位生成任务, |
| | | else if (taskData.taskType == 5)//移库流程,直接使用起点货位和终点货位生成任务,并绑定托盘 |
| | | { |
| | | //创建托盘物料绑定信息,并计算终点货位 |
| | | if (CreateCntrIteminfo(taskData.pickStation, CntrCode, ItemCode, partData.partDesc, partData.partType, partData.lotNumber, partData.unit, partData.weight, taskData.carrierType, taskData.grade)) |
| | |
| | | { |
| | | Start = taskData.pickStation; |
| | | } |
| | | else |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据起点{taskData.pickStation},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | endloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == taskData.dropStation).First(); |
| | | if (endloc != null) |
| | | { |
| | | End = taskData.dropStation; |
| | | } |
| | | else |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据终点{taskData.dropStation},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "创建托盘物料信息失败"; |
| | | AddErrorInfo("创建托盘失败", result.msg); |
| | | AddErrorInfo("创建托盘失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据托盘{partData.rfid},未找到托盘货位绑定关系"; |
| | | AddErrorInfo("货位查找失败", result.msg); |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据终点{End},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg); |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"终点库区:{taskData.dropStation}无可用货位"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据终点库区:{taskData.dropStation},未找到对应货位"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "创建托盘物料信息失败"; |
| | | AddErrorInfo("创建托盘失败", result.msg); |
| | | AddErrorInfo("创建托盘失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | | else if (taskData.taskType == 8)//叠盘机空托回库 |
| | | { |
| | | note = "空托回库";//井松空托回库,需要与叠盘机安全交互 |
| | | startloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == taskData.pickStation).First(); |
| | | if (startloc != null) |
| | | { |
| | | Start = startloc.S_CODE; |
| | | } |
| | | else |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据起点:{taskData.pickStation},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | endloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == taskData.dropStation).First(); |
| | | if (endloc != null) |
| | | { |
| | | End = taskData.dropStation; |
| | | } |
| | | else |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据终点:{End},找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("货位查找失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | LogHelper.Info($"Createtask==> 任务类型有误"); |
| | | result.code = "1"; |
| | | result.msg = "任务类型:{taskData.taskType}不在规定范围内"; |
| | | AddErrorInfo("任务类型错误", result.msg); |
| | | AddErrorInfo("任务类型错误", result.msg, Source); |
| | | } |
| | | if (taskData.taskType != 4) |
| | | { |
| | |
| | | LogHelper.Info($"AllowThrough==> 参数为null"); |
| | | result.code = "1"; |
| | | result.msg = "参数为null值,请检查参数格式"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, "", model.task_no); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据下发任务号{model.task_no}未找到对应任务"; |
| | | AddErrorInfo("未找到任务", result.msg); |
| | | AddErrorInfo("未找到任务", result.msg, "", model.task_no); |
| | | return result; |
| | | } |
| | | return result; |
| | |
| | | try |
| | | { |
| | | //创建托盘数据绑定关系 |
| | | if (ContainerHelper.CreateCntrItem(model.Rfid, model.PartNumber, model.PartDesc, model.LotNumber, model.Weight)) |
| | | if (ContainerHelper.CreateCntrItem(model.Rfid, model.PartNumber, model.PartDesc, model.LotNumber, model.Weight, model.Qty)) |
| | | { |
| | | //创建成功流程 |
| | | } |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "产出信息下发失败,托盘物料绑定关系创建失败"; |
| | | AddErrorInfo("创建绑定关系失败", result.msg); |
| | | AddErrorInfo("创建绑定关系失败", result.msg, "Mes"); |
| | | return result; |
| | | } |
| | | return result; |
| | |
| | | internal static Result Putin(Putin model, int n_type) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "入平库任务下发成功" }; |
| | | string Source = "Mes"; |
| | | if (n_type == 0) |
| | | { |
| | | Source = "PDA"; |
| | | } |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | | Location loc = new Location(); |
| | | |
| | | string Start = model.InitialLocation; //起点货位 |
| | | string itemcode = model.PartNumber; //物料编码 |
| | | string areacode = ""; |
| | | try |
| | | { |
| | | |
| | | |
| | | #region 判断托盘绑定货位是否和下发绑定起点相同,如果没绑定托盘则绑定托盘 |
| | | var CntrLoc = db.Queryable<LocCntrRel>().Where(a => a.S_CNTR_CODE.Trim() == model.Rfid).First(); |
| | | if (CntrLoc != null) |
| | | { |
| | | if (CntrLoc.S_LOC_CODE != Start) |
| | | { |
| | | LogHelper.Info($"ItemBack:创建任务失败,托盘:{model.Rfid}绑定位置不是起点:{Start}"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,托盘:{model.Rfid}绑定位置不是起点:{Start}"; |
| | | AddErrorInfo("托盘绑定位置不同", result.msg); |
| | | LogHelper.Info($"ItemBack:{result.msg}"); |
| | | AddErrorInfo("托盘绑定位置不同", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"Putin==>库区:{areacode}无可用货位"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"库区:{areacode}无可用货位"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | LogHelper.Info($"Putin==> {result.msg}"); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"Putin==> 任务起点:{Start}找不到对应货位,请检查货位表"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"任务起点:{Start}找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | LogHelper.Info($"Putin==> {result.msg}"); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,起点:{Start}有锁"; |
| | | AddErrorInfo("货位有锁", result.msg); |
| | | AddErrorInfo("货位有锁", result.msg, Source); |
| | | return result; |
| | | } |
| | | //创建wcs任务 |
| | |
| | | internal static Result PutOut(PutOut model, int n_type) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "出平库任务下发成功" }; |
| | | string Source = "Mes"; |
| | | if (n_type == 0) |
| | | { |
| | | Source = "PDA"; |
| | | } |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | string Start = ""; |
| | | string End = ""; |
| | | string CntrCode = ""; |
| | | |
| | | string itemcode = model.PartNumber; |
| | | string cntrType = ""; |
| | | string areacode = ""; |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"ItemBack:创建任务失败,物料号{model.PartNumber}不属于规定物料"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,物料号{model.PartNumber}不属于规定物料"; |
| | | AddErrorInfo("物料编码格式错误", result.msg); |
| | | LogHelper.Info($"ItemBack:{result.msg}"); |
| | | AddErrorInfo("物料编码格式错误", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"PutOut==> 任务物料:{itemcode}找不到对应库存"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"任务物料:{itemcode}找不到对应库存"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | LogHelper.Info($"ItemBack:{result.msg}"); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,起点{Start}有锁"; |
| | | AddErrorInfo("货位有锁", result.msg); |
| | | AddErrorInfo("货位有锁", result.msg, Source); |
| | | return result; |
| | | } |
| | | //创建wcs任务 |
| | |
| | | internal static Result Empty(Empty model) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "空工装回库任务下发成功" }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"叠盘货位不可用"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | else |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"根据货位备注:叠盘,货位楼层:{startloc.N_LAYER},货位仓库:{startloc.S_WH_CODE},找不到叠盘货位"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"叠盘货位不可用"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | LogHelper.Info($"根据货位备注:叠盘,货位楼层:{startloc.N_LAYER},货位仓库:{startloc.S_WH_CODE},找不到叠盘货位"); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"叠盘货位不可用"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | else |
| | |
| | | LogHelper.Info($"根据货位备注:片胶堆叠位,货位仓库:{startloc.S_WH_CODE},找不到叠盘货位"); |
| | | result.code = "1"; |
| | | result.msg = $"叠盘货位不可用"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"创建任务失败,根据托盘编码{model.Rfid}未找到托盘出库任务"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,根据托盘编码{model.Rfid}未找到托盘出库任务"; |
| | | AddErrorInfo("查找任务失败", result.msg); |
| | | LogHelper.Info($"{result.msg}"); |
| | | AddErrorInfo("查找任务失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | if (string.IsNullOrEmpty(areacode)) |
| | | { |
| | | LogHelper.Info($"创建任务失败,根据托盘编码{model.Rfid}找到出库任务{mst.S_CODE}的起点库区为空"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,根据托盘编码{model.Rfid}找到出库任务{mst.S_CODE}的起点库区为空"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | LogHelper.Info($"{result.msg}"); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"库区:{areacode}无可用货位"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"库区:{areacode}无可用货位"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | LogHelper.Info($"{result.msg}"); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"Empty==> 任务起点:{Start}找不到对应货位,请检查货位表"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"Empty==> 任务起点:{Start}找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | LogHelper.Info($"{result.msg}"); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | | Result result = new Result() { code = "200", msg = "空工装呼叫任务下发成功" }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"callfixture:创建空工装呼叫任务==>根据货位{endloc.S_CODE}未找到托盘货位绑定关系"); |
| | | result.code = "1"; |
| | | result.msg = $"创建空工装呼叫任务==>根据货位{endloc.S_CODE}未找到托盘货位绑定关系"; |
| | | AddErrorInfo("查找托盘失败", result.msg); |
| | | LogHelper.Info($"callfixture:{result.msg}"); |
| | | AddErrorInfo("查找托盘失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"callfixture==> 任务起点:{End}找不到对应货位,请检查货位表"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"任务起点:{End}找不到对应货位,请检查货位表"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | LogHelper.Info($"callfixture:{result.msg}"); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | |
| | | } |
| | | #endregion |
| | |
| | | internal static Result ItemBack(ItemBack model) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "余料返回任务下发成功" }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | |
| | | } |
| | |
| | | { |
| | | if (CntrLoc.S_LOC_CODE != Start) |
| | | { |
| | | LogHelper.Info($"ItemBack:创建任务失败,托盘:{model.Rfid}绑定位置不是起点:{Start}"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,托盘:{model.Rfid}绑定位置不是起点:{Start}"; |
| | | AddErrorInfo("托盘绑定位置不同", result.msg); |
| | | LogHelper.Info($"ItemBack:{result.msg}"); |
| | | AddErrorInfo("托盘绑定位置不同", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"ItemBack:创建任务失败,托盘:{model.Rfid}未找到绑定货位"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,托盘:{model.Rfid}未找到绑定货位"; |
| | | AddErrorInfo("查找托盘货位失败", result.msg); |
| | | LogHelper.Info($"ItemBack:{result.msg}"); |
| | | AddErrorInfo("查找托盘货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"ItemBack:创建任务失败,物料号{model.PartNumber}不属于规定物料"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,物料号{model.PartNumber}不属于规定物料"; |
| | | AddErrorInfo("物料编码格式错误", result.msg); |
| | | LogHelper.Info($"ItemBack:{result.msg}"); |
| | | AddErrorInfo("物料编码格式错误", result.msg, Source); |
| | | return result; |
| | | } |
| | | var EndLocs = db.Queryable<Location>().Where(a => a.S_AREA_CODE.Trim() == areacode).ToList(); |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"终点库区:{areacode}无可用货位"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据终点库区:{areacode},未找到对应货位"; |
| | | AddErrorInfo("查找库区失败", result.msg); |
| | | AddErrorInfo("查找库区失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | //loc = StorageCompute(itemcode, areacode); |
| | |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"库区:{areacode}无可用货位"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"库区:{areacode}无可用货位"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"货位:{Start}找不到对应货位"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"货位:{Start}找不到对应货位"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | msg = "线边库存查询成功" |
| | | |
| | | }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | |
| | | } |
| | |
| | | internal static Result add(add model) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "物料主数据创建成功" }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg,Source); |
| | | return result; |
| | | } |
| | | try |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "物料主数据已存在"; |
| | | AddErrorInfo("物料主数据已存在", result.msg); |
| | | AddErrorInfo("物料主数据已存在", result.msg,Source); |
| | | return result; |
| | | } |
| | | TN_Material itemInfo = new TN_Material(); |
| | |
| | | internal static Result CreatTask(CreatTask model) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "点对点任务创建成功" }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | string Start = ""; //取货点 |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,根据起点{model.InitialLocation}未找到对应货位绑定托盘托盘"; |
| | | AddErrorInfo("查找托盘失败", result.msg); |
| | | AddErrorInfo("查找托盘失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | internal static Result CreatelevatorTask(Elevator model) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "点对点任务创建成功" }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg,Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,起点{startloc.S_CODE}有锁"; |
| | | AddErrorInfo("货位有锁", result.msg); |
| | | AddErrorInfo("货位有锁", result.msg,Source); |
| | | return result; |
| | | } |
| | | |
| | | var cntr = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == startloc.S_CODE).First(); |
| | | if (cntr == null) |
| | | { |
| | | LogHelper.Info($"callfixture:创建空工装呼叫任务==>根据货位{endloc.S_CODE}未找到托盘货位绑定关系"); |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"起点{model.Data.start_loc_code}未查询绑定托盘"; |
| | | AddErrorInfo("查找托盘失败", result.msg); |
| | | LogHelper.Info($"callfixture:创建空工装呼叫任务==>{result.msg}"); |
| | | AddErrorInfo("查找托盘失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,根据货位编码:{dtcode}未找到电梯货位"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | AddErrorInfo("查找货位失败", result.msg,Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | |
| | | Result result = new Result() { code = "200", msg = "货位信息上传成功" }; |
| | | String Source = "MES"; |
| | | RequestList<UploadLoc> result1 = new RequestList<UploadLoc>(); |
| | | List<UploadLoc> listuploadloc = new List<UploadLoc>(); |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"货位上传失败,根据货位编码{item.Location}未找到对应的货位信息"; |
| | | AddErrorInfo("查找货位失败", result.msg); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | LogHelper.Info($"物料到位回报失败=>回报地址没有配置"); |
| | | result.code = "1"; |
| | | result.msg = $"物料到位回报失败=>回报地址没有配置"; |
| | | AddErrorInfo("地址错误", result.msg); |
| | | AddErrorInfo("地址错误", result.msg, Source); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | internal static Result ClearLoc(ClearTask model) |
| | | { |
| | | Result result = new Result() { code = "200", msg = "库位清除成功" }; |
| | | string Source = "MES"; |
| | | if (model == null) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | string loc = model.LocationNum; |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"根据货位:{loc}找不到货位关系"; |
| | | AddErrorInfo("货位为空", result.msg); |
| | | AddErrorInfo("货位为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | var error = new ErrorInfo |
| | | { |
| | | EEEORMESSAGE = errorInfo, |
| | | ERRORMESSAGE = errorInfo, |
| | | TASKNO = taskno, |
| | | AREACODE = areacode, |
| | | REMAKE = remake, |