/// <summary> /// 获取特定的工具夹实体 /// </summary> /// <param name="tongsEntity"></param> /// <returns></returns> public TongsEntityVo GetTongsEntity(TongsEntity tongsEntity) { TongsEntityVo result = new TongsEntityVo(); TongsEntity tongs = tongsEntityDao.selectTongsEntityByCodeAndSeq(tongsEntity); TongsDefinition p = new TongsDefinition(); p.Code = tongs.Code; TongsDefinition tongsDefinition = tongsDefinitionDao.selectTongsDefinitionByCode(p); var ParentType = typeof(TongsEntity); var Properties = ParentType.GetProperties(); foreach (var Propertie in Properties) { if (Propertie.CanRead && Propertie.CanWrite) { Propertie.SetValue(result, Propertie.GetValue(tongs, null), null); } } result.FamilyId = tongsDefinition.FamilyId; result.Name = tongsDefinition.Name; result.Model = tongsDefinition.Model; result.PartNo = tongsDefinition.PartNo; result.UserdFor = tongsDefinition.UserdFor; result.Upl = tongsDefinition.Upl; result.OwnerId = tongsDefinition.OwnerId; result.Remark = tongsDefinition.Remark; result.PmPeriod = tongsDefinition.PmPeriod; return(result); }
public string getEntity(string code, int seq) { string token = TokenHelper.GetTokenJson(HttpContext.Request.Headers["Authorization"]);//利用这个进行数据按部门进行隔离 TokenInfo tokenInfo = JSONHelper.JSONToObject <TokenInfo>(token); int WorkcellId = tokenInfo.workCell; TongsEntity tongsEntity = new TongsEntity(); tongsEntity.WorkcellId = WorkcellId; tongsEntity.Code = code; tongsEntity.SeqId = seq; TongsEntityVo result = fixtureService.GetTongsEntity(tongsEntity); return(JSONHelper.ObjectToJSON(ResponseUtil.Ok(result))); }