public void SyncWelfareBrand() { var interfaceName = "syncwelFareBrand"; var loggingSessionInfo = BaseService.GetLoggingSession(); var brandService = new BrandDetailBLL(loggingSessionInfo); var dsBrands = new DataSet(); var brands = new BrandList(); brands.brandlist = new List <Brand>(); //更新接口同步表 var queryList = UpdateInterfaceTimestamp(interfaceName, loggingSessionInfo); if (queryList != null && queryList.Length > 0) { //存在,根据日期条件查询 dsBrands = brandService.GetSynWelfareBrandList(queryList.FirstOrDefault().LatestTime.ToString()); } else { //不存在,查询所有数据 dsBrands = brandService.GetSynWelfareBrandList(string.Empty); } if (dsBrands != null && dsBrands.Tables.Count > 0 && dsBrands.Tables[0].Rows.Count > 0) { brands.brandlist = DataTableToObject.ConvertToList <Brand>(dsBrands.Tables[0]); var content = brands.ToJSON(); //将描述字段Encode foreach (var item in brands.brandlist) { item.branddesc = HttpUtility.UrlEncode(item.branddesc, Encoding.UTF8); byte[] buff = Encoding.UTF8.GetBytes(item.branddesc); item.branddesc = Convert.ToBase64String(buff); } //上传数据 var result = UploadData(interfaceName, brands.ToJSON()); //写入接口日志 var logEntity = new ZInterfaceLogEntity() { LogId = Utils.NewGuid(), InterfaceName = interfaceName, Params = content, ResultCode = result.code, ResultDesc = result.description }; InsertInterfaceLog(logEntity, loggingSessionInfo); } }
public void syncwelFareObjectImages() { var interfaceName = "syncwelFareObjectImages"; var loggingSessionInfo = BaseService.GetLoggingSession(); var imageService = new ObjectImagesBLL(loggingSessionInfo); var dsImages = new DataSet(); var images = new ImageList(); images.mapping = new List <Image>(); //更新接口同步表 var queryList = UpdateInterfaceTimestamp(interfaceName, loggingSessionInfo); if (queryList != null && queryList.Length > 0) { //存在,根据日期条件查询 dsImages = imageService.GetSynWelfareObjectImageList(queryList.FirstOrDefault().LatestTime.ToString()); } else { //不存在,查询所有数据 dsImages = imageService.GetSynWelfareObjectImageList(string.Empty); } if (dsImages != null && dsImages.Tables.Count > 0 && dsImages.Tables[0].Rows.Count > 0) { images.mapping = DataTableToObject.ConvertToList <Image>(dsImages.Tables[0]); //上传数据 var content = images.ToJSON(); var result = UploadData(interfaceName, images.ToJSON()); //写入接口日志 var logEntity = new ZInterfaceLogEntity() { LogId = Utils.NewGuid(), InterfaceName = interfaceName, Params = content, ResultCode = result.code, ResultDesc = result.description }; InsertInterfaceLog(logEntity, loggingSessionInfo); } }
public void SyncWelfareType() { var interfaceName = "syncwelFarePreferentialType"; var loggingSessionInfo = BaseService.GetLoggingSession(); var categoryService = new ItemCategoryService(loggingSessionInfo); var dsTypes = new DataSet(); var preTypeList = new PreferentialTypeList(); preTypeList.preferentialtypelist = new List <PreferentialType>(); //更新接口同步表 var queryList = UpdateInterfaceTimestamp(interfaceName, loggingSessionInfo); if (queryList != null && queryList.Length > 0) { //存在,根据日期条件查询 dsTypes = categoryService.GetSynWelfareTypeList(queryList.FirstOrDefault().LatestTime.ToString()); } else { //不存在,查询所有数据 dsTypes = categoryService.GetSynWelfareTypeList(string.Empty); } if (dsTypes != null && dsTypes.Tables.Count > 0 && dsTypes.Tables[0].Rows.Count > 0) { preTypeList.preferentialtypelist = DataTableToObject.ConvertToList <PreferentialType>(dsTypes.Tables[0]); //上传数据 var content = preTypeList.ToJSON(); var result = UploadData(interfaceName, content); //写入接口日志 var logEntity = new ZInterfaceLogEntity() { LogId = Utils.NewGuid(), InterfaceName = interfaceName, Params = content, ResultCode = result.code, ResultDesc = result.description }; InsertInterfaceLog(logEntity, loggingSessionInfo); } }
public void Update(ZInterfaceLogEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran) { _currentDAO.Update(pEntity, pIsUpdateNullField, pTran); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Update(ZInterfaceLogEntity pEntity, IDbTransaction pTran) { Update(pEntity, true, pTran); }
/// <summary> /// 在事务内创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Create(ZInterfaceLogEntity pEntity, IDbTransaction pTran) { _currentDAO.Create(pEntity, pTran); }
/// <summary> /// 创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> public void Create(ZInterfaceLogEntity pEntity) { _currentDAO.Create(pEntity); }
/// <summary> /// 分页根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public PagedQueryResult <ZInterfaceLogEntity> PagedQueryByEntity(ZInterfaceLogEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex) { return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex)); }
/// <summary> /// 根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public ZInterfaceLogEntity[] QueryByEntity(ZInterfaceLogEntity pQueryEntity, OrderBy[] pOrderBys) { return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys)); }
/// <summary> /// 删除 /// </summary> /// <param name="pEntity"></param> public void Delete(ZInterfaceLogEntity pEntity) { _currentDAO.Delete(pEntity); }
public void Update(ZInterfaceLogEntity pEntity, bool pIsUpdateNullField) { _currentDAO.Update(pEntity, pIsUpdateNullField); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> public void Update(ZInterfaceLogEntity pEntity) { Update(pEntity, true); }
public void SyncWelfareItem() { var interfaceName = "syncwelFareItem"; var loggingSessionInfo = BaseService.GetLoggingSession(); var itemService = new ItemService(loggingSessionInfo); var dsItems = new DataSet(); var items = new ItemList(); items.itemlist = new List <Item>(); //更新接口同步表 var queryList = UpdateInterfaceTimestamp(interfaceName, loggingSessionInfo); if (queryList != null && queryList.Length > 0) { //存在,根据日期条件查询 dsItems = itemService.GetItemTypeList(queryList.FirstOrDefault().LatestTime.ToString()); } else { //不存在,查询所有数据 dsItems = itemService.GetItemTypeList(string.Empty); } if (dsItems != null && dsItems.Tables.Count > 0 && dsItems.Tables[0].Rows.Count > 0) { items.itemlist = DataTableToObject.ConvertToList <Item>(dsItems.Tables[0]); for (int i = 0; i < dsItems.Tables[0].Rows.Count; i++) { DataRow dr = dsItems.Tables[0].Rows[i]; //商品品牌Mapping集合 items.itemlist[i].itembrandmapping = new List <ItemBrandMapping>(); if (!string.IsNullOrEmpty(dr["brandid"].ToString())) { items.itemlist[i].itembrandmapping.Add(new ItemBrandMapping() { mappingid = Utils.NewGuid(), brandid = dr["brandid"].ToString(), isdelete = "0" }); } //门店与商品Mapping集合 items.itemlist[i].itemstoremapping = new List <ItemStoreMapping>(); var dsMappings = itemService.GetItemStoreMapping(dr["itemid"].ToString()); if (dsMappings != null && dsMappings.Tables.Count > 0 && dsMappings.Tables[0].Rows.Count > 0) { items.itemlist[i].itemstoremapping = DataTableToObject.ConvertToList <ItemStoreMapping>(dsMappings.Tables[0]); } //商品与优惠券类型 items.itemlist[i].itemptypemapping = new List <ItemPtypeMapping>(); if (!string.IsNullOrEmpty(dr["ptypeid"].ToString())) { items.itemlist[i].itemptypemapping.Add(new ItemPtypeMapping() { mappingid = Utils.NewGuid(), tpypeId = dr["ptypeid"].ToString(), isdelete = "0" }); } } //上传数据 var content = items.ToJSON(); var result = UploadData(interfaceName, content); //写入接口日志 var logEntity = new ZInterfaceLogEntity() { LogId = Utils.NewGuid(), InterfaceName = interfaceName, Params = content, ResultCode = result.code, ResultDesc = result.description }; InsertInterfaceLog(logEntity, loggingSessionInfo); } }
private void InsertInterfaceLog(ZInterfaceLogEntity entity, LoggingSessionInfo loggingSessionInfo) { var interfaceLog = new ZInterfaceLogBLL(loggingSessionInfo); interfaceLog.Create(entity); }