| | |
| | | { |
| | | //创建托盘物料绑定信息,并计算终点货位 |
| | | Start = taskData.pickStation; |
| | | if (CreateCntrIteminfo(Start, CntrCode, ItemCode, partData.partDesc, partData.partType, partData.lotNumber, partData.unit, partData.weight, taskData.carrierType, taskData.grade)) |
| | | if (CreateCntrIteminfo(partData, taskData)) |
| | | { |
| | | endloc = Computeloc(CntrCode, taskData.dropStation, taskData.carrierType); |
| | | if (endloc != null) |
| | |
| | | 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)) |
| | | if (CreateCntrIteminfo(partData, taskData)) |
| | | { |
| | | startloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == taskData.pickStation).First(); |
| | | if (startloc != null) |
| | |
| | | { |
| | | note = "异常库区入库"; |
| | | //创建托盘物料绑定信息,并计算终点货位 |
| | | if (CreateCntrIteminfo(taskData.pickStation, CntrCode, ItemCode, partData.partDesc, partData.partType, partData.lotNumber, partData.unit, partData.weight, taskData.carrierType, taskData.grade)) |
| | | if (CreateCntrIteminfo(partData, taskData)) |
| | | { |
| | | startloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == taskData.pickStation).First(); |
| | | if (startloc != null) |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 预备库任务状态下发 |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg,Source); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | try |
| | |
| | | if (db.Queryable<TN_Material>().Where(a => a.S_ITEM_CODE == model.PartNumber).Count() > 0) |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "物料主数据已存在"; |
| | | AddErrorInfo("物料主数据已存在", result.msg,Source); |
| | | result.msg = $"物料编码:{model.PartNumber}的物料主数据已存在"; |
| | | // AddErrorInfo("物料主数据已存在", result.msg, Source); |
| | | LogHelper.Info($"add:{result.msg}"); |
| | | return result; |
| | | } |
| | | TN_Material itemInfo = new TN_Material(); |
| | | itemInfo.S_ITEM_CODE = model.PartNumber; |
| | | itemInfo.ITEM_TYPE = model.PartClass; |
| | | itemInfo.S_ITEM_NAME = model.PartDesc; |
| | | itemInfo.REMARK1 = model.StewingTime.ToString("yyyy-MM-dd"); |
| | | itemInfo.REMARK2 = model.OverdueTime.ToString("yyyy-MM-dd"); |
| | | itemInfo.REMARK1 = model.StewingTime; |
| | | itemInfo.REMARK2 = model.OverdueTime; |
| | | itemInfo.S_MP_TYPE = model.Unit; |
| | | |
| | | db.Insertable<TN_Material>(itemInfo).ExecuteCommand(); |
| | | if (db.Insertable<TN_Material>(itemInfo).ExecuteCommand()>0) |
| | | { |
| | | LogHelper.Info($"add:物料编码:{model.PartNumber}的物料主数据已同步"); |
| | | } ; |
| | | return result; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"物料主数据创建失败 错误信息:{ex}"; |
| | | LogHelper.Error("add Error:" + ex.ToString(), ex); |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = "参数为null"; |
| | | AddErrorInfo("参数为空", result.msg,Source); |
| | | AddErrorInfo("参数为空", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,起点{startloc.S_CODE}有锁"; |
| | | AddErrorInfo("货位有锁", result.msg,Source); |
| | | 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) |
| | | { |
| | | |
| | | |
| | | result.code = "1"; |
| | | result.msg = $"起点{model.Data.start_loc_code}未查询绑定托盘"; |
| | | LogHelper.Info($"callfixture:创建空工装呼叫任务==>{result.msg}"); |
| | |
| | | { |
| | | result.code = "1"; |
| | | result.msg = $"创建任务失败,根据货位编码:{dtcode}未找到电梯货位"; |
| | | AddErrorInfo("查找货位失败", result.msg,Source); |
| | | AddErrorInfo("查找货位失败", result.msg, Source); |
| | | return result; |
| | | } |
| | | |
| | |
| | | return result; |
| | | } |
| | | /// <summary> |
| | | /// 创建托盘物料绑定关系 |
| | | /// 立库任务下发创建托盘物料绑定关系 |
| | | /// </summary> |
| | | /// <param name="loc">货位编码</param> |
| | | /// <param name="cntr">托盘编码</param> |
| | | /// <param name="partNumber">物料编码</param> |
| | | /// <param name="partDesc">物料描述</param> |
| | | /// <param name="partType">物料类型</param> |
| | | /// <param name="cntrtype">托盘类型</param> |
| | | /// <param name="unit">物料单位</param> |
| | | /// <param name="weight">物料重量</param> |
| | | internal static bool CreateCntrIteminfo(string loc, string cntr, string partNumber, string partDesc, string partType, string batch, string unit, string weight, string cntrtype = "1", string level = "") |
| | | internal static bool CreateCntrIteminfo(partData partData, taskData taskData) |
| | | { |
| | | return ContainerHelper.CreateCntrItem(loc, cntr, partNumber, partDesc, partType, cntrtype, batch, weight, unit, level); |
| | | if (partData == null && taskData == null) |
| | | { |
| | | LogHelper.Info($"CreateCntrIteminfo==> 立库任务下发参数有空,创建物料托盘绑定关系失败"); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | return ContainerHelper.CreateCntrItem(taskData.pickStation, partData.rfid, partData.partNumber, partData.partDesc, partData.partType, taskData.carrierType, partData.lotNumber, partData.weight, partData.unit, |
| | | taskData.tyreType, taskData.supplier, taskData.receiveLot, taskData.subpool, partData.productionTime, partData.maturityTime, taskData.grade); |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 根据托盘编码,机台编码,工装类型计算机台线边区域 |
| | | /// </summary> |
| | | /// <param name="cntrcode">托盘编码</param> |
| | | /// <param name="jtcode">机台编码</param> |
| | | /// <param name="cntrType">托盘类型</param> |
| | | /// <returns></returns> |
| | | internal static Location Computeloc(string cntrcode, string jtcode, string cntrType) |
| | | { |