沈泽
2021-11-16 d7b5be548fa11bb06aa98c5c9fb43c9702646298
新增采购入库单,销售订单
4个文件已修改
1个文件已添加
285 ■■■■ 已修改文件
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs
@@ -234,6 +234,36 @@
                return objJsonResult;
            }
        }
        /// <summary>
        ///删除功能
        /// </summary>
        /// <returns></returns>
        [Route("Cg_POInStockBill/DeltetPOInStockBill")]
        [HttpGet]
        public object DeltetPOInStockBill(string HInterID)
        {
            try
            {
                oCN.BeginTran();
                oCN.RunProc("Delete From Cg_POInStockBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Cg_POInStockBillSub where HInterID = " + HInterID);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //
WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
New file
@@ -0,0 +1,112 @@
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 Kf_POStockInBillController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        /// <summary>
        /// 根据基础资料ID 查找记录
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Kf_POStockInBill/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where HitemID=" + HInterID, "h_v_Kf_POStockInBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    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;
            }
        }
        /// <summary>
        /// 返回收料通知单列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Kf_POStockInBill/list")]
        [HttpGet]
        public object list(string sWhere)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList " + sWhere, "h_v_Kf_POStockInBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_Kf_POStockInBillList where 1 = 1 ";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Kf_POStockInBillList");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    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;
            }
        }
        //
    }
}
WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
@@ -988,44 +988,44 @@
        #endregion
        /// <summary>
        /// 采购入库单列表
        /// </summary>
        /// <returns></returns>
        [Route("Kf_POStockInBill/GetPOStockInBill")]
        [HttpGet]
        public object GetPOStockInBill(string sWhere)
        {
            try
            {
        ///// <summary>
        ///// 采购入库单列表
        ///// </summary>
        ///// <returns></returns>
        //[Route("Kf_POStockInBill/GetPOStockInBill")]
        //[HttpGet]
        //public object GetPOStockInBill(string sWhere)
        //{
        //    try
        //    {
                ds = Sc_GetPOStockInBill(sWhere);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //        ds = Sc_GetPOStockInBill(sWhere);
        //        if (ds == null || ds.Tables[0].Rows.Count <= 0)
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "没有返回任何记录!";
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        else
        //        {
        //            objJsonResult.code = "1";
        //            objJsonResult.count = 1;
        //            objJsonResult.Message = "返回记录成功!";
        //            objJsonResult.data = ds.Tables[0];
        //            return objJsonResult;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        #region sql语句
WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -19,7 +19,45 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        /// <summary>
        /// 根据基础资料ID 查找记录
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xs_SeOrderBill/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_IF_SeOrderBillList where HitemID=" + HInterID, "h_v_IF_SeOrderBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    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;
            }
        }
        /// <summary>
        /// 返回销售订单列表
        ///参数:string sql。
@@ -68,6 +106,36 @@
            }
        }
        /// <summary>
        ///删除功能
        /// </summary>
        /// <returns></returns>
        [Route("Xs_SeOrderBill/DeltetSeOrderBill")]
        [HttpGet]
        public object DeltetSeOrderBill(string HInterID)
        {
            try
            {
                oCN.BeginTran();
                oCN.RunProc("Delete From Xs_SeOrderBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Xs_SeOrderBillSub where HInterID = " + HInterID);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //
WebAPI/WebAPI.csproj
@@ -319,6 +319,7 @@
    <Compile Include="Controllers\BLL\Xt_UserController.cs" />
    <Compile Include="Controllers\BLL\Xt_SystemLogController.cs" />
    <Compile Include="Controllers\CellWidthController.cs" />
    <Compile Include="Controllers\CGGL\Kf_POStockInBillController.cs" />
    <Compile Include="Controllers\CGGL\Cg_POOrderBillController.cs" />
    <Compile Include="Controllers\CGGL\WW_EntrustOrderBillController.cs" />
    <Compile Include="Controllers\CGGL\Cg_POInStockBillController.cs" />