yusijie
2022-11-25 494c68c9ad1cc3b085c27e87865269c4593c24e8
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -1,9 +1,11 @@
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections.Generic;
using System.Data;
using System.Web.Http;
using ViewAPI;
using WebAPI.Models;
namespace WebAPI.Controllers
{
@@ -187,6 +189,8 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -197,22 +201,31 @@
                }
                ds = Sc_MouldMaintainBillList_s(sWhere);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -231,12 +244,12 @@
        {
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn("select *  from h_v_Sc_MouldMaintain order by 日期 desc", "h_v_Sc_MouldMaintain");
                return new SQLHelper.ClsCN().RunProcReturn("select *  from h_v_Sc_MouldMaintain order by hmainid desc", "h_v_Sc_MouldMaintain");
            }
            else
            {
                string sql1 = "select * from h_v_Sc_MouldMaintain 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_Sc_MouldMaintain");
            }
@@ -266,22 +279,23 @@
                }
                ds = Sc_MouldDotCheckPlanBillList_s(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;
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -298,7 +312,7 @@
        public static DataSet Sc_MouldDotCheckPlanBillList_s(string sWhere)
        {
            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckPlanBillList order by 日期 desc", "h_v_Sc_MouldDotCheckPlanBillList");
            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckPlanBillList where 1=1 "+sWhere+ " order by hmainid desc", "h_v_Sc_MouldDotCheckPlanBillList");
        }
        #endregion
@@ -312,6 +326,7 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -321,22 +336,33 @@
                    return objJsonResult;
                }
                ds = Sc_MouldDotCheckBillList_s(sWhere);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -353,7 +379,7 @@
        public static DataSet Sc_MouldDotCheckBillList_s(string sWhere)
        {
            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckBillList where 1=1 " + sWhere + "order by 日期 desc", "h_v_Sc_MouldDotCheckBillList");
            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckBillList where 1=1 " + sWhere + "order by hmainid desc", "h_v_Sc_MouldDotCheckBillList");
        }
        #endregion
@@ -427,22 +453,23 @@
                }
                ds = Sc_MouldMaintainPlanBillList_s(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;
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -459,7 +486,7 @@
        public static DataSet Sc_MouldMaintainPlanBillList_s(string sWhere)
        {
            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainPlanBillList where 1=1 "+sWhere+" order by 日期 desc", "h_v_Sc_MouldMaintainPlanBillList");
            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainPlanBillList where 1=1 "+sWhere+ " order by hmainid desc", "h_v_Sc_MouldMaintainPlanBillList");
        }
        #endregion
@@ -474,6 +501,7 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -484,10 +512,20 @@
                }
                ds = Sc_MouldConkBookBillList_s(sWhere);
                //添加列名
                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 ex)
@@ -508,7 +546,7 @@
            DataSet ds;
            if (sWhere == null || sWhere.Equals(""))
            {
                ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList order by 日期 desc" + sWhere, "h_v_Sc_MouldConkBookBillList");
                ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList where 1=1 " + sWhere+ " order by hmainid desc", "h_v_Sc_MouldConkBookBillList");
            }
            else
            {
@@ -542,6 +580,7 @@
                }
                ds = Sc_MouldRepairCheckBillList_s(sWhere);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
@@ -567,12 +606,12 @@
            DataSet ds;
            if (sWhere == null || sWhere.Equals(""))
            {
                ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairCheckBillList_Edit order by 日期 desc" + sWhere, "h_v_Sc_MouldRepairCheckBillList_Edit");
                ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairCheckBillList_Edit where 1=1" + sWhere+ " order by hmainid desc", "h_v_Sc_MouldRepairCheckBillList_Edit");
            }
            else
            {
                string sql1 = "select * from h_v_Sc_MouldRepairCheckBillList_Edit where 1 = 1 ";
                string sql = sql1 + sWhere + "order by 日期 desc";
                string sql = sql1 + sWhere + "order by hmainid desc";
                ds = new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairCheckBillList_Edit");
            }
            return ds;
@@ -647,6 +686,7 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -657,22 +697,32 @@
                }
                ds = Sc_MouldRepairWorkBillList_s(sWhere);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -691,12 +741,12 @@
        {
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairWorkBillList order by 日期 desc" + sWhere, "h_v_Sc_MouldRepairWorkBillList");
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairWorkBillList where 1=1 " + sWhere+ " order by hmainid desc", "h_v_Sc_MouldRepairWorkBillList");
            }
            else
            {
                string sql1 = "select * from h_v_Sc_MouldRepairWorkBillList 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_Sc_MouldRepairWorkBillList");
            }
        }
@@ -807,35 +857,36 @@
        /// <returns></returns>
        [Route("Kf_MoveStockBill/GetMoveStockBillList")]
        [HttpGet]
        public object GetMoveStockBillList(string sWhere)
        public object GetMoveStockBillList(string sWhere,string user)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_MoveStockBillList order by 日期 desc", "h_v_IF_MoveStockBillList");
                }
                else
                {
                    string sql = "select * from h_v_IF_MoveStockBillList where 1=1 " + sWhere+ "order by 日期 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_MoveStockBillList");
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBillQuery", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.Message = "无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_MoveStockBillList order by hmainid desc", "h_v_IF_MoveStockBillList");
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                    string sql = "select * from h_v_IF_MoveStockBillList where 1=1 " + sWhere+ "order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_MoveStockBillList");
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception ex)
            {
@@ -847,34 +898,84 @@
            }
        }
        #region 调拨单  删除
        [Route("Kf_MoveStockBill/DelteteGetMoveStockBill")]
        [HttpGet]
        public object DelteteGetMoveStockBill(string HInterID, string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Kf_ICStockBillSub 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;
            }
        }
        #endregion
        /// <summary>
        /// 销售出库单列表
        /// </summary>
        /// <returns></returns>
        [Route("Kf_SellOutBill/GetSellOutBillList")]
        [HttpGet]
        public object GetSellOutBillList(string sWhere)
        public object GetSellOutBillList(string sWhere,string user)
        {
            try
            {
                ds = Sc_GetSellOutBillList(sWhere);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBillQuery", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.Message = "没有查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                ds = Sc_GetSellOutBillList(sWhere);
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -891,10 +992,20 @@
        /// <returns></returns>
        [Route("Kf_SellOutBill/DeltetSellOutBill")]
        [HttpGet]
        public object DeltetSeOutStockBackBill(string HInterID)
        public object DeltetSeOutStockBackBill(string HInterID,string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
@@ -920,7 +1031,14 @@
        public static DataSet Sc_GetSellOutBillList(string sWhere)
        {
            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_SellOutBillList order by 日期 desc", "h_v_IF_SellOutBillList");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_SellOutBillList order by hmainid desc", "h_v_IF_SellOutBillList");
            }
            else
            {
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_SellOutBillList where 1=1 " + sWhere + " order by hmainid desc", "h_v_IF_SellOutBillList");
            }
        }
        #endregion
@@ -931,36 +1049,46 @@
        /// <returns></returns>
        [Route("Kf_OtherOutBill/GetOtherOutBillList")]
        [HttpGet]
        public object GetOtherOutBillList(string sWhere)
        public object GetOtherOutBillList(string sWhere,string user)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherOutBillList where 1=1 order by 日期 desc", "h_v_Kf_OtherOutBillList");
                }
                else
                {
                    string sql = "select * from h_v_Kf_OtherOutBillList where 1 = 1 " + sWhere+ " order by 日期 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherOutBillList");
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBillQuery", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.Message = "无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherOutBillList where 1=1 order by hmainid desc", "h_v_Kf_OtherOutBillList");
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                    string sql = "select * from h_v_Kf_OtherOutBillList where 1 = 1 " + sWhere+ " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherOutBillList");
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -972,6 +1100,44 @@
            }
        }
        #region 其他出库单  删除
        [Route("Kf_OtherOutBill/DelteteGetOtherOutBill")]
        [HttpGet]
        public object DelteteGetOtherOutBill(string HInterID, string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Kf_ICStockBillSub 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;
            }
        }
        #endregion
        /// <summary>
        /// 委外出库单列表
@@ -1078,36 +1244,38 @@
        /// <returns></returns>
        [Route("Kf_ProductInBill/GetProductInBill")]
        [HttpGet]
        public object GetProductInBill(string sWhere)
        public object GetProductInBill(string sWhere,string user)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_ProductInBillList where 1=1  order by 日期 desc", "h_v_IF_ProductInBillList");
                }
                else
                {
                    string sql = "select * from h_v_IF_ProductInBillList where 1 = 1 " + sWhere + " order by 日期 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_ProductInBillList");
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Kf_ProductInBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.Message = "无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_ProductInBillList where 1=1  order by hmainid desc", "h_v_IF_ProductInBillList");
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                    string sql = "select * from h_v_IF_ProductInBillList where 1 = 1 " + sWhere + " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_ProductInBillList");
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception ex)
            {
@@ -1118,7 +1286,37 @@
                return objJsonResult;
            }
        }
        #region 条码明细
        [Route("Kf_ICStockBillSub_WMS/Kf_ICStockBillSub_WMS_List")]
        [HttpGet]
        public object Kf_ICStockBillSub_WMS_List(string sWhere, string user)
        {
            try
            {
                ds = oCN.RunProcReturn(@"Select m.HNumber 物料代码,m.HName 物料名称,m.HModel 规格型号
                                    ,wms.HBarCode 条码,wms.HQty 数量,w.HNumber 仓库代码,w.HName 仓库名称 from Kf_ICStockBillSub_WMS wms
                                    left join h_v_IF_Material m on wms.HMaterID = m.HItemID
                                    left join h_v_IF_Warehouse w on wms.HWhID = w.HItemID where 1=1 "+ sWhere, "Kf_ICStockBillSub_WMS");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                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;
            }
        }
        #endregion
        /// <summary>
        ///产品入库单删除功能
        /// </summary>
@@ -1158,36 +1356,46 @@
        /// <returns></returns>
        [Route("Kf_OtherInBill/GetOtherInBill")]
        [HttpGet]
        public object GetOtherInBill(string sWhere)
        public object GetOtherInBill(string sWhere,string user)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherInBillList where 1=1  order by 日期 desc", "h_v_Kf_OtherInBillList");
                }
                else
                {
                    string sql = "select * from h_v_Kf_OtherInBillList where 1 = 1 " + sWhere+ " order by 日期 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherInBillList");
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Kf_OtherInBillQuery", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.Message = "无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherInBillList where 1=1  order by hmainid desc", "h_v_Kf_OtherInBillList");
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                    string sql = "select * from h_v_Kf_OtherInBillList where 1 = 1 " + sWhere+ " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherInBillList");
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -1205,35 +1413,45 @@
        /// <returns></returns>
        [Route("Kf_EntrustInBill/GetEntrustInBill")]
        [HttpGet]
        public object GetEntrustInBill(string sWhere)
        public object GetEntrustInBill(string sWhere,string user)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Kf_EntrustInBillList where 1=1", "h_v_Kf_EntrustInBillList");
                }
                else
                {
                    string sql = "select * from h_v_Kf_EntrustInBillList where 1 = 1 " + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Kf_EntrustInBillList");
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Kf_EntrustInBillQuery", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Kf_EntrustInBillList where 1=1 order by hmainid desc", "h_v_Kf_EntrustInBillList");
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                    string sql = "select * from h_v_Kf_EntrustInBillList where 1 = 1 " + sWhere+ " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Kf_EntrustInBillList");
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -3105,7 +3323,32 @@
            return objJsonResult;
        }
        #endregion
        #region[模具点检记录表选择点检计划带出表格数据]
        [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckSubBillListByPlan")]
        [HttpGet]
        public object Sc_MouldDotCheckSubBillListByPlan(string HPlanInterID)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql1 = "select hsubid HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckPlanBillList where hmainid =" + HPlanInterID;
                ds = oCN.RunProcReturn(sql1, "h_v_Sc_MouldDotCheckPlanBillList");
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取信息成功!";
                objJsonResult.data = ds.Tables[0];
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
        #region [模具点检记录表删除功能]
        /// <summary>
        /// 模具点检记录删除功能
@@ -3710,15 +3953,19 @@
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ");
                    oCn.RunProc(sql);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改成功
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  1,{oBill.omodel.HInterID.ToString()},' ' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                }
                if (bResult)
                {
                    string sql = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ";
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
@@ -3905,6 +4152,7 @@
                }
                ds = Sc_GetMouldScrapOutHouseBill(sWhere, Organization);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
@@ -3926,11 +4174,11 @@
            string sql1 = string.Format(@"select * from h_v_Sc_MouldScrapOutHouseBillList where 库存组织='" + Organization + "'");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldScrapOutHouseBillList");
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + " order by 制单日期 desc", "h_v_Sc_MouldScrapOutHouseBillList");
            }
            else
            {
                string sql = sql1 + sWhere + "order by 制单日期 desc";
                string sql = sql1 + sWhere + " order by 制单日期 desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList");
            }
        }
@@ -4119,15 +4367,19 @@
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'out','{oBill.omodel.HInterID.ToString()}' ");
                    oCn.RunProc(sql);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改成功
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  1,{oBill.omodel.HInterID.ToString()},' ' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                }
                if (bResult)
                {
                    string sql = $"exec h_p_Sc_MouldChangeFileStatus  'out','{oBill.omodel.HInterID.ToString()}' ";
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
@@ -4204,10 +4456,21 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //删除前查找当前单据的所有器具ID
                //string swhere = "";
                //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub");
                //for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                //{
                //    swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString()+",";
                //}
                //swhere = swhere.Substring(0, swhere.Length - 1);
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    //删除成功修改器具档案位置
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  0,0,'{swhere}' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -4480,6 +4743,7 @@
                }
                ds = Sc_GetMouldProdBackBill(sWhere, Organization);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
@@ -4546,7 +4810,7 @@
                    ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo,
                                                设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, 
                                                单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID, 
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList");
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList");
                }
                else
@@ -4556,7 +4820,7 @@
                    string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo,
                                                设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, 
                                                单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID, 
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList where 1 = 1 ");
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdBackBillList where 1 = 1 ");
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList");
@@ -4694,18 +4958,21 @@
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ");
                    oCn.RunProc(sql1);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改成功
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  1,{oBill.omodel.HInterID.ToString()},' ' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                }
                if (bResult)
                {
                    string sql = $"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ";
                    string sql =string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ") ;
                    oCn.RunProc(sql);
                    string sql1 = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ";
                    oCn.RunProc(sql1);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
@@ -4782,10 +5049,21 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //删除前查找当前单据的所有器具ID
                //string swhere = "";
                //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub");
                //for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                //{
                //    swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString()+",";
                //}
                //swhere = swhere.Substring(0, swhere.Length - 1);
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    //删除成功修改器具档案位置
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  0,0,'{swhere}' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -4918,6 +5196,7 @@
                }
                ds = Sc_GetMouldProdOutBill(sWhere, Organization);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
@@ -4939,6 +5218,7 @@
            string sql1 = string.Format(@"select * from h_v_Sc_MouldProdOutHouseBillList where 库存组织='" + Organization + "'");
            if (sWhere == null || sWhere.Equals(""))
            {
                Log.LogInfo(sql1);
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldProdOutHouseBillList");
            }
            else
@@ -4984,7 +5264,7 @@
                    ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo,
                                                设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, 
                                                单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID, 
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList");
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList");
                }
                else
@@ -4994,7 +5274,7 @@
                    string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo,
                                                设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, 
                                                单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID, 
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 ");
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 ");
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList");
                }
@@ -5132,15 +5412,19 @@
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'out','{oBill.omodel.HInterID.ToString()}' ");
                    oCn.RunProc(sql);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改成功
                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  1,{oBill.omodel.HInterID.ToString()},' ' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                }
                if (bResult)
                {
                    string sql = $"exec h_p_Sc_MouldChangeFileStatus  'out','{oBill.omodel.HInterID.ToString()}' ";
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
@@ -5255,10 +5539,21 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //删除前查找当前单据的所有器具ID
                //string swhere = "";
                //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub");
                //for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                //{
                //    swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString() + ",";
                //}
                //swhere = swhere.Substring(0, swhere.Length - 1);
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    //删除成功修改器具档案位置
                    // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  0,0,'{swhere}' ");
                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
                    oCn.RunProc(sql);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -5380,6 +5675,8 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeChangeBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -5390,10 +5687,20 @@
                }
                ds = Sc_GetMouldLifeChangeBill(sWhere);
                //添加列名
                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 = "返回记录成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
@@ -5410,12 +5717,12 @@
        {
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldLifeChangeBillList order by 日期 desc", "h_v_Sc_MouldLifeChangeBillList");
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldLifeChangeBillList order by hmainid desc", "h_v_Sc_MouldLifeChangeBillList");
            }
            else
            {
                string sql1 = "select * from h_v_Sc_MouldLifeChangeBillList 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_Sc_MouldLifeChangeBillList");
            }