|  |  |  | 
|---|
|  |  |  | public class SB_EquipICMOTechParamBillController : ApiController | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public DBUtility.ClsPub.Enum_BillStatus BillStatus; | 
|---|
|  |  |  | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); | 
|---|
|  |  |  | public const string ModName = "3919";                   //单据类型 | 
|---|
|  |  |  | public const string ModCaption = "设备工艺参数订单点检表";          //单据名称 | 
|---|
|  |  |  | public const string ModRightName = "SB_EquipICMOTechParamBill"; | 
|---|
|  |  |  | 
|---|
|  |  |  | oBill.DetailColl.Add(oItemSub); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //保存 | 
|---|
|  |  |  | bool bResult; | 
|---|
|  |  |  | //获取系统参数 | 
|---|
|  |  |  | string Ret = ""; | 
|---|
|  |  |  | if (oSystemParameter.ShowBill(ref Ret)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (oSystemParameter.omodel.SB_EquipICMOTechParamBill_MustBeginWorkCtl == "Y") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ds = oCn.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceID = '" + oBill.omodel.HSourceID + "' and HSourceBillNo = '" + oBill.omodel.HProcExchBillNo + "' and HSourceInterID = '" + oBill.omodel.HProcExchInterID + "'and HSourceEntryID = '" + oBill.omodel.HProcExchEntryID + "' and hicmostatus =1", "Sc_ICMOBillStatus_Tmp"); | 
|---|
|  |  |  | if (ds.Tables[0].Rows[0]["HICMOStatus"].ToString() != "1") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "当前工单不是开工状态不能进行设备工艺参数点检!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //保存 | 
|---|
|  |  |  | bool bResult; | 
|---|
|  |  |  | if (OperationType == "1")   //新增保存 | 
|---|
|  |  |  | { | 
|---|
|  |  |  | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
|---|
|  |  |  | bResult = oBill.AddBill (ref DBUtility.ClsPub.sExeReturnInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else                        //编辑保存 | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 异常工艺参数预警列表信息 | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 异常工艺参数预警列表信息 | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | [Route("SB_EquipICMOTechParamBillController/GetSb_EquipMentCollectionTechParam_ERR")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object GetSb_EquipMentCollectionTechParam_ERR(string sWhere, string HMaker) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //判断权限 | 
|---|
|  |  |  | if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, HMaker)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "您没有该模块权限,请与管理员联系!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //返回列表信息 | 
|---|
|  |  |  | ds = oCn.RunProcReturn("select * from h_v_Sb_EquipMentCollectionTechParam_ERRList where 1=1 " + sWhere + " order by 发现异常时间 desc", "h_v_Sb_EquipMentCollectionTechParam_ERRList"); | 
|---|
|  |  |  | List<object> columnNameList = new List<object>(); | 
|---|
|  |  |  | //添加列名 | 
|---|
|  |  |  | 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 = "0"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "成功!"; | 
|---|
|  |  |  | objJsonResult.data = ds.Tables[0]; | 
|---|
|  |  |  | objJsonResult.list = columnNameList; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "查询列表信息失败!" + e.ToString(); | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|