protected override void HandleTag(BStruBase data, string tagIsid) { if (!(data is TDOC tdoc)) { return; } TagRes tag = new TagRes() { tagIsid = tagIsid ?? Uuid.Create16Token(), tagName = data.Name, tagTypeCode = "21", //B接口读写 dataType = "5", //5-float ioType = "3", //'读写类型(0不可读写/1只读/2只写/3可读可写)' addition = 0, // bias multiplier = 1, // 倍数 ruleIsid = cfg.AppSettings["ruleIsid"], // saved tagAddr = "1", // 1 }; DbData = new SqlTdoc() { objDesc = tdoc.Des, objId = tdoc.ID, objName = tdoc.Name, objTypeId = (int)tdoc.Type, parentId = tdoc.ParentID, saved = (int)tdoc.Saved, controlEnable = (int)tdoc.ControlEnable, desc0 = tdoc.Desc0, desc1 = tdoc.Desc1, }; }
private void Compare2Repo(TagRes tag) { var tagMap = SuperBRepertory.Inst.tagmap.Find(m => m.tagIsid == tag.tagIsid); if (tagMap == null) { return; } // SuperBRepertory.Inst.taic.Find() }
public HttpResponseMessage GetReserveTags(HomePageReq req) { var now = DateTime.Now; //if (now.Hour >= 17) // return ControllerHelper.Instance.JsonEmptyArr(500, "17点之后无法预订"); var weekday = (int)now.DayOfWeek; var day = weekday + 1; if (weekday == 6) { day = 0; } FoodInfoOper.Instance.ClearWeekFood(); var list = new List <FoodView>(); var nowInt = Convert.ToInt32(now.DayOfWeek); //本周 if (nowInt > 0) { var dt = now.AddDays(8 - nowInt).Date; //var dt2 = dt.AddDays(-7).Date; list = CacheHelper.GetByCondition <FoodView>("foodview", " isdeleted=0 and ison=1 and isweek=1 and isMain=1 and foodTime<'" + dt + "' and foodTime>'" + now.Date + "'"); } //下一周 else { var dt = now.AddDays(1).Date; list = CacheHelper.GetByCondition <FoodView>("foodview", " isdeleted=0 and ison=1 and isweek=1 and isMain=1 and foodTime>'" + dt + "'"); } //list = CacheHelper.GetByCondition<FoodView>("foodview", " isdeleted=0 and ison=1 and isweek=1 and isMain=1 and secondTag=" + day); if (list.Count < 1) { return(ControllerHelper.Instance.JsonEmptyArr(200, "无预定菜品")); } var dict = list.Select(p => new { p.foodTagId, p.foodTagName }).Distinct().ToDictionary(p => (int)p.foodTagId, p => (string)p.foodTagName); List <TagRes> listR = new List <TagRes>(); TagRes tr2 = new TagRes(0, "普通商品"); listR.Add(tr2); foreach (var item in dict) { TagRes tr = new TagRes(item.Key, item.Value); listR.Add(tr); } return(ControllerHelper.Instance.JsonResult(200, JsonConvert.SerializeObject(listR), "")); }
public virtual bool UpdateTag(TagRes tag) { if (Tag.tagIsid != tag.tagIsid) { return(false); } Tag = tag; if (tag.tagName != OrgiData.Name) { OrgiData.Name = tag.tagName; return(true); } return(false); }
/// <summary> /// 获取区域中的菜品标签 /// </summary> /// <returns></returns> public List <TagRes> GetTagInArea(int areaId) { var list = CacheHelper.GetByCondition <RiderStockJoin>("RiderStockJoin", " riderStatus=1 and riderAreaId = " + areaId); var dict = list.Select(p => new { p.tagId, p.tagName }).Distinct().ToDictionary(p => (int)p.tagId, p => p.tagName); var listTemp = new List <TagRes>(); foreach (var item in dict) { TagRes tr = new TagRes(item.Key, item.Value); listTemp.Add(tr); } return(listTemp); }
protected override void HandleTag(BStruBase data, string tagIsid) { if (!(data is TAIC taic)) { return; } TagRes tag = new TagRes() { tagIsid = tagIsid ?? Uuid.Create16Token(), tagName = data.Name, tagTypeCode = "21", //B接口读写 dataType = "5", //5-float ioType = "1", //'读写类型(0不可读写/1只读/2只写/3可读可写)' addition = 0, // bias multiplier = 1, // 倍数 ruleIsid = cfg.AppSettings["ruleIsid"], // saved tagAddr = "1", // 1 }; DbData = new SqlTaic() { alarmEnable = (int)taic.AlarmEnable, alarmLevel = (int)taic.AlarmLevel, hiLimit1 = taic.HiLimit1, hiLimit2 = taic.HiLimit2, hiLimit3 = taic.HiLimit3, loLimit1 = taic.LoLimit1, loLimit2 = taic.LoLimit2, loLimit3 = taic.LoLimit3, maxVal = taic.MaxVal, minVal = taic.MinVal, objDesc = taic.Des, objId = taic.ID, objName = taic.Name, objTypeId = (int)taic.Type, parentId = taic.ParentID, percision = taic.Percision, saved = (int)taic.Saved, stander = taic.Stander, unit = taic.Unit, }; }