| | |
| | | } |
| | | |
| | | 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"); |
| | | |
| | | |
| | | //判断用户是否拥有查看所有客户权限 |
| | | if (DBUtility.ClsPub.Security_Log_second("Gy_UserLookAllCus", 1, false, user)) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery"); |
| | | } |
| | | else |
| | | { |
| | | //获取用户编码 |
| | | string sql = "select * from Gy_Czygl where Czymc = '" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql, "Gy_Czygl"); |
| | | string userID = ds.Tables[0].Rows[0]["Czybm"].ToString(); |
| | | |
| | | string sql1 = " and HCusID in (select HCusID from Gy_UserCustomerRelation Where HUserID = '" + userID + "')"; |
| | | string sql2 = "select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + sql1 + " order by hmainid desc "; |
| | | ds = oCN.RunProcReturn(sql2, "h_v_Sc_ProcessExchangeBillQuery"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //添加列名 |
| | |
| | | } |
| | | #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]"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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/sc_ICOMReportClose")] |
| | | [HttpPost] |