Merge remote-tracking branch 'origin/div' into div
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.brand.BrandInfo;
|
| | | import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoRecordService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoService;
|
| | | import com.yeshi.fanli.service.inter.brand.TaoBaoShopHistoryService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | | |
| | | @Resource
|
| | | private BrandInfoService brandInfoService;
|
| | | |
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | | @Resource
|
| | | private BrandInfoRecordService brandInfoRecordService;
|
| | | |
| | |
|
| | | /**
|
| | | * 店铺列表
|
| | |
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 品牌列表列表
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getList", method = RequestMethod.POST)
|
| | | public void getList(AcceptData acceptData, Integer page, Long cid, Long uid, PrintWriter out) {
|
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult("页码不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (cid != null && cid == 0) {
|
| | | cid = null;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1 && cid != null) {
|
| | | List<BrandInfo> brandlist = brandInfoService.listValidBrandInfoCache(cid);
|
| | | if(brandlist == null)
|
| | | brandlist = new ArrayList<BrandInfo>();
|
| | | data.put("brandlist", JsonUtil.getApiCommonGson().toJson(brandlist));
|
| | | }
|
| | | |
| | | |
| | | long count = brandInfoService.countBrandInfo(cid);
|
| | | |
| | | List<BrandInfoVO> list = brandInfoService.listBrandInfoCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid);
|
| | | if (list == null)
|
| | | list = new ArrayList<BrandInfoVO>();
|
| | | |
| | | GsonBuilder gb = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder());
|
| | | gb.excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson = gb.create();
|
| | | |
| | | data.put("count", count);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 店铺详情过渡页
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getShopInfoV2", method = RequestMethod.POST)
|
| | | public void getShopInfoV2(AcceptData acceptData, Integer page, Long id, Long uid, PrintWriter out) {
|
| | | |
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult("缺失店铺id"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<TaoBaoShop> shopList = new ArrayList<TaoBaoShop>();
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("index_top");
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | | TaoBaoShop taoBaoShop = taoBaoShopService.selectByPrimaryKey(id);
|
| | | if (taoBaoShop == null) {
|
| | | out.print(JsonUtil.loadFalseResult("店铺信息获取失败"));
|
| | | return;
|
| | | }
|
| | | String shopLink = taoBaoShop.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
|
| | | }
|
| | |
|
| | | String shopNameCustom = taoBaoShop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShop.setShopName(shopNameCustom);
|
| | | }
|
| | |
|
| | | String shopIconCustom = taoBaoShop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShop.setShopIcon(shopIconCustom);
|
| | | }
|
| | |
|
| | | Integer userType = taoBaoShop.getUserType();
|
| | | if (userType == null || userType == 0) {
|
| | | taoBaoShop.setUserType(10);
|
| | | } else {
|
| | | taoBaoShop.setUserType(11);
|
| | | }
|
| | |
|
| | | shopList.add(taoBaoShop);
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加足迹
|
| | | taoBaoShopHistoryService.addHistory(id, uid, acceptData.getDevice());
|
| | | }
|
| | | });
|
| | | }
|
| | | data.put("picList", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | | data.put("shopList", JsonUtil.getApiCommonGson().toJson(shopList));
|
| | | |
| | |
|
| | | // 商品列表信息
|
| | | int pageSize = 50;
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | // 先查询大淘客数据
|
| | | List<DaTaoKeDetail> listDaTaoKe = daTaoKeGoodsService.listBySellerId(0, pageSize, id);
|
| | | if (listDaTaoKe != null && listDaTaoKe.size() > 0) {
|
| | | for (DaTaoKeDetail daTaoKe : listDaTaoKe) {
|
| | | listGoodsBrief.add(TaoBaoUtil.convert(daTaoKe));
|
| | | }
|
| | | }
|
| | |
|
| | | // 不足50条数据、查询精选库
|
| | | if (listGoodsBrief.size() < pageSize) {
|
| | | int needCount = pageSize - listGoodsBrief.size();
|
| | | List<TaoBaoGoodsBrief> listGoods = taoBaoGoodsBriefService.listByShopId(0, needCount, id);
|
| | | if (listGoods != null && listGoods.size() > 0) {
|
| | |
|
| | | if (listGoodsBrief.size() > 0) {
|
| | | for (int i = 0; i < listGoods.size(); i++) {
|
| | | long aid = listGoods.get(i).getAuctionId();
|
| | | boolean isRepeat = false;
|
| | | for (TaoBaoGoodsBrief goodsBrief : listGoodsBrief) {
|
| | | long auctionId = goodsBrief.getAuctionId();
|
| | | if (auctionId == aid) {
|
| | | isRepeat = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (isRepeat) {
|
| | | listGoods.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | listGoodsBrief.addAll(listGoods);
|
| | | }
|
| | | }
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | if (listGoodsBrief.size() > 0) {
|
| | | List<Long> listGid = new ArrayList<Long>();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | listGid.add(taoBaoGoodsBrief.getAuctionId());
|
| | | }
|
| | | // API网络接口验证是否在售
|
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null;
|
| | | try {
|
| | | listTaoKeGoods = TaoKeApiUtil.getBatchGoodsInfo(listGid);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | // 商品信息过滤
|
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | boolean stateSale = false; // 默认停售
|
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId();
|
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) {
|
| | | Long auctionId = taoKeGoods.getAuctionId();
|
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) {
|
| | | stateSale = true; // 在售
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (!stateSale) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
|
| | | shareRate);
|
| | | array.add(gson.toJson(goodsDetailVO));
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | // 添加到更新列表
|
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 店铺足迹
|
| | | * |
| | | * @param acceptData
|
| | | * @param type
|
| | | * 精选1, 足迹列表2
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHistoryV2", method = RequestMethod.POST)
|
| | | public void getHistoryV2(AcceptData acceptData, Integer page, Long uid, Integer type, PrintWriter out) {
|
| | | if (type == null) {
|
| | | out.print(JsonUtil.loadFalseResult("类型不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult("页码不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int pageSize;
|
| | | if (type == 1) {
|
| | | pageSize = 4;
|
| | | } else {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | | |
| | | long count = 0;
|
| | | List<TaoBaoShopHistory> listHistory = null;
|
| | | if (uid == null || uid == 0) {
|
| | | String device = acceptData.getDevice();
|
| | | count = taoBaoShopHistoryService.countByDevice(device);
|
| | | if (count > 0) {
|
| | | listHistory = taoBaoShopHistoryService.listByDevice((page - 1) * pageSize, pageSize, device);
|
| | | }
|
| | | } else {
|
| | | count = taoBaoShopHistoryService.countByUid(uid);
|
| | | if (count > 0) {
|
| | | listHistory = taoBaoShopHistoryService.listByUid((page - 1) * pageSize, pageSize, uid);
|
| | | }
|
| | | }
|
| | | |
| | | List<BrandInfo> list = new ArrayList<BrandInfo>();
|
| | | if (listHistory != null && listHistory.size() > 0) {
|
| | | for (TaoBaoShopHistory history : listHistory) {
|
| | | TaoBaoShop taoBaoShop = history.getTaoBaoShop();
|
| | | if (taoBaoShop == null)
|
| | | continue;
|
| | | |
| | | String shopNameCustom = taoBaoShop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShop.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | | String shopIconCustom = taoBaoShop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShop.setShopIcon(shopIconCustom);
|
| | | }
|
| | | |
| | | BrandInfo brandInfo = new BrandInfo();
|
| | | brandInfo.setId(taoBaoShop.getId());
|
| | | brandInfo.setName(taoBaoShop.getShopName());
|
| | | brandInfo.setIcon(taoBaoShop.getShopIcon());
|
| | | list.add(brandInfo);
|
| | | }
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.search.SearchKeyVO;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | root.put("scoreExchange", getScoreExchangeInfo(acceptData));
|
| | |
|
| | | root.put("searchDiscovery", getSearchDiscoveryInfo(acceptData));
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "获取数据失败"));
|
| | |
| | | root.put("tagImg", "http://img.flqapp.com/resource/score_exchange_tag.png");
|
| | | return root;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 金币兑换信息
|
| | | * |
| | | * @param acceptData
|
| | | * @return
|
| | | */
|
| | | private JSONObject getSearchDiscoveryInfo(AcceptData acceptData) {
|
| | | JSONArray array = new JSONArray();
|
| | | String keys = configService.get("search_discovery_keys");
|
| | | if (!StringUtil.isNullOrEmpty(keys)) {
|
| | | JSONArray arrayKeys = JSONArray.fromObject(keys);
|
| | | for (int i = 0; i < arrayKeys.size(); i++) {
|
| | | String name = arrayKeys.get(i).toString();
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("searchKey", name);
|
| | | |
| | | SearchKeyVO keyVO = new SearchKeyVO();
|
| | | keyVO.setName(name);
|
| | | keyVO.setParams(params.toString());
|
| | | array.add(keyVO);
|
| | | }
|
| | | }
|
| | | |
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", configService.get("search_discovery_h5_link"));
|
| | | |
| | | JSONObject root = new JSONObject();
|
| | | root.put("picture", "http://img.flqapp.com/resource/home_search_found.png");
|
| | | root.put("params", params);
|
| | | root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
|
| | | |
| | | root.put("jumpResult", jumpDetailV2Service.getByTypeCache("search_goods_result",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
|
| | | root.put("keyList", array);
|
| | | return root;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 首页底部商品推荐
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.brand; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.brand.BrandInfo; |
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO; |
| | | |
| | | public interface BrandInfoMapper extends BaseMapper<BrandInfo> { |
| | | |
| | | int deleteBatchByPrimaryKey(List<Long> list); |
| | | |
| | | /** |
| | | * 查询返回前端品牌 |
| | | * @param start |
| | | * @param count |
| | | * @param cid |
| | | * @return |
| | | */ |
| | | List<BrandInfoVO> listBrandInfoVO(@Param("start")long start, @Param("count")int count,@Param("cid") Long cid); |
| | | |
| | | |
| | | long countBrandInfo(@Param("cid") Long cid); |
| | | |
| | | |
| | | /** |
| | | * 查询有效店铺 |
| | | * @param cid |
| | | * @return |
| | | */ |
| | | List<BrandInfoVO> listValidBrandInfoCache(@Param("cid") Long cid); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.brand; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.brand.BrandInfoRecord; |
| | | |
| | | public interface BrandInfoRecordMapper extends BaseMapper<BrandInfoRecord> { |
| | | |
| | | /** |
| | | * 将状态更新为删除状态 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | void updateState(@Param("brandId") Long brandId, @Param("uid") Long uid, @Param("device") String device); |
| | | |
| | | |
| | | /** |
| | | * 查询记录 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | BrandInfoRecord getRecord(@Param("brandId") Long brandId, @Param("uid") Long uid, @Param("device") String device); |
| | | |
| | | /** |
| | | * 查询历史记录 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<BrandInfoRecord> listRecord(@Param("start") long start, @Param("count") int count, |
| | | @Param("uid") Long uid, @Param("device") String device); |
| | | |
| | | long countRecord(@Param("uid") Long uid, @Param("device") String device); |
| | | |
| | | } |
| | |
| | | public interface IntegralDetailMapper extends BaseMapper<IntegralDetail> { |
| | | |
| | | /** |
| | | * 根据唯一值查询明细 |
| | | * @param uniqueKey |
| | | * @return |
| | | */ |
| | | IntegralDetail getDetailByUniqueKey(@Param("uniqueKey")String uniqueKey); |
| | | |
| | | /** |
| | | * 获取用户总共有多少记录数据 |
| | | * |
| | | * @param uid |
New file |
| | |
| | | package com.yeshi.fanli.entity.brand;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | /**
|
| | | * 品牌信息
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_brand_info")
|
| | | public class BrandInfo implements Serializable{
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "bf_id")
|
| | | private Long id;
|
| | | |
| | | @Column(name = "bf_cid")
|
| | | private BrandClass brandClass;// 分类
|
| | | |
| | | @Expose
|
| | | @Column(name = "bf_name")
|
| | | private String name; // 品牌名称
|
| | | |
| | | @Expose
|
| | | @Column(name = "bf_icon")
|
| | | private String icon; // 品牌logo
|
| | | |
| | | @Column(name = "bf_weight")
|
| | | private Double weight; // 权重:值越大越前
|
| | | |
| | | @Column(name = "bf_state")
|
| | | private Integer state;// 状态:0停用 1启用
|
| | | |
| | | @Column(name = "bf_create_time")
|
| | | private Date createTime;
|
| | | |
| | | @Column(name = "bf_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | |
| | | public BrandInfo() {}
|
| | | |
| | | |
| | | public BrandInfo(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | | |
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public BrandClass getBrandClass() {
|
| | | return brandClass;
|
| | | }
|
| | |
|
| | | public void setBrandClass(BrandClass brandClass) {
|
| | | this.brandClass = brandClass;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getIcon() {
|
| | | return icon;
|
| | | }
|
| | |
|
| | | public void setIcon(String icon) {
|
| | | this.icon = icon;
|
| | | }
|
| | |
|
| | | public Double getWeight() {
|
| | | return weight;
|
| | | }
|
| | |
|
| | | public void setWeight(Double weight) {
|
| | | this.weight = weight;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.entity.brand;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 品牌信息浏览记录
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_brand_info_record")
|
| | | public class BrandInfoRecord {
|
| | | |
| | | @Column(name = "bir_id")
|
| | | private Long id;
|
| | | |
| | | @Column(name = "bir_bid")
|
| | | private BrandInfo brandInfo;// 品牌信息
|
| | | |
| | | @Column(name = "bir_uid")
|
| | | private Long uid; |
| | | |
| | | @Column(name = "bir_device")
|
| | | private String device;
|
| | | |
| | | @Column(name = "bir_state")
|
| | | private Integer state;// 1已删除 0未删除
|
| | | |
| | | @Column(name = "bir_create_time")
|
| | | private Date createTime;
|
| | | |
| | | @Column(name = "bir_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public BrandInfo getBrandInfo() {
|
| | | return brandInfo;
|
| | | }
|
| | |
|
| | | public void setBrandInfo(BrandInfo brandInfo) {
|
| | | this.brandInfo = brandInfo;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public String getDevice() {
|
| | | return device;
|
| | | }
|
| | |
|
| | | public void setDevice(String device) {
|
| | | this.device = device;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | } |
| | |
| | | @Expose
|
| | | @Column(name = "td_remark")
|
| | | private String remark; // 备注
|
| | | |
| | | @Expose
|
| | | @Column(name = "td_unique_key")
|
| | | private String uniqueKey; // 唯一值
|
| | |
|
| | | @Expose
|
| | | @Column(name = "td_create_time")
|
| | |
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public String getUniqueKey() {
|
| | | return uniqueKey;
|
| | | }
|
| | |
|
| | | public void setUniqueKey(String uniqueKey) {
|
| | | this.uniqueKey = uniqueKey;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.brand;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class BrandInfoException extends BaseException {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public BrandInfoException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public BrandInfoException() {
|
| | | super();
|
| | | }
|
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.brand.BrandInfoMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.brand.BrandInfo"> |
| | | <id column="bf_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="bf_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="bf_icon" property="icon" jdbcType="VARCHAR"/> |
| | | <result column="bf_weight" property="weight" jdbcType="DOUBLE"/> |
| | | <result column="bf_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="bf_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="bf_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <association column="bf_cid" property="brandClass" javaType="com.yeshi.fanli.entity.brand.BrandClass"> |
| | | <id column="bf_cid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ResultVOMap" type="com.yeshi.fanli.vo.brand.BrandInfoVO"> |
| | | <id column="bf_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="bf_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="bf_icon" property="icon" jdbcType="VARCHAR"/> |
| | | <result column="bf_weight" property="weight" jdbcType="DOUBLE"/> |
| | | <result column="bf_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="bf_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="bf_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <association column="bf_cid" property="brandClass" javaType="com.yeshi.fanli.entity.brand.BrandClass"> |
| | | <id column="bf_cid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">bf_id,bf_cid,bf_name,bf_icon,bf_weight,bf_state,bf_create_time,bf_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_brand_info where bf_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_brand_info where bf_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.brand.BrandInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_brand_info (bf_id,bf_cid,bf_name,bf_icon,bf_weight,bf_state,bf_create_time,bf_update_time) values (#{id,jdbcType=BIGINT},#{brandClass.id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{weight,jdbcType=DOUBLE},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.brand.BrandInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_brand_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">bf_id,</if> |
| | | <if test="brandClass != null">bf_cid,</if> |
| | | <if test="name != null">bf_name,</if> |
| | | <if test="icon != null">bf_icon,</if> |
| | | <if test="weight != null">bf_weight,</if> |
| | | <if test="state != null">bf_state,</if> |
| | | <if test="createTime != null">bf_create_time,</if> |
| | | <if test="updateTime != null">bf_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="brandClass != null">#{brandClass.id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="icon != null">#{icon,jdbcType=VARCHAR},</if> |
| | | <if test="weight != null">#{weight,jdbcType=DOUBLE},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.brand.BrandInfo">update yeshi_ec_brand_info set bf_cid = #{brandClass.id,jdbcType=BIGINT},bf_name = #{name,jdbcType=VARCHAR},bf_icon = #{icon,jdbcType=VARCHAR},bf_weight = #{weight,jdbcType=DOUBLE},bf_state = #{state,jdbcType=INTEGER},bf_create_time = #{createTime,jdbcType=TIMESTAMP},bf_update_time = #{updateTime,jdbcType=TIMESTAMP} where bf_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.brand.BrandInfo">update yeshi_ec_brand_info |
| | | <set> |
| | | <if test="brandClass != null">bf_cid=#{brandClass.id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">bf_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="icon != null">bf_icon=#{icon,jdbcType=VARCHAR},</if> |
| | | <if test="weight != null">bf_weight=#{weight,jdbcType=DOUBLE},</if> |
| | | <if test="state != null">bf_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">bf_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">bf_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where bf_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List"> |
| | | delete from yeshi_ec_brand_info WHERE bf_id in |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </delete> |
| | | |
| | | <select id="listBrandInfoVO" resultMap="ResultVOMap"> |
| | | SELECT * FROM yeshi_ec_brand_info d |
| | | WHERE d.`bf_state` = 1 <if test="cid != null">AND d.`bf_cid` = #{cid} </if> |
| | | ORDER BY d.`bf_weight` DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countBrandInfo" resultType="Long"> |
| | | SELECT IFNULL(COUNT(d.`bf_id`),0) FROM yeshi_ec_brand_info d |
| | | WHERE d.`bf_state` = 1 <if test="cid != null">AND d.`bf_cid` = #{cid} </if> |
| | | </select> |
| | | |
| | | <select id="listValidBrandInfoCache" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_brand_info d |
| | | WHERE d.`bf_state` = 1 AND d.`bf_cid` = #{cid} |
| | | ORDER BY d.`bf_weight` DESC |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.brand.BrandInfoRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.brand.BrandInfoRecord"> |
| | | <id column="bir_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="bir_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="bir_device" property="device" jdbcType="VARCHAR"/> |
| | | <result column="bir_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="bir_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="bir_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <association column="bir_bid" property="brandInfo" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.brand.BrandInfoMapper.BaseResultMap"> |
| | | </association> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">bir_id,bir_bid,bir_uid,bir_device,bir_state,bir_create_time,bir_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_brand_info_record where bir_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_brand_info_record where bir_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.brand.BrandInfoRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_brand_info_record (bir_id,bir_bid,bir_uid,bir_device,bir_state,bir_create_time,bir_update_time) values (#{id,jdbcType=BIGINT},#{brandInfo.id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.brand.BrandInfoRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_brand_info_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">bir_id,</if> |
| | | <if test="brandInfo != null">bir_bid,</if> |
| | | <if test="uid != null">bir_uid,</if> |
| | | <if test="device != null">bir_device,</if> |
| | | <if test="state != null">bir_state,</if> |
| | | <if test="createTime != null">bir_create_time,</if> |
| | | <if test="updateTime != null">bir_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="brandInfo != null">#{brandInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="device != null">#{device,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.brand.BrandInfoRecord">update yeshi_ec_brand_info_record set bir_bid = #{brandInfo.id,jdbcType=BIGINT},bir_uid = #{uid,jdbcType=BIGINT},bir_device = #{device,jdbcType=VARCHAR},bir_state = #{state,jdbcType=INTEGER},bir_create_time = #{createTime,jdbcType=TIMESTAMP},bir_update_time = #{updateTime,jdbcType=TIMESTAMP} where bir_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.brand.BrandInfoRecord">update yeshi_ec_brand_info_record |
| | | <set> |
| | | <if test="brandInfo != null">bir_bid=#{brandInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">bir_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="device != null">bir_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">bir_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">bir_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">bir_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where bir_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <update id="updateState"> |
| | | update yeshi_ec_brand_info_record set bir_state = 1 |
| | | where bir_bid = #{brandId} |
| | | <if test="uid != null">AND bir_uid = #{uid}</if> |
| | | <if test="device != null">AND bir_device = #{device}</if> |
| | | </update> |
| | | |
| | | <select id="getRecord" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_brand_info_record |
| | | WHERE bir_bid = #{brandId} |
| | | <if test="uid != null">AND bir_uid = #{uid}</if> |
| | | <if test="device != null">AND bir_device = #{device}</if> |
| | | ORDER BY bir_update_time DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="listRecord" resultMap="BaseResultMap"> |
| | | SELECT * FROM |
| | | (SELECT bir_id FROM yeshi_ec_brand_info_record |
| | | WHERE bir_state = 0 |
| | | <if test="uid != null">AND bir_uid = #{uid}</if> |
| | | <if test="device != null">AND bir_device = #{device}</if> |
| | | GROUP BY bir_bid)A |
| | | LEFT JOIN yeshi_ec_brand_info_record h on A.bir_id = h.bir_id |
| | | LEFT JOIN `yeshi_ec_brand_info` p ON h.`bir_bid` = p.`bf_id` |
| | | ORDER BY h.bir_update_time DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countRecord" resultType="Long"> |
| | | SELECT IFNULL(COUNT(DISTINCT bir_bid),0) FROM yeshi_ec_brand_info_record |
| | | WHERE bir_state = 0 |
| | | <if test="uid != null">AND bir_uid = #{uid}</if> |
| | | <if test="device != null">AND bir_device = #{device}</if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="td_title" property="title" jdbcType="VARCHAR"/> |
| | | <result column="td_desc_info" property="descInfo" jdbcType="VARCHAR"/> |
| | | <result column="td_remark" property="remark" jdbcType="VARCHAR"/> |
| | | <result column="td_unique_key" property="uniqueKey" jdbcType="VARCHAR"/> |
| | | <result column="td_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="UserMonthMoneyMap" type="com.yeshi.fanli.vo.integral.IntegralMonthVO"> |
| | | <result column="expend" property="expend" jdbcType="DECIMAL" /> |
| | | <result column="income" property="income" jdbcType="DECIMAL" /> |
| | | <result column="dateFormate" property="dateFormate" jdbcType="VARCHAR" /> |
| | | <result column="expend" property="expend" jdbcType="DECIMAL" /> |
| | | <result column="income" property="income" jdbcType="DECIMAL" /> |
| | | <result column="dateFormate" property="dateFormate" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">td_id,td_uid,td_money,td_title,td_desc_info,td_remark,td_create_time</sql> |
| | | <sql id="Base_Column_List">td_id,td_uid,td_money,td_title,td_desc_info,td_remark,td_unique_key,td_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_integral_detail where td_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_integral_detail where td_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_detail (td_id,td_uid,td_money,td_title,td_desc_info,td_remark,td_create_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{descInfo,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_detail (td_id,td_uid,td_money,td_title,td_desc_info,td_remark,td_unique_key,td_create_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{descInfo,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{uniqueKey,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_detail |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">td_id,</if> |
| | |
| | | <if test="title != null">td_title,</if> |
| | | <if test="descInfo != null">td_desc_info,</if> |
| | | <if test="remark != null">td_remark,</if> |
| | | <if test="uniqueKey != null">td_unique_key,</if> |
| | | <if test="createTime != null">td_create_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="descInfo != null">#{descInfo,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="uniqueKey != null">#{uniqueKey,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralDetail">update yeshi_ec_integral_detail set td_uid = #{uid,jdbcType=BIGINT},td_money = #{money,jdbcType=INTEGER},td_title = #{title,jdbcType=VARCHAR},td_desc_info = #{descInfo,jdbcType=VARCHAR},td_remark = #{remark,jdbcType=VARCHAR},td_create_time = #{createTime,jdbcType=TIMESTAMP} where td_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralDetail">update yeshi_ec_integral_detail set td_uid = #{uid,jdbcType=BIGINT},td_money = #{money,jdbcType=INTEGER},td_title = #{title,jdbcType=VARCHAR},td_desc_info = #{descInfo,jdbcType=VARCHAR},td_remark = #{remark,jdbcType=VARCHAR},td_unique_key = #{uniqueKey,jdbcType=VARCHAR},td_create_time = #{createTime,jdbcType=TIMESTAMP} where td_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralDetail">update yeshi_ec_integral_detail |
| | | <set> |
| | | <if test="uid != null">td_uid=#{uid,jdbcType=BIGINT},</if> |
| | |
| | | <if test="title != null">td_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="descInfo != null">td_desc_info=#{descInfo,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">td_remark=#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="uniqueKey != null">td_unique_key=#{uniqueKey,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">td_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where td_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="selectCountByUid" resultType="java.lang.Long" parameterType="java.lang.Long"> |
| | | <select id="getDetailByUniqueKey" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_integral_detail |
| | | WHERE td_unique_key = #{uniqueKey} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectCountByUid" resultType="java.lang.Long" parameterType="java.lang.Long"> |
| | | SELECT count(td_id) FROM yeshi_ec_integral_detail |
| | | WHERE td_uid = #{uid} |
| | | <if test="type == 1">AND td_money <![CDATA[>]]> 0</if> |
| | |
| | | </trim> |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<TaoBaoShopVO> listEffectiveShop(long start, int count, Long cid) {
|
| | | if (cid != null && cid <= 0) {
|
| | | cid = null;
|
| | | }
|
| | | |
| | | List<TaoBaoShopVO> listInfo = taoBaoShopService.listBrandShopinfo(start, count, cid);
|
| | | if (listInfo == null || listInfo.size() == 0)
|
| | | return listInfo;
|
| | | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | // 淘宝商品信息过滤
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
|
| | |
|
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) {
|
| | | String shopNameCustom = taoBaoShopVO.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShopVO.setShopName(shopNameCustom);
|
| | | }
|
| | |
|
| | | String shopIconCustom = taoBaoShopVO.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShopVO.setShopIcon(shopIconCustom);
|
| | | }
|
| | |
|
| | | List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
|
| | | // 商品添加到更新队列
|
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory
|
| | | .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), null, fanLiRate, shareRate);
|
| | | listGoods.add(goodsDetailVO);
|
| | | }
|
| | | taoBaoShopVO.setListGoodsVO(listGoods);
|
| | | }
|
| | | return listInfo;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public long countBrandShopinfo(Long cid) {
|
| | | if (cid != null && cid <= 0) {
|
| | | cid = null;
|
| | | }
|
| | | return taoBaoShopService.countBrandShopinfo(cid);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public List<TaoBaoShop> listEffectiveClassShop(Long cid) {
|
| | | if (cid == null && cid <= 0)
|
| | | return null;
|
| | | |
| | | List<BrandClassShop> list = brandClassShopMapper.listEffective(cid);
|
| | | if (list == null || list.size() == 0)
|
| | | return null;
|
| | |
|
| | | List<TaoBaoShop> listShop = new ArrayList<TaoBaoShop>();
|
| | | for (BrandClassShop brandClassShop : list) {
|
| | | TaoBaoShop shop = brandClassShop.getShop();
|
| | | if (shop != null) {
|
| | | Integer userType = shop.getUserType();
|
| | | if (userType == null || userType == 0) {
|
| | | shop.setUserType(10);
|
| | | } else {
|
| | | shop.setUserType(11);
|
| | | }
|
| | |
|
| | | String shopLink = shop.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | shop.setShopLink(TaoBaoUtil.getShopLink(shop.getId()));
|
| | | }
|
| | |
|
| | | String shopNameCustom = shop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | shop.setShopName(shopNameCustom);
|
| | | }
|
| | |
|
| | | String shopIconCustom = shop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | shop.setShopIcon(shopIconCustom);
|
| | | }
|
| | |
|
| | | listShop.add(shop);
|
| | | }
|
| | | }
|
| | | return listShop;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.brand;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.brand.BrandInfoRecordMapper;
|
| | | import com.yeshi.fanli.entity.brand.BrandInfo;
|
| | | import com.yeshi.fanli.entity.brand.BrandInfoRecord;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoRecordService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class BrandInfoRecordServiceImpl implements BrandInfoRecordService {
|
| | | |
| | | @Resource
|
| | | private BrandInfoRecordMapper brandInfoRecordMapper;
|
| | |
|
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public void deleteRecord(List<Long> list, Long uid, String device) {
|
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | | |
| | | if ((uid == null || uid == 0) && StringUtil.isNullOrEmpty(device))
|
| | | return;
|
| | | |
| | | // 优先用户为主
|
| | | if (uid != null && uid > 0)
|
| | | device = null;
|
| | | |
| | | for (long brandId: list) {
|
| | | brandInfoRecordMapper.updateState(brandId, uid, device);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void addRecord(Long brandId, Long uid, String device) {
|
| | | if (brandId == null || brandId == 0)
|
| | | return;
|
| | | |
| | | if ((uid == null || uid == 0) && StringUtil.isNullOrEmpty(device))
|
| | | return;
|
| | | |
| | | // 优先用户为主
|
| | | if (uid != null && uid > 0)
|
| | | device = null;
|
| | | |
| | | BrandInfoRecord record = brandInfoRecordMapper.getRecord(brandId, uid, device);
|
| | | if (record != null) {
|
| | | BrandInfoRecord update = new BrandInfoRecord();
|
| | | update.setState(0);
|
| | | update.setId(record.getId());
|
| | | update.setUpdateTime(new Date());
|
| | | brandInfoRecordMapper.updateByPrimaryKeySelective(update);
|
| | | } else {
|
| | | record = new BrandInfoRecord();
|
| | | record.setUid(uid);
|
| | | record.setDevice(device);
|
| | | record.setBrandInfo(new BrandInfo(brandId));
|
| | | record.setCreateTime(new Date());
|
| | | record.setUpdateTime(new Date());
|
| | | brandInfoRecordMapper.insertSelective(record);
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<BrandInfoRecord> listRecord(long start, int count, Long uid, String device) {
|
| | | if ((uid == null || uid == 0) && StringUtil.isNullOrEmpty(device))
|
| | | return null;
|
| | | |
| | | // 优先用户为主
|
| | | if (uid != null && uid > 0)
|
| | | device = null;
|
| | | |
| | | return brandInfoRecordMapper.listRecord(start, count, uid, device);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countRecord(Long uid, String device) {
|
| | | if ((uid == null || uid == 0) && StringUtil.isNullOrEmpty(device))
|
| | | return 0;
|
| | | |
| | | // 优先用户为主
|
| | | if (uid != null && uid > 0)
|
| | | device = null;
|
| | | return brandInfoRecordMapper.countRecord(uid, device);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.brand;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.brand.BrandInfoMapper;
|
| | | import com.yeshi.fanli.entity.brand.BrandInfo;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.exception.brand.BrandInfoException;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | |
|
| | | @Service
|
| | | public class BrandInfoServiceImpl implements BrandInfoService {
|
| | | |
| | | @Resource
|
| | | private BrandInfoMapper brandInfoMapper;
|
| | | |
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | | |
| | | @Resource
|
| | | private BrandClassShopService brandClassShopService;
|
| | |
|
| | | |
| | | @Override
|
| | | public void saveObject(BrandInfo record) throws BrandInfoException{
|
| | | String name = record.getName();
|
| | | if (name == null || name.trim().length() == 0)
|
| | | throw new BrandInfoException(1, "名称不能为空");
|
| | | |
| | | Integer state = record.getState();
|
| | | if (state == null)
|
| | | record.setState(0);
|
| | | |
| | | Long id = record.getId();
|
| | | if (id == null) {
|
| | | record.setCreateTime(new Date());
|
| | | record.setUpdateTime(new Date());
|
| | | brandInfoMapper.insert(record);
|
| | | } else {
|
| | | BrandInfo resultObj = brandInfoMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null)
|
| | | throw new BrandInfoException(1, "修改内容已不存在");
|
| | | |
| | | record.setCreateTime(resultObj.getCreateTime());
|
| | | record.setUpdateTime(new Date());
|
| | | brandInfoMapper.updateByPrimaryKey(record);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public int deleteBatchByPrimaryKey(List<Long> list) {
|
| | | return brandInfoMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<BrandInfo> listQuery(long start, int count, String key, Integer state) {
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer state) {
|
| | | return 0;
|
| | | }
|
| | | |
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'listValidBrandInfoCache-'+#cid")
|
| | | public List<BrandInfo> listValidBrandInfoCache(Long cid) {
|
| | | List<BrandInfo> listInfo = new ArrayList<BrandInfo>();
|
| | | |
| | | List<TaoBaoShop> listShop = brandClassShopService.listEffectiveClassShop(cid);
|
| | | if (listShop == null || listShop.size() == 0)
|
| | | return listInfo;
|
| | | for (TaoBaoShop taoBaoShop : listShop) {
|
| | | BrandInfo brandInfo = new BrandInfo();
|
| | | brandInfo.setId(taoBaoShop.getId());
|
| | | brandInfo.setName(taoBaoShop.getShopName());
|
| | | brandInfo.setIcon(taoBaoShop.getShopIcon());
|
| | | listInfo.add(brandInfo);
|
| | | }
|
| | | return listInfo;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'listBrandInfoCache-'+#start+'-'+#start +'-'+#cid")
|
| | | public List<BrandInfoVO> listBrandInfoCache(long start, int count, Long cid) {
|
| | | List<BrandInfoVO> listInfo = new ArrayList<BrandInfoVO>();
|
| | | |
| | | List<TaoBaoShopVO> listShop = brandClassShopService.listEffectiveShop(start, count, cid);
|
| | | if (listShop == null || listShop.size() == 0)
|
| | | return listInfo;
|
| | | |
| | | for (TaoBaoShopVO taoBaoShopVO : listShop) {
|
| | | String shopNameCustom = taoBaoShopVO.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShopVO.setShopName(shopNameCustom);
|
| | | }
|
| | | String shopIconCustom = taoBaoShopVO.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShopVO.setShopIcon(shopIconCustom);
|
| | | }
|
| | | |
| | | BrandInfoVO brandInfoVO = new BrandInfoVO();
|
| | | brandInfoVO.setId(taoBaoShopVO.getId());
|
| | | brandInfoVO.setName(taoBaoShopVO.getShopName());
|
| | | brandInfoVO.setIcon(taoBaoShopVO.getShopIcon());
|
| | | brandInfoVO.setListGoods(taoBaoShopVO.getListGoodsVO());
|
| | | listInfo.add(brandInfoVO);
|
| | | }
|
| | | return listInfo;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public long countBrandInfo(Long cid){
|
| | | return brandClassShopService.countBrandShopinfo(cid);
|
| | | }
|
| | | }
|
| | |
| | | integralDetailMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public IntegralDetail getDetailByUniqueKey(String uniqueKey) {
|
| | | return integralDetailMapper.getDetailByUniqueKey(uniqueKey);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<IntegralDetailVO> listDetailForClient(Long uid, Long detailId, Date maxTime, Integer type) {
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
| | | @Resource
|
| | | private IntegralTaskService integralTaskService;
|
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | | private IntegralTaskClassService integralTaskClassService;
|
| | |
|
| | |
| | | return integralTaskRecordMapper.listByUidAndTaskId(uid, taskId, (page - 1) * count, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 被邀请人下了首单(第一笔返利订单) 直接给邀请人一笔金币
|
| | | * @param uid
|
| | | */
|
| | | |
| | | // @Async()
|
| | | @Override
|
| | | public void firstOrderRewardInviter(Long uid, String beizu) {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null) |
| | | public void firstRebateOrderRewardBoss(Long uid, Long originUid, String beizu) {
|
| | | if (uid == null || originUid == null)
|
| | | return;
|
| | |
|
| | | String reward = configService.get("first_order_reward_boss");
|
| | | if (StringUtil.isNullOrEmpty(reward))
|
| | | return;
|
| | | firstOrderReward(uid, originUid, Integer.parseInt(reward), "一", beizu);
|
| | | }
|
| | | |
| | | // @Async()
|
| | | @Override
|
| | | public void firstRebateOrderRewardBossSuper(Long uid, Long originUid, String beizu) {
|
| | | if (uid == null || originUid == null)
|
| | | return;
|
| | | |
| | | String reward = configService.get("first_order_reward_boss_super");
|
| | | if (StringUtil.isNullOrEmpty(reward)) |
| | | return;
|
| | | firstOrderReward(uid, originUid, Integer.parseInt(reward), "二", beizu);
|
| | | }
|
| | | |
| | | |
| | | // @Async()
|
| | | @Override
|
| | | public void firstShareOrderReward(Long uid, String beizu) {
|
| | | if(uid == null)
|
| | | return;
|
| | | |
| | | String reward = configService.get("first_share_order_reward");
|
| | | if (StringUtil.isNullOrEmpty(reward)) |
| | | return;
|
| | | firstOrderReward(uid, null, Integer.parseInt(reward), null, beizu);
|
| | | }
|
| | | |
| | | |
| | | // @Async()
|
| | | @Override
|
| | | public void firstSharerOrderRewardBoss(Long uid, Long originUid, String beizu) {
|
| | | if (uid == null || originUid == null)
|
| | | return;
|
| | | |
| | | String reward = configService.get("first_share_order_reward_boss");
|
| | | if (StringUtil.isNullOrEmpty(reward)) |
| | | return;
|
| | | firstOrderReward(uid, originUid, Integer.parseInt(reward), "一", beizu);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 队员首单奖励金币
|
| | | * @param uid
|
| | | * @param addGoldCoin
|
| | | * @param level 所属哪级队员
|
| | | * @param beizu
|
| | | */
|
| | | private void firstOrderReward(Long uid, Long originUid, Integer addGoldCoin, String level, String beizu) {
|
| | | String uniqueKey = "firstOrder-"+ uid.toString();
|
| | | if (originUid != null) |
| | | uniqueKey = uniqueKey + "-" + originUid;
|
| | | |
| | | // 判断是否已领取
|
| | | IntegralDetail detailRecord = integralDetailService.getDetailByUniqueKey(uniqueKey);
|
| | | if (detailRecord != null)
|
| | | return;
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null) |
| | | return;
|
| | |
|
| | | Integer goldCoin = userInfoExtra.getGoldCoin();
|
| | | if (goldCoin == null)
|
| | | goldCoin = 0;
|
| | | |
| | | int addGoldCoin = Integer.parseInt(reward);
|
| | | goldCoin = goldCoin + addGoldCoin;
|
| | |
|
| | | try {
|
| | | // 增加金币
|
| | | UserInfoExtra extra = new UserInfoExtra();
|
| | | extra.setId(userInfoExtra.getId());
|
| | | extra.setGoldCoin(goldCoin);
|
| | | userInfoExtraService.saveUserInfoExtra(extra);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | return;
|
| | | }
|
| | |
|
| | | // 金币详情
|
| | | IntegralDetail detail = new IntegralDetail();
|
| | | detail.setTitle("队员首笔奖励");
|
| | | detail.setTitle("金币奖励");
|
| | | detail.setUid(uid);
|
| | | detail.setMoney(addGoldCoin);
|
| | | detail.setRemark(beizu);
|
| | | detail.setUniqueKey(uniqueKey);
|
| | | detail.setCreateTime(new Date());
|
| | | integralDetailService.insertSelective(detail);
|
| | |
|
| | | // 消息
|
| | | MsgOtherRewardIntegralDTO msgOther = new MsgOtherRewardIntegralDTO();
|
| | | msgOther.setTitle("金币奖励");
|
| | | msgOther.setSource("一级队员首笔下单,系统奖励邀请人金币");
|
| | | msgOther.setNum(addGoldCoin + "金币");
|
| | | msgOther.setTotal(goldCoin + "金币");
|
| | | msgOther.setExplain("仅一级队员首笔下单奖励");
|
| | | userOtherMsgNotificationService.firstOrderRewardMsg(uid, "订单已到账后系统会自动奖励", msgOther);
|
| | | if (StringUtil.isNullOrEmpty(level)) {
|
| | | msgOther.setSource("首笔分享订单,系统奖励金币 ");
|
| | | msgOther.setExplain("首笔分享订单得到的奖金不足0.01元时奖励 ");
|
| | | } else {
|
| | | msgOther.setSource(level + "级队员首次下单,系统奖励金币 ");
|
| | | msgOther.setExplain("仅新邀请队员首下单你得到的奖金不足0.01元时奖励 ");
|
| | | }
|
| | | userOtherMsgNotificationService.firstOrderRewardMsg(uid, null, msgOther);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.entity.brand.BrandClassShop;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.exception.brand.BrandClassShopException;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | public JSONObject listEffectiveCacheV2(int page, Long cid);
|
| | |
|
| | | |
| | | /**
|
| | | * 兼容2.0
|
| | | * @param start
|
| | | * @param count
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoShopVO> listEffectiveShop(long start, int count, Long cid);
|
| | |
|
| | | |
| | | |
| | | public long countBrandShopinfo(Long cid);
|
| | |
|
| | | |
| | | /**
|
| | | * 分类下店铺
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoShop> listEffectiveClassShop(Long cid);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.brand;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.brand.BrandInfoRecord;
|
| | |
|
| | | /**
|
| | | * 店铺足迹
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface BrandInfoRecordService {
|
| | |
|
| | | /**
|
| | | * 足迹列表
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<BrandInfoRecord> listRecord(long start, int count, Long uid, String device);
|
| | |
|
| | | public long countRecord(Long uid, String device);
|
| | |
|
| | |
|
| | | /**
|
| | | * 添加历史记录
|
| | | * @param shopId
|
| | | * @param uid
|
| | | * @param device
|
| | | */
|
| | | public void addRecord(Long brandId, Long uid, String device);
|
| | |
|
| | | /**
|
| | | * 删除足迹
|
| | | * @param list
|
| | | * @param uid
|
| | | * @param device
|
| | | */
|
| | | public void deleteRecord(List<Long> list, Long uid, String device);
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.brand;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.brand.BrandInfo;
|
| | | import com.yeshi.fanli.exception.brand.BrandClassException;
|
| | | import com.yeshi.fanli.exception.brand.BrandInfoException;
|
| | | import com.yeshi.fanli.vo.brand.BrandInfoVO;
|
| | |
|
| | | /**
|
| | | * 品牌信息
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface BrandInfoService {
|
| | |
|
| | | |
| | | /**
|
| | | * 保存品牌信息
|
| | | * @param record
|
| | | * @throws BrandClassException
|
| | | * @throws Exception
|
| | | */
|
| | | public void saveObject(BrandInfo record) throws BrandInfoException;
|
| | |
|
| | | |
| | | /**
|
| | | * 批量删除
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public int deleteBatchByPrimaryKey(List<Long> list);
|
| | | |
| | | |
| | | /**
|
| | | * 查询列表
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public List<BrandInfo> listQuery(long start, int count, String key, Integer state);
|
| | |
|
| | | public long countQuery(String key, Integer state);
|
| | |
|
| | | /**
|
| | | * 查询品牌返回前端
|
| | | * @param start
|
| | | * @param count
|
| | | * @param cid
|
| | | * @return
|
| | | * @throws BrandInfoException
|
| | | */
|
| | | public List<BrandInfoVO> listBrandInfoCache(long start, int count, Long cid);
|
| | |
|
| | |
|
| | | /**
|
| | | * 品牌数量
|
| | | * @param cid
|
| | | * @return
|
| | | * @throws BrandInfoException
|
| | | */
|
| | | public long countBrandInfo(Long cid);
|
| | |
|
| | | /**
|
| | | * 有效店铺
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<BrandInfo> listValidBrandInfoCache(Long cid);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void insertSelective(IntegralDetail record);
|
| | |
|
| | | |
| | | /**
|
| | | * 唯一值查询
|
| | | * @param uniqueKey
|
| | | * @return
|
| | | */
|
| | | public IntegralDetail getDetailByUniqueKey(String uniqueKey);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public long countByCidAndUidAndCreateTime(Long cid,Long uid, Date minTime, Date maxTime);
|
| | |
|
| | | |
| | | /**
|
| | | * 被邀请人下了首单(第一笔返利订单),则直接给邀请人一笔金币进入到金币余额中(金币的额度暂定为1500金币)
|
| | | * @param uid 邀请人id
|
| | | * @param beizu 备注信息
|
| | | * 补偿上级 :一级队员首笔返利订单不足0.01元
|
| | | * @param uid
|
| | | * @param beizu
|
| | | */
|
| | | public void firstOrderRewardInviter(Long uid, String beizu);
|
| | | public void firstRebateOrderRewardBoss(Long uid, Long originUid, String beizu);
|
| | |
|
| | | /**
|
| | | * 补偿上上级:二级队员首笔返利订单不足0.01元
|
| | | * @param uid
|
| | | * @param beizu
|
| | | */
|
| | | public void firstRebateOrderRewardBossSuper(Long uid, Long originUid,String beizu);
|
| | |
|
| | | /**
|
| | | * 首笔分享订单不足0.01元补偿
|
| | | * @param uid
|
| | | * @param beizu
|
| | | */
|
| | | public void firstShareOrderReward(Long uid, String beizu);
|
| | |
|
| | | /**
|
| | | * 补偿上级 :首笔分享订单不足0.01元补偿
|
| | | * @param uid
|
| | | * @param beizu
|
| | | */
|
| | | public void firstSharerOrderRewardBoss(Long uid, Long originUid, String beizu);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.brand;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.brand.BrandInfo;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | public class BrandInfoVO extends BrandInfo implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Expose
|
| | | private List<GoodsDetailVO> listGoods;
|
| | |
|
| | | public List<GoodsDetailVO> getListGoods() {
|
| | | return listGoods;
|
| | | }
|
| | |
|
| | | public void setListGoods(List<GoodsDetailVO> listGoods) {
|
| | | this.listGoods = listGoods;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.search;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class SearchKeyVO implements Serializable {
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | // 搜索词
|
| | | @Expose
|
| | | private String name;
|
| | | // 跳转参数
|
| | | @Expose
|
| | | private String params;
|
| | | |
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | | public String getParams() {
|
| | | return params;
|
| | | }
|
| | | public void setParams(String params) {
|
| | | this.params = params;
|
| | | } |
| | | }
|