智云SRM-WEBAPI(目前客户通用API)
王 垚
2021-12-27 915a14a8a714919fbeb97da463a66243a0374443
WebAPI/Controllers/WebAPIController.cs
@@ -1,4 +1,5 @@
using DAL;
using DBUtility;
using Microsoft.AspNet.SignalR;
using Model;
using SQLHelper;
@@ -200,7 +201,7 @@
                    return objJsonResult; ;
                }
                //===========
                oDs = oCn.RunProcReturn("select Czmm from  Gy_Czygl where Czybm='" + UserName + "'", "Gy_Czygl");
                oDs = oCn.RunProcReturn("select Czmm from  Gy_Czygl where Czymc='" + UserName + "'", "Gy_Czygl");
                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -211,7 +212,7 @@
                }
                else
                {
                    oCn.RunProc("update  Gy_Czygl set Czmm='" + DBUtility.ClsPub.StrToPsd(PassWord.Trim()) + "' where Czybm='" + UserName.Trim() + "'");
                    oCn.RunProc("update  Gy_Czygl set Czmm='" + DBUtility.ClsPub.StrToPsd(PassWord.Trim()) + "' where Czymc='" + UserName.Trim() + "'");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "* 密码修改成功!";
@@ -725,5 +726,49 @@
            return objJsonResult; ;
        }
        #region [公告数据查询]
        [Route("MsgData")]
        [HttpGet]
        public object MsgData(string sWhere)
        {
            ClsCNSRM oCn = new ClsCNSRM();
            DataSet oDs = new DataSet();
            var sql = "select A.HInterID,b.HEntryID,A.HContext,A.HDeptID,D.HName HDeptName, A.HSendMan, B.HReceiveMan,A.HLevel,A.HDescription,case when B.HReadFlag=0 then '未阅' when B.HReadFlag=1 then '已阅' end HReadFlag,A.HDate" +
                " from OA_InformBillMain A inner join  OA_InformBillSub B on A.HInterID=B.HInterID left join Gy_Department D on A.HDeptID=D.HItemID where 1=1 " + sWhere;
            oDs = oCn.RunProcReturn(sql, "OA_InformBillMain");
            if (oDs.Tables[0].Rows.Count > 0)
            {
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回数据成功!";
                objJsonResult.data = oDs;
            }
            else {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回数据失败!";
                objJsonResult.data = oDs;
            }
            return objJsonResult; ;
        }
        #endregion
        #region[更改公告状态]
        [Route("UpdateMessage")]
        [HttpGet]
        public object UpdateMessage(string UserName, string HInterID,string HEntryID)
        {
            ClsCNSRM oCn = new ClsCNSRM();
            oCn.BeginTran();
            oCn.RunProc("Update OA_InformBillSub set HReadFlag=1 HUpDater='"+ UserName + "',HUpDateDate=getdate() where HInterID='" + HInterID + "' and HEntryID='"+ HEntryID + "'", ref ClsPub.sExeReturnInfo);
            oCn.Commit();
            objjson.code = "1";
            objjson.count = 1;
            objjson.Message =ClsPub.sExeReturnInfo;
            objjson.data = null;
            return objjson;;
        }
        #endregion
    }
}