王 垚
2022-04-06 9167264eeb081fdbb94d8a1d2f76f35a6ccdd5fe
WebAPI/Controllers/¹¤×ʹÜÀí/Pay_SingleBalBillController.cs
@@ -24,18 +24,26 @@
        public DLL.ClsPay_SingleBalBill BillOld0 = new DLL.ClsPay_SingleBalBill();   //                                                                                         
        /// <summary>
        /// è¿”回工资结算个人列表
        /// è¿”回工资结算个人列表(个人)
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Pay_SingleBalBill/GetSingleBalBill")]
        [HttpGet]
        public object GetSingleBalBill(string sWhere)
        public object GetSingleBalBill(string sWhere,string user)
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Pay_SingleBalBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = Sc_GetSingleBalBill(sWhere);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
@@ -56,12 +64,12 @@
        {
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_SingleBalBillList order by æ—¥æœŸ desc", "h_v_Pay_SingleBalBillList");
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_SingleBalBillList order by hmainid desc", "h_v_Pay_SingleBalBillList");
            }
            else
            {
                string sql1 = "select * from h_v_Pay_SingleBalBillList where 1 = 1 ";
                string sql = sql1 + sWhere + "order by æ—¥æœŸ desc";
                string sql = sql1 + sWhere + " order by hmainid desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_SingleBalBillList");
            }
@@ -131,7 +139,7 @@
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string refSav = sArray[2].ToString();
            //string msg4 = sArray[3].ToString();
            string msg4 = sArray[3].ToString();
            string UserName = "";
            string s = "";
@@ -139,15 +147,15 @@
            ListModels oListModels = new ListModels();
            try
            {
                ////编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Pay_SingleBalBill_Edit", 1, true, msg4))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无保存权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Pay_SingleBalBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DLL.ClsPay_SingleBalBill oBill = new DLL.ClsPay_SingleBalBill();
                List<Models.ClsPay_SingleBalBillMain> lsmain = new List<Models.ClsPay_SingleBalBillMain>();
@@ -318,10 +326,18 @@
        /// <returns></returns>
        [Route("Pay_SingleBalBill/DeltetSingleBalBill")]
        [HttpGet]
        public object Pay_SingleBalBill(string HInterID)
        public object Pay_SingleBalBill(string HInterID,string user)
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Pay_SingleBalBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("Delete From Pay_SingleBalBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Pay_SingleBalBillSub where HInterID = " + HInterID);
@@ -366,6 +382,37 @@
                return objJsonResult;
            }
        }
        /// <summary>
        /// ç”Ÿæˆå·¥èµ„结算
        /// </summary>
        /// <param name="HBeginDate">开始日期</param>
        /// <param name="HEndDate">结束日期</param>
        /// <param name="HDeptID">部门ID</param>
        /// <returns></returns>
        [Route("Pay_SingleBalBill/GenerateSalary")]
        [HttpGet]
        public object GenerateSalary(string HBeginDate, string HEndDate,int HDeptID)
        {
            try
            {
                string sql = $"exec h_p_Gy_GenerateSalary '{HBeginDate}','{HEndDate}','{HDeptID}' ";
                oCN.RunProc(sql);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "生成成功";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //
    }
}