1
zrg
2 天以前 c4c02944532a9bfda6de9a0cd85a9dfa631ed003
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -570,6 +570,7 @@
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg2;
                    oBill.oModel = oItem;
                }
                //保存
@@ -1120,11 +1121,11 @@
        [HttpGet]
        public object DeltetGy_Material(string HItemID, string user)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            oCN.BeginTran();//开始事务
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (user == "10000")//api同步方式
                {
                    oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID);
@@ -1152,7 +1153,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
@@ -1386,7 +1387,49 @@
        }
        #endregion
        #region 获取当前公司名
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Xt_getInfo/getCompanyName")]
        [HttpGet]
        public object getCompanyName()
        {
            try
            {
                string sErr = "";
                if(oSystemParameter.ShowBill(ref sErr))
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = oSystemParameter.omodel.WMS_CampanyName;
                    objJsonResult.data = oSystemParameter.omodel.WMS_CampanyName;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当前公司名获取失败!" ;
                    objJsonResult.data = null;
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        /// <summary>
@@ -1705,7 +1748,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.Message = "[0000-1-058]无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -1716,7 +1759,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "删除条码前判断发生错误!";
                    objJsonResult.Message = "[3899-1-001]删除条码前判断发生错误!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -1726,9 +1769,9 @@
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
                        objJsonResult.Message = "[0000-1-007]" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                        return objJsonResult;
                    }
                }
                //Int64 lngBillKey = 0;
@@ -1737,7 +1780,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据ID为空!";
                    objJsonResult.Message = "[0000-1-009]单据ID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -1782,7 +1825,7 @@
                    oCN.Commit();
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除成功";
                    objJsonResult.Message = "[0000-1-008]删除成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -1790,7 +1833,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据未找到";
                    objJsonResult.Message = "[0000-1-045]单据未找到";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -1800,7 +1843,7 @@
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message;
                objJsonResult.Message = "[0000-1-007]" + e.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
@@ -1827,7 +1870,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "作废失败!无权限!";
                    objJsonResult.Message = "[0000-1-063]作废失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -1836,7 +1879,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.Message = "[0000-1-009]HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -1864,7 +1907,7 @@
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "作废成功";
                        objJsonResult.Message = "[0000-1-040]作废成功";
                        objJsonResult.data = null;
                        oCN.Commit();
@@ -1873,7 +1916,7 @@
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.Message = "[0000-1-042]作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        oCN.RollBack();
@@ -1896,7 +1939,7 @@
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反作废失败,原因:反作废条码前判断发生错误!";
                        objJsonResult.Message = "[0000-1-042]反作废失败,原因:反作废条码前判断发生错误!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
@@ -1908,7 +1951,7 @@
                            objJsonResult.code = "1";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反作废失败,原因:" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.Message = "[0000-1-042]反作废失败,原因:" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -1930,7 +1973,7 @@
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
                        objJsonResult.Message = "[0000-1-043]反作废成功";
                        objJsonResult.data = null;
                        oCN.Commit();
                        return objJsonResult;
@@ -1939,7 +1982,7 @@
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.Message = "[0000-1-042]反作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
@@ -1952,7 +1995,7 @@
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "作废失败或者反作废失败!" + e.ToString();
                objJsonResult.Message = "[0000-1-044]作废失败或者反作废失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }