1
duhe
7 天以前 948a6ec49183bdc8621d8c6e184c45a3738b034b
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;
@@ -819,7 +875,23 @@
            var _value = sMainSub["sMainSub"].ToString();
            string msg1 = _value.ToString();
            //保存单据
            return objJsonResult = AddBillMain(msg1);
            objJsonResult = AddBillMain(msg1);
            JObject resultJObj = JObject.FromObject(objJsonResult);
            if (oSystemParameter.ShowBill(ref DBUtility.ClsPub.sErrInfo))
            {
                if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                {
                    resultJObj["NotShowTips"] = true;
                }
                else
                {
                    resultJObj["NotShowTips"] = false;
                }
            }
            return resultJObj;
        }
        public json AddBillMain(string msg1)
@@ -957,12 +1029,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
@@ -991,6 +1065,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();