沈泽
2021-11-19 1fec2f9ed5f7a8b1c4a6feddc585dba88ed6b3c9
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
7个文件已修改
10个文件已添加
850 ■■■■■ 已修改文件
DBUtility/基础资料/ClsGy_Base_Model.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
LMES/ClsShowMod.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_ConkReason_Model.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_ConkReasonBillController.cs 256 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSb_EquipDotCheckRuleBill.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSb_EquipDotCheckRuleBillMain.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSb_EquipDotCheckRuleBillSub.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSb_EquipMaintainRuleBillMain.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSb_EquipMaintainRuleBillSub.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSb_EquipMaintainRuleBillSub_Item.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DBUtility/»ù´¡×ÊÁÏ/ClsGy_Base_Model.cs
@@ -15,7 +15,7 @@
        public bool HStopflag;
        public string HRemark;
        public long HLevel;
        public long HParentID;
        public long HParentID=0;
        public string HModel;
        public long HUnitID;
        public string HUnitNumber;
LMES/ClsShowMod.cs
@@ -5217,6 +5217,13 @@
                        oSc_ProdWIPTotalReport.Show();
                        oMainForm.AddTabPage(oSc_ProdWIPTotalReport);
                        break;
                    case "mes_wipprocreport_wip":
                        MES_WIPProcReport_WIP oMES_WIPProcReport_WIP = new MES_WIPProcReport_WIP();
                        oMES_WIPProcReport_WIP.MdiParent = oMain;
                        oMES_WIPProcReport_WIP.ModCaption = gnmc;
                        oMES_WIPProcReport_WIP.Show();
                        oMainForm.AddTabPage(oMES_WIPProcReport_WIP);
                        break;
                    case "mes_wipprocreport":
                        MES_WIPProcReport oMES_WIPProcReport = new MES_WIPProcReport();
                        oMES_WIPProcReport.MdiParent = oMain;
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_ConkReason_Model.cs
@@ -8,5 +8,15 @@
    {
       //
        public string HExplanation;  //描述varchar(500)
        public DateTime HMakeTime;
        public string HMakeEmp;
        public int HConkTypeID;
        public string HCheckEmp;
        public DateTime HCheckTime;
        public string HModifyEmp;
        public DateTime HModifyTime;
        public string HStopEmp;
        public DateTime HStopTime;
    }
}
WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
New file
@@ -0,0 +1,185 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.SBGL
{
    public class Sb_EquipDotCheckRuleBillController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//单据状态(新增,修改,浏览,更新单价,变更)
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        public DLL.ClsSb_EquipDotCheckRuleBill BillNew = new DLL.ClsSb_EquipDotCheckRuleBill();   //对应单据类
        public DLL.ClsSb_EquipDotCheckRuleBill BillOld = new DLL.ClsSb_EquipDotCheckRuleBill();   //对应单据类
        #region è®¾å¤‡ç‚¹æ£€è§„程单列表
        [Route("Sb_EquipDotCheckRuleBill/GetEquipDotCheckRuleList")]
        [HttpGet]
        public object GetEquipDotCheckRuleList(string sWhere)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipDotCheckRuleList " + sWhere + " order by hmainid desc", "h_v_Sb_EquipDotCheckRuleList");
                }
                else
                {
                    string sql1 = "select * from h_v_Sb_EquipDotCheckRuleList where 1 = 1";
                    string sql = sql1 + sWhere + " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
                }
                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;
            }
        }
        #endregion
        #region è®¾å¤‡ç‚¹æ£€è§„程记录删除功能
        [Route("Sb_EquipDotCheckRuleBill/DeleteEquipDotCheckRuleBillList")]
        [HttpGet]
        public object DeleteEquipDotCheckRuleBillList(string HInterID)
        {
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            DLL.ClsSb_EquipDotCheckRuleBill oBill = new DLL.ClsSb_EquipDotCheckRuleBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                if (oBill.omodel.HBillStatus > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.omodel.HChecker != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据未找到";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region[设备点检规程单编辑时获取表头数据]
        [Route("Sb_EquipDotCheckRuleBill/Sb_EquipDotCheckRuleBillListCheckDetai")]
        [HttpGet]
        public ApiResult<DataSet> Sb_EquipDotCheckRuleBillListCheckDetai(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipDotCheckRuleList  where hmainid= " + HID + " ", "h_v_Sb_EquipDotCheckRuleList");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在点检规程表" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        #endregion
        #region[设备点检规程单编辑时获取表体数据]
        [Route("Sb_EquipDotCheckRuleBill/Sb_EquipDotCheckRuleBillListProjectDetai")]
        [HttpGet]
        public object Sb_EquipDotCheckRuleBillListProjectDetai(string sqlWhere)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select ç‚¹æ£€é¡¹ç›®ID,点检项目,点检部位,具体要求,负责人ID,负责人代码,负责人,子备注 from h_v_Sb_EquipDotCheckRuleList", "h_v_Sb_EquipDotCheckRuleList");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                }
                else
                {
                    string sql1 = "select ç‚¹æ£€é¡¹ç›®ID,点检项目,点检部位,具体要求,负责人ID,负责人代码,负责人,子备注 from h_v_Sb_EquipDotCheckRuleList where 1 = 1 ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
                    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
    }
}
WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
New file
@@ -0,0 +1,175 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.SBGL
{
    public class Sb_EquipMaintainRuleBillController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//单据状态(新增,修改,浏览,更新单价,变更)
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        public DLL.ClsSb_EquipMaintainRuleBill BillNew = new DLL.ClsSb_EquipMaintainRuleBill();   //对应单据类
        public DLL.ClsSb_EquipMaintainRuleBill BillOld = new DLL.ClsSb_EquipMaintainRuleBill();   //对应单据类
        #region è®¾å¤‡ä¿å…»è§„程单列表
        [Route("Sb_EquipMaintainRuleBill/GetEquipMaintainRuleList")]
        [HttpGet]
        public object GetEquipMaintainRuleList(string sWhere)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipMaintainRuleList " + sWhere + " order by hmainid desc", "h_v_Sb_EquipMaintainRuleList");
                }
                else
                {
                    string sql1 = "select * from h_v_Sb_EquipMaintainRuleList where 1 = 1";
                    string sql = sql1 + sWhere + " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainRuleList");
                }
                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;
            }
        }
        #endregion
        #region è®¾å¤‡ä¿å…»è§„程记录删除功能
        [Route("Sb_EquipMaintainRuleBill/DeleteEquipMaintainRuleBillList")]
        [HttpGet]
        public object DeleteEquipMaintainRuleBillList(string HInterID)
        {
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            DLL.ClsSb_EquipMaintainRuleBill oBill = new DLL.ClsSb_EquipMaintainRuleBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                if (oBill.omodel.HBillStatus > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.omodel.HChecker != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据未找到";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        # region è®¾å¤‡ä¿å…»è§„程记录点击主表时获取表体数据新(保养项列表、配件项列表)
        [Route("Sb_EquipMaintainRuleBill/Sb_EquipMaintainRuleBillListProjectDetaiNew")]
        [HttpGet]
        public object Sb_EquipMaintainRuleBillListProjectDetaiNew(string HInterID)
        {
            DataSet ds, ds1;
            List<object> list = new List<object>();
            string Swhere = "";
            try
            {
                if (HInterID != "" || HInterID != null)
                {
                    Swhere = " and hmainid='" + HInterID + "'";
                }
                else
                {
                    Swhere = HInterID;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //获取保养项目编辑数据
                string sql = "select ä¿å…»é¡¹ç›®ID,保养项目,保养部位,具体要求,负责人ID,负责人代码,负责人名称,子备注2 from h_v_Sb_EquipMaintainRuleList where 1 = 1 " + Swhere + "";
                ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainRuleList");
                //获取配件项目编辑数据
                string sql1 = "select é…ä»¶ID,配件代码,配件名称,单位ID,计量单位代码,计量单位名称,用量,标准用量,子备注1 from h_v_Sb_EquipMaintainRuleList where 1 = 1 " + Swhere + "";
                ds1 = oCN.RunProcReturn(sql1, "h_v_Sb_EquipMaintainRuleList");
                list.Add(ds.Tables[0]);
                list.Add(ds1.Tables[0]);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取信息成功!";
                objJsonResult.list = list;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
    }
}
WebAPI/Controllers/WebAPIController.cs
@@ -2144,21 +2144,13 @@
        /// <returns></returns>
        [Route("Sc_MouldDotCheckRuleInter/GetMouldDotCheckRuleInterList")]
        [HttpGet]
        public object GetMouldDotCheckRuleInterList(int MouldProjectID)
        public object GetMouldDotCheckRuleInterList(string sWhere)
        {
            if (MouldProjectID <= 0)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "产品器具未选择";
                objjson.data = null;
                return objjson;
            }
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = string.Format(@"select * from h_v_Sc_MouldDotCheckRuleBillList");
                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckRuleBillList");
                string sql = string.Format(@"select * from h_v_Sc_MouldDotCheckRuleBillList ");
                ds = oCN.RunProcReturn(sql+sWhere, "h_v_Sc_MouldDotCheckRuleBillList");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_ConkReasonBillController.cs
New file
@@ -0,0 +1,256 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.基础资料.基础资料
{
    public class Gy_ConkReasonBillController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//单据状态(新增,修改,浏览,更新单价,变更)
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        public Model.ClsGy_ConkReason_Model BillNew0 = new Model.ClsGy_ConkReason_Model();
        #region æ•…障原因列表
        [Route("Gy_ConkReasonBill/Get_ConkReasonBillList")]
        [HttpGet]
        public object Get_ConkReasonBillList(string sWhere)
        {
            try
            {
                ds = Sc_GetConkReasonBill(sWhere);
                if (ds == null)
                {
                    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;
            }
        }
        public static DataSet Sc_GetConkReasonBill(string sWhere)
        {
            string sql1 = string.Format(@"select * from h_v_Gy_ConkReasonList");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + sWhere + " order by hitemid desc", "h_v_Gy_ConkReasonList");
            }
            else
            {
                string sql = sql1 + sWhere + "order by hitemid desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Gy_ConkReasonList");
            }
        }
        #endregion
        #region [故障原因删除功能]
        [Route("Gy_ConkReasonBill/set_DeleteBill")]
        [HttpGet]
        public object set_DeleteBill(string HItemID)
        {
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HItemID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            ds = oCn.RunProcReturn("select * from Gy_ConkReason where HItemID=" + lngBillKey, "Gy_ConkReason");
            if (ds != null)
            {
                oCn.RunProc("Delete from Gy_ConkReason where HItemID=" + lngBillKey);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "此单据不存在,请查看是否重复删除";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region [编辑显示表头]
        [Route("Gy_ConkReasonBill/GetConkReasonByID")]
        [HttpGet]
        public object GetConkReasonByID(string HID)
        {
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            ds = oCn.RunProcReturn("select * from Gy_ConkReason where HItemID=" + lngBillKey, "Gy_ConkReason");
            if (ds != null)
            {
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "此单据不存在";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä¿å­˜æ•…障原因
        [Route("Gy_ConkReasonBill/SaveGy_ConkReason")]
        [HttpPost]
        public object SaveGy_ConkReason([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg2 = _value.ToString();
            string[] sArray = msg2.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg1 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();//当前人
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            ListModels oListModels = new ListModels();
            try
            {
                Model.ClsGy_ConkReason_Model oBill = new Model.ClsGy_ConkReason_Model();
                List<Model.ClsGy_ConkReason_Model> lsmain = new List<Model.ClsGy_ConkReason_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_ConkReason(msg1);
                foreach (Model.ClsGy_ConkReason_Model oItem in lsmain)
                {
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItem.HName.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!名称不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //得到短代码
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oBill = oItem;
                }
                //保存
                //保存完毕后处理
                if (oBill.HItemID == 0)
                {
                    oCn.RunProc("Insert into Gy_ConkReason " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HMakeEmp,HExplanation,HConkTypeID) " +
                    " Values('" + oBill.HNumber + "','" + oBill.HName + "','" + oBill.HHelpCode + "','" + oBill.HShortNumber + "'," + oBill.HParentID.ToString() +
                    "," + oBill.HLevel.ToString() + "," + Convert.ToString(oBill.HEndFlag ? 1 : 0) + "," + Convert.ToString(oBill.HStopflag ? 1 : 0) + ",'" + oBill.HRemark +
                    "','" + oBill.HUseFlag + "',getdate(),'" + msg3 + "','" + oBill.HExplanation + "',0" +
                    ")", ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改上级为非末级代码
                    oCn.RunProc("Update Gy_ConkReason set HEndflag=0 where HItemID=" + oBill.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    oCN.RunProc("UpDate Gy_ConkReason set  " +
                    " HNumber='" + oBill.HNumber + "'" +  //固定赋值===============
                    ",HName='" + oBill.HName + "'" +
                    ",HShortNumber='" + oBill.HShortNumber + "'" +
                    ",HHelpCode='" + oBill.HHelpCode + "'" +
                    ",HUseFlag='" + oBill.HUseFlag + "'" +
                    ",HRemark='" + oBill.HRemark + "'" +
                    ",HExplanation='" + oBill.HExplanation + "'" +
                    ",HModifyTime=getdate()" +
                    ",HModifyEmp='" + msg3 + "'" +
                    ",HStopflag=" + Convert.ToString(oBill.HStopflag ? 1 : 0) +
                    " where HInterID=" + oBill.HItemID.ToString());
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "修改成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/DLL/ClsSb_EquipDotCheckRuleBill.cs
New file
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.DLL
{
    public class ClsSb_EquipDotCheckRuleBill : DBUtility.ClsXt_BaseBill
    {
        public Models.ClsSb_EquipDotCheckRuleBillMain omodel = new Models.ClsSb_EquipDotCheckRuleBillMain();
        public List<Models.ClsSb_EquipDotCheckRuleBillSub> DetailColl_Mater = new List<Models.ClsSb_EquipDotCheckRuleBillSub>();
        public ClsSb_EquipDotCheckRuleBill()
        {
            base.MvarItemKeySub = "ClsSb_EquipDotCheckRuleBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "Sb_EquipDotCheckRuleBillMain";
            base.MvarReportTitle = "设备点检规程";
            base.BillType = "3913";
        }
    }
}
WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs
New file
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.DLL
{
    public class ClsSb_EquipMaintainRuleBill : DBUtility.ClsXt_BaseBill
    {
        public Models.ClsSb_EquipMaintainRuleBillMain omodel = new Models.ClsSb_EquipMaintainRuleBillMain();
        public List<Models.ClsSb_EquipMaintainRuleBillSub> DetailColl_Mater = new List<Models.ClsSb_EquipMaintainRuleBillSub>();
        public List<Models.ClsSb_EquipMaintainRuleBillSub_Item> DetailColl_Pay = new List<Models.ClsSb_EquipMaintainRuleBillSub_Item>();
        public ClsSb_EquipMaintainRuleBill()
        {
            base.MvarItemKeySub = "Sb_EquipMaintainRuleBillSub";
            base.MvarItemKeySub2 = "Sb_EquipMaintainRuleBillSub_Item";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "Sb_EquipMaintainRuleBillMain";
            base.MvarReportTitle = "设备保养规程";
            base.BillType = "3912";
        }
        #region å›ºå®šä»£ç 
        ~ClsSb_EquipMaintainRuleBill()
        {
            DetailColl_Mater = null;
            DetailColl_Pay = null;
            //DetailColl_Entrust = null;
            //DetailColl_Money = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
    }
}
WebAPI/ListModels.cs
@@ -547,6 +547,18 @@
        }
        /// <summary>
        /// å¤„理新增故障原因表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_ConkReason_Model> getObjectByJson_Gy_ConkReason(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_ConkReason_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_ConkReason_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增模具保养记录表主表的json
        /// </summary>
        /// <param name="jsonString"></param>
WebAPI/Models/ClsSb_EquipDotCheckRuleBillMain.cs
New file
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class ClsSb_EquipDotCheckRuleBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public DateTime HBeginDate;// datetime          --计划开始日期
        public DateTime HEndDate;//                    datetime    --计划结束日期
        public string HCycleUnit;//          varchar(10) --周期单位(天,月,周)
        public int HCheckCycle;// int    --点检周期
        public string HExplanation;//        varchar(500)    --摘要
        public string HInnerBillNo;//            varchar(50)   --内部单据号
    }
}
WebAPI/Models/ClsSb_EquipDotCheckRuleBillSub.cs
New file
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class ClsSb_EquipDotCheckRuleBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public int HDotCheckItemID;// int --点检项目ID
        public string HDotCheckItem;//  varchar(100)  --点检项目
        public string HDotCheckPart;//  varchar(100)  --点检部位
        public string HClaim;//      varchar(100)       --具体要求
        public int HManagerID;//  int   --负责人id(职员表)
    }
}
WebAPI/Models/ClsSb_EquipMaintainRuleBillMain.cs
New file
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class ClsSb_EquipMaintainRuleBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public string HCycleUnit;    //--周期单位(天,月,周)
        public int HCheckCycle;     //--保养周期
        public string HExplanation;   // varchar(500)   --摘要
        public string HInnerBillNo;   //varchar(50)     --内部单据号
    }
}
WebAPI/Models/ClsSb_EquipMaintainRuleBillSub.cs
New file
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class ClsSb_EquipMaintainRuleBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public string HBillNo_bak;
        public int HItemSubID;          //    --自增列(GUID)
        public int HMaterID;  //int       --配件ID
        public int HUnitID;//    int     --计量单位
        public string HQty;//       dec(18,8)       --用量
        public string HQtyMust;//    dec(18,8)     --标准用量(暂时隐藏)
    }
}
WebAPI/Models/ClsSb_EquipMaintainRuleBillSub_Item.cs
New file
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class ClsSb_EquipMaintainRuleBillSub_Item : DBUtility.ClsXt_BaseBillSub
    {
        public string HBillNo_bak;
        public int HItemSubID;          //    --自增列(GUID)
        public int HMaintainItemID;// int  --保养项目ID
        public string HMaintainItem;//  varchar(100)  --保养项目
        public string HMaintainPart;  //varchar(100)  --保养部位
        public string HClaim;//      varchar(100)       --具体要求
        public int HManagerID;//  int   --负责人id(职员表)
    }
}
WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -18,25 +18,25 @@
      <publishTime>02/22/2013 08:43:40</publishTime>
    </File>
    <File Include="bin/BLL.dll">
      <publishTime>11/16/2021 18:46:35</publishTime>
      <publishTime>11/17/2021 17:22:47</publishTime>
    </File>
    <File Include="bin/BLL.pdb">
      <publishTime>11/16/2021 18:46:35</publishTime>
      <publishTime>11/17/2021 17:22:47</publishTime>
    </File>
    <File Include="bin/DAL.dll">
      <publishTime>11/16/2021 18:46:33</publishTime>
      <publishTime>11/17/2021 17:22:44</publishTime>
    </File>
    <File Include="bin/DAL.pdb">
      <publishTime>11/16/2021 18:46:33</publishTime>
      <publishTime>11/17/2021 17:22:44</publishTime>
    </File>
    <File Include="bin/Dapper.dll">
      <publishTime>07/22/2016 14:52:40</publishTime>
    </File>
    <File Include="bin/DBUtility.dll">
      <publishTime>11/16/2021 18:46:29</publishTime>
      <publishTime>11/17/2021 17:22:38</publishTime>
    </File>
    <File Include="bin/DBUtility.pdb">
      <publishTime>11/16/2021 18:46:29</publishTime>
      <publishTime>11/17/2021 17:22:38</publishTime>
    </File>
    <File Include="bin/Interop.gregn6Lib.dll">
      <publishTime>08/25/2021 10:28:25</publishTime>
@@ -60,10 +60,10 @@
      <publishTime>07/25/2012 11:48:56</publishTime>
    </File>
    <File Include="bin/Model.dll">
      <publishTime>11/16/2021 18:46:30</publishTime>
      <publishTime>11/17/2021 17:22:39</publishTime>
    </File>
    <File Include="bin/Model.pdb">
      <publishTime>11/16/2021 18:46:30</publishTime>
      <publishTime>11/17/2021 17:22:39</publishTime>
    </File>
    <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
      <publishTime>08/16/2021 17:23:15</publishTime>
@@ -72,22 +72,22 @@
      <publishTime>08/03/2014 20:33:56</publishTime>
    </File>
    <File Include="bin/Pub_Class.dll">
      <publishTime>11/16/2021 18:46:28</publishTime>
      <publishTime>11/17/2021 17:22:36</publishTime>
    </File>
    <File Include="bin/Pub_Class.pdb">
      <publishTime>11/16/2021 18:46:28</publishTime>
      <publishTime>11/17/2021 17:22:36</publishTime>
    </File>
    <File Include="bin/Pub_Control.dll">
      <publishTime>11/16/2021 18:46:28</publishTime>
      <publishTime>11/17/2021 17:22:37</publishTime>
    </File>
    <File Include="bin/Pub_Control.pdb">
      <publishTime>11/16/2021 18:46:28</publishTime>
      <publishTime>11/17/2021 17:22:37</publishTime>
    </File>
    <File Include="bin/SQLHelper.dll">
      <publishTime>11/16/2021 18:46:29</publishTime>
      <publishTime>11/17/2021 17:22:37</publishTime>
    </File>
    <File Include="bin/SQLHelper.pdb">
      <publishTime>11/16/2021 18:46:29</publishTime>
      <publishTime>11/17/2021 17:22:37</publishTime>
    </File>
    <File Include="bin/stdole.dll">
      <publishTime>05/09/2021 13:35:37</publishTime>
@@ -189,10 +189,10 @@
      <publishTime>11/24/2014 11:18:48</publishTime>
    </File>
    <File Include="bin/WebAPI.dll">
      <publishTime>11/16/2021 18:46:38</publishTime>
      <publishTime>11/17/2021 17:22:52</publishTime>
    </File>
    <File Include="bin/WebAPI.pdb">
      <publishTime>11/16/2021 18:46:38</publishTime>
      <publishTime>11/17/2021 17:22:52</publishTime>
    </File>
    <File Include="bin/WebGrease.dll">
      <publishTime>07/17/2013 17:03:52</publishTime>
@@ -363,7 +363,7 @@
      <publishTime>08/06/2021 22:57:28</publishTime>
    </File>
    <File Include="Web.config">
      <publishTime>11/16/2021 18:46:49</publishTime>
      <publishTime>11/17/2021 17:23:18</publishTime>
    </File>
  </ItemGroup>
</Project>
WebAPI/WebAPI.csproj
@@ -357,6 +357,8 @@
    <Compile Include="Controllers\ReportPlatFormController.cs" />
    <Compile Include="Controllers\SBGL\Gy_EquipFileMainController.cs" />
    <Compile Include="Controllers\SBGL\Gy_EquipTypeController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipDotCheckRuleBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipMaintainRuleBillController.cs" />
    <Compile Include="Controllers\SCGL\Sc_MESProductReportBillController.cs" />
    <Compile Include="Controllers\Sc_MouldRepairOutBillController.cs" />
    <Compile Include="Controllers\Sc_MouldRepairInBillListController - .cs" />
@@ -389,6 +391,7 @@
    <Compile Include="Controllers\仓存管理\Kf_MateOutBillController.cs" />
    <Compile Include="Controllers\品质管理\工序检验单\QC_ProcessCheckBillController.cs" />
    <Compile Include="Controllers\品质管理\首件检验单\QC_FirstPieceCheckBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_ConkReasonBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_DotCheckBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_MaintainBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_RepairBillController.cs" />
@@ -415,6 +418,7 @@
    <Compile Include="DLL\ClsSb_EquipConkBookBill.cs" />
    <Compile Include="DLL\ClsSb_EquipDotCheckBill.cs" />
    <Compile Include="DLL\ClsSb_EquipMaintainBill.cs" />
    <Compile Include="DLL\ClsSb_EquipMaintainRuleBill.cs" />
    <Compile Include="DLL\ClsSb_EquipRepairCheckBill.cs" />
    <Compile Include="DLL\ClsSb_EquipRepairWorkBill.cs" />
    <Compile Include="DLL\ClsSc_ICMOBillWorkQtyStatus_Tmp.cs" />
@@ -446,6 +450,7 @@
    <Compile Include="DLL\ClsWW_EntrustProcessReportBill.cs" />
    <Compile Include="DLL\ClsWW_EntrustProcessSendOutBill.cs" />
    <Compile Include="DLL\ClsWW_EntrustWorkOrderBill.cs" />
    <Compile Include="DLL\ClsSb_EquipDotCheckRuleBill.cs" />
    <Compile Include="LogService.cs" />
    <Compile Include="Models\ApiConfig.cs" />
    <Compile Include="Models\ApiResult.cs" />
@@ -462,6 +467,11 @@
    <Compile Include="Models\ClsKf_MateOutBillSub.cs" />
    <Compile Include="Models\ClsOA_InformBillMain.cs" />
    <Compile Include="Models\ClsOA_InformBillSub.cs" />
    <Compile Include="Models\ClsSb_EquipDotCheckRuleBillMain.cs" />
    <Compile Include="Models\ClsSb_EquipDotCheckRuleBillSub.cs" />
    <Compile Include="Models\ClsSb_EquipMaintainRuleBillMain.cs" />
    <Compile Include="Models\ClsSb_EquipMaintainRuleBillSub.cs" />
    <Compile Include="Models\ClsSb_EquipMaintainRuleBillSub_Item.cs" />
    <Compile Include="Models\Pay_PeriodInfoSet.cs" />
    <Compile Include="Models\Gy_OrderBackInfo.cs" />
    <Compile Include="Models\Gy_OrderLevList.cs" />