WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/DLL/ClsSb_EquipDotCheckRuleBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ClsSb_EquipDotCheckRuleBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ClsSb_EquipDotCheckRuleBillSub.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ClsSb_EquipMaintainRuleBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ClsSb_EquipMaintainRuleBillSub.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ClsSb_EquipMaintainRuleBillSub_Item.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
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/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/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/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" /> @@ -416,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" /> @@ -447,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" /> @@ -463,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" />