| | |
| | | } |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery"); |
| | | |
| | | |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region 工序流转卡维护-查询 |
| | | /// <summary> |
| | | /// 返回工序流转卡维护列表主表 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("LEMS/Sc_ProcessExchangeBillList_Query")] |
| | | [HttpGet] |
| | | public object Sc_ProcessExchangeBillList_Query(string sWhere, string user, string HBillSubType) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (HBillSubType == "SUB") |
| | | { |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_SubQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "指引卡无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "流转卡无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //获取系统参数 |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户为龙山汽配 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配") |
| | | { |
| | | //获取需要拼接的字符串 |
| | | string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "工序派工单列表"); |
| | | |
| | | sWhere += sql_splice; |
| | | } |
| | | } |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillList_Query"); |
| | | |
| | | |
| | | //添加列名 |
| | | 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.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序流转卡 下查 |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">单据ID</param> |
| | | /// <returns></returns> |
| | | [Route("LEMS/MES_Sc_ProcessExchangeBillQuery_LookDown")] |
| | | [HttpGet] |
| | | public object MES_Sc_ProcessExchangeBillQuery_LookDown(int HInterID) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameListSum = new List<object>(); |
| | | List<object> columnNameList0 = new List<object>(); |
| | | List<object> columnNameList1 = new List<object>(); |
| | | List<object> columnNameList2 = new List<object>(); |
| | | List<object> columnNameList3 = new List<object>(); |
| | | //List<object> columnNameList4 = new List<object>(); |
| | | |
| | | string sql = "exec h_p_Sc_ProcessExchangeBillList_LookDown " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcessExchangeBillList_LookDown"); |
| | | |
| | | //添加 工序进站接收单 列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList0.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 工序出站汇报单 列名 |
| | | foreach (DataColumn col in ds.Tables[1].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList1.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 指引卡开工单 列名 |
| | | foreach (DataColumn col in ds.Tables[2].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList2.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 指引卡完工单 列名 |
| | | foreach (DataColumn col in ds.Tables[3].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList3.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | ////添加 工序流转卡 列名 |
| | | //foreach (DataColumn col in ds.Tables[4].Columns) |
| | | //{ |
| | | // Type dataType = col.DataType; |
| | | // string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | // columnNameList4.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | //} |
| | | |
| | | columnNameListSum.Add(columnNameList0); |
| | | columnNameListSum.Add(columnNameList1); |
| | | columnNameListSum.Add(columnNameList2); |
| | | columnNameListSum.Add(columnNameList3); |
| | | //columnNameListSum.Add(columnNameList4); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables; |
| | | objJsonResult.list = columnNameListSum; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | //获取系统参数 |
| | | string Ret = ""; |
| | | string Count = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户为龙山汽配 |
| | |
| | | |
| | | sWhere += sql_splice; |
| | | } |
| | | //判断客户为瑞与祺 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺") |
| | | { |
| | | Count = "top 1000"; |
| | | } |
| | | } |
| | | |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeIssueBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeIssueBillQuery"); |
| | | ds = oCN.RunProcReturn("select " + Count + " * from h_v_Sc_ProcessExchangeIssueBillQuery where 1 = 1 " + sWhere + " order by hmainid desc,CONVERT(int,流水号) asc", "h_v_Sc_ProcessExchangeIssueBillQuery"); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | #region 生产订单 下查 |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">单据ID</param> |
| | | /// <returns></returns> |
| | | [Route("LEMS/MES_IF_ICMOBillList_Json_LookDown")] |
| | | [HttpGet] |
| | | public object MES_IF_ICMOBillList_Json_LookDown(int HInterID) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameListSum = new List<object>(); |
| | | List<object> columnNameList0 = new List<object>(); |
| | | List<object> columnNameList1 = new List<object>(); |
| | | List<object> columnNameList2 = new List<object>(); |
| | | List<object> columnNameList3 = new List<object>(); |
| | | List<object> columnNameList4 = new List<object>(); |
| | | List<object> columnNameList5 = new List<object>(); |
| | | List<object> columnNameList6 = new List<object>(); |
| | | |
| | | string sql = "exec h_p_Sc_ICMOBillList_LookDown " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Xs_SeOrderBill_lookdown"); |
| | | |
| | | //添加 工序进站接收单 列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList0.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 工序出站汇报单 列名 |
| | | foreach (DataColumn col in ds.Tables[1].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList1.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 指引卡开工单 列名 |
| | | foreach (DataColumn col in ds.Tables[2].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList2.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 指引卡完工单 列名 |
| | | foreach (DataColumn col in ds.Tables[3].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList3.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 工序流转卡 列名 |
| | | foreach (DataColumn col in ds.Tables[4].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList4.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 生产领料单 列名 |
| | | foreach (DataColumn col in ds.Tables[5].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList5.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //添加 生产订单变更单 列名 |
| | | foreach (DataColumn col in ds.Tables[6].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList6.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | columnNameListSum.Add(columnNameList0); |
| | | columnNameListSum.Add(columnNameList1); |
| | | columnNameListSum.Add(columnNameList2); |
| | | columnNameListSum.Add(columnNameList3); |
| | | columnNameListSum.Add(columnNameList4); |
| | | columnNameListSum.Add(columnNameList5); |
| | | columnNameListSum.Add(columnNameList6); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables; |
| | | objJsonResult.list = columnNameListSum; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 生产分析报表 |
| | | [Route("LEMS/ProductionAnalysisReportList")] |
| | | [HttpGet] |
| | |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec [h_p_Sc_ProductionAnalysisReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 |
| | | |
| | | #region 销售统计报表 |
| | | [Route("LEMS/SeOutReportList")] |
| | | [HttpGet] |
| | | public object SeOutReportList(string DateYear, string HType, string user) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds; |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (DateYear == null || DateYear.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请选择有效年份"; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec [h_p_Xe_SeOutReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 |
| | | |
| | | #region 销售发货统计报表 |
| | | [Route("LEMS/SeOutStockReportList")] |
| | | [HttpGet] |
| | | public object SeOutStockReportList(string DateYear, string HType, string user) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds; |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (DateYear == null || DateYear.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请选择有效年份"; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec [h_p_Xs_SeOutStockReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]"); |
| | | } |
| | | |
| | | //添加列名 |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region 报表查看权限控制 |
| | | /// <summary> |
| | | ///参数:string HInterID。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("LMES/getReportByModRightNameCheck")] |
| | | [HttpGet] |
| | | public object getReportByModRightNameCheck(string ModRightNameCheck, string user) |
| | | { |
| | | try |
| | | { |
| | | string s = ""; |
| | | |
| | | //查看权限 |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |