| | |
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | |
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.RecommendUserGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | | import com.yeshi.fanli.exception.goods.RecommendUserGoodsException;
|
| | | import com.yeshi.fanli.exception.msg.UserSystemMsgException;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendUserGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgAccountDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgMoneyDetailService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.msg.UserHomeMsgVO;
|
| | | import com.yeshi.fanli.vo.msg.UserMsgVO;
|
| | | import com.yeshi.fanli.vo.msg.UserSystemMsgVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserSystemMsgService userSystemMsgService;
|
| | |
|
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | @Resource
|
| | | private QualityFactoryService qualityFactoryService;
|
| | |
|
| | | // 消息的类型
|
| | | final static String MSG_TYPE_ORDER = "order";
|
| | |
| | | return builder;
|
| | | }
|
| | |
|
| | | private void addRecommendGoods(Long uid, String imei, String idfa) {
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa);
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) {
|
| | | for (int i = 0; i < result.getTaoBaoGoodsBriefs().size(); i++) {
|
| | | if (result.getTaoBaoGoodsBriefs().get(i).getCouponAmount() == null
|
| | | || result.getTaoBaoGoodsBriefs().get(i).getCouponAmount().compareTo(new BigDecimal(0)) <= 0) {
|
| | | result.getTaoBaoGoodsBriefs().remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | // 随机几个
|
| | | int count = (int) (Math.random() * 3) + 1;
|
| | | Set<Integer> positionList = new HashSet<>();
|
| | | for (int i = 0; i < count; i++)
|
| | | if (result.getTaoBaoGoodsBriefs().size() > 0) {
|
| | | positionList.add((int) (result.getTaoBaoGoodsBriefs().size() * Math.random()));
|
| | | }
|
| | |
|
| | | if (positionList != null && positionList.size() > 0) {
|
| | | List<CommonGoods> goodsList = new ArrayList<>();
|
| | | for (Integer p : positionList) {
|
| | | TaoBaoGoodsBrief goodsB = result.getTaoBaoGoodsBriefs().get(p);
|
| | | try {
|
| | | CommonGoods cgoods = commonGoodsService
|
| | | .addOrUpdateCommonGoods(CommonGoodsFactory.create(goodsB));
|
| | | goodsList.add(cgoods);
|
| | | } catch (CommonGoodsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | try {
|
| | | recommendUserGoodsService.addRecommend(uid, "", goodsList);
|
| | | } catch (RecommendUserGoodsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecommendGoods(Long uid) {
|
| | | List<QualityFactory> qfList = qualityFactoryService.listByMinSalesCountOrderByCreateTimeDesc(10000, 1, 20);
|
| | | if (qfList != null && qfList != null) {
|
| | | for (int i = 0; i < qfList.size(); i++) {
|
| | | if (qfList.get(i).getTaoBaoGoodsBrief().getCouponAmount() == null
|
| | | || qfList.get(i).getTaoBaoGoodsBrief().getCouponAmount().compareTo(new BigDecimal(0)) <= 0) {
|
| | | qfList.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | // 随机几个
|
| | | int count = (int) (Math.random() * 3) + 1;
|
| | | Set<Integer> positionList = new HashSet<>();
|
| | | for (int i = 0; i < count; i++)
|
| | | if (qfList.size() > 0) {
|
| | | positionList.add((int) (qfList.size() * Math.random()));
|
| | | }
|
| | |
|
| | | if (positionList != null && positionList.size() > 0) {
|
| | | List<CommonGoods> goodsList = new ArrayList<>();
|
| | | for (Integer p : positionList) {
|
| | | TaoBaoGoodsBrief goodsB = qfList.get(p).getTaoBaoGoodsBrief();
|
| | | try {
|
| | | CommonGoods cgoods = commonGoodsService
|
| | | .addOrUpdateCommonGoods(CommonGoodsFactory.create(goodsB));
|
| | | goodsList.add(cgoods);
|
| | | } catch (CommonGoodsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | try {
|
| | | recommendUserGoodsService.addRecommend(uid, "", goodsList);
|
| | | } catch (RecommendUserGoodsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取首页消息
|
| | | *
|
| | |
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (page == 1) {
|
| | | boolean canAdd = false;
|
| | | int hour = Calendar.getInstance().get(Calendar.HOUR);
|
| | | RecommendUserGoods goods = recommendUserGoodsService.getLatestRecommendUserGoods(uid);
|
| | | if (goods == null) {
|
| | | canAdd = true;
|
| | | } else {
|
| | | // 是否和上次间隔时间足够
|
| | | if (System.currentTimeMillis() - goods.getCreateTime().getTime() >= 1000 * 60 * 60 * 8L) {
|
| | | canAdd = true;
|
| | | }
|
| | | }
|
| | |
|
| | | if (canAdd) {
|
| | | if (hour < 12)
|
| | | addRecommendGoods(uid);
|
| | | else
|
| | | addRecommendGoods(uid, acceptData.getImei(), acceptData.getIdfa());
|
| | | }
|
| | | }
|
| | |
|
| | | List<UserHomeMsgVO> volist = new ArrayList<>();
|
| | |
| | | new UserSystemMsgVO(usm.getId(), usm.getType().name(), usm.getSolved(), usm.getTitle(),
|
| | | usm.getContent(),
|
| | | usm.getTimeTag() == 1 ? "http://img.flqapp.com/resource/msg/icon_emergent.png" : "",
|
| | | Constant.systemCommonConfig.getDefaultPortrait(), getTimeDesc(now, usm.getCreateTime()),
|
| | | num.getTypeSystem()));
|
| | | "http://img.flqapp.com/resource/msg/icon_msg_system.png",
|
| | | getTimeDesc(now, usm.getCreateTime()), num.getTypeSystem()));
|
| | | }
|
| | | root.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.goods; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.goods.RecommendUserGoodsMap; |
| | | |
| | | public interface RecommendUserGoodsMapMapper extends BaseMapper<RecommendUserGoodsMap>{ |
| | | |
| | | List<RecommendUserGoodsMap> listByUidAndCommonGoodsId(@Param("uid") Long uid, |
| | | @Param("commonGoodsId") Long commonGoodsId); |
| | | |
| | | Long countByUidAndCommonGoodsId(@Param("uid") Long uid, @Param("commonGoodsId") Long commonGoodsId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Long countRecommendGoods(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 获取最近的推荐 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | RecommendUserGoods getLatestRecommendUserGoods(Long uid); |
| | | } |
| | |
| | | |
| | | int updateByPrimaryKey(QualityFactory record); |
| | | |
| | | |
| | | /** |
| | | * 批量插入 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int insertBatch(List<QualityFactory> list); |
| | | |
| | | |
| | | /** |
| | | * 批量选择更新 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int updateBatchSelective(List<QualityFactory> list); |
| | | |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 统计总行数 |
| | | * |
| | | * @return |
| | | */ |
| | | Long countTotalRows(@Param("days") Integer days); |
| | | |
| | | |
| | | List<QualityFactory> queryByGoodsId(@Param("goodsId") Long goodsId); |
| | | |
| | | |
| | | /** |
| | | * 根据多个商品id 查询对应的商品信息 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<QualityFactory> listQueryGoodsByGoodsId(List<Long> list); |
| | | |
| | | |
| | | Long queryCountByGoodsId(@Param("goodsId") Long goodsId); |
| | | |
| | | List<QualityFactory> listQueryByAuctionId(List<Long> list); |
| | | |
| | | |
| | | // 精选库查询 -- 查询所有 |
| | | List<QualityFactory> queryAll(@Param("start") long start, @Param("count") int count,@Param("days") Integer days); |
| | | |
| | | |
| | | // 待更新精选商品id |
| | | List<Long> queryNeedUpdate(@Param("start") long start, @Param("count") int count, @Param("hour") int hour); |
| | | |
| | | // 统计需更新商品数量 |
| | | long countQueryNeedUpdate(); |
| | | |
| | | |
| | | // 精选库查询 |
| | | List<QualityFactory> query(@Param("start") long start, @Param("count") int count, @Param("key") String key, |
| | |
| | | // 类目id 搜索此类型 |
| | | @Param("gcid") Long gcid, @Param("keyType") Integer keyType); |
| | | |
| | | |
| | | |
| | | long queryCount( @Param("key") String key, @Param("goodsSource") Integer goodsSource, @Param("days") Integer days, |
| | | // 在售价范围 |
| | | @Param("startZkPrice") Integer startZkPrice, @Param("endZkPrice") Integer endZkPrice, |
| | |
| | | |
| | | /** |
| | | * 统计商品数量 |
| | | * |
| | | * @return |
| | | */ |
| | | Map<String, Object> getCountAll(); |
| | | |
| | | /** |
| | | * 根据商品id移除精选库 |
| | | * |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | int deleteByGoodsId(Long goodsId); |
| | | |
| | | |
| | | /** |
| | | * 查询精选商品数据应用前端 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | * @return |
| | | */ |
| | | List<QualityFactory> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key, |
| | | @Param("systemCid") Long systemCid, @Param("labId") Long labId, @Param("cids") String cids, @Param("hasQuan") Integer hasQuan);// 分类id、标签id |
| | | @Param("systemCid") Long systemCid, @Param("labId") Long labId, @Param("cids") String cids, |
| | | @Param("hasQuan") Integer hasQuan);// 分类id、标签id |
| | | |
| | | /** |
| | | * 对应查询精选商品数据应用前端统计 |
| | | */ |
| | | long countQuery( @Param("key") String key, @Param("systemCid") Long systemCid, |
| | | @Param("labId") Long labId, @Param("cids") String cids, @Param("hasQuan") Integer hasQuan); |
| | | |
| | | |
| | | long countQuery(@Param("key") String key, @Param("systemCid") Long systemCid, @Param("labId") Long labId, |
| | | @Param("cids") String cids, @Param("hasQuan") Integer hasQuan); |
| | | |
| | | /** |
| | | * 根据关键词 搜索商品标题和标签 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param systemCid |
| | |
| | | * @return |
| | | */ |
| | | List<QualityFactory> listQueryByKeyAndlabIDs(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("list") List<Long> list, |
| | | @Param("sort") Integer sort,@Param("systemCid") Long systemCid, |
| | | @Param("hasQuan") Integer hasQuan, @Param("userType") Integer userType, @Param("biz30day") Integer biz30day, |
| | | @Param("key") String key, @Param("list") List<Long> list, @Param("sort") Integer sort, |
| | | @Param("systemCid") Long systemCid, @Param("hasQuan") Integer hasQuan, @Param("userType") Integer userType, |
| | | @Param("biz30day") Integer biz30day, |
| | | // 在售价范围 |
| | | @Param("startprice") Integer startprice, @Param("endprice") Integer endprice); |
| | | |
| | |
| | | // 在售价范围 |
| | | @Param("startprice") Integer startprice, @Param("endprice") Integer endprice); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据类目id删除商品 |
| | | * |
| | | * @param doTime |
| | | * @param gcids |
| | | * @return |
| | | */ |
| | | int removeStorageGoods(String doTime, Long gcids); |
| | | |
| | | |
| | | /** |
| | | * 今日必抢 - 9k9 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param systemCid |
| | |
| | | * @return |
| | | */ |
| | | List<QualityFactory> listQueryEverydayRob(@Param("start") long start, @Param("count") int count, |
| | | @Param("systemCid")Long systemCid, @Param("labId")Long labId, |
| | | @Param("sortField")Integer sortField, |
| | | @Param("systemCid") Long systemCid, @Param("labId") Long labId, @Param("sortField") Integer sortField, |
| | | @Param("startCouponAmount")Double startCouponAmount, @Param("endCouponAmount")Double endCouponAmount); |
| | | |
| | | long countQueryEverydayRob(@Param("systemCid")Long systemCid, @Param("labId")Long labId, |
| | | @Param("startCouponAmount")Double startCouponAmount, @Param("endCouponAmount")Double endCouponAmount); |
| | | |
| | | |
| | | /** |
| | | * 子类查询 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | * @param labId |
| | | * @return |
| | | */ |
| | | List<QualityFactory> listQueryByKey(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("sort") Integer sort, @Param("systemCid")Long systemCid, |
| | | @Param("hasQuan") Integer hasQuan, @Param("userType") Integer userType, @Param("biz30day") Integer biz30day, |
| | | List<QualityFactory> listQueryByKey(@Param("start") long start, @Param("count") int count, @Param("key") String key, |
| | | @Param("sort") Integer sort, @Param("systemCid") Long systemCid, @Param("hasQuan") Integer hasQuan, |
| | | @Param("userType") Integer userType, @Param("biz30day") Integer biz30day, |
| | | // 在售价范围 |
| | | @Param("startprice") Integer startprice, @Param("endprice") Integer endprice); |
| | | |
| | |
| | | // 在售价范围 |
| | | @Param("startprice") Integer startprice, @Param("endprice") Integer endprice); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 券面额数据查询 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | @Param("startAmount") Integer startAmount, @Param("endAmount") Integer endAmount, |
| | | @Param("startPropor") Integer startPropor); |
| | | |
| | | long countQueryByCouponAmount(@Param("startAmount") Integer startAmount, |
| | | @Param("endAmount") Integer endAmount, @Param("startPropor") Integer startPropor); |
| | | |
| | | long countQueryByCouponAmount(@Param("startAmount") Integer startAmount, @Param("endAmount") Integer endAmount, |
| | | @Param("startPropor") Integer startPropor); |
| | | |
| | | /** |
| | | * 限时抢购商品 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param periodtime |
| | |
| | | |
| | | long countQueryByFlashSale(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 返利金额数据查询 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | long countQueryByRebateAmount(@Param("proportion") String proportion, @Param("startAmount") Integer startAmount, |
| | | @Param("endAmount") Integer endAmount, @Param("tkRate") double tkRate); |
| | | |
| | | |
| | | /** |
| | | * 返利金额数据查询 - 首页下方数据 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | */ |
| | | List<QualityFactory> listRecommendToIndex(@Param("start") long start, @Param("count") int count, |
| | | @Param("proportion") Double proportion, @Param("commision") Integer commision, |
| | | @Param("couponAmount") Integer couponAmount, @Param("tkRate") double tkRate, @Param("couponRatio") Double couponRatio); |
| | | @Param("couponAmount") Integer couponAmount, @Param("tkRate") double tkRate, |
| | | @Param("couponRatio") Double couponRatio); |
| | | |
| | | long countRecommendToIndex(@Param("proportion") Double proportion, @Param("commision") Integer commision, |
| | | @Param("couponAmount") Integer couponAmount, @Param("tkRate") double tkRate, @Param("couponRatio") Double couponRatio); |
| | | |
| | | @Param("couponAmount") Integer couponAmount, @Param("tkRate") double tkRate, |
| | | @Param("couponRatio") Double couponRatio); |
| | | |
| | | /** |
| | | * 根据时间 获取dateTime时间之前创建的商品信息 |
| | | * @param systemCid 系统分类id |
| | | * @param dateTime 筛选时间 |
| | | * @param goodsSource 商品来源 |
| | | * |
| | | * @param systemCid |
| | | * 系统分类id |
| | | * @param dateTime |
| | | * 筛选时间 |
| | | * @param goodsSource |
| | | * 商品来源 |
| | | * @return |
| | | */ |
| | | List<Long> getAuctionIdbyClassId(@Param("systemCid") Long systemCid, @Param("goodsSource") Integer goodsSource, |
| | |
| | | |
| | | /** |
| | | * 更新权重 |
| | | * |
| | | * @param weight |
| | | * @param time |
| | | * @return |
| | | */ |
| | | void updateWeight(@Param("weight") Integer weight, @Param("time") Integer time); |
| | | |
| | | |
| | | // 查询优惠券-当日 |
| | | List<QualityFactory> queryToCouponColumn(@Param("start") long start, @Param("count") int count); |
| | | |
| | | long countQueryToCouponColumn(); |
| | | |
| | | |
| | | /** |
| | | * 搜索-推荐商品 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key 关键词 |
| | | * @param key |
| | | * 关键词 |
| | | * @return |
| | | */ |
| | | List<QualityFactory> listRecommendBykey(@Param("start") long start, @Param("count") int count, |
| | |
| | | @Param("endprice") Double endprice,@Param("startTkRate") Double startTkRate, |
| | | @Param("endTkRate") Double endTkRate); |
| | | |
| | | |
| | | List<QualityFactory> listQueryBylabIDs(@Param("start") long start, @Param("count") int count, |
| | | @Param("list") List<Long> list, @Param("gid") Long gid,@Param("systemCid") Long systemCid); |
| | | |
| | | /** |
| | | * 按最低销量倒叙排列 |
| | | * |
| | | * @param salesCount |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<QualityFactory> listByMinSalesCountOrderByCreateTimeDesc(@Param("salesCount") int salesCount, |
| | | @Param("start") long start, @Param("count") int count); |
| | | |
| | | } |
| | |
| | | private String osVersion;
|
| | | private String network;
|
| | | private String imei;
|
| | | private String idfa;
|
| | |
|
| | | public String getIdfa() {
|
| | | return idfa;
|
| | | }
|
| | |
|
| | | public void setIdfa(String idfa) {
|
| | | this.idfa = idfa;
|
| | | }
|
| | |
|
| | | public String getImei() {
|
| | | return imei;
|
| | |
| | | <id column="id" property="id" jdbcType="BIGINT" />
|
| | | <result column="account" property="account" jdbcType="VARCHAR" />
|
| | | <result column="extractTime" property="extractTime" jdbcType="BIGINT" />
|
| | | <result column="receiveTime" property="receiveTime" jdbcType="TIMESTAMP" />
|
| | | |
| | | <result column="ip" property="ip" jdbcType="VARCHAR" />
|
| | | <result column="money" property="money" jdbcType="DECIMAL" />
|
| | | <result column="name" property="name" jdbcType="VARCHAR" />
|
| | |
| | |
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">
|
| | | id,account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId
|
| | | id,account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId,receiveTime
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.Extract"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_extract (id,
|
| | | account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId)
|
| | | account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId,receiveTime)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},
|
| | | #{account,jdbcType=VARCHAR},
|
| | |
| | | #{type,jdbcType=INTEGER},
|
| | | #{userInfo.id,jdbcType=BIGINT},
|
| | | #{system.id,jdbcType=BIGINT}
|
| | | #{adminId,jdbcType=BIGINT}
|
| | | #{adminId,jdbcType=BIGINT},
|
| | | #{receiveTime,jdbcType=TIMESTAMP}
|
| | | )
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.Extract"
|
| | |
| | | adminId,
|
| | | </if>
|
| | |
|
| | | <if test="receiveTime != null">
|
| | | receiveTime,
|
| | | </if>
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | </trim>
|
| | | <trim prefix="values (" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">
|
| | |
| | | <if test="system != null">
|
| | | #{adminId,jdbcType=BIGINT},
|
| | | </if>
|
| | | |
| | | <if test="receiveTime != null">
|
| | | #{receiveTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | |
| | | |
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.Extract">
|
| | |
| | | <if test="system != null">
|
| | | adminId = #{adminId,jdbcType=BIGINT},
|
| | | </if>
|
| | | |
| | | <if test="receiveTime != null">
|
| | | #{receiveTime,jdbcType=TIMESTAMP},
|
| | | </if>
|
| | | |
| | | |
| | | </set>
|
| | | where id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
| | | =#{adminId,jdbcType=BIGINT},
|
| | | sid
|
| | | =
|
| | | #{system.id,jdbcType=BIGINT}
|
| | | #{system.id,jdbcType=BIGINT},
|
| | | receiveTime
|
| | | =#{receiveTime,jdbcType=TIMESTAMP}
|
| | | where id =
|
| | | #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="listByUidAndCommonGoodsId" resultMap="BaseResultMap"> |
| | | SELECT m.* FROM |
| | | yeshi_ec_recommend_user_goods_map m LEFT JOIN |
| | | yeshi_ec_recommend_user_goods g ON m.`rugm_recommend_id`=g.`rug_id` |
| | | WHERE g.`rug_uid`=#{uid} AND m.`rugm_common_goods_id`=#{commonGoodsId} |
| | | </select> |
| | | |
| | | <select id="countByUidAndCommonGoodsId" resultType="java.lang.Long"> |
| | | SELECT |
| | | count(m.id) FROM yeshi_ec_recommend_user_goods_map m LEFT JOIN |
| | | yeshi_ec_recommend_user_goods g ON m.`rugm_recommend_id`=g.`rug_id` |
| | | WHERE g.`rug_uid`=#{uid} AND m.`rugm_common_goods_id`=#{commonGoodsId} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_recommend_user_goods_map where rugm_id = |
| | | #{id,jdbcType=BIGINT} |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="getLatestRecommendUserGoods" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | * |
| | | from yeshi_ec_recommend_user_goods |
| | | where rug_uid = |
| | | #{0} order by rug_create_time desc limit 1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_recommend_user_goods where rug_id = #{id,jdbcType=BIGINT} |
| | |
| | | <!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.lable.QualityFactoryMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> |
| | | <id column="sg_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="sg_class_id" property="systemCid" jdbcType="BIGINT"/> |
| | | <result column="sg_entry_mode" property="entryMode" jdbcType="INTEGER"/> |
| | | <result column="sg_goods_source" property="goodsSource" jdbcType="INTEGER"/> |
| | | <result column="sg_source_calss" property="sourceCalss" jdbcType="VARCHAR"/> |
| | | <result column="sg_goods_source" property="goodsSource" |
| | | jdbcType="INTEGER" /> |
| | | <result column="sg_source_calss" property="sourceCalss" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="sg_weight" property="weight" jdbcType="INTEGER"/> |
| | | <result column="sg_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="sg_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> |
| | |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ResultMap" type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> |
| | | <resultMap id="ResultMap" |
| | | type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> |
| | | <id column="sg_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="sg_class_id" property="systemCid" jdbcType="BIGINT"/> |
| | | <result column="sg_entry_mode" property="entryMode" jdbcType="INTEGER"/> |
| | | <result column="sg_goods_source" property="goodsSource" jdbcType="INTEGER"/> |
| | | <result column="sg_source_calss" property="sourceCalss" jdbcType="VARCHAR"/> |
| | | <result column="sg_goods_source" property="goodsSource" |
| | | jdbcType="INTEGER" /> |
| | | <result column="sg_source_calss" property="sourceCalss" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="sg_weight" property="weight" jdbcType="INTEGER"/> |
| | | <result column="sg_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="sg_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> |
| | |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <resultMap id="GoodsResultMap" type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> |
| | | <resultMap id="GoodsResultMap" |
| | | type="com.yeshi.fanli.entity.bus.lable.QualityFactory"> |
| | | <id column="sg_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="sg_class_id" property="systemCid" jdbcType="BIGINT"/> |
| | | <result column="sg_entry_mode" property="entryMode" jdbcType="INTEGER"/> |
| | | <result column="sg_goods_source" property="goodsSource" jdbcType="INTEGER"/> |
| | | <result column="sg_source_calss" property="sourceCalss" jdbcType="VARCHAR"/> |
| | | <result column="sg_goods_source" property="goodsSource" |
| | | jdbcType="INTEGER" /> |
| | | <result column="sg_source_calss" property="sourceCalss" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="sg_weight" property="weight" jdbcType="INTEGER"/> |
| | | <result column="sg_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="sg_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> |
| | |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">sg_id,sg_class_id,sg_goods_id,sg_entry_mode,sg_goods_source,sg_source_calss,sg_rule_id,sg_weight,sg_create_aid,sg_createtime,sg_update_aid,sg_updatetime</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_quality_factory where sg_id = #{id,jdbcType=BIGINT} |
| | | <sql id="Base_Column_List">sg_id,sg_class_id,sg_goods_id,sg_entry_mode,sg_goods_source,sg_source_calss,sg_rule_id,sg_weight,sg_create_aid,sg_createtime,sg_update_aid,sg_updatetime |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_quality_factory where sg_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_quality_factory where sg_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_quality_factory (sg_id,sg_class_id,sg_goods_id,sg_entry_mode,sg_goods_source,sg_source_calss,sg_rule_id,sg_weight,sg_create_aid,sg_createtime,sg_update_aid,sg_updatetime) values (#{id,jdbcType=BIGINT},#{systemCid,jdbcType=BIGINT},#{taoBaoGoodsBrief.id,jdbcType=BIGINT},#{entryMode,jdbcType=INTEGER},#{goodsSource,jdbcType=INTEGER},#{sourceCalss,jdbcType=VARCHAR},#{boutiqueAutoRule.id,jdbcType=BIGINT},#{weight,jdbcType=INTEGER},#{createUser.id,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updateUser.id,jdbcType=BIGINT},#{updatetime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_quality_factory |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_quality_factory where sg_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_quality_factory |
| | | (sg_id,sg_class_id,sg_goods_id,sg_entry_mode,sg_goods_source,sg_source_calss,sg_rule_id,sg_weight,sg_create_aid,sg_createtime,sg_update_aid,sg_updatetime) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{systemCid,jdbcType=BIGINT},#{taoBaoGoodsBrief.id,jdbcType=BIGINT},#{entryMode,jdbcType=INTEGER},#{goodsSource,jdbcType=INTEGER},#{sourceCalss,jdbcType=VARCHAR},#{boutiqueAutoRule.id,jdbcType=BIGINT},#{weight,jdbcType=INTEGER},#{createUser.id,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updateUser.id,jdbcType=BIGINT},#{updatetime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_quality_factory |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">sg_id,</if> |
| | | <if test="systemCid != null">sg_class_id,</if> |
| | |
| | | <if test="createtime != null">sg_createtime,</if> |
| | | <if test="updateUser != null">sg_update_aid,</if> |
| | | <if test="updatetime != null">sg_updatetime,</if> |
| | | </trim>values |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="systemCid != null">#{systemCid,jdbcType=BIGINT},</if> |
| | |
| | | <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory">update yeshi_ec_quality_factory set sg_class_id = #{systemCid,jdbcType=BIGINT},sg_goods_id = #{taoBaoGoodsBrief.id,jdbcType=BIGINT},sg_entry_mode = #{entryMode,jdbcType=INTEGER},sg_goods_source = #{goodsSource,jdbcType=INTEGER},sg_source_calss = #{sourceCalss,jdbcType=VARCHAR},sg_rule_id = #{boutiqueAutoRule.id,jdbcType=BIGINT},sg_weight = #{weight,jdbcType=INTEGER},sg_create_aid = #{createUser.id,jdbcType=BIGINT},sg_createtime = #{createtime,jdbcType=TIMESTAMP},sg_update_aid = #{updateUser.id,jdbcType=BIGINT},sg_updatetime = #{updatetime,jdbcType=TIMESTAMP} where sg_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory">update yeshi_ec_quality_factory |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory">update |
| | | yeshi_ec_quality_factory set sg_class_id = |
| | | #{systemCid,jdbcType=BIGINT},sg_goods_id = |
| | | #{taoBaoGoodsBrief.id,jdbcType=BIGINT},sg_entry_mode = |
| | | #{entryMode,jdbcType=INTEGER},sg_goods_source = |
| | | #{goodsSource,jdbcType=INTEGER},sg_source_calss = |
| | | #{sourceCalss,jdbcType=VARCHAR},sg_rule_id = |
| | | #{boutiqueAutoRule.id,jdbcType=BIGINT},sg_weight = |
| | | #{weight,jdbcType=INTEGER},sg_create_aid = |
| | | #{createUser.id,jdbcType=BIGINT},sg_createtime = |
| | | #{createtime,jdbcType=TIMESTAMP},sg_update_aid = |
| | | #{updateUser.id,jdbcType=BIGINT},sg_updatetime = |
| | | #{updatetime,jdbcType=TIMESTAMP} where sg_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.lable.QualityFactory"> |
| | | update yeshi_ec_quality_factory |
| | | <set> |
| | | <if test="systemCid != null">sg_class_id=#{systemCid,jdbcType=BIGINT},</if> |
| | | <if test="taoBaoGoodsBrief != null">sg_goods_id=#{taoBaoGoodsBrief.id,jdbcType=BIGINT},</if> |
| | |
| | | <if test="createtime != null">sg_createtime=#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateUser != null">sg_update_aid=#{updateUser.id,jdbcType=BIGINT},</if> |
| | | <if test="updatetime != null">sg_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </set> where sg_id = #{id,jdbcType=BIGINT} |
| | | </set> |
| | | where sg_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List"> |
| | |
| | | separator=",">#{item}</foreach> |
| | | </delete> |
| | | |
| | | <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List"> |
| | | <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="java.util.List"> |
| | | insert into yeshi_ec_quality_factory |
| | | (<include refid="Base_Column_List" />) |
| | | ( |
| | | <include refid="Base_Column_List" /> |
| | | ) |
| | | values |
| | | |
| | | <foreach collection="list" item="item" separator=","> |
| | |
| | | </trim> |
| | | </trim> |
| | | where sg_id in |
| | | <foreach collection="list" index="index" item="item" separator="," open="(" close=")"> |
| | | <foreach collection="list" index="index" item="item" |
| | | separator="," open="(" close=")"> |
| | | #{item.id,jdbcType=BIGINT} |
| | | </foreach> |
| | | </update> |
| | |
| | | <select id="queryAll" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_quality_factory |
| | | <if test="days != null"> |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL ${days} DAY) > DATE(lab_updatetime); |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL ${days} DAY) > |
| | | DATE(lab_updatetime); |
| | | </if> |
| | | order by sg_updatetime LIMIT ${start},${count} |
| | | |
| | |
| | | <!-- 查询超过hour个小时未更新商品,进行更新 --> |
| | | <select id="queryNeedUpdate" resultType="java.lang.Long"> |
| | | SELECT h.sg_goods_id FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN `yeshi_ec_taobao_goods` tb ON h.`sg_goods_id` = tb.id |
| | | LEFT JOIN |
| | | `yeshi_ec_taobao_goods` tb ON h.`sg_goods_id` = tb.id |
| | | WHERE <![CDATA[TO_DAYS(tb.`updatetime`) < TO_DAYS(NOW()) OR (HOUR(NOW()) -HOUR(tb.`updatetime`)) >= #{hour}]]> |
| | | order by h.`sg_updatetime` LIMIT ${start},${count} |
| | | </select> |
| | |
| | | <!-- 查询超过5个小时未更新商品,进行更新 --> |
| | | <select id="countQueryNeedUpdate" resultType="java.lang.Long"> |
| | | SELECT count(sg_id) FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN `yeshi_ec_taobao_goods` tb ON h.`sg_goods_id` = tb.id |
| | | LEFT JOIN |
| | | `yeshi_ec_taobao_goods` tb ON h.`sg_goods_id` = tb.id |
| | | WHERE <![CDATA[TO_DAYS(tb.`updatetime`) < TO_DAYS(NOW()) OR (HOUR(NOW()) -HOUR(tb.`updatetime`)) >= 4]]> |
| | | </select> |
| | | |
| | |
| | | <select id="query" resultMap="ResultMap"> |
| | | |
| | | SELECT ts.* FROM ( |
| | | SELECT DISTINCT( tt.`sg_id`) AS id FROM yeshi_ec_quality_factory tt |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON tt.`sg_goods_id`= tb.`id` |
| | | SELECT DISTINCT( tt.`sg_id`) AS id FROM |
| | | yeshi_ec_quality_factory tt |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | tt.`sg_goods_id`= tb.`id` |
| | | <if test='keyType == 3'> |
| | | LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_label lab ON lg.`lg_label_id` = lab.`lab_id` |
| | | LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = |
| | | lg.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_label lab ON lg.`lg_label_id` = |
| | | lab.`lab_id` |
| | | </if> |
| | | WHERE 1=1 |
| | | <if test="goodsSource != null"> |
| | |
| | | </if> |
| | | tt.`sg_updatetime` desc |
| | | LIMIT ${start},${count} |
| | | ) a LEFT JOIN yeshi_ec_quality_factory ts ON ts.`sg_id`=a.id |
| | | ) a LEFT JOIN |
| | | yeshi_ec_quality_factory ts ON ts.`sg_id`=a.id |
| | | |
| | | |
| | | </select> |
| | |
| | | <select id="queryCount" resultType="java.lang.Long"> |
| | | <!-- 根据条件统计所有标签数量 --> |
| | | SELECT count(ts.sg_id) FROM ( |
| | | SELECT DISTINCT( tt.`sg_id`) AS id FROM yeshi_ec_quality_factory tt |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON tt.`sg_goods_id`= tb.`id` |
| | | SELECT DISTINCT( tt.`sg_id`) AS id FROM |
| | | yeshi_ec_quality_factory tt |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | tt.`sg_goods_id`= tb.`id` |
| | | <if test='keyType == 3'> |
| | | LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_label lab ON lg.`lg_label_id` = lab.`lab_id` |
| | | LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = |
| | | lg.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_label lab ON lg.`lg_label_id` = |
| | | lab.`lab_id` |
| | | </if> |
| | | WHERE 1=1 |
| | | <if test="goodsSource != null"> |
| | |
| | | |
| | | <!--查询精选商品信息--> |
| | | <select id="queryByGoodsId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_quality_factory WHERE sg_goods_id = ${goodsId} |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_quality_factory WHERE sg_goods_id = ${goodsId} |
| | | </select> |
| | | |
| | | <select id="queryCountByGoodsId" resultType="java.lang.Long"> |
| | | SELECT COUNT(sg_id) FROM yeshi_ec_quality_factory WHERE sg_goods_id = ${goodsId} |
| | | SELECT COUNT(sg_id) |
| | | FROM yeshi_ec_quality_factory WHERE sg_goods_id = |
| | | ${goodsId} |
| | | </select> |
| | | |
| | | <select id="getCountAll" resultType="java.util.HashMap"> |
| | | <!-- 统计今日各种方式录入数量 --> |
| | | SELECT COUNT(sg_id) AS total, IFNULL(SUM(CASE WHEN sg_entry_mode = 1 THEN 1 ELSE 0 END),0) AS totalMANUAL, |
| | | IFNULL(SUM(CASE WHEN sg_entry_mode = 2 THEN 1 ELSE 0 END),0) AS totalSYSTEM, |
| | | IFNULL(SUM(CASE WHEN sg_entry_mode = 3 THEN 1 ELSE 0 END),0) AS totalSEARCH, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 1 THEN 1 ELSE 0 END),0) AS totalTB, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 2 THEN 1 ELSE 0 END),0) AS totalJD, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 3 THEN 1 ELSE 0 END),0) AS totalPDD, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 4 THEN 1 ELSE 0 END),0) AS totalWPH |
| | | SELECT COUNT(sg_id) AS total, IFNULL(SUM(CASE WHEN sg_entry_mode = 1 |
| | | THEN 1 ELSE 0 END),0) AS totalMANUAL, |
| | | IFNULL(SUM(CASE WHEN |
| | | sg_entry_mode = 2 THEN 1 ELSE 0 END),0) AS totalSYSTEM, |
| | | IFNULL(SUM(CASE WHEN sg_entry_mode = 3 THEN 1 ELSE 0 END),0) AS |
| | | totalSEARCH, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 1 THEN 1 ELSE 0 |
| | | END),0) AS totalTB, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 2 THEN 1 |
| | | ELSE 0 END),0) AS |
| | | totalJD, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 3 THEN |
| | | 1 ELSE 0 END),0) AS totalPDD, |
| | | IFNULL(SUM(CASE WHEN sg_goods_source = 4 |
| | | THEN 1 ELSE 0 END),0) AS |
| | | totalWPH |
| | | FROM yeshi_ec_quality_factory |
| | | </select> |
| | | |
| | | <delete id="deleteByGoodsId" parameterType="java.lang.Long"> |
| | | delete from yeshi_ec_quality_factory where sg_goods_id = #{goodsId,jdbcType=BIGINT} |
| | | delete from |
| | | yeshi_ec_quality_factory where sg_goods_id = |
| | | #{goodsId,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="countTotalRows" resultType="java.lang.Long"> |
| | | SELECT COUNT(sg_id) FROM yeshi_ec_quality_factory |
| | | <if test="days != null"> |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL ${days} DAY) > DATE(lab_updatetime); |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL ${days} DAY) > |
| | | DATE(lab_updatetime); |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | <!-- 移动查询 --> |
| | | SELECT * FROM `yeshi_ec_quality_factory` h |
| | | <if test="labId != null"> |
| | | LEFT JOIN `yeshi_ec_label_goods` g ON h.`sg_goods_id` = g.`lg_goods_id` |
| | | LEFT JOIN `yeshi_ec_label_goods` g ON h.`sg_goods_id` = |
| | | g.`lg_goods_id` |
| | | </if> |
| | | <!-- 商品关键词 --> |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE 1=1 |
| | | WHERE |
| | | 1=1 |
| | | <!-- 商品关键词 --> |
| | | <if test='key != null and key != ""'> |
| | | AND tb.`title` LIKE '%${key}%' |
| | |
| | | <!-- 移动统计 --> |
| | | SELECT IFNULL(COUNT( h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h |
| | | <if test="labId != null"> |
| | | LEFT JOIN `yeshi_ec_label_goods` g ON h.`sg_goods_id` = g.`lg_goods_id` |
| | | LEFT JOIN `yeshi_ec_label_goods` g ON h.`sg_goods_id` = |
| | | g.`lg_goods_id` |
| | | </if> |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE 1=1 |
| | | WHERE |
| | | 1=1 |
| | | <!-- 商品关键词 --> |
| | | <if test='key != null and key != ""'> |
| | | AND tb.`title` LIKE '%${key}%' |
| | |
| | | <select id="listQueryEverydayRob" resultMap="BaseResultMap"> |
| | | <!-- 移动查询每日必抢 --> |
| | | SELECT * FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN `yeshi_ec_label_goods` g ON h.`sg_goods_id` = g.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE g.`lg_label_id`= #{labId} AND TO_DAYS(h.`sg_updatetime`) = TO_DAYS(NOW()) |
| | | LEFT JOIN |
| | | `yeshi_ec_label_goods` g ON h.`sg_goods_id` = g.`lg_goods_id` |
| | | LEFT JOIN |
| | | yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE |
| | | g.`lg_label_id`= #{labId} AND TO_DAYS(h.`sg_updatetime`) = |
| | | TO_DAYS(NOW()) |
| | | <!-- 分类id--> |
| | | <if test="systemCid != null"> |
| | | AND h.`sg_class_id` = #{systemCid} |
| | |
| | | <select id="countQueryEverydayRob" resultType="java.lang.Long"> |
| | | <!-- 移动查询每日必抢 --> |
| | | SELECT IFNULL(COUNT( h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN `yeshi_ec_label_goods` g ON h.`sg_goods_id` = g.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE g.`lg_label_id`= #{labId} AND TO_DAYS(h.`sg_updatetime`) = TO_DAYS(NOW()) |
| | | LEFT JOIN `yeshi_ec_label_goods` g ON h.`sg_goods_id` = |
| | | g.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= |
| | | tb.`id` |
| | | WHERE g.`lg_label_id`= #{labId} AND TO_DAYS(h.`sg_updatetime`) |
| | | = |
| | | TO_DAYS(NOW()) |
| | | <if test="systemCid != null"> |
| | | AND h.`sg_class_id` = #{systemCid} |
| | | </if> |
| | |
| | | |
| | | <delete id="removeStorageGoods" parameterType="java.lang.Long"> |
| | | DELETE FROM yeshi_ec_quality_factory h |
| | | WHERE h.`sg_class_id`= #{gcids} AND <![CDATA[ h.`sg_createtime` < #{doTime} ]]> |
| | | AND h.`sg_goods_id` NOT extsts(SELECT DISTINCT lg.`lg_goods_id` FROM yeshi_ec_label_goods lg) |
| | | WHERE h.`sg_class_id`= #{gcids} |
| | | AND <![CDATA[ h.`sg_createtime` < #{doTime} ]]> |
| | | AND h.`sg_goods_id` NOT extsts(SELECT DISTINCT lg.`lg_goods_id` FROM |
| | | yeshi_ec_label_goods lg) |
| | | </delete> |
| | | |
| | | <select id="listQueryGoodsByGoodsId" resultMap="BaseResultMap"> |
| | | <!-- 根据auctionId 查询商品信息 --> |
| | | SELECT <include refid="Base_Column_List" />FROM yeshi_ec_quality_factory |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_quality_factory |
| | | WHERE sg_goods_id in |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | |
| | | |
| | | <select id="listQueryByKey" resultMap="BaseResultMap"> |
| | | <!-- 移动查询 --> |
| | | SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | h.`sg_goods_id`= tb.`id` |
| | | WHERE tb.`title` LIKE '%${key}%' |
| | | |
| | | <if test="systemCid != null"> |
| | |
| | | <!-- 移动统计 --> |
| | | SELECT IFNULL(COUNT( h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE tb.`title` LIKE '%${key}%' |
| | | WHERE |
| | | tb.`title` LIKE '%${key}%' |
| | | <if test="systemCid != null"> |
| | | AND h.`sg_class_id` = #{systemCid} |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="listQueryByAuctionId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_quality_factory h |
| | | left join yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` WHERE tb.auctionId in |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_quality_factory h |
| | | left join yeshi_ec_taobao_goods tb ON |
| | | h.`sg_goods_id`= tb.`id` WHERE |
| | | tb.auctionId in |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </select> |
| | | |
| | | |
| | | <select id="listQueryByCouponAmount" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | h.`sg_goods_id`= tb.`id` |
| | | WHERE 1=1 |
| | | <if test="startAmount != null"> |
| | | AND <![CDATA[ tb.`couponAmount` >= #{startAmount}]]> |
| | |
| | | <select id="countQueryByCouponAmount" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT( h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE 1=1 |
| | | WHERE |
| | | 1=1 |
| | | <if test="startAmount != null"> |
| | | AND <![CDATA[ tb.`couponAmount` >= #{startAmount}]]> |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="listQueryByFlashSale" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_quality_factory h |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_quality_factory h |
| | | |
| | | RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_id` = s.`fs_qfgoods_id` |
| | | RIGHT JOIN yeshi_ec_quality_flash_sale |
| | | s ON h.`sg_id` = s.`fs_qfgoods_id` |
| | | |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb |
| | | ON h.`sg_goods_id`= tb.`id` |
| | | |
| | | WHERE <![CDATA[ tb.`couponTotalCount` > 0 AND tb.couponLeftCount<tb.couponTotalCount ]]> |
| | | |
| | |
| | | <select id="countQueryByFlashSale" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT( h.`sg_id`),0) FROM yeshi_ec_quality_factory h |
| | | |
| | | RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_id` = s.`fs_qfgoods_id` |
| | | RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_id` = |
| | | s.`fs_qfgoods_id` |
| | | |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | h.`sg_goods_id`= tb.`id` |
| | | |
| | | WHERE <![CDATA[ tb.`couponTotalCount` > 0 AND tb.couponLeftCount<tb.couponTotalCount]]> |
| | | </select> |
| | |
| | | <select id="listQueryByKeyAndlabIDs" resultMap="BaseResultMap"> |
| | | |
| | | SELECT ts.* FROM ( |
| | | SELECT DISTINCT( tt.`sg_id`) AS id FROM yeshi_ec_quality_factory tt |
| | | SELECT DISTINCT( tt.`sg_id`) AS id FROM |
| | | yeshi_ec_quality_factory tt |
| | | |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON tt.`sg_goods_id`= tb.`id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | tt.`sg_goods_id`= tb.`id` |
| | | |
| | | LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_label_goods lg ON |
| | | tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | |
| | | WHERE (tb.`title` LIKE '%${key}%' OR lg.`lg_label_id` IN |
| | | WHERE (tb.`title` LIKE '%${key}%' |
| | | OR lg.`lg_label_id` IN |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | ) |
| | |
| | | |
| | | LIMIT ${start},${count} |
| | | |
| | | ) a LEFT JOIN yeshi_ec_quality_factory ts ON ts.`sg_id`=a.id |
| | | ) a LEFT JOIN |
| | | yeshi_ec_quality_factory ts ON ts.`sg_id`=a.id |
| | | |
| | | </select> |
| | | |
| | | <select id="countQueryKeyAndlabIDs" resultType="java.lang.Long"> |
| | | <!-- 根据条件统计所有标签数量 --> |
| | | SELECT count(ts.sg_id) FROM ( |
| | | SELECT DISTINCT(tt.`sg_id`) AS id FROM yeshi_ec_quality_factory tt |
| | | SELECT DISTINCT(tt.`sg_id`) AS id FROM |
| | | yeshi_ec_quality_factory tt |
| | | |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON tt.`sg_goods_id`= tb.`id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | tt.`sg_goods_id`= tb.`id` |
| | | |
| | | LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_label_goods lg ON |
| | | tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | |
| | | WHERE (tb.`title` LIKE '%${key}%' OR lg.`lg_label_id` IN |
| | | WHERE (tb.`title` LIKE '%${key}%' |
| | | OR lg.`lg_label_id` IN |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | ) |
| | |
| | | |
| | | |
| | | <select id="listQueryByRebateAmount" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_quality_factory` h |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN |
| | | (SELECT tb.`id`,tb.biz30day,(CASE WHEN<![CDATA[ tb.`zkPrice` < tb.`couponStartFee`]]> THEN tb.`zkPrice` * tb.`tkRate`/10000*#{proportion} |
| | | ELSE (tb.`zkPrice`-tb.`couponAmount`) * tb.`tkRate`/10000*#{proportion} END)AS RateAmount FROM yeshi_ec_taobao_goods tb |
| | | where tb.tkRate > #{tkRate})g |
| | | (SELECT |
| | | tb.`id`,tb.biz30day,(CASE WHEN<![CDATA[ tb.`zkPrice` < tb.`couponStartFee`]]> |
| | | THEN tb.`zkPrice` * tb.`tkRate`/10000*#{proportion} |
| | | ELSE |
| | | (tb.`zkPrice`-tb.`couponAmount`) * tb.`tkRate`/10000*#{proportion} |
| | | END)AS RateAmount FROM yeshi_ec_taobao_goods tb |
| | | where tb.tkRate > |
| | | #{tkRate})g |
| | | |
| | | ON h.`sg_goods_id`= g.`id` |
| | | WHERE 1=1 |
| | |
| | | SELECT IFNULL(COUNT( h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN |
| | | |
| | | (SELECT tb.`id`,(CASE WHEN <![CDATA[tb.`zkPrice` < tb.`couponStartFee`]]> THEN tb.`zkPrice` * tb.`tkRate`/10000*#{proportion} |
| | | ELSE (tb.`zkPrice`-tb.`couponAmount`) * tb.`tkRate`/10000*#{proportion} END)AS RateAmount FROM yeshi_ec_taobao_goods tb |
| | | where tb.tkRate > #{tkRate})g |
| | | (SELECT tb.`id`,(CASE WHEN <![CDATA[tb.`zkPrice` < tb.`couponStartFee`]]> |
| | | THEN tb.`zkPrice` * tb.`tkRate`/10000*#{proportion} |
| | | ELSE |
| | | (tb.`zkPrice`-tb.`couponAmount`) * tb.`tkRate`/10000*#{proportion} |
| | | END)AS RateAmount FROM yeshi_ec_taobao_goods tb |
| | | where tb.tkRate > |
| | | #{tkRate})g |
| | | |
| | | ON h.`sg_goods_id`= g.`id` |
| | | WHERE 1=1 |
| | |
| | | |
| | | <select id="getAuctionIdbyClassId" resultType="java.lang.Long"> |
| | | SELECT tb.`id` FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN `yeshi_ec_taobao_goods` tb ON h.`sg_goods_id` = tb.`id` |
| | | WHERE h.`sg_class_id` = #{systemCid} AND h.`sg_goods_source` = #{goodsSource} |
| | | LEFT JOIN |
| | | `yeshi_ec_taobao_goods` tb ON h.`sg_goods_id` = tb.`id` |
| | | WHERE |
| | | h.`sg_class_id` = #{systemCid} AND h.`sg_goods_source` = |
| | | #{goodsSource} |
| | | AND <![CDATA[h.`sg_createtime` < '${beforeTime}']]> |
| | | AND NOT EXISTS(SELECT lg_goods_id FROM `yeshi_ec_label_goods` lb WHERE lb.`lg_goods_id` = tb.`id`) |
| | | AND NOT EXISTS(SELECT lg_goods_id FROM `yeshi_ec_label_goods` lb WHERE |
| | | lb.`lg_goods_id` = tb.`id`) |
| | | </select> |
| | | |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="listRecommendToIndex" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_quality_factory` h |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN |
| | | (SELECT tb.`id`,tb.tkRate, |
| | | <![CDATA[(CASE WHEN tb.`zkPrice` < tb.`couponStartFee` THEN tb.`zkPrice` * tb.`tkRate`/10000*#{proportion} |
| | |
| | | WHERE tb.tkRate >= #{tkRate} |
| | | AND tb.`couponAmount` >= #{couponAmount} |
| | | AND (tb.`couponAmount`/ tb.zkPrice)*100 > #{couponRatio} |
| | | ]]> )g |
| | | ]]> |
| | | )g |
| | | |
| | | ON h.`sg_goods_id`= g.`id` |
| | | |
| | |
| | | WHERE tb.tkRate >= #{tkRate} |
| | | AND tb.`couponAmount` >= #{couponAmount} |
| | | AND (tb.`couponAmount`/ tb.zkPrice)*100 > #{couponRatio} |
| | | ]]> )g |
| | | ]]> |
| | | )g |
| | | |
| | | ON h.`sg_goods_id`= g.`id` |
| | | |
| | |
| | | |
| | | |
| | | <select id="listRecommendBykey" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | h.`sg_goods_id`= tb.`id` |
| | | WHERE 1=1 |
| | | <!-- 关键词搜索 --> |
| | | <if test='key != null and key != ""'> AND tb.`title` LIKE '%${key}%' </if> |
| | |
| | | <select id="countRecommendBykey" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(h.`sg_id`),0) FROM `yeshi_ec_quality_factory` h |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id` |
| | | WHERE 1=1 |
| | | WHERE |
| | | 1=1 |
| | | <!-- 关键词搜索 --> |
| | | <if test='key != null and key != ""'> AND tb.`title` LIKE '%${key}%' </if> |
| | | <!-- 在售价范围 --> |
| | |
| | | |
| | | <select id="listQueryBylabIDs" resultMap="GoodsResultMap"> |
| | | SELECT * FROM ( |
| | | SELECT DISTINCT( tt.`sg_id`) AS tbid FROM yeshi_ec_quality_factory tt |
| | | SELECT DISTINCT( tt.`sg_id`) AS tbid FROM |
| | | yeshi_ec_quality_factory tt |
| | | |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON tt.`sg_goods_id`= tb.`id` |
| | | LEFT JOIN yeshi_ec_taobao_goods tb ON |
| | | tt.`sg_goods_id`= tb.`id` |
| | | |
| | | LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | LEFT JOIN yeshi_ec_label_goods lg ON |
| | | tt.`sg_goods_id` = lg.`lg_goods_id` |
| | | |
| | | WHERE tb.`id` != #{gid} |
| | | <if test='systemCid != null'> |
| | |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | LIMIT ${start},${count} |
| | | ) a LEFT JOIN yeshi_ec_quality_factory ts ON ts.`sg_id`=a.tbid |
| | | LEFT JOIN yeshi_ec_taobao_goods tbb ON ts.`sg_goods_id`= tbb.`id` |
| | | ) a LEFT JOIN yeshi_ec_quality_factory ts ON |
| | | ts.`sg_id`=a.tbid |
| | | LEFT JOIN yeshi_ec_taobao_goods tbb ON |
| | | ts.`sg_goods_id`= tbb.`id` |
| | | </select> |
| | | |
| | | |
| | | <select id="listByMinSalesCountOrderByCreateTimeDesc" resultMap="BaseResultMap"> |
| | | SELECT f.* FROM `yeshi_ec_quality_factory` f LEFT JOIN |
| | | yeshi_ec_taobao_goods t ON f.`sg_goods_id`=t.`id` WHERE |
| | | t.`biz30day`>=#{salesCount} ORDER BY f.`sg_createtime` DESC limit |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | return recommendUserGoodsMapper.countRecommendGoods(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<RecommendUserGoodsMap> listByUidAndCommonGoodsId(Long uid, Long commonGoodsId) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Long countByUidAndCommonGoodsId(Long uid, Long commonGoodsId) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public RecommendUserGoods getLatestRecommendUserGoods(Long uid) {
|
| | | return recommendUserGoodsMapper.getLatestRecommendUserGoods(uid);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | // 加入通知
|
| | | if (notificationMap.get(type) == null) {
|
| | | HongBaoV2 tempHongBao = new HongBaoV2(hongBao.getId());
|
| | | tempHongBao.setUserInfo(hongBao.getUserInfo());
|
| | | HongBaoV2 tempHongBao = new HongBaoV2(oldHongBao.getId());
|
| | | tempHongBao.setUserInfo(oldHongBao.getUserInfo());
|
| | | tempHongBao.setMoney(hongBao.getMoney());
|
| | | CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | tempCommonOrder.setPayment(commonOrder.getPayment());
|
| | |
| | | }
|
| | | hongBaoV2Mapper.insertSelective(firstHongbao);
|
| | | // 用户通知
|
| | | if (notificationMap.get(type) == null) {
|
| | | if (notificationMap.get(HongBaoV2.TYPE_YIJI) == null) {
|
| | | HongBaoV2 tempHongBao = new HongBaoV2(firstHongbao.getId());
|
| | | tempHongBao.setUserInfo(firstHongbao.getUserInfo());
|
| | | tempHongBao.setMoney(firstHongbao.getMoney());
|
| | | CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | tempCommonOrder.setPayment(commonOrder.getPayment());
|
| | | notificationMap.put(type, new HongBaoOrder(tempCommonOrder, tempHongBao));
|
| | | notificationMap.put(HongBaoV2.TYPE_YIJI, new HongBaoOrder(tempCommonOrder, tempHongBao));
|
| | | } else {
|
| | | // 增加付款金额与资金
|
| | | HongBaoOrder tempHongBaoOrder = notificationMap.get(type);
|
| | | HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_YIJI);
|
| | | tempHongBaoOrder.getCommonOrder()
|
| | | .setPayment(tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
|
| | | tempHongBaoOrder.getHongBaoV2()
|
| | | .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(firstHongbao.getMoney()));
|
| | | notificationMap.put(type, tempHongBaoOrder);
|
| | | notificationMap.put(HongBaoV2.TYPE_YIJI, tempHongBaoOrder);
|
| | | }
|
| | |
|
| | | // 插入二级子红包
|
| | |
| | | hongBaoV2Mapper.insertSelective(secondHongbao);
|
| | |
|
| | | // 用户通知
|
| | | if (notificationMap.get(type) == null) {
|
| | | if (notificationMap.get(HongBaoV2.TYPE_ERJI) == null) {
|
| | | HongBaoV2 tempHongBao = new HongBaoV2(secondHongbao.getId());
|
| | | tempHongBao.setUserInfo(secondHongbao.getUserInfo());
|
| | | tempHongBao.setMoney(secondHongbao.getMoney());
|
| | | CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | tempCommonOrder.setPayment(commonOrder.getPayment());
|
| | | notificationMap.put(type, new HongBaoOrder(tempCommonOrder, tempHongBao));
|
| | | notificationMap.put(HongBaoV2.TYPE_ERJI, new HongBaoOrder(tempCommonOrder, tempHongBao));
|
| | | } else {
|
| | | // 增加付款金额与资金
|
| | | HongBaoOrder tempHongBaoOrder = notificationMap.get(type);
|
| | | HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_ERJI);
|
| | | tempHongBaoOrder.getCommonOrder().setPayment(
|
| | | tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
|
| | | tempHongBaoOrder.getHongBaoV2()
|
| | | .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(secondHongbao.getMoney()));
|
| | | notificationMap.put(type, tempHongBaoOrder);
|
| | | notificationMap.put(HongBaoV2.TYPE_ERJI, tempHongBaoOrder);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKeySelective(QualityFactory record) throws QualityFactoryException {
|
| | | return qualityFactoryMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void deleteByTbAuctionId(Long auctionId) {
|
| | |
| | | labelGoodsMapper.deleteBatchByGoodsId(listGid);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void deleteByGoodsId(List<String> ids) throws QualityFactoryException {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public QualityFactory selectByPrimaryKey(Long id) throws QualityFactoryException {
|
| | |
| | | return qualityFactoryMapper.queryNeedUpdate(start, count, hour);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取缓存
|
| | | * @param key 键
|
| | | * @param title 标签名称
|
| | | * |
| | | * @param key
|
| | | * 键
|
| | | * @param title
|
| | | * 标签名称
|
| | | * @return
|
| | | */
|
| | | public String getLabelIdByRedis (String key, String title) throws Exception {
|
| | |
| | | List<Long> listDeleteQuality = new ArrayList<Long>();
|
| | | // 删除标签
|
| | | List<Long> listDeleteLabel = new ArrayList<Long>();
|
| | | |
| | |
|
| | | List<QualityFactory> listUpdateQuality = new ArrayList<QualityFactory>();
|
| | |
|
| | |
| | |
|
| | | } else {
|
| | | /* 更新商品信息 */
|
| | | TaoBaoGoodsBrief updateGoods = taoBaoGoodsUpdateService.getUpdateTaoBaoGoodsBrief(newGoodsBrief);
|
| | | TaoBaoGoodsBrief updateGoods = taoBaoGoodsUpdateService
|
| | | .getUpdateTaoBaoGoodsBrief(newGoodsBrief);
|
| | |
|
| | | updateGoods.setId(id);
|
| | | taoBaoGoodsBriefService.setGoodsBriefDefault(updateGoods);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void autoInsertOrUpadateStorage(List<TaoBaoGoodsBrief> goodsList, List<Label> listLabs,
|
| | | BoutiqueAutoRule autoRule) throws Exception {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | // 商品id集合
|
| | | List<Long> listSystemTBid = new ArrayList<Long>();
|
| | |
|
| | |
| | | List<QualityFactory> listAddInsert = new ArrayList<QualityFactory>();
|
| | | // 进入精选商品列表
|
| | | List<QualityFactory> listAddUpdate = new ArrayList<QualityFactory>();
|
| | | |
| | |
|
| | | // 插入商品淘宝ID集合
|
| | | List<Long> listAuctionId = new ArrayList<Long>();
|
| | |
| | |
|
| | | listGoodsUpdate.add(updateGoods);
|
| | |
|
| | | |
| | | Long has9k9ID = null;
|
| | |
|
| | | /* 贴上标签 */
|
| | |
| | |
|
| | | for (Label label : listLabs) {
|
| | |
|
| | | // 包含 9.9/19.9/29.9/49.9 、同时来源淘宝推荐: 由于获取详情与推荐接口的券信息存在出入 以最后详情为准
|
| | | if (list9Class.contains(label.getId()) && autoRule.isCalss9k9() && QualityFactory.SOURCE_TAOBAO_MATERIAL == autoRule.getGoodsSource()) {
|
| | | // 包含 9.9/19.9/29.9/49.9 、同时来源淘宝推荐: 由于获取详情与推荐接口的券信息存在出入
|
| | | // 以最后详情为准
|
| | | if (list9Class.contains(label.getId()) && autoRule.isCalss9k9()
|
| | | && QualityFactory.SOURCE_TAOBAO_MATERIAL == autoRule.getGoodsSource()) {
|
| | |
|
| | | /* 获取商品详情后计算是否属于 9k9系列 加入对应的标签*/
|
| | | LabelGoods labelGds = screen9K9(updateGoods, map);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /* 判断是否已经贴上标签 9k9标签 */
|
| | | if (list9Class.size() > 0) {
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 清空 9K9系列标签
|
| | | for (LabelGoods labelGoods : listGlid) {
|
| | |
| | |
|
| | | for (Label label : listLabs) {
|
| | |
|
| | | // 包含 9.9/19.9/29.9/49.9 、同时来源淘宝推荐: 由于获取详情与推荐接口的券信息存在出入 以最后详情为准
|
| | | if (list9Class.contains(label.getId()) && autoRule.isCalss9k9() && |
| | | QualityFactory.SOURCE_TAOBAO_MATERIAL == autoRule.getGoodsSource()) {
|
| | | // 包含 9.9/19.9/29.9/49.9 、同时来源淘宝推荐: 由于获取详情与推荐接口的券信息存在出入
|
| | | // 以最后详情为准
|
| | | if (list9Class.contains(label.getId()) && autoRule.isCalss9k9()
|
| | | && QualityFactory.SOURCE_TAOBAO_MATERIAL == autoRule.getGoodsSource()) {
|
| | | /* 加入对应的9.9/19.9/29.9/49.9 标签*/
|
| | | LabelGoods labelGds = screen9K9(newGoodsBrief, map);
|
| | |
|
| | |
| | | return lg;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<QualityFactory> listByMinSalesCountOrderByCreateTimeDesc(int salesCount, int page, int pageSize) {
|
| | | return qualityFactoryMapper.listByMinSalesCountOrderByCreateTimeDesc(salesCount, (page - 1) * pageSize,
|
| | | pageSize);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.exception.msg.MsgAccountDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgAccountDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgAccountDetailMapper msgAccountDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMsgReadStateService userMsgReadStateService;
|
| | |
|
| | | @Override
|
| | | public void addMsgAccountDetail(MsgAccountDetail detail) throws MsgAccountDetailException {
|
| | |
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgAccountDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addAccountMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.exception.msg.MsgInviteDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgInviteDetailMapper msgInviteDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMsgReadStateService userMsgReadStateService;
|
| | |
|
| | | @Override
|
| | | public void addMsgInviteDetail(MsgInviteDetail detail) throws MsgInviteDetailException {
|
| | |
| | | update.setRead(false);
|
| | | msgInviteDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | userMsgReadStateService.addInviteMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.exception.msg.MsgMoneyDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgMoneyDetailMapper msgMoneyDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMsgReadStateService userMsgReadStateService;
|
| | |
|
| | | @Override
|
| | | public void addMsgMoneyDetail(MsgMoneyDetail detail) throws MsgMoneyDetailException {
|
| | |
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.fanliWeiQuan
|
| | | || detail.getMsgType() == MsgTypeMoneyTypeEnum.inviteWeiQuan
|
| | | || detail.getMsgType() == MsgTypeMoneyTypeEnum.shareWeiQuan) {
|
| | | if (detail.getMoney() == null || detail.getOrderId() == null || detail.getBalance() == null)
|
| | | throw new MsgMoneyDetailException(2, "消息信息不全");
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setRead(false);
|
| | | msgMoneyDetailMapper.insertSelective(detail);
|
| | | }
|
| | |
|
| | | userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.exception.msg.MsgOrderDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgOrderDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgOrderDetailMapper msgOrderDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMsgReadStateService userMsgReadStateService;
|
| | |
|
| | | @Override
|
| | | public void addMsgOrderDetail(MsgOrderDetail detail) throws MsgOrderDetailException {
|
| | |
| | | update.setBeiZhu(detail.getBeiZhu());
|
| | | msgOrderDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | userMsgReadStateService.addOrderMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return;
|
| | |
|
| | | MsgOrderDetail update = new MsgOrderDetail();
|
| | | update.setId(detail.getId());
|
| | | update.setId(msg.getId());
|
| | | update.setHongBaoMoney(detail.getHongBaoMoney());
|
| | | update.setPayMoney(detail.getPayMoney());
|
| | | if (detail.getState().intValue() != msg.getState()) {
|
| | | update.setState(detail.getState());
|
| | | update.setUpdateTime(new Date());
|
| | | userMsgReadStateService.addOrderMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | | msgOrderDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.msg;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.exception.msg.MsgInviteDetailException;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgInviteDetailFactory;
|
| | |
|
| | | @Service
|
| | | public class UserInviteMsgNotificationServiceImpl implements UserInviteMsgNotificationService{
|
| | |
|
| | | @Resource
|
| | | private MsgInviteDetailService msgInviteDetailService;
|
| | |
|
| | | @Override
|
| | | public void inviteScan(Long uid, ThreeSale sale) {
|
| | | // TODO Auto-generated method stub
|
| | | |
| | | MsgInviteDetail detail = MsgInviteDetailFactory.createInviteScanSuccess(sale, uid, null);
|
| | | try {
|
| | | msgInviteDetailService.addMsgInviteDetail(detail);
|
| | | } catch (MsgInviteDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void inviteSuccess(Long uid, ThreeSale sale) {
|
| | | // TODO Auto-generated method stub
|
| | | |
| | | MsgInviteDetail detail = MsgInviteDetailFactory.createInviteSuccess(sale, uid, null);
|
| | | try {
|
| | | msgInviteDetailService.addMsgInviteDetail(detail);
|
| | | } catch (MsgInviteDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void inviteFail(Long uid, ThreeSale sale) {
|
| | | // TODO Auto-generated method stub
|
| | | |
| | | MsgInviteDetail detail = MsgInviteDetailFactory.createInviteFail(sale, uid, null);
|
| | | try {
|
| | | msgInviteDetailService.addMsgInviteDetail(detail);
|
| | | } catch (MsgInviteDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.system.SystemZnx;
|
| | | import com.yeshi.fanli.exception.msg.UserSystemMsgException;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserSystemMsgMapper userSystemMsgMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMsgReadStateService userMsgReadStateService;
|
| | |
|
| | | @Override
|
| | | public void addUserSystemMsg(Long uid, UserSystemMsgTypeEnum type, String title, String content, int timeTag,
|
| | |
| | | msg.setTimeTag(timeTag);
|
| | | }
|
| | | userSystemMsgMapper.insertSelective(msg);
|
| | | userMsgReadStateService.addSystemMsgUnReadCount(uid, 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | Extract updateExtract = new Extract();
|
| | | updateExtract.setId(extract.getId());
|
| | | updateExtract.setState(Constant.EXTRACT_PASS);
|
| | | updateExtract.setReceiveTime(new Date());
|
| | | updateExtract.setReason("提现成功");
|
| | | extractMapper.updateByPrimaryKeySelective(updateExtract);
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.RecommendUserGoods;
|
| | | import com.yeshi.fanli.entity.goods.RecommendUserGoodsMap;
|
| | | import com.yeshi.fanli.exception.goods.RecommendUserGoodsException;
|
| | |
|
| | | public interface RecommendUserGoodsService {
|
| | |
| | | */
|
| | | public void addRecommend(Long uid, String recommendDesc, List<CommonGoods> goodsList)
|
| | | throws RecommendUserGoodsException;
|
| | | |
| | | /**
|
| | | * |
| | | * @param uid
|
| | | * @param commonGoodsId
|
| | | * @return
|
| | | */
|
| | | public List<RecommendUserGoodsMap> listByUidAndCommonGoodsId(Long uid,Long commonGoodsId);
|
| | | |
| | | /**
|
| | | * |
| | | * @param uid
|
| | | * @param commonGoodsId
|
| | | * @return
|
| | | */
|
| | | public Long countByUidAndCommonGoodsId(Long uid,Long commonGoodsId);
|
| | | |
| | |
|
| | | /**
|
| | | * 获取推荐列表
|
| | |
| | | */
|
| | | public long countRecommend(Long uid);
|
| | |
|
| | | public RecommendUserGoods getLatestRecommendUserGoods(Long uid);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.lable;
|
| | |
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | |
|
| | | /**
|
| | | * 选择性更新内容——不为空则更新该字段
|
| | | * |
| | | * @param record
|
| | | * @return
|
| | | * @throws QualityFactoryException
|
| | | */
|
| | | public int updateByPrimaryKeySelective(QualityFactory record) throws QualityFactoryException;
|
| | |
|
| | | |
| | | /**
|
| | | * 根据id查找当前对象
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | * @throws QualityFactoryException
|
| | | */
|
| | | public QualityFactory selectByPrimaryKey(Long id) throws QualityFactoryException;
|
| | |
|
| | | |
| | | /**
|
| | | * 统计商品数量
|
| | | * |
| | | * @return
|
| | | */
|
| | | public Map<String, Object> getCountAll();
|
| | |
|
| | | /**
|
| | | * 根据商品id 移除精品库
|
| | | * |
| | | * @param ids
|
| | | * @throws QualityFactoryException
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 根据淘宝id 删除精选库对应信息
|
| | | * |
| | | * @param gid
|
| | | * @throws QualityFactoryException
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 根据淘宝id集合 批量删除精选库对应信息
|
| | | * |
| | | * @param listId
|
| | | * @throws QualityFactoryException
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 根据淘宝id 删除
|
| | | * |
| | | * @param auctionId
|
| | | * @throws QualityFactoryException
|
| | | */
|
| | | public void deleteByTbAuctionId(Long auctionId);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计商品id 是存在精品库
|
| | | * |
| | | * @param goodsId
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 批量入库--淘宝
|
| | | * |
| | | * @param auctionIdList
|
| | | * @param admin
|
| | | * @throws Exception
|
| | | */
|
| | | public void addBatch(List<Long> auctionIdList, String las, AdminUser admin) throws Exception;
|
| | |
|
| | | |
| | | /**
|
| | | * 精选库商品筛选
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | |
| | | */
|
| | | public List<QualityFactory> query(long start, int count, String key, Integer totalSales, Integer price,
|
| | | Integer tkRate, Integer propor, Integer goodsSource, Integer days, Integer startZkPrice, Integer endZkPrice,
|
| | | Integer startBiz30day, Integer endBiz30day, Integer startWeight, Integer endWeight, |
| | | Integer startTkRate, Integer endTkRate, Integer startAmount, Integer endAmount,
|
| | | Integer hasCoupon, Integer freeShipment, Integer isPrepay, Integer payRate30, |
| | | Integer goodRate, Integer rfdRate,Integer startPropor, Integer endPropor,
|
| | | Long gcid, Integer keyType) throws QualityFactoryException;
|
| | | Integer startBiz30day, Integer endBiz30day, Integer startWeight, Integer endWeight, Integer startTkRate,
|
| | | Integer endTkRate, Integer startAmount, Integer endAmount, Integer hasCoupon, Integer freeShipment,
|
| | | Integer isPrepay, Integer payRate30, Integer goodRate, Integer rfdRate, Integer startPropor,
|
| | | Integer endPropor, Long gcid, Integer keyType) throws QualityFactoryException;
|
| | |
|
| | | public long queryCount(String key, Integer goodsSource, Integer days, Integer startZkPrice, |
| | | Integer endZkPrice, Integer startBiz30day, Integer endBiz30day, Integer startWeight, |
| | | Integer endWeight, Integer startTkRate, Integer endTkRate, Integer startAmount, |
| | | Integer endAmount, Integer hasCoupon, Integer freeShipment, Integer isPrepay, |
| | | Integer payRate30, Integer goodRate, Integer rfdRate,Integer startPropor, Integer endPropor,
|
| | | Long gcid, Integer keyType) throws QualityFactoryException;
|
| | |
|
| | | public long queryCount(String key, Integer goodsSource, Integer days, Integer startZkPrice, Integer endZkPrice,
|
| | | Integer startBiz30day, Integer endBiz30day, Integer startWeight, Integer endWeight, Integer startTkRate,
|
| | | Integer endTkRate, Integer startAmount, Integer endAmount, Integer hasCoupon, Integer freeShipment,
|
| | | Integer isPrepay, Integer payRate30, Integer goodRate, Integer rfdRate, Integer startPropor,
|
| | | Integer endPropor, Long gcid, Integer keyType) throws QualityFactoryException;
|
| | |
|
| | | /**
|
| | | * 批量设置权重 + 随机权重
|
| | | * |
| | | * @param idList
|
| | | * @param admin
|
| | | * @param weight
|
| | |
| | | * @param weightLarge
|
| | | * @throws Exception
|
| | | */
|
| | | public void setWeightBatch(List<Long> idList, AdminUser admin, Integer weight, Integer weightSmall, Integer weightLarge) throws Exception;
|
| | | public void setWeightBatch(List<Long> idList, AdminUser admin, Integer weight, Integer weightSmall,
|
| | | Integer weightLarge) throws Exception;
|
| | |
|
| | | /**
|
| | | * 统计总行数
|
| | | * |
| | | * @return
|
| | | */
|
| | | public Long countTotalRows(Integer days);
|
| | |
|
| | | /**
|
| | | * 查询所有数据-无条件
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<QualityFactory> queryAll(long start, int count, Integer days);
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询需要更新的精选库商品id
|
| | | * |
| | | * @param count
|
| | | * @param hour
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 统计更新数据量
|
| | | * |
| | | * @return
|
| | | */
|
| | | public long queryNeedUpdateCount();
|
| | |
|
| | | /**
|
| | | * 查询精选商品数据应用前端
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param classId 分类id
|
| | | * @param labId 标签id
|
| | | * @param classId
|
| | | * 分类id
|
| | | * @param labId
|
| | | * 标签id
|
| | | * @return
|
| | | */
|
| | | public List<QualityFactory> listQuery(long start, int count, String key, Long classId, Long labId);
|
| | |
| | | */
|
| | | public long countQuery(String key, Integer goodsSource, Long classId, Long labId);
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 更新精选库商品
|
| | | * |
| | | * @param goodsList
|
| | | * @param systemCid
|
| | | * @param labels
|
| | |
| | | public void autoInsertOrUpadateStorage(List<TaoBaoGoodsBrief> goodsList,List<Label> listLabs,
|
| | | BoutiqueAutoRule autoRule) throws Exception;
|
| | |
|
| | | |
| | | /**
|
| | | * AuctionId查收精选库
|
| | | * |
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public List<QualityFactory> listQueryByAuctionId(List<Long> list);
|
| | |
|
| | | |
| | | /**
|
| | | * 根据时间 获取当前时间之前创建的商品信息
|
| | | * @param systemCid 系统分类id
|
| | | * @param dateTime 筛选时间
|
| | | * @param goodsSource 商品来源
|
| | | * |
| | | * @param systemCid
|
| | | * 系统分类id
|
| | | * @param dateTime
|
| | | * 筛选时间
|
| | | * @param goodsSource
|
| | | * 商品来源
|
| | | * @return
|
| | | */
|
| | | public List<Long> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime) throws QualityFactoryException;
|
| | | public List<Long> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime)
|
| | | throws QualityFactoryException;
|
| | |
|
| | | /**
|
| | | * 更新权重
|
| | | * |
| | | * @param weight
|
| | | * @param time
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 根据精选库商品id 更新商品信息
|
| | | * @param listId 商品主键
|
| | | * |
| | | * @param listId
|
| | | * 商品主键
|
| | | */
|
| | | public void updateGoodsFactory(List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 根据最低销量查询精选库(按创建时间倒叙排列)
|
| | | * |
| | | * @param salesCount
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | public List<QualityFactory> listByMinSalesCountOrderByCreateTimeDesc(int salesCount, int page, int pageSize);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public static MsgOrderDetail createFanLiOrder(Long uid, String orderId, int goodsCount, int orderState,
|
| | | BigDecimal payMoney, BigDecimal money, String beiZhu) {
|
| | | if (payMoney == null || money == null || uid == null)
|
| | | if (uid == null)
|
| | | return null;
|
| | | MsgOrderDetail detail = new MsgOrderDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(
|
| | | TimeUtil.getGernalTime(msg.getExtract().getExtractTime(), "yyyy-MM-dd HH:mm"), COLOR_CONTENT));
|
| | | TimeUtil.getGernalTime(msg.getExtract().getExtractTime()+1000*60*60*24L, "yyyy-MM-dd HH:mm"), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("预计到账", "#888888"), contentList));
|
| | |
|
| | | if (msg.getExtract().getState() == Extract.STATE_PASS) {//
|
| | |
| | | date + msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | else
|
| | | new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite.png.png",
|
| | | date + msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_share.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_share_money.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.inviteWeiQuan) {
|
| | | contentList.add(new ClientTextStyleVO(msg.getOrderId(), COLOR_CONTENT));
|
New file |
| | |
| | | package com.yeshi.fanli.vo.msg;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.UserMsgUnReadNum;
|
| | |
|
| | | /*
|
| | | * 用户消息已读状态存储
|
| | | */
|
| | | @Table("yeshi_ec_msg_read_state")
|
| | | public class UserMsgUnReadNumVO {
|
| | | private String typeOrder;// 订单消息未读数
|
| | |
|
| | | private String typeMoney;// 资金消息未读数
|
| | |
|
| | | private String typeAccount;// 账户消息未读数
|
| | |
|
| | | private String typeInvite;// 邀请消息未读数
|
| | |
|
| | | private String typeScore;// 积分消息未读数
|
| | |
|
| | | private String typeSystem;// 系统消息未读数
|
| | |
|
| | | public UserMsgUnReadNumVO(UserMsgUnReadNum num) {
|
| | | this.typeAccount = getCountDesc(num.getTypeAccount());
|
| | | this.typeInvite = getCountDesc(num.getTypeInvite());
|
| | | this.typeMoney = getCountDesc(num.getTypeMoney());
|
| | | this.typeOrder = getCountDesc(num.getTypeOrder());
|
| | | this.typeScore = getCountDesc(num.getTypeScore());
|
| | | this.typeSystem = getCountDesc(num.getTypeSystem());
|
| | | }
|
| | |
|
| | | static String getCountDesc(int count) {
|
| | | if (count >= 100)
|
| | | return "99+";
|
| | | else
|
| | | return count + "";
|
| | | }
|
| | |
|
| | | public UserMsgUnReadNumVO() {
|
| | |
|
| | | }
|
| | |
|
| | | public String getTypeOrder() {
|
| | | return typeOrder;
|
| | | }
|
| | |
|
| | | public void setTypeOrder(String typeOrder) {
|
| | | this.typeOrder = typeOrder;
|
| | | }
|
| | |
|
| | | public String getTypeMoney() {
|
| | | return typeMoney;
|
| | | }
|
| | |
|
| | | public void setTypeMoney(String typeMoney) {
|
| | | this.typeMoney = typeMoney;
|
| | | }
|
| | |
|
| | | public String getTypeSystem() {
|
| | | return typeSystem;
|
| | | }
|
| | |
|
| | | public void setTypeSystem(String typeSystem) {
|
| | | this.typeSystem = typeSystem;
|
| | | }
|
| | |
|
| | | public String getTypeAccount() {
|
| | | return typeAccount;
|
| | | }
|
| | |
|
| | | public void setTypeAccount(String typeAccount) {
|
| | | this.typeAccount = typeAccount;
|
| | | }
|
| | |
|
| | | public String getTypeInvite() {
|
| | | return typeInvite;
|
| | | }
|
| | |
|
| | | public void setTypeInvite(String typeInvite) {
|
| | | this.typeInvite = typeInvite;
|
| | | }
|
| | |
|
| | | public String getTypeScore() {
|
| | | return typeScore;
|
| | | }
|
| | |
|
| | | public void setTypeScore(String typeScore) {
|
| | | this.typeScore = typeScore;
|
| | | }
|
| | |
|
| | | }
|