| | |
| | | using System; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | |
| | | 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"); |
| | | ds = oCN.RunProcReturn("select 点检项目ID HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,负责人ID HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,子备注 HRemark from h_v_Sb_EquipDotCheckRuleList", "h_v_Sb_EquipDotCheckRuleList"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select 点检项目ID,点检项目,点检部位,具体要求,负责人ID,负责人代码,负责人,子备注 from h_v_Sb_EquipDotCheckRuleList where 1 = 1 "; |
| | | string sql1 = "select 点检项目ID HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,负责人ID HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,子备注 HRemark from h_v_Sb_EquipDotCheckRuleList where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList"); |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region 设备点检规程单 保存/编辑 |
| | | /// <summary> |
| | | /// 设备点检规程单 保存 |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("Sb_EquipDotCheckRuleBill/SaveEquipDotCheckRuleBill")] |
| | | [HttpPost] |
| | | public object SaveEquipDotCheckRuleBill([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | |
| | | string UserName = ""; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | DLL.ClsSb_EquipDotCheckRuleBill oBill = new DLL.ClsSb_EquipDotCheckRuleBill(); |
| | | List<Models.ClsSb_EquipDotCheckRuleBillMain> lsmain = new List<Models.ClsSb_EquipDotCheckRuleBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Sb_EquipDotCheckRuleBillMain(msg2); |
| | | foreach (Models.ClsSb_EquipDotCheckRuleBillMain oItem in lsmain) |
| | | { |
| | | UserName = oItem.HMaker; //制单人 |
| | | oItem.HBillType = "3913"; |
| | | oItem.HBillSubType = "3913"; |
| | | DBUtility.ClsPub.CurUserName = UserName; |
| | | oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --日期 |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!没有单据日期,无法保存!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | |
| | | //表体数据 按 },{来拆分数组 //去掉【和】 |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "’"); |
| | | List<Models.ClsSb_EquipDotCheckRuleBillSub> ls = new List<Models.ClsSb_EquipDotCheckRuleBillSub>(); |
| | | ls = oListModels.getObjectByJson_Sb_EquipDotCheckRuleBillSub(msg3); |
| | | int i = 0; |
| | | foreach (Models.ClsSb_EquipDotCheckRuleBillSub oItemSub in ls) |
| | | { |
| | | |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | //oItemSub.HCloseMan = ""; //行关闭 |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | | oItemSub.HSourceInterID = 0; // 源单主内码 |
| | | oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | oItemSub.HRelationQty = 0; //关联数量 |
| | | |
| | | oBill.DetailColl_Mater.Add(oItemSub); |
| | | |
| | | } |
| | | //保存 |
| | | //保存完毕后处理 |
| | | bool bResult; |
| | | if (oBill.omodel.HInterID == 0) |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | | //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet }; |
| | | } |
| | | #endregion |
| | | #region[设备保养计划表编辑时获取表题数据] |
| | | #region[设备保养计划表编辑时获取表头数据] |
| | | [Route("Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListProjectDetai")] |
| | | [HttpGet] |
| | | public object Sb_EquipMaintainPlanBillListProjectDetai(string sqlWhere) |
| | |
| | | base.MvarReportTitle = "设备点检规程"; |
| | | base.BillType = "3913"; |
| | | } |
| | | |
| | | //修改单据 |
| | | public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | // |
| | | oCn.BeginTran(); |
| | | //更新主表 |
| | | oCn.RunProc("UpDate Sb_EquipDotCheckRuleBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //固定赋值=============== |
| | | ",HDate='" + omodel.HDate + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | | ",HUpDater='" + omodel.HMaker + "'" + |
| | | ",HUpDateDate=getdate()" + |
| | | //======================================== |
| | | ",HBeginDate='" + omodel.HBeginDate + "'" + |
| | | ",HEndDate='" + omodel.HEndDate + "'" + |
| | | ",HCycleUnit='" + omodel.HCycleUnit+ "'" + |
| | | ",HCheckCycle='" + omodel.HCheckCycle + "'" + |
| | | ",HExplanation='" + omodel.HExplanation + "'" + |
| | | ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + |
| | | " where HInterID=" + lngBillKey.ToString()); |
| | | //删除关联 |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //删除子表 |
| | | oCn.RunProc("Delete From Sb_EquipDotCheckRuleBillSub where HInterID=" + lngBillKey.ToString()); |
| | | //插入子表 |
| | | omodel.HInterID = lngBillKey; |
| | | foreach (Models.ClsSb_EquipDotCheckRuleBillSub oSub in DetailColl_Mater) |
| | | { |
| | | oCn.RunProc("Insert into Sb_EquipDotCheckRuleBillSub " + |
| | | " (HInterID,HEntryID," + |
| | | "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + |
| | | "HDotCheckItemID,HDotCheckItem,HDotCheckPart,HClaim," + |
| | | "HManagerID" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | ",'" + oSub.HDotCheckItemID + "','" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim + |
| | | "'," + oSub.HManagerID.ToString() + |
| | | ") "); |
| | | } |
| | | sReturn = "修改单据成功!"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //新增单据 |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //得到mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //若MAINDI重复则重新获取 |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | oCn.RunProc("Insert Into Sb_EquipDotCheckRuleBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HRemark" + |
| | | ",HBeginDate,HEndDate,HCycleUnit,HCheckCycle,HExplanation,HInnerBillNo" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + |
| | | "'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HCycleUnit+ "','" + omodel.HCheckCycle + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" + |
| | | ") "); |
| | | //插入子表 |
| | | foreach (Models.ClsSb_EquipDotCheckRuleBillSub oSub in DetailColl_Mater) |
| | | { |
| | | oCn.RunProc("Insert into Sb_EquipDotCheckRuleBillSub " + |
| | | " (HInterID,HEntryID," + |
| | | "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + |
| | | "HDotCheckItemID,HDotCheckItem,HDotCheckPart,HClaim," + |
| | | "HManagerID" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | ",'" + oSub.HDotCheckItemID + "','" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim + |
| | | "'," + oSub.HManagerID.ToString() + |
| | | ") "); |
| | | } |
| | | sReturn = "新增单据成功!"; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //显示单据 |
| | | } |
| | | } |
| | |
| | | return list; |
| | | } /// <summary> |
| | | |
| | | ///设备点检记录表 主表 |
| | | ///设备点检记录表 主表 |
| | | ///ClsSb_EquipDotCheckBillMain |
| | | public List<Model.ClsSb_EquipDotCheckBillMain> getObjectByJson_Sb_EquipDotCheckBillMain(string jsonString) |
| | | { |
| | |
| | | List<Model.ClsSb_EquipDotCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipDotCheckBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | ///设备点检规程表 主表 Models.ClsSb_EquipDotCheckRuleBillMain |
| | | ///ClsSb_EquipDotCheckBillMain |
| | | public List<Models.ClsSb_EquipDotCheckRuleBillMain> getObjectByJson_Sb_EquipDotCheckRuleBillMain(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Models.ClsSb_EquipDotCheckRuleBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsSb_EquipDotCheckRuleBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | ///设备点检规程表 子表 Models.ClsSb_EquipDotCheckRuleBillMain |
| | | ///ClsSb_EquipDotCheckBillMain |
| | | public List<Models.ClsSb_EquipDotCheckRuleBillSub> getObjectByJson_Sb_EquipDotCheckRuleBillSub(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Models.ClsSb_EquipDotCheckRuleBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsSb_EquipDotCheckRuleBillSub>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | ///设备点检记录表 子表 |
| | | ///ClsSb_EquipDotCheckBillSub |
| | | public List<Model.ClsSb_EquipDotCheckBillSub> getObjectByJson_Sb_EquipDotCheckBillSub(string jsonString) |
| | |
| | | <publishTime>02/22/2013 08:43:40</publishTime> |
| | | </File> |
| | | <File Include="bin/BLL.dll"> |
| | | <publishTime>11/24/2021 19:23:01</publishTime> |
| | | <publishTime>11/25/2021 19:03:26</publishTime> |
| | | </File> |
| | | <File Include="bin/BLL.pdb"> |
| | | <publishTime>11/24/2021 19:23:01</publishTime> |
| | | <publishTime>11/25/2021 19:03:26</publishTime> |
| | | </File> |
| | | <File Include="bin/DAL.dll"> |
| | | <publishTime>11/24/2021 19:22:59</publishTime> |
| | | <publishTime>11/25/2021 19:03:24</publishTime> |
| | | </File> |
| | | <File Include="bin/DAL.pdb"> |
| | | <publishTime>11/24/2021 19:22:59</publishTime> |
| | | <publishTime>11/25/2021 19:03:24</publishTime> |
| | | </File> |
| | | <File Include="bin/Dapper.dll"> |
| | | <publishTime>07/22/2016 14:52:40</publishTime> |
| | | </File> |
| | | <File Include="bin/DBUtility.dll"> |
| | | <publishTime>11/24/2021 19:22:55</publishTime> |
| | | <publishTime>11/25/2021 19:03:20</publishTime> |
| | | </File> |
| | | <File Include="bin/DBUtility.pdb"> |
| | | <publishTime>11/24/2021 19:22:55</publishTime> |
| | | <publishTime>11/25/2021 19:03:20</publishTime> |
| | | </File> |
| | | <File Include="bin/Interop.gregn6Lib.dll"> |
| | | <publishTime>08/25/2021 10:28:25</publishTime> |
| | |
| | | <publishTime>07/25/2012 11:48:56</publishTime> |
| | | </File> |
| | | <File Include="bin/Model.dll"> |
| | | <publishTime>11/24/2021 19:22:55</publishTime> |
| | | <publishTime>11/25/2021 19:03:21</publishTime> |
| | | </File> |
| | | <File Include="bin/Model.pdb"> |
| | | <publishTime>11/24/2021 19:22:55</publishTime> |
| | | <publishTime>11/25/2021 19:03:21</publishTime> |
| | | </File> |
| | | <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs"> |
| | | <publishTime>08/16/2021 17:23:15</publishTime> |
| | |
| | | <publishTime>08/03/2014 20:33:56</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Class.dll"> |
| | | <publishTime>11/24/2021 19:22:52</publishTime> |
| | | <publishTime>11/25/2021 19:03:18</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Class.pdb"> |
| | | <publishTime>11/24/2021 19:22:52</publishTime> |
| | | <publishTime>11/25/2021 19:03:18</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Control.dll"> |
| | | <publishTime>11/24/2021 19:22:53</publishTime> |
| | | <publishTime>11/25/2021 19:03:19</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Control.pdb"> |
| | | <publishTime>11/24/2021 19:22:53</publishTime> |
| | | <publishTime>11/25/2021 19:03:19</publishTime> |
| | | </File> |
| | | <File Include="bin/SQLHelper.dll"> |
| | | <publishTime>11/24/2021 19:22:54</publishTime> |
| | | <publishTime>11/25/2021 19:03:19</publishTime> |
| | | </File> |
| | | <File Include="bin/SQLHelper.pdb"> |
| | | <publishTime>11/24/2021 19:22:54</publishTime> |
| | | <publishTime>11/25/2021 19:03:19</publishTime> |
| | | </File> |
| | | <File Include="bin/stdole.dll"> |
| | | <publishTime>05/09/2021 13:35:37</publishTime> |
| | |
| | | <publishTime>11/24/2014 11:18:48</publishTime> |
| | | </File> |
| | | <File Include="bin/WebAPI.dll"> |
| | | <publishTime>11/24/2021 19:23:04</publishTime> |
| | | <publishTime>11/25/2021 19:03:29</publishTime> |
| | | </File> |
| | | <File Include="bin/WebAPI.pdb"> |
| | | <publishTime>11/24/2021 19:23:04</publishTime> |
| | | <publishTime>11/25/2021 19:03:29</publishTime> |
| | | </File> |
| | | <File Include="bin/WebGrease.dll"> |
| | | <publishTime>07/17/2013 17:03:52</publishTime> |
| | |
| | | <publishTime>08/06/2021 22:57:28</publishTime> |
| | | </File> |
| | | <File Include="Web.config"> |
| | | <publishTime>11/24/2021 19:23:17</publishTime> |
| | | <publishTime>11/25/2021 19:03:39</publishTime> |
| | | </File> |
| | | </ItemGroup> |
| | | </Project> |