| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 器具寿命耗用分析报表 |
| | | [Route("Sc_MouldRepairInBillList/Get_Sc_MouldLifeUsePicReport")] |
| | | [HttpGet] |
| | | public object Get_Sc_MouldLifeUsePicReport(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_MouldLifeUsePicReport order by 月份 desc", "h_v_Sc_MouldLifeUsePicReport"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldLifeUsePicReport where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by 日期 "; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldLifeUsePicReport"); |
| | | } |
| | | //添加列名 |
| | | 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 e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | //string msg5 = sArray[3].ToString(); |
| | | |
| | | |
| | | string UserName = ""; |
| | | ListModels oListModels = new ListModels(); |
| | |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Sc_MouldDotCheckPlanBillMain(msg2); |
| | | foreach (Model.ClsSc_MouldDotCheckPlanBillMain oItem in lsmain) |
| | | { |
| | | //oItem.HMaker = ""; |
| | | { |
| | | UserName = oItem.HMaker; //制单人 |
| | | oItem.HBillType = "3820"; |
| | | oItem.HBillSubType = "3820"; |
| | | |
| | | //oItem.HInterID =0; |
| | | //oItem.HBillNo = ""; |
| | | |
| | | oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --日期 |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | //oItem.HMakeDate = ""; |
| | | //oItem.HYear = ""; |
| | | //oItem.HPeriod = ""; |
| | | //oItem.HRemark = ""; |
| | | //oItem.HCycleUnit = ""; |
| | | //oItem.HCheckCycle = ""; |
| | | //oItem.HBeginDate = ""; |
| | | //oItem.HEndDate = ""; |
| | | //oItem.HInnerBillNo = ""; |
| | | //oItem.HExplanation = ""; |
| | | |
| | | //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | //oItemSub.HCloseMan = ""; //行关闭 |
| | | |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | |
| | | oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | oItemSub.HRelationQty = 0; //关联数量 |
| | | //oItemSub.HRelationMoney = 0; //关联金额 |
| | | //HMaterID = "";//配件代码 |
| | | //HUnitID = "";//单位代码 |
| | | //HQty = "";//实际用量 |
| | | //HQtyMust = "";//单位用量 |
| | | //HRemark = "";//备注 |
| | | oItemSub.HRelationQty = 0; //关联数量 |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | |
| | | ////配件项表体数据 |
| | | ////按 },{来拆分数组 //去掉【和】 |
| | | //msg5 = msg5.Substring(1, msg5.Length - 2); |
| | | //msg5 = msg5.Replace("\\", ""); |
| | | //msg5 = msg5.Replace("\n", ""); //\n |
| | | // //msg2 = msg2.Replace("'", "’"); |
| | | //List<Model.ClsSc_MouldDotCheckPlanBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckPlanBillSub_Item>(); |
| | | //ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckPlanBillSub_Item(msg5); |
| | | //int j = 0; |
| | | //foreach (Model.ClsSc_MouldDotCheckPlanBillSub_Item oItemSub in ls1) |
| | | //{ |
| | | |
| | | // j++; |
| | | // oItemSub.HEntryID = j; |
| | | // //oItemSub.HCloseMan = ""; //行关闭 |
| | | // oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | // oItemSub.HCloseType = false; //关闭类型 |
| | | |
| | | // oItemSub.HSourceInterID = 0; // 源单主内码 |
| | | // oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | |
| | | // oItemSub.HRelationQty = 0; //关联数量 |
| | | // oBill.DetailCol.Add(oItemSub); |
| | | //} |
| | | |
| | | } |
| | | //保存 |
| | | //保存完毕后处理 |
| | | bool bResult; |