111
cjs
9 天以前 6fe4792f1f71389400d075b57fb613d7815b6783
ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ERPService.cs
@@ -2040,13 +2040,13 @@
        }
        internal static void senderpTaskDG(string startBit, string trayCode)
        internal static bool senderpTaskDG(string startBit, string trayCode)
        {
            try
            {
                //通过托盘号调用wms接口获取物料信息
                CMMLog.Info("SendErpTaskInfoTableDG 表 开始:" + startBit);
                CMMLog.Info("SendErpTaskInfoTableDG 表查询 开始:" + startBit);
                var url = hao.WebUrl + "GlmTrayItemSet";
                var erpInfo = MongoDBSingleton.Instance.FindOne<SendErpTaskInfoTableDG>(Query.EQ("Bit", startBit), "SendErpTaskInfoTableDG");
                if (erpInfo == null)
@@ -2072,35 +2072,46 @@
                        var wmsResponse = JsonConvert.DeserializeObject<LKInfoResModel>(feedback);
                        if (wmsResponse.Success == true)
                        {
                            materiCode = wmsResponse.Data.CN_S_MATERI_CODE;
                            materiCode = wmsResponse.Data.CN_S_ITEM_CODE;
                            lotCode = wmsResponse.Data.CN_S_LOT_NO;
                            totalWeight = wmsResponse.Data.CN_N_WEIGHT;
                            productTime = wmsResponse.Data.CN_S_Data;
                            totalWeight = (int)wmsResponse.Data.CN_F_QUANTITY * wmsResponse.Data.CN_N_CONUT;
                            productTime = wmsResponse.Data.CN_T_PRODUCTION_S;
                        }
                    }
                    CMMLog.Info("SendErpTaskInfoTableDG 表 1");
                    MongoDBSingleton.Instance.Insert<SendErpTaskInfoTableDG>(new SendErpTaskInfoTableDG
                    CMMLog.Info("SendErpTaskInfoTableDG表 1");
                    if (!string.IsNullOrEmpty(materiCode) && !string.IsNullOrEmpty(lotCode) && totalWeight != 0 && !string.IsNullOrEmpty(productTime))
                    {
                        Bit = startBit,
                        materiCode = materiCode,
                        lotCode = lotCode,
                        totalWeight = totalWeight,
                        productTime = Convert.ToDateTime(productTime).AddHours(8),
                        invalidationTime = Convert.ToDateTime(productTime).AddHours(8).AddDays(365),
                        dateTime = DateTime.Now.AddHours(8),
                        //变更注释
                        mesSucess = "0"
                    }, "SendErpTaskInfoTable");
                        MongoDBSingleton.Instance.Insert<SendErpTaskInfoTableDG>(new SendErpTaskInfoTableDG
                        {
                            Bit = startBit,
                            materiCode = materiCode,
                            lotCode = lotCode,
                            totalWeight = totalWeight,
                            productTime = Convert.ToDateTime(productTime).AddHours(8),
                            invalidationTime = Convert.ToDateTime(productTime).AddHours(8).AddDays(365),
                            dateTime = DateTime.Now.AddHours(8),
                            //变更注释
                            mesSucess = "0"
                        }, "SendErpTaskInfoTableDG");
                        return true;
                    }
                    else
                    {
                        CMMLog.Info($"SendErpTaskInfoTableDG:获取数据错误,materiCode:{materiCode},lotCode:{lotCode},totalWeight:{totalWeight},productTime:{productTime}");
                    }
                }
                CMMLog.Info("插入SendErpTaskInfoTable 表 结束");
                CMMLog.Info("插入SendErpTaskInfoTableDG表 结束");
            }
            catch (Exception ex)
            {
                CMMLog.Info("插入SendErpTaskInfoTable 表 err:" + ex.Message);
                CMMLog.Info("插入SendErpTaskInfoTableDG表 err:" + ex.Message);
            }
            return false;
        }
        internal static void SendERPTaskCompleteFuncDG()