chenhaozhe
2026-03-07 291fdb29daf239a13fcfb3f5e08a2f5bf9167534
WebAPI/Controllers/Æ·ÖʹÜÀí/Ѳ¼ìµ¥/QC_PatrolProcCheckOtherBillController.cs
@@ -7,6 +7,7 @@
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Controllers.SCGL;
using WebAPI.Models;
namespace WebAPI.Controllers
@@ -244,6 +245,7 @@
                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_PatrolProcCheckOtherBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckOtherBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_PatrolProcCheckOtherBillSub>();
                for (int i = 0; i < subList.ToArray().Length; i++)
@@ -310,6 +312,8 @@
                //保存完毕后处理
                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
@@ -337,6 +341,28 @@
                //提示
                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 + "," + 7507, "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();
@@ -1326,6 +1352,63 @@
        }
        #endregion
        #region å·¡æ£€å•根据源单类型获取信息-源单为取样单
        [Route("QC_PatrolProcCheckBill/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_PatrolProc_GetTakeSampleCheckBillList " + "'工序','" + HInterID + "'";
                            break;
                        case "物料":
                            sql = "exec h_p_QC_PatrolProc_GetTakeSampleCheckBillList " + "'物料','" + HInterID + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_PatrolProc_GetTakeSampleCheckBillList " + "'工艺路线','" + HInterID + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_PatrolProc_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  PDA巡检记录单 æŸ¥è¯¢åˆ—表
        [Route("QC_PatrolProcCheckOtherBill/QC_PatrolProcCheckOtherBillList_PDA")]
        [HttpGet]