| | |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_EquipFileList", 1, false, user)) |
| | | List<object> columnNameList = new List<object>(); |
| | | //查看权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_EquipFileBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipFileMainList"); |
| | | } |
| | | //添加列名 |
| | | 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) |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 下推根据设备id查询回显 |
| | | [Route("Gy_EquipFileMain/getSb_EquipList")] |
| | | [HttpGet] |
| | | public object getSb_EquipBeginBillList(int HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | //查看权限 |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_EquipFileBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查询失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_EquipFileMainList where hmainid=" + HInterID, " h_v_Gy_EquipFileMainList"); |
| | | |
| | | //添加列名 |
| | | 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 [设备档案删除功能] |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_EquipFileMainList where hmainid=" + HInterID, "h_v_Gy_EquipFileMainList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_EquipFileMain_Edit where hmainid=" + HInterID, "h_v_Gy_EquipFileMain_Edit"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | string HLogo = list[0].HLogo; //√ varchar(50) //品牌 |
| | | int HSellSupID = list[0].HSellSupID; // √ int //供应商(Gy_Supplier) |
| | | int HMakeSupID = list[0].HMakeSupID; // int //制造商 (Gy_Supplier) |
| | | string HMainSourceFlag = list[0].HMainSourceFlag; //varchar(10) //是否主生产设备(否,是) |
| | | |
| | | string HMacAddress = list[0].HMacAddress; // varchar(50) //数采物理地址 |
| | | string HIPAddress = list[0].HIPAddress; // varchar(50) //数采IP地址 |
| | | string HLinkNETMode = list[0].HLinkNETMode; // varchar(50) //联网方式 |
| | | string HCollectMode = list[0].HCollectMode; // varchar(50) //采集方式 |
| | | string HCollectClass = list[0].HCollectClass; // varchar(50) //采集类型 |
| | | string HMainSourceFlag = list[0].HMainSourceFlag; //varchar(10) //是否主生产设备(否,是) |
| | | int HMainSourceID = list[0].HMainSourceID; //int //所属主生产设备(Gy_EquipFileBillMain) |
| | | string HMaker = msg5; |
| | | string HMakeDate = DateTime.Now.Date.ToString(); |
| | | //string HMakeDate = DateTime.Now.Date.ToString(); |
| | | int HEquipDotCheckRuleInterID = list[0].HEquipDotCheckRuleInterID; |
| | | int HEquipMaintainRuleInterID = list[0].HEquipMaintainRuleInterID; |
| | | int HSourceID = list[0].HSourceID; |
| | |
| | | oCN.RunProc("Insert into Gy_EquipFileBillMain " + |
| | | " (HInterID,hbillno,HEquipFileNumber,HEquipFileNo,HName,HModel,HModel2,HMaterID,HUnitID,HOutComDate" + |
| | | ",HOutComNo,HDeptID,HUseEmpID,HRepairEmpID,HAddress,HSetupDate,HStartupDate,HStatus," + |
| | | "HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID,HSourceID,HMainSourceFlag,HMacAddress,HMainSourceID) " + |
| | | "HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID," + |
| | | "HSourceID,HMainSourceFlag,HMacAddress,HMainSourceID,HIPAddress,HLinkNETMode,HCollectMode,HCollectClass) " + |
| | | " Values("+ HInterID+",'" + hbillno + "','" + HEquipFileNumber + "','" + HEquipFileNo + "','" + HName + "','" + HModel + "','" + HModel2 + "'," + HMaterID + "," + HUnitID + |
| | | ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HUseEmpID + "," + HRepairEmpID + ",'" + HAddress + |
| | | "','" + HSetupDate + "','" + HStartupDate + "','" + HStatus + "'," + HEquipFileTypeID + ",'" + HProNum + |
| | | "','" + HBarCode + "','" + HWorkArea + "','" + HLogo + "'," + HSellSupID + "," + HMakeSupID + ",'3308','" + HDate + "','" + HYear + "','" + HMaker + "','" + HMakeDate + "','" + HEquipMaintainRuleInterID + "','" + HEquipDotCheckRuleInterID +"'," + HSourceID + ",'" + HMainSourceFlag + "','" + HMacAddress + "','" + HMainSourceID + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | "','" + HBarCode + "','" + HWorkArea + "','" + HLogo + "'," + HSellSupID + "," + HMakeSupID + ",'3308','" + HDate + "','" + HYear + "','" + HMaker + "',GETDATE(),'" + HEquipMaintainRuleInterID + "','" + HEquipDotCheckRuleInterID +"'" + |
| | | "," + HSourceID + ",'" + HMainSourceFlag + "','" + HMacAddress + "','" + HMainSourceID + "','" + HIPAddress + "','" + HLinkNETMode + "','" + HCollectMode + "','" + HCollectClass + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改上级为非末级代码 |
| | | objJsonResult = AddBillSub(msg3, msg4, HInterID, hbillno, 1); |
| | | |
| | |
| | | int HMakeSupID = list[0].HMakeSupID; // int //制造商 (Gy_Supplier) |
| | | string HMainSourceFlag = list[0].HMainSourceFlag; //varchar(10) //是否主生产设备(否,是) |
| | | string HMacAddress = list[0].HMacAddress; // varchar(50) //数采物理地址 |
| | | string HIPAddress = list[0].HIPAddress; // varchar(50) //数采IP地址 |
| | | string HLinkNETMode = list[0].HLinkNETMode; // varchar(50) //联网方式 |
| | | string HCollectMode = list[0].HCollectMode; // varchar(50) //采集方式 |
| | | string HCollectClass = list[0].HCollectClass; // varchar(50) //采集类型 |
| | | int HMainSourceID = list[0].HMainSourceID; //int //所属主生产设备(Gy_EquipFileBillMain) |
| | | string HUpDater = msg5; |
| | | string HUpDateDate = DateTime.Now.Date.ToString(); |
| | | //string HUpDateDate = DateTime.Now.Date.ToString(); |
| | | int HEquipDotCheckRuleInterID = list[0].HEquipDotCheckRuleInterID; |
| | | int HEquipMaintainRuleInterID = list[0].HEquipMaintainRuleInterID; |
| | | int HSourceID = list[0].HSourceID; |
| | |
| | | ",HLogo='" + HLogo + "'" + |
| | | ",HSellSupID=" + HSellSupID + |
| | | ",HMakeSupID= " + HMakeSupID + |
| | | ",HUpDater= '" + HUpDater + "'" + |
| | | ",HUpDateDate= '" + HUpDateDate + "'" + |
| | | ",HUpDater= '" + HUpDater + "'" + |
| | | ",HUpDateDate= GETDATE()" + |
| | | ",HEquipDotCheckRuleInterID='" + HEquipDotCheckRuleInterID + "'" + |
| | | ",HEquipMaintainRuleInterID='" + HEquipMaintainRuleInterID + "'" + |
| | | ",HSourceID='" + HSourceID + "'" + |
| | | ",HMainSourceFlag= '" + HMainSourceFlag + "'" + |
| | | ",HMacAddress= '" + HMacAddress + "'" + |
| | | ",HMainSourceID = '" + HMainSourceID + "'" + |
| | | ",HIPAddress='" + HIPAddress + "'" + |
| | | ",HLinkNETMode='" + HLinkNETMode + "'" + |
| | | ",HCollectMode='" + HCollectMode + "'" + |
| | | ",HCollectClass='" + HCollectClass + "'" + |
| | | " Where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改子项目代码 |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |