예제 #1
0
        private string getPrintContentCode(string MFPlansId, string YBBQ)
        {
            IPQCRouteCheckHelper ipqc = new IPQCRouteCheckHelper();
            DataTable            dt   = ipqc.GetSteptInfo(MFPlansId);

            if (dt.Rows.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("{\"result\":0,\"msg\":\"获取成功\",\"data\":");

                DataRow dr = dt.Rows[0];

                IPQCCheckPrintModel model = new IPQCCheckPrintModel();

                model.ProductDescribe  = Convert.ToString(dr["ProductDescription"]);
                model.ProductShortName = Convert.ToString(dr["ProductShortName"]);

                model.POName    = Convert.ToString(dr["BillNo"]);
                model.YBBQ      = YBBQ;
                model.MOName    = Convert.ToString(dr["MOName"]);
                model.SteptName = Convert.ToString(dr["SpecificationName"]);
                PrintCodeConvert pc = new PrintCodeConvert();

                string Msg = pc.GetPrintIPQCRouteCodeConvertStr(model);
                return("{\"result\":1,\"msg\":\"" + Msg + "\"}");
            }
            else
            {
                return("{\"result\":-1,\"msg\":\"获取失败\"}");
            }
        }
예제 #2
0
        /// <summary>
        /// 根据工序ID获取信息
        /// </summary>
        /// <param name="wFSteptId"></param>
        /// <returns></returns>
        private string getStepInfo(string MFPlansId, string ScanLotSN)
        {
            if (!string.IsNullOrEmpty(ScanLotSN))
            {
                if (MFPlansId != ScanLotSN)
                {
                    return("{\"result\":-1,\"msg\":\"扫描信息与" + MFPlansId + "不匹配\"}");
                }
            }

            IPQCRouteCheckHelper ipqc = new IPQCRouteCheckHelper();

            DataTable dt = ipqc.GetSteptInfo(MFPlansId);

            if (dt.Rows.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("{\"result\":0,\"msg\":\"获取成功\",\"data\":");

                DataRow dr = dt.Rows[0];

                string XMLData = Convert.ToString(dr["XMLData"]);
                if (!string.IsNullOrEmpty(XMLData))
                {
                    string  jsonData = CommHelper.XMLToJson(XMLData);
                    JObject o        = JObject.Parse(jsonData);
                    JToken  Token    = o["IQCdata"];

                    Token["Describe"].Parent.AddAfterSelf(new JProperty("SpecificationName", Convert.ToString(dr["SpecificationName"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("WFSteptId", Convert.ToString(dr["WFSteptId"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("BillNo", Convert.ToString(dr["BillNo"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("MOName", Convert.ToString(dr["MOName"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("ProductId", Convert.ToString(dr["ProductId"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("ProductShortName", Convert.ToString(dr["ProductShortName"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("ProductName", Convert.ToString(dr["ProductName"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("ProductDescription", Convert.ToString(dr["ProductDescription"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("QCResult", Convert.ToString(dr["QCResult"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("CustomerName", Convert.ToString(dr["CustomerName"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("IsDone", Convert.ToString(dr["IsDone"])));
                    Token["Describe"].Parent.AddAfterSelf(new JProperty("MOQtyRequired", Convert.ToString(dr["MOQtyRequired"])));


                    sb.Append(CommHelper.JsonTOStr(Token));
                    sb.Append("}");
                    return(sb.ToString());
                }
                else
                {
                    string json = "{" + String.Format("\"SpecificationName\":\"{0}\",\"WFSteptId\":\"{1}\",\"BillNo\":\"{2}\","
                                                      + "\"MOName\":\"{3}\",\"ProductId\":\"{4}\",\"QCResult\":\"{5}\",\"ProductDescription\":\"{6}\",\"ProductName\":\"{7}\",\"CustomerName\":\"{8}\",\"IsDone\":\"{9}\",\"MOQtyRequired\":\"{10}\",\"ProductShortName\":\"{11}\"",
                                                      dr["SpecificationName"], dr["MFPlansEntryId"], dr["BillNo"], dr["MOName"],
                                                      dr["ProductId"], dr["QCResult"], dr["ProductDescription"], dr["ProductName"], dr["CustomerName"], Convert.ToString(dr["IsDone"]), Convert.ToString(dr["MOQtyRequired"]), dr["ProductShortName"]) + "}";
                    sb.Append(json);
                    sb.Append("}");
                    return(sb.ToString());
                }
            }
            else
            {
                return("{\"result\":-1,\"msg\":\"扫描信息不存在\"}");
            }
        }