| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 打包下线口到成品货架口——直接查询下线口通道内数据(四钴车间) |
| | | /// </summary> |
| | | /// <param name="timeStamp">时间戳</param> |
| | | /// <returns></returns> |
| | | internal static TimeCuoInfoComTwo TimeCuoTwo(int[] result) |
| | | { |
| | | //时间戳 地址读配置文件 |
| | | string FCWeightTotal = GetTrayCode(result.Skip(96).Take(2).ToArray());//总复称重量 |
| | | string timeCuo = GetTrayCode(result.Skip(98).Take(2).ToArray());//时间戳 |
| | | var timeCuoInfo = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("TimeCuo", timeCuo), "TimeCuoInfoComTwo"); |
| | | if(timeCuoInfo == null) |
| | | { |
| | | MongoDBSingleton.Instance.Insert<TimeCuoInfoComTwo>(new TimeCuoInfoComTwo() { TimeCuo = timeCuo,FCWeightTotal = FCWeightTotal }); |
| | | } |
| | | |
| | | var infoPack = MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.And(Query.EQ("TimeCuo", timeCuo)), "TimeCuoInfoComTwo"); |
| | | if(infoPack != null) |
| | | { |
| | | for (int i = 1; i <= 4; i++) |
| | | { |
| | | string empCode = RemoveNull(GetTrayCode(result.Skip((i - 1) * 24).Take(5).ToArray()));//员工编码 |
| | | string trayCode = RemoveNull(GetTrayCode(result.Skip((i - 1) * 24 + 5).Take(3).ToArray()));//托盘码 |
| | | string machineCode = RemoveNull(GetTrayCode(result.Skip((i - 1) * 24 + 8).Take(1).ToArray()));//包装机号 |
| | | int needWeight = Convert.ToInt32(Completion(result[((i - 1) * 24 + 9)]) + Completion(result[((i - 1) * 24 + 10)]), 2);//产品需求重量 |
| | | int oneWeight = Convert.ToInt32(Completion(result[((i - 1) * 24 + 11)]) + Completion(result[((i - 1) * 24 + 12)]), 2);//单托毛重 |
| | | int readWeight = Convert.ToInt32(Completion(result[((i - 1) * 24 + 13)]) + Completion(result[((i - 1) * 24 + 14)]), 2);//单托净重 |
| | | int fcWeight = Convert.ToInt32(Completion(result[((i - 1) * 24 + 15)]) + Completion(result[((i - 1) * 24 + 16)]), 2);//单托复称重量 |
| | | int trayType = Convert.ToInt32(Completion(result[((i - 1) * 24 + 17)]), 2);//托盘类型 |
| | | int addState = Convert.ToInt32(Completion(result[((i - 1) * 24 + 18)]), 2);//叠包层数 |
| | | int bagNumber = Convert.ToInt32(Completion(result[((i - 1) * 24 + 19)]), 2);//袋号 |
| | | 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); |
| | | MongoDBSingleton.Instance.Update<TimeCuoInfoComTwo>(Query.EQ("TimeCuo", timeCuo), updateBuilder, UpdateFlags.None); |
| | | } |
| | | //产品批次号 产品型号 物料名称 计量单位均可在erp表中根据物料编码获取 |
| | | |
| | | string materialCode = RemoveNull(GetTrayCode(result.Skip(130).Take(15).ToArray()).Trim().ToString()); |
| | | UpdateBuilder update = Update.Set("materialCode", materialCode); |
| | | MongoDBSingleton.Instance.Update<TimeCuoInfoComTwo>(Query.EQ("TimeCuo", timeCuo), update, UpdateFlags.None); |
| | | } |
| | | |
| | | return MongoDBSingleton.Instance.FindOne<TimeCuoInfoComTwo>(Query.EQ("TimeCuo", timeCuo), "TimeCuoInfoComTwo"); |
| | | } |
| | | |
| | | public static string TransUTF8(string text) |
| | | { |
| | |
| | | /// 设备通道数据2——单托实际重量:32位整数 |
| | | /// </summary> |
| | | public string oneTrayWeight { get; set; } = "0"; |
| | | /// <summary> |
| | | /// 设备通道数据2——复称毛重:32位整数 |
| | | /// </summary> |
| | | public string oneTrayWeightFC { get; set; } = "0,0"; |
| | | /// <summary> |
| | | /// 设备通道数据2——托盘类型:32位整数 |
| | | /// </summary> |
| | |
| | | /// <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> |