1
duhe
2026-03-02 c3b14901031d985ef750027d4952264369a1d7b0
WebAPI/Controllers/Æ·ÖʹÜÀí/¹¤Ðò¼ìÑéµ¥/QC_ProcessCheckBillController.cs
@@ -242,6 +242,62 @@
        }
        #endregion
        #region å·¥åºæ£€éªŒå•根据源单类型获取信息-源单为取样单
        [Route("QC_ProcessCheckBill/get_TakeSampleCheckBill")]
        [HttpGet]
        public object get_TakeSampleCheckBill(string HInterID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sReturn = "";
                string sql = "";
                if (oSystemParameter.ShowBill(ref sReturn))
                {
                    switch (oSystemParameter.omodel.QC_ProcessCheckBill_QCSchemeSource)
                    {
                        case "工序":
                            sql = "exec h_p_QC_Process_GetTakeSampleCheckBillList " + "'工序','" + HInterID + "'";
                            break;
                        case "物料":
                            sql = "exec h_p_QC_Process_GetTakeSampleCheckBillList " + "'物料','" + HInterID + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_Process_GetTakeSampleCheckBillList " + "'工艺路线','" + HInterID + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_Process_GetTakeSampleCheckBillList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¥åºæ£€éªŒå• å®¡æ ¸ åå®¡æ ¸ å…³é—­ åå…³é—­ ä½œåºŸ åä½œåºŸ
        /// <summary>
        /// å·¥åºæ£€éªŒå• å®¡æ ¸ã€åå®¡æ ¸
@@ -270,7 +326,7 @@
                string sReturn = "";
                if (oSystemParameter.ShowBill(ref sReturn) == true)
                {
                    if (oSystemParameter.omodel.QC_FirstPieceCheckBill_EnableMultiLevel.ToUpper() == "Y") //系统参数  å¯ç”¨è‡ªåŠ¨å®¡æ ¸
                    if (oSystemParameter.omodel.QC_ProcessCheckBill_EnableMultiLevel.ToUpper() == "Y") //系统参数  å¯ç”¨è‡ªåŠ¨å®¡æ ¸
                    {
                        objJsonResult.code = CodeConstant.FAIL;
                        objJsonResult.count = CountConstant.FAIL;
@@ -892,6 +948,8 @@
                BillNew.omodel.HBatchNo = ClsPub.isStrNull(mainList[0].HBatchNo);
                BillNew.omodel.HTakeSampleCheckBillID = ClsPub.isLong(mainList[0].HTakeSampleCheckBillID);
                BillNew.omodel.HTakeSampleCheckBillNo = ClsPub.isStrNull(mainList[0].HTakeSampleCheckBillNo);
                BillNew.omodel.HCheckQty = ClsPub.isLong(mainList[0].HCheckQty);
                List<Model.ClsQC_ProcessCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_ProcessCheckBillSub>();
                for (int i = 0; i < subList.ToArray().Length; i++)
@@ -941,6 +999,7 @@
                        oSub.HInspectMethodID = DBUtility.ClsPub.isLong(subList[i].HInspectMethodID);//检验方法
                        oSub.HInspectBasisID = DBUtility.ClsPub.isLong(subList[i].HInspectBasisID);//检验依据
                        oSub.HCompareSymbol = DBUtility.ClsPub.isStrNull(subList[i].HCompareSymbol);//比较符
                        oSub.HInspectValQ = subList[i].HInspectValQ;
                        BillNew.DetailColl.Add(oSub);
                    }
@@ -954,12 +1013,14 @@
                    }
                }
                //保存完毕后处理
                if (OperationType.Equals("1") || OperationType.Equals("2"))
                {
                    string sAutoCheck = oSystemParameter.GetSingleSystemParameter("QC_ProcessCheckBill_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.Verify = sAutoCheck;
                    bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
                }
                else
@@ -988,6 +1049,27 @@
                //提示
                if (bResult == true)
                {
                    string sReturn = "";
                    // åŽèˆŸ ä¿å­˜æˆåŠŸåŽä¸‹æŽ¨å·¥ä½œè”ç³»å•
                    if (oSystemParameter.ShowBill(ref sReturn) == true)
                    {
                        if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                        {
                            //自动生成工作联系单
                            var ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + BillOld.omodel.HInterID + "," + 7520, "h_p_OA_WorkLinkBill_Create");
                            if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
                            {
                                int HInterID = int.Parse(ds2.Tables[0].Rows[0]["NewHInterID"].ToString());
                                LogService.Write("执行消息推送..." + HInterID);
                                // è§¦å‘消息推送
                                Service.GeTuiService.PubishSingle(HInterID);
                            }
                        }
                    }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = ClsPub.sExeReturnInfo+"单据号:" + mainList[0].HBillNo.Trim();