| | |
| | | { |
| | | if (req.isSuccess) |
| | | { |
| | | var timeCuo = MongoDBSingleton.Instance.FindOne<TimeCuoInfoCom>(Query.EQ("packingMachineNumber", models.machineNo), "TimeCuoInfoCom"); |
| | | var timeCuo = MongoDBSingleton.Instance.FindOne<TimeCuoInfoCom>(Query.EQ("timeStampMES", req.data.mesCode), "TimeCuoInfoCom"); |
| | | if (timeCuo == null) |
| | | { |
| | | MongoDBSingleton.Instance.Insert<TimeCuoInfoCom>(new TimeCuoInfoCom |
| | |
| | | //变更注释 |
| | | totalNeedWeight = (int)req.data.FMustQty, |
| | | FEntryID_1 = 0, |
| | | orderCode = "" |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | var query = Query.EQ("packingMachineNumber", models.machineNo); |
| | | var query = Query.EQ("timeStampMES", req.data.mesCode); |
| | | //变更注释 |
| | | UpdateBuilder update = Update.Set("isFold", 1).Set("packingMachineNumber", models.machineNo).Set("needWeight", (int)req.data.FMustQty) |
| | | .Set("realWeight", (int)req.data.FMustQty).Set("totalWeight", (int)req.data.FMustQty).Set("batchNumber", req.data.Flot) |
| | |
| | | //上报条码表 |
| | | CMMLog.Info($"INSERT INTO T_JY_BARCODESync (FBarCode, FBarCodeRule,FMaterialNumber,FCreateOrgNumber,FLot,FUnit,FQty,FStockNumber,FDept,FBillDate,F_JY_CZZ,FOpStatus) VALUES ('{req.data.barCode}','01','{req.data.materialName}','02','{req.data.Flot}','{req.data.FUnit}','{req.data.FMustQty}','CK020','BM000161','{req.data.ywDate}','{req.data.jycjj}','0')"); |
| | | new SqlHelper<object>().ExecuteSql($" INSERT INTO T_JY_BARCODESync (FBarCode, FBarCodeRule,FMaterialNumber,FCreateOrgNumber,FLot,FUnit,FQty,FStockNumber,FDept,FBillDate,F_JY_CZZ,FOpStatus) VALUES ('{req.data.barCode}','01','{req.data.materialName}','02','{req.data.Flot}','{req.data.FUnit}','{req.data.FMustQty}','CK020','BM000161','{req.data.ywDate}','{req.data.jycjj}','0')", false); |
| | | //var plc = Settings.GetPlcInfo().Where(b => b.location == models.machineNo && b.enable == 1).First(); |
| | | //if(plc != null) |
| | | //{ |
| | | // var wirteall01 = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel |
| | | // { |
| | | // addr = plc.writeAddr, |
| | | // host = plc.ip, |
| | | // port = plc.port, |
| | | // data = 4 |
| | | // }); |
| | | //} |
| | | |
| | | var plc = Settings.GetPlcInfo().Where(b => b.location == models.machineNo && b.enable == 1).First(); |
| | | if(plc != null) |
| | | { |
| | | var wirteall01 = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel |
| | | { |
| | | addr = plc.writeAddr, |
| | | host = plc.ip, |
| | | port = plc.port, |
| | | data = 4 |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | else CMMLog.Debug("打包下线口接驳位点位未配置"); |
| | |
| | | { |
| | | result.errMsg = req.msg; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |