销售订单执行汇总表 报表的 存储过程编写。
销售毛利估算分析表 报表的 存储过程编写。
销售出库汇总表 报表的 存储过程编写。
客户发货及时率表 报表的 存储过程编写。
1个文件已修改
1个文件已添加
197 ■■■■■ 已修改文件
WebAPI/Controllers/XSGL/Xs_SeReportController.cs 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/XSGL/Xs_SeReportController.cs
New file
@@ -0,0 +1,196 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    //销售报表Controller
    public class Xs_SeReportController : ApiController
    {
        //销售报表
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region 销售毛利估算分析报表 查询
        /// <summary>
        /// 返回项目阶段列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xs_SeReport/Xs_SeOrderBillProfitReportList")]
        [HttpGet]
        public object Xs_SeOrderBillProfitReportList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec  h_p_Xs_SeOrderBillProfitReport   '" + sWhere + "',''", "h_p_Xs_SeOrderBillProfitReport");
                //添加列名
                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 = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 销售出库汇总报表 查询
        /// <summary>
        /// 返回项目阶段列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xs_SeReport/Xs_SellOutStockSumReportList")]
        [HttpGet]
        public object Xs_SellOutStockSumReportList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec  h_p_Xs_SellOutStockSumReport   '" + sWhere + "',''  ", "h_p_Xs_SellOutStockSumReport");
                //添加列名
                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 = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 销售订单执行汇总报表 查询
        /// <summary>
        /// 返回项目阶段列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xs_SeReport/Xs_SeOrderBillProcessSumReportList")]
        [HttpGet]
        public object Xs_SeOrderBillProcessSumReportList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec  h_p_Xs_SeOrderBillProcessSumReport    '" + sWhere + "','',''", "h_p_Xs_SeOrderBillProcessSumReport");
                //添加列名
                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 = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 客户发货及时率报表 查询
        /// <summary>
        /// 返回项目阶段列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xs_SeReport/Xs_SeOrderSendDaySumReportList")]
        [HttpGet]
        public object Xs_SeOrderSendDaySumReportList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec  h_p_Xs_SeOrderSendDaySumReport    '" + sWhere + "','',''", "h_p_Xs_SeOrderSendDaySumReport");
                //添加列名
                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 = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/WebAPI.csproj
@@ -483,6 +483,7 @@
    <Compile Include="Controllers\CGGL\YF_PayMentBillController.cs" />
    <Compile Include="Controllers\XSGL\YS_ReceiveBackBillController.cs" />
    <Compile Include="Controllers\CGGL\YF_PayMentOtherBillController.cs" />
    <Compile Include="Controllers\XSGL\Xs_SeReportController.cs" />
    <Compile Include="Controllers\XSGL\YS_ReceiveOtherBillController.cs" />
    <Compile Include="Controllers\XSGL\YS_ReceiveBillController.cs" />
    <Compile Include="Controllers\XSGL\Kf_SellOutBillController.cs" />