yangle
2023-12-25 14fdd4d979f0306b79bb638576b341ed13f4780a
单品过站优化
生产分析报表
2个文件已修改
65 ■■■■■ 已修改文件
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/LMESController.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -687,6 +687,23 @@
                    }
                }
                else {
                    string str1 = HBarCode.Substring(23, 3);
                    DataSet dataSet = oCN.RunProcReturn(@"select  m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK)
left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID
left join Xt_ORGANIZATIONS o WITH(NOLOCK) on a.HPRDORGID=o.HItemID
where HBillNo='" + HProcExchBillNo + "' and HProjectNum like'" + str1 + "%' and HPRDORGID=" + HOrgID, "Sc_ProcessExchangeBillMain");
                    if (dataSet.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "条码与流转卡不存在对应关系!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "")
                    {
                        objJsonResult.code = "0";
WebAPI/Controllers/LMESController.cs
@@ -1215,6 +1215,54 @@
            return GetObjectJson(ds);
        }
        #region 生产分析报表
        [Route("LEMS/ProductionAnalysisReportList")]
        [HttpGet]
        public object ProductionAnalysisReportList(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_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/sc_ICOMReportClose")]
        [HttpPost]