duhe
2025-04-08 2925dd8e5456fab545751ff6941a15de66b2ba42
WebAPI/Controllers/SBGL/SB_EquipICMOTechParamBillController.cs
@@ -86,6 +86,59 @@
        }
        #endregion
        #region 设备工艺参数分页查询
        [Route("SB_EquipICMOTechParamBillController/GetSB_EquipICMOTechParamBillList_Page")]
        [HttpGet]
        public object GetSB_EquipICMOTechParamBillList_Page(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameList, 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCn.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillListPage " + page + "," + size + ",''", "h_p_SB_EquipICMOTechParamBillListPage");
                }
                else
                {
                    ds = oCn.RunProcReturn("exec h_p_SB_EquipICMOTechParamBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_SB_EquipICMOTechParamBillListPage");
                }
                //添加列名
                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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备工艺参数订单点检表删除
        /// <summary>
        /// 删除设备工艺参数订单点检表
@@ -409,23 +462,47 @@
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //关闭单据
                        if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
                        string sql = "";
                        //关闭前控制===============================================Begin===================================================================
                        sql = "exec h_p_Sb_EquipICMOTechParamBill_BeforeCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'";
                        ds = oCn.RunProcReturn(sql, "h_p_Sb_EquipICMOTechParamBill_BeforeCloseCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "关闭失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.Message = "关闭失败!原因:关闭前前判断失败,无返回信息,请与网络管理人员联系";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //关闭前控制===============================================End===================================================================
                        //关闭提交
                        if (oBill.CloseBill(Convert.ToInt32(HInterID), oBill.omodel.HBillNo, "h_p_Sb_EquipICMOTechParamBill_AfterCloseCtrl", HMaker, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                        {
                            objJsonResult.code = "1";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "关闭成功";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "单据号:" + oBill.omodel.HBillNo + " 关闭成功!";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                            return objJsonResult;
                        }
                    }
                    else
                    {
@@ -437,23 +514,47 @@
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反关闭单据
                        if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, HMaker, ref ClsPub.sExeReturnInfo))
                        string sql = "";
                        //反关闭前控制===============================================Begin===================================================================
                        sql = "exec h_p_Sb_EquipICMOTechParamBill_BeforeUnCloseCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'";
                        ds = oCn.RunProcReturn(sql, "h_p_Sb_EquipICMOTechParamBill_BeforeUnCloseCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反关闭失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.Message = "反关闭失败!原因:反关闭前前判断失败,无返回信息,请与网络管理人员联系";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反关闭前控制===============================================End===================================================================
                        //反关闭提交
                        if (oBill.CancelClose(Convert.ToInt32(HInterID), oBill.omodel.HBillNo, "h_p_Sb_EquipICMOTechParamBill_AfterUnCloseCtrl", HMaker, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                        {
                            objJsonResult.code = "1";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反关闭成功";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "单据号:" + oBill.omodel.HBillNo + " 反关闭成功!";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                            return objJsonResult;
                        }
                    }
                }
                else
@@ -667,7 +768,7 @@
                {
                    BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
                    //判断新增权限
                    if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HMaker))
                    if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, HMaker))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;