| | |
| | | CMMLog.Debug($"WriteItemInfo:End!"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 写入包装机物料信息 |
| | | /// </summary> |
| | | /// <param name="plcInfo"></param> |
| | | public static void WriteItemInfoTwo(Settings.PlcInfo plcInfo) |
| | | { |
| | | CMMLog.Debug($"WriteItemInfo:Start!"); |
| | | |
| | | try |
| | | { |
| | | //读取【翻页】通道数据 |
| | | var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel |
| | | { |
| | | dataNum = 1, |
| | | addr = plcInfo.FyReadAddr, |
| | | host = plcInfo.ip, |
| | | port = plcInfo.port |
| | | }); |
| | | CMMLog.Debug($"WriteItemInfo:读取【翻页】通道数据为:{JsonConvert.SerializeObject(result)}!"); |
| | | if (true) // result != null && result.errCode == 0 |
| | | { |
| | | // 示例:读出值为1 获取1~5编号的物料数据;读出值为2 获取6~10编号的物料数据 规则 result.result[0] * 5 - 4 起始编号 |
| | | //int startItemNo = 1; |
| | | int startItemNo = result.result[0] * 5 - 4; |
| | | CMMLog.Debug($"WriteItemInfo:翻页数据为:{startItemNo}!"); |
| | | var reLocationTask = MongoDBSingleton.Instance.Find<ERPItemTable>(Query.And(Query.In("item_no", new List<MongoDB.Bson.BsonValue>() { startItemNo, startItemNo + 1, startItemNo + 2, startItemNo + 3, startItemNo + 4 })), "ERPItemTable").ToList(); |
| | | int reLocationTaskNum = reLocationTask != null ? reLocationTask.Count : 0; |
| | | CMMLog.Debug($"WriteItemInfo:查询出ERP物料表数据数量为:{reLocationTaskNum}!备注:只有数量为5才会写入数据"); |
| | | if (reLocationTaskNum == 5) |
| | | { |
| | | int no = 0; |
| | | reLocationTask.ForEach(a => |
| | | { |
| | | int writeAddr = plcInfo.FyWriteAddr + no * 50; |
| | | if (no > 0) writeAddr = writeAddr + 40; |
| | | no++; |
| | | // 解析物料数据并写入 有效数据通道 50,50(产品型号-10 物料编码-15 物料名称-20 计量单位-5) |
| | | int[] num = new int[50]; |
| | | // 内存地址 0~19 协议地址 1~20 批次号 人工输入,不需要程序写入 |
| | | for (int i = 0; i <= 19; i++) num[i] = 0; |
| | | // 内存地址 20~29 协议地址 21~30 产品型号 |
| | | // HandleItemInfo(a.item_spec, 20, 29, num); |
| | | HandleItemInfoChina(a.item_spec, 0, 9, num); |
| | | CMMLog.Debug($"WriteItemInfo:物料信息处理-2。处理数据:{a.item_spec},处理后数据:{JsonConvert.SerializeObject(num)}"); |
| | | // 内存地址 30~49 协议地址 31~50 物料编码 |
| | | HandleItemInfo(a.item_code, 10, 24, num); |
| | | CMMLog.Debug($"WriteItemInfo:物料信息处理-2。处理数据:{a.item_code},处理后数据:{JsonConvert.SerializeObject(num)}"); |
| | | // 内存地址 50~64 协议地址 51~65 物料名称 |
| | | // HandleItemInfo(a.item_name, 50, 64, num); |
| | | HandleItemInfoChina(a.item_name, 25, 44, num);// 中文处理 |
| | | CMMLog.Debug($"WriteItemInfo:物料信息处理-2。处理数据:{a.item_name},处理后数据:{JsonConvert.SerializeObject(num)}"); |
| | | // 内存地址 65~69 协议地址 66~70 计量单位 |
| | | HandleItemInfo(a.item_uom, 45, 49, num); |
| | | CMMLog.Debug($"WriteItemInfo:物料信息处理-2。处理数据:{a.item_uom},处理后数据:{JsonConvert.SerializeObject(num)}"); |
| | | |
| | | CMMLog.Debug($"WriteItemInfo:发送物料信息。序号:{a.item_no},ip:{plcInfo.ip},port:{plcInfo.port},写入起始地址:{writeAddr},写入数据:{JsonConvert.SerializeObject(num)}"); |
| | | |
| | | var wirteall01 = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti |
| | | { |
| | | addr = writeAddr, |
| | | host = plcInfo.ip, |
| | | port = plcInfo.port, |
| | | data = num |
| | | }); |
| | | int writeResult = wirteall01 != null ? wirteall01.errCode : 1; |
| | | CMMLog.Debug($"WriteItemInfo:发送物料信息。序号:{a.item_no},写入结果:{writeResult}。ip:{plcInfo.ip},port:{plcInfo.port},写入起始地址:{writeAddr},写入数据:{JsonConvert.SerializeObject(num)}"); |
| | | }); |
| | | } |
| | | } |
| | | else CMMLog.Debug($"WriteItemInfo:未读取【翻页】通道数据!"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | CMMLog.Debug($"WriteItemInfo Error:{ex.Message}"); |
| | | } |
| | | |
| | | CMMLog.Debug($"WriteItemInfo:End!"); |
| | | } |
| | | |
| | | public static void HandleItemInfo(string itemInfo,int startIndex, int endIndex , int[] num) |
| | | { |
| | | string data = itemInfo;// 要写入的处理后数据 |
| | |
| | | { |
| | | list.ForEach(a => |
| | | { |
| | | if(a.deviceType == "1") |
| | | { |
| | | PLCControl.PickUpBlank(a); |
| | | } |
| | | else |
| | | { |
| | | PLCControl.PickUpBlankTwo(a); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | } |
| | |
| | | list.ForEach(a => |
| | | { |
| | | // 包装机启动时读取【翻页通道】,根据页号获取五条数据,然后写入包装机 |
| | | //ERPService.WriteItemInfo(a); |
| | | //ERPService.WriteItemInfoTwo(a); |
| | | |
| | | PLCControl.CheckPackingMachineTetracobalt(a); |
| | | }); |
| | |
| | | { |
| | | lock (lock10015) |
| | | { |
| | | ERPService.insertMidTable(); |
| | | //ERPService.insertMidTable(); |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | if (CheckStartFree(plc.location)) |
| | | { |
| | | PLCControl.CheckPackingLineFullTwo(plc); |
| | | //PLCControl.CheckPackingLineFullTwo(plc); |
| | | PLCControl.CheckPackingLineFullThree(plc); |
| | | } |
| | | } |
| | | //Thread.Sleep(500); |
| | |
| | | int productTime = Convert.ToInt32(Completion(result[(i - 1) * 24 + 20]) + Completion(result[(i - 1) * 24 + 21]), 2);//生产日期 |
| | | string timeCuoTwo = Convert.ToInt32(Completion(result[(i - 1) * 24 + 22]) + Completion(result[(i - 1) * 24 + 23]), 2).ToString(); //时间戳 |
| | | |
| | | //注意:这里赋值中间表参数请对照信息交互表具体通道值对应 |
| | | //UpdateBuilder update = Update.Set("employeeId" + i.ToString(), empCode).Set("trayCode" + i.ToString(), trayCode).Set("packingMachineNumber" + i.ToString(), machineCode).Set("needWeight" + i.ToString(), needWeight) |
| | | // .Set("oneWeight" + i.ToString(), oneWeight).Set("realWeight" + i.ToString(), readWeight).Set("FCWeight" + i.ToString(), fcWeight).Set("trayType" + i.ToString(), trayType) |
| | | // .Set("isFold" + i.ToString(), addState).Set("bagNumber" + i.ToString(), bagNumber).Set("productData" + i.ToString(), productTime).Set("timeCuo" + i.ToString(), timeCuoTwo); |
| | | UpdateBuilder updateBuilder = Update.Set("employeeId" + i.ToString(), empCode).Set("trayCode" + i.ToString(), trayCode).Set("packingMachineNumber" + i.ToString(), machineCode).Set("needWeight" + i.ToString(), needWeight) |
| | | .Set("oneWeight" + i.ToString(), oneWeight).Set("realWeight" + i.ToString(), readWeight).Set("FCWeight" + i.ToString(), fcWeight).Set("trayType" + i.ToString(), trayType) |
| | | .Set("isFold" + i.ToString(), addState).Set("bagNumber" + i.ToString(), bagNumber).Set("productData" + i.ToString(), productTime).Set("timeCuo" + i.ToString(), timeCuoTwo); |
| | |
| | | /// <summary> |
| | | /// 员工编号1 |
| | | /// </summary> |
| | | public string employeeId1 { get; set; } |
| | | public string employeeId { get; set; } |
| | | /// <summary> |
| | | /// 托盘码1 |
| | | /// </summary> |
| | | public string trayCode1 { get; set; } |
| | | public string trayCode { get; set; } |
| | | /// <summary> |
| | | /// 包装机号1 |
| | | /// </summary> |
| | | public string packingMachineNumber1 { get; set; } |
| | | public string packingMachineNumber { get; set; } |
| | | /// <summary> |
| | | /// 产品需求重量1:32位整数 |
| | | /// </summary> |
| | | public int needWeight1 { get; set; } |
| | | public int needWeight { get; set; } |
| | | /// <summary> |
| | | /// 单托毛重1:32位整数 |
| | | /// </summary> |
| | | public int oneWeight1 { get; set; } |
| | | public int oneWeight { get; set; } |
| | | /// <summary> |
| | | /// 单托实际重量1:32位整数 |
| | | /// </summary> |
| | | public int realWeight1 { get; set; } |
| | | public int realWeight { get; set; } |
| | | /// <summary> |
| | | /// 单托复称重量1:32位整数 |
| | | /// </summary> |
| | | public int FCWeight1 { get; set; } |
| | | public int FCWeight { get; set; } |
| | | /// <summary> |
| | | /// 托盘类型1 |
| | | /// </summary> |
| | | public string trayType1 { get; set; } |
| | | public string trayType { get; set; } |
| | | /// <summary> |
| | | /// 叠包层数1 |
| | | /// </summary> |
| | | public int isFold1 { get; set; } |
| | | public int isFold { get; set; } |
| | | /// <summary> |
| | | /// 本批次内袋号:(1,2,3……10) 整数1 |
| | | /// </summary> |
| | | public int bagNumber1 { get; set; } |
| | | public int bagNumber { get; set; } |
| | | /// <summary> |
| | | /// 生产日期(32位整数)1 |
| | | /// </summary> |
| | | public string productData1 { get; set; } |
| | | public string productData { get; set; } |
| | | /// <summary> |
| | | /// 单包下料时间戳 |
| | | /// </summary> |
| | | public string timeCuo1 { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 员工编号2 |
| | | /// </summary> |
| | | public string employeeId2 { get; set; } |
| | | /// <summary> |
| | | /// 托盘码2 |
| | | /// </summary> |
| | | public string trayCode2 { get; set; } |
| | | /// <summary> |
| | | /// 包装机号2 |
| | | /// </summary> |
| | | public string packingMachineNumber2 { get; set; } |
| | | /// <summary> |
| | | /// 产品需求重量2:32位整数 |
| | | /// </summary> |
| | | public int needWeight2 { get; set; } |
| | | /// <summary> |
| | | /// 单托毛重2:32位整数 |
| | | /// </summary> |
| | | public int oneWeight2 { get; set; } |
| | | /// <summary> |
| | | /// 单托实际重量2:32位整数 |
| | | /// </summary> |
| | | public int realWeight2 { get; set; } |
| | | /// <summary> |
| | | /// 单托复称重量2:32位整数 |
| | | /// </summary> |
| | | public int FCWeight2 { get; set; } |
| | | /// <summary> |
| | | /// 托盘类型2 |
| | | /// </summary> |
| | | public string trayType2 { get; set; } |
| | | /// <summary> |
| | | /// 叠包层数2 |
| | | /// </summary> |
| | | public int isFold2 { get; set; } |
| | | /// <summary> |
| | | /// 本批次内袋号:(1,2,3……20) 整数2 |
| | | /// </summary> |
| | | public int bagNumber2 { get; set; } |
| | | /// <summary> |
| | | /// 生产日期(32位整数)2 |
| | | /// </summary> |
| | | public string productData2 { get; set; } |
| | | /// <summary> |
| | | /// 单包下料时间戳 |
| | | /// </summary> |
| | | public string timeCuo2 { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 员工编号3 |
| | | /// </summary> |
| | | public string employeeId3 { get; set; } |
| | | /// <summary> |
| | | /// 托盘码3 |
| | | /// </summary> |
| | | public string trayCode3 { get; set; } |
| | | /// <summary> |
| | | /// 包装机号3 |
| | | /// </summary> |
| | | public string packingMachineNumber3 { get; set; } |
| | | /// <summary> |
| | | /// 产品需求重量3:33位整数 |
| | | /// </summary> |
| | | public int needWeight3 { get; set; } |
| | | /// <summary> |
| | | /// 单托毛重3:32位整数 |
| | | /// </summary> |
| | | public int oneWeight3 { get; set; } |
| | | /// <summary> |
| | | /// 单托实际重量3:32位整数 |
| | | /// </summary> |
| | | public int realWeight3 { get; set; } |
| | | /// <summary> |
| | | /// 单托复称重量3:32位整数 |
| | | /// </summary> |
| | | public int FCWeight3 { get; set; } |
| | | /// <summary> |
| | | /// 托盘类型3 |
| | | /// </summary> |
| | | public string trayType3 { get; set; } |
| | | /// <summary> |
| | | /// 叠包层数3 |
| | | /// </summary> |
| | | public int isFold3 { get; set; } |
| | | /// <summary> |
| | | /// 本批次内袋号:(1,2,3……30) 整数3 |
| | | /// </summary> |
| | | public int bagNumber3 { get; set; } |
| | | /// <summary> |
| | | /// 生产日期(32位整数)3 |
| | | /// </summary> |
| | | public string productData3 { get; set; } |
| | | /// <summary> |
| | | /// 单包下料时间戳 |
| | | /// </summary> |
| | | public string timeCuo3 { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 员工编号4 |
| | | /// </summary> |
| | | public string employeeId4 { get; set; } |
| | | /// <summary> |
| | | /// 托盘码4 |
| | | /// </summary> |
| | | public string trayCode4 { get; set; } |
| | | /// <summary> |
| | | /// 包装机号4 |
| | | /// </summary> |
| | | public string packingMachineNumber4 { get; set; } |
| | | /// <summary> |
| | | /// 产品需求重量4:32位整数 |
| | | /// </summary> |
| | | public int needWeight4 { get; set; } |
| | | /// <summary> |
| | | /// 单托毛重4:32位整数 |
| | | /// </summary> |
| | | public int oneWeight4 { get; set; } |
| | | /// <summary> |
| | | /// 单托实际重量4:32位整数 |
| | | /// </summary> |
| | | public int realWeight4 { get; set; } |
| | | /// <summary> |
| | | /// 单托复称重量4:32位整数 |
| | | /// </summary> |
| | | public int FCWeight4 { get; set; } |
| | | /// <summary> |
| | | /// 托盘类型4 |
| | | /// </summary> |
| | | public string trayType4 { get; set; } |
| | | /// <summary> |
| | | /// 叠包层数4 |
| | | /// </summary> |
| | | public int isFold4 { get; set; } |
| | | /// <summary> |
| | | /// 本批次内袋号:(1,2,3……40) 整数4 |
| | | /// </summary> |
| | | public int bagNumber4 { get; set; } |
| | | /// <summary> |
| | | /// 生产日期(32位整数)4 |
| | | /// </summary> |
| | | public string productData4 { get; set; } |
| | | /// <summary> |
| | | /// 单包下料时间戳 |
| | | /// </summary> |
| | | public string timeCuo4 { get; set; } |
| | | public string timeCuo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 复称总重量 |
| | |
| | | /// 计量单位 |
| | | /// </summary> |
| | | public string measurementUnit { get; set; } |
| | | public DateTime createTime { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | host = plc.ip, |
| | | port = plc.port |
| | | }); |
| | | CMMLog.Info($"叠盘下线读取通道{plc.ip},port:{plc.port},地址:{plc.readAddr + 1}的值为{JsonConvert.SerializeObject(result)}"); |
| | | if (result != null && result.errCode == 0) |
| | | { |
| | | //1.满托下线 |
| | |
| | | string wmstaskno = ""; |
| | | string traycode = ""; |
| | | string trayType = ""; |
| | | if(plc.deviceType == "25") trayType = result.result[1] == 1 ? "川字托" : "田字托"; |
| | | if (plc.deviceType == "25") |
| | | { |
| | | trayType = result.result[1] == 1 ? "川字托" : result.result[1] == 2 ? "田字托" : ""; |
| | | if (string.IsNullOrEmpty(trayType)) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode,"","",false, trayType); |
| | | if (req) |
| | | { |
| | |
| | | if (timecuo != null) |
| | | { |
| | | string timeStamp = timecuo.TimeCuo; |
| | | string employeeId = timecuo.employeeId1; |
| | | // ERP变更-调用ERP接口传输相关数据 |
| | | WMSHelper.WMSIn(plc.location, "time", ref wmstaskno, ref timeStamp, timeStamp, employeeId,true); |
| | | //string employeeId = timecuo.employeeId1; |
| | | //// ERP变更-调用ERP接口传输相关数据 |
| | | //WMSHelper.WMSIn(plc.location, "time", ref wmstaskno, ref timeStamp, timeStamp, employeeId,true); |
| | | } |
| | | else CMMLog.Info($"时间戳接口返回值为空!"); |
| | | } |
| | |
| | | if (result != null && result.errCode == 0) |
| | | { |
| | | //3:人工叫空托盘(川字) 4:人工叫空托盘(田字) |
| | | if (result.result[0] == 3 || result.result[0] == 4) |
| | | if ((pmInfo.deviceType == "1" && result.result[0] == 3)|| (pmInfo.deviceType == "21" &&(result.result[0] == 3 || result.result[0] == 4))) |
| | | { |
| | | //包装线补空流程 |
| | | //判断空托缓存点(5 对 2)是否有空托,有空托判断是否有任务,有任务则判断另一个点位 |
| | |
| | | CMMLog.Info("配置文件未配置包装机空托缓存点"); |
| | | } |
| | | } |
| | | //流程未对接好,是否这样使用 待定 |
| | | //if (result.result[0] == 4) |
| | | //{ |
| | | // //调用wms出库接口 |
| | | // var tasks = MongoDBSingleton.Instance.Find<TN_I_TASK_MST>(Query.EQ("CN_S_END_BIT", pmInfo.location), "TN_I_TASK_MST"); |
| | | // //判断一下当前叠托点是否有任务占用 |
| | | // if (ProcessHelper.CheckEndFree(pmInfo.location) && tasks.Count == 0) |
| | | // { |
| | | // //可以生成任务,调WMS接口获取任务信息 |
| | | // bool req = WMSHelper.WMSOut(pmInfo.location, ""); |
| | | // if (req) CMMLog.Debug($"调用WMS获取辅材出库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型) |
| | | // else CMMLog.Debug($"调用WMS获取辅材出库生成任务失败!"); |
| | | // } |
| | | // else CMMLog.Debug($"检查当前叠托点是否有任务占用,或者MST主表中有缓存架入叠盘机的任务!"); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | Thread.Sleep(100000); |
| | | } |
| | | |
| | | internal static void CheckPackingLineFullThree(Settings.PlcInfo plc) |
| | | { |
| | | var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel |
| | | { |
| | | dataNum = 25, |
| | | addr = plc.readAddr, |
| | | host = plc.ip, |
| | | port = plc.port |
| | | }); |
| | | if(result != null && result.errCode == 0) |
| | | { |
| | | if (result.result[0] == 1) |
| | | { |
| | | //获取物料信息 根据托盘码区分 |
| | | string trayCode = RemoveNull(GetTrayCode(result.result.Skip(6).Take(3).ToArray()));//托盘码 |
| | | |
| | | |
| | | var infoPack = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.And(Query.EQ("trayCode", trayCode)), "TimeCuoInfoComTwo"); |
| | | if (infoPack != null) |
| | | { |
| | | string empCode = RemoveNull(GetTrayCode(result.result.Skip(1).Take(5).ToArray()));//员工编码 |
| | | string machineCode = RemoveNull(GetTrayCode(result.result.Skip(9).Take(1).ToArray()));//包装机号 |
| | | int needWeight = Convert.ToInt32(Completion(result.result[10]) + Completion(result.result[11]), 2);//产品需求重量 |
| | | int oneWeight = Convert.ToInt32(Completion(result.result[12]) + Completion(result.result[13]), 2);//单托毛重 |
| | | int readWeight = Convert.ToInt32(Completion(result.result[14]) + Completion(result.result[15]), 2);//单托净重 |
| | | int fcWeight = Convert.ToInt32(Completion(result.result[16]) + Completion(result.result[17]), 2);//单托复称重量 |
| | | int trayType = Convert.ToInt32(Completion(result.result[18]), 2);//托盘类型 |
| | | int addState = Convert.ToInt32(Completion(result.result[19]), 2);//叠包层数 |
| | | int bagNumber = Convert.ToInt32(Completion(result.result[20]), 2);//袋号 |
| | | int productTime = Convert.ToInt32(Completion(result.result[21]) + Completion(result.result[22]), 2);//生产日期 |
| | | string timeCuoTwo = Convert.ToInt32(Completion(result.result[23]) + Completion(result.result[24]), 2).ToString(); //时间戳 |
| | | |
| | | UpdateBuilder updateBuilder = Update.Set("employeeId", empCode).Set("trayCode", trayCode).Set("packingMachineNumber", machineCode).Set("needWeight", needWeight) |
| | | .Set("oneWeight", oneWeight).Set("realWeight", readWeight).Set("FCWeight", fcWeight).Set("trayType", trayType) |
| | | .Set("isFold", addState).Set("bagNumber", bagNumber).Set("productData", productTime); |
| | | //产品批次号 产品型号 物料名称 计量单位均可在erp表中根据物料编码获取 |
| | | |
| | | result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel |
| | | { |
| | | dataNum = 15, |
| | | addr = plc.readAddr + 131, |
| | | host = plc.ip, |
| | | port = plc.port |
| | | }); |
| | | |
| | | string materialCode = RemoveNull(GetTrayCode(result.result.Skip(0).Take(15).ToArray()).Trim().ToString()); |
| | | UpdateBuilder update = Update.Set("materialCode", materialCode); |
| | | MongoDBSingleton.Instance.Update<TimeCuoInfoComTwo>(Query.EQ("trayCode", trayCode), update, UpdateFlags.None); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | var time = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("timeStamp", timeStamp), "TimeCuoInfoCom"); |
| | | CMMLog.Info($"WMSIn-{startBit}:{ItemCode}:查询条件:timeStamp={timeStamp},读出 TimeCuoInfoComTwo 表数据为:{JsonConvert.SerializeObject(time)}"); |
| | | if (ItemCode == "time" && time != null) |
| | | { |
| | | CMMLog.Info($"WMSIn-{startBit}:time获取时间戳数据为:{time.TimeCuo}!"); |
| | | model.data.Add(new ItemData() |
| | | { |
| | | //1楼拆盘机调WMS获取入库终点,传输时间戳数据(暂定) |
| | | //isFold = time.isFold, |
| | | //packingMachineNumber = time.packingMachineNumber, |
| | | itemCode = time.productModel, |
| | | lotNo = time.lotNo, |
| | | machineNo = time.packingMachineNumber1.ToString(), |
| | | packageCode = time.bagNumber1.ToString(), |
| | | //palletLayers = time.bagNumber1.ToString(), |
| | | foldingbag = time.isFold1.ToString(), |
| | | //totalWeight = time.totalWeight, |
| | | timeStamp = int.Parse(time.TimeCuo), |
| | | //productType = time.productModel, |
| | | //bagNumber = time.bagNumber, |
| | | //needWeight = time.needWeight, |
| | | realWeight = time.realWeight1, |
| | | //batchNumber = time.batchNumber, |
| | | //totalCount = time.totalCount, |
| | | |
| | | Jm_Item_Code = time.materialCode, |
| | | Jm_Item_Name = time.materialName, |
| | | Jm_Item_Model = time.productModel, |
| | | Jm_Item_Unit = time.measurementUnit, |
| | | Jm_Item_Staff = employee_id |
| | | }); |
| | | //var time = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("timeStamp", timeStamp), "TimeCuoInfoCom"); |
| | | //CMMLog.Info($"WMSIn-{startBit}:{ItemCode}:查询条件:timeStamp={timeStamp},读出 TimeCuoInfoComTwo 表数据为:{JsonConvert.SerializeObject(time)}"); |
| | | //var erpItemTableInfo = MongoDBSingleton.Instance.FindOne<ERPItemTable>(Query.EQ("item_code", time.materialCode), "ERPItemTable"); |
| | | //CMMLog.Info($"WMSIn-{startBit}:查询条件:item_code={time.materialCode},读出 ERPItemTable 表数据为:{JsonConvert.SerializeObject(erpItemTableInfo)}"); |
| | | //if (ItemCode == "time" && time != null && erpItemTableInfo != null) |
| | | //{ |
| | | // CMMLog.Info($"WMSIn-{startBit}:time获取时间戳数据为:{time.TimeCuo}!"); |
| | | // model.data.Add(new ItemData() |
| | | // { |
| | | // itemCode = time.productModel, |
| | | // lotNo = time.lotNo, |
| | | // machineNo = time.packingMachineNumber1.ToString(), |
| | | // packageCode = time.bagNumber1.ToString(), |
| | | // foldingbag = time.isFold1.ToString(), |
| | | // timeStamp = int.Parse(time.TimeCuo), |
| | | // realWeight = time.realWeight1, |
| | | // |
| | | // Jm_Item_Code = time.materialCode, |
| | | // Jm_Item_Name = time.materialName, |
| | | // Jm_Item_Model = time.productModel, |
| | | // Jm_Item_Unit = time.measurementUnit, |
| | | // Jm_Item_Staff = employee_id |
| | | // }); |
| | | //} |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var time = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("timeStamp", timeStamp), "TimeCuoInfoCom"); |
| | | CMMLog.Info($"WMSInTwo-{startBit}:{ItemCode}:查询条件:timeStamp={timeStamp},读出 TimeCuoInfoComTwo 表数据为:{JsonConvert.SerializeObject(time)}"); |
| | | if (ItemCode == "time" && time != null) |
| | | { |
| | | CMMLog.Info($"WMSInTwo-{startBit}:time获取时间戳数据为:{time.TimeCuo}!"); |
| | | model.data.Add(new ItemData() |
| | | { |
| | | //1楼拆盘机调WMS获取入库终点,传输时间戳数据(暂定) |
| | | //isFold = time.isFold, |
| | | //packingMachineNumber = time.packingMachineNumber, |
| | | itemCode = time.productModel, |
| | | lotNo = time.lotNo, |
| | | machineNo = time.packingMachineNumber1.ToString(), |
| | | packageCode = time.bagNumber1.ToString(), |
| | | //palletLayers = time.bagNumber1.ToString(), |
| | | foldingbag = time.isFold1.ToString(), |
| | | //totalWeight = time.totalWeight, |
| | | timeStamp = int.Parse(time.TimeCuo), |
| | | //productType = time.productModel, |
| | | //bagNumber = time.bagNumber, |
| | | //needWeight = time.needWeight, |
| | | realWeight = time.realWeight1, |
| | | //batchNumber = time.batchNumber, |
| | | //totalCount = time.totalCount, |
| | | |
| | | Jm_Item_Code = time.materialCode, |
| | | Jm_Item_Name = time.materialName, |
| | | Jm_Item_Model = time.productModel, |
| | | Jm_Item_Unit = time.measurementUnit, |
| | | Jm_Item_Staff = employee_id |
| | | }); |
| | | } |
| | | //var time = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("timeStamp", timeStamp), "TimeCuoInfoCom"); |
| | | //CMMLog.Info($"WMSInTwo-{startBit}:{ItemCode}:查询条件:timeStamp={timeStamp},读出 TimeCuoInfoComTwo 表数据为:{JsonConvert.SerializeObject(time)}"); |
| | | //if (ItemCode == "time" && time != null) |
| | | //{ |
| | | // CMMLog.Info($"WMSInTwo-{startBit}:time获取时间戳数据为:{time.TimeCuo}!"); |
| | | // model.data.Add(new ItemData() |
| | | // { |
| | | // //1楼拆盘机调WMS获取入库终点,传输时间戳数据(暂定) |
| | | // //isFold = time.isFold, |
| | | // //packingMachineNumber = time.packingMachineNumber, |
| | | // itemCode = time.productModel, |
| | | // lotNo = time.lotNo, |
| | | // machineNo = time.packingMachineNumber1.ToString(), |
| | | // packageCode = time.bagNumber1.ToString(), |
| | | // //palletLayers = time.bagNumber1.ToString(), |
| | | // foldingbag = time.isFold1.ToString(), |
| | | // //totalWeight = time.totalWeight, |
| | | // timeStamp = int.Parse(time.TimeCuo), |
| | | // //productType = time.productModel, |
| | | // //bagNumber = time.bagNumber, |
| | | // //needWeight = time.needWeight, |
| | | // realWeight = time.realWeight1, |
| | | // //batchNumber = time.batchNumber, |
| | | // //totalCount = time.totalCount, |
| | | // |
| | | // Jm_Item_Code = time.materialCode, |
| | | // Jm_Item_Name = time.materialName, |
| | | // Jm_Item_Model = time.productModel, |
| | | // Jm_Item_Unit = time.measurementUnit, |
| | | // Jm_Item_Staff = employee_id |
| | | // }); |
| | | //} |
| | | } |
| | | |
| | | } |