yangle
2024-11-28 f9c66dcfca26da4eeba5c87df4ca3916461e37f8
WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs
@@ -318,6 +318,7 @@
                oCN.BeginTran();
                oCN.RunProc("delete from Sc_WorkBeginDotCheckBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Sc_WorkBeginDotCheckBillSub where HInterID = " + HInterID);
                oCN.Commit();
@@ -824,6 +825,44 @@
        }
        #endregion
        #region 根据生产资源获取最新的模具
        [Route("Sc_WorkBeginDotCheckBill/Sc_WorkBeginDotCheckBill_HMould")]
        [HttpGet]
        public object Sc_WorkBeginDotCheckBill_HMould(string HSourceID, string User)
        {
            try
            {
                List<DataTable> tableList = new List<DataTable>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_Edit", 1, false, User))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select top 1 a.*,b.HName 模具名称 from Sc_MouldUpperBillSub a left join Gy_MouldFileMain b on a.HMouldID=b.HInterID where a.HSourceID='" + HSourceID + "'order by HScanDate desc", "Sc_MouldUpperBillSub");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "查询成功!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备启动点检清单列表 查询       
        [Route("Sc_WorkBeginDotCheckBill/getGy_WorkBeginDotCheckListBillMainList")]
        [HttpGet]
@@ -1117,6 +1156,7 @@
                oCN.BeginTran();
                oCN.RunProc("delete from Gy_WorkBeginDotCheckListBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Gy_WorkBeginDotCheckListBillSub where HInterID = " + HInterID);
                oCN.Commit();
@@ -1576,15 +1616,29 @@
                string HInterId = dic["HInterId"].ToString();             
                ds = oCN.RunProcReturn("exec h_p_DotCheckDayList '" + Type + "','" + HInterId + "'", "h_p_DotCheckDayList");
                if (ds.Tables.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当月没有数据产生!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //添加列名
                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!";