admin
2019-01-22 0e552c5dba18d27622116a7d7a6e04fc99f8e8a7
Merge branch 'dev-msg'
23个文件已修改
1个文件已添加
1014 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/RecommendUserGoodsMapMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/RecommendUserGoodsMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/accept/AcceptData.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractMapper.xml 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/RecommendUserGoodsMapMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/RecommendUserGoodsMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 353 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/RecommendUserGoodsServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgAccountDetailServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgInviteDetailServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgMoneyDetailServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOrderDetailServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserInviteMsgNotificationServiceImpl.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/RecommendUserGoodsService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityFactoryService.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgUnReadNumVO.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -6,7 +6,9 @@
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;
@@ -24,6 +26,7 @@
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;
@@ -33,8 +36,13 @@
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;
@@ -45,7 +53,9 @@
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;
@@ -79,6 +89,12 @@
    @Resource
    private UserSystemMsgService userSystemMsgService;
    @Resource
    private CommonGoodsService commonGoodsService;
    @Resource
    private QualityFactoryService qualityFactoryService;
    // 消息的类型
    final static String MSG_TYPE_ORDER = "order";
@@ -212,6 +228,84 @@
        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();
                }
            }
        }
    }
    /**
     * 获取首页消息
     * 
@@ -225,6 +319,27 @@
        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<>();
@@ -286,8 +401,8 @@
                        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));
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/RecommendUserGoodsMapMapper.java
@@ -1,9 +1,16 @@
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);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/RecommendUserGoodsMapper.java
@@ -27,4 +27,12 @@
     * @return
     */
    Long countRecommendGoods(@Param("uid") Long uid);
    /**
     * 获取最近的推荐
     *
     * @param uid
     * @return
     */
    RecommendUserGoods getLatestRecommendUserGoods(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java
@@ -21,25 +21,25 @@
    int updateByPrimaryKey(QualityFactory record);
    
    /**
     * 批量插入
     *
     * @param list
     * @return
     */
    int insertBatch(List<QualityFactory> list);
    
    /**
     * 批量选择更新
     *
     * @param list
     * @return
     */
    int updateBatchSelective(List<QualityFactory> list);
    
    /**
     * 批量删除
     *
     * @param list
     * @return
     */
@@ -47,37 +47,33 @@
    
    /**
     * 统计总行数
     *
     * @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,
@@ -106,8 +102,6 @@
            // 类目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,
@@ -132,20 +126,22 @@
    
    /**
     * 统计商品数量
     *
     * @return
     */
    Map<String, Object> getCountAll();
    
    /**
     * 根据商品id移除精选库
     *
     * @param goodsId
     * @return
     */
    int deleteByGoodsId(Long goodsId);
    
    /**
     * 查询精选商品数据应用前端
     *
     * @param start
     * @param count
     * @param key
@@ -154,18 +150,18 @@
     * @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
@@ -175,9 +171,9 @@
     * @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);
    
@@ -186,19 +182,18 @@
            // 在售价范围
            @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
@@ -207,16 +202,15 @@
     * @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
@@ -224,9 +218,9 @@
     * @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);
        
@@ -238,11 +232,9 @@
                // 在售价范围
             @Param("startprice") Integer startprice, @Param("endprice") Integer endprice);
    
    /**
     * 券面额数据查询
     *
     * @param start
     * @param count
     * @param key
@@ -253,12 +245,12 @@
            @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
@@ -268,10 +260,9 @@
    
    long countQueryByFlashSale();
    
    /**
     * 返利金额数据查询
     *
     * @param start
     * @param count
     * @param key
@@ -285,9 +276,9 @@
    long countQueryByRebateAmount(@Param("proportion") String proportion, @Param("startAmount") Integer startAmount,
            @Param("endAmount") Integer endAmount,  @Param("tkRate") double tkRate);
    /**
     * 返利金额数据查询 - 首页下方数据
     *
     * @param start
     * @param count
     * @param key
@@ -296,17 +287,22 @@
     */
    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,
@@ -314,24 +310,25 @@
    
    /**
     * 更新权重
     *
     * @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, 
@@ -345,9 +342,18 @@
            @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);
}
fanli/src/main/java/com/yeshi/fanli/entity/accept/AcceptData.java
@@ -14,6 +14,15 @@
    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;
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractMapper.xml
@@ -5,6 +5,8 @@
        <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" />
@@ -23,7 +25,7 @@
    </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">
@@ -52,7 +54,7 @@
    <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},
@@ -65,7 +67,8 @@
        #{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"
@@ -111,6 +114,14 @@
                adminId,
            </if>
            <if test="receiveTime != null">
                receiveTime,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
@@ -149,6 +160,12 @@
            <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">
@@ -194,6 +211,12 @@
            <if test="system != null">
                adminId = #{adminId,jdbcType=BIGINT},
            </if>
            <if test="receiveTime != null">
                #{receiveTime,jdbcType=TIMESTAMP},
            </if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
@@ -222,7 +245,9 @@
        =#{adminId,jdbcType=BIGINT},
        sid
        =
        #{system.id,jdbcType=BIGINT}
        #{system.id,jdbcType=BIGINT},
        receiveTime
        =#{receiveTime,jdbcType=TIMESTAMP}
        where id =
        #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/mapping/goods/RecommendUserGoodsMapMapper.xml
@@ -35,6 +35,21 @@
    </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}
fanli/src/main/java/com/yeshi/fanli/mapping/goods/RecommendUserGoodsMapper.xml
@@ -48,6 +48,18 @@
    </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}
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -2,12 +2,15 @@
<!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"/>
@@ -31,12 +34,15 @@
    </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"/>
@@ -59,12 +65,15 @@
    </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"/>
@@ -87,13 +96,27 @@
    </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>
@@ -107,7 +130,8 @@
      <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>
@@ -123,8 +147,22 @@
      <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>
@@ -137,7 +175,8 @@
      <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">
@@ -146,9 +185,12 @@
            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=",">
@@ -220,7 +262,8 @@
            </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>
@@ -229,7 +272,8 @@
  <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} 
        
@@ -238,7 +282,8 @@
       <!-- 查询超过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>
@@ -246,7 +291,8 @@
        <!-- 查询超过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>
   
@@ -255,11 +301,15 @@
  <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">
@@ -402,7 +452,8 @@
             </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>
@@ -410,11 +461,15 @@
    <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">
@@ -530,33 +585,49 @@
  
      <!--查询精选商品信息-->
   <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>
      
@@ -564,11 +635,13 @@
          <!-- 移动查询 -->
           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}%' 
@@ -601,10 +674,12 @@
        <!-- 移动统计 -->
           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}%' 
@@ -630,9 +705,13 @@
    <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}    
@@ -668,9 +747,13 @@
    <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>
@@ -686,13 +769,17 @@
      
      <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>
@@ -701,8 +788,11 @@
      
       <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">
@@ -756,7 +846,8 @@
        <!-- 移动统计 -->
           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>
@@ -787,16 +878,23 @@
    </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}]]>  
@@ -817,7 +915,8 @@
    <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>
@@ -831,11 +930,15 @@
    </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 ]]>
        
@@ -847,9 +950,11 @@
    <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>
@@ -859,13 +964,17 @@
  <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>
                  )
@@ -916,20 +1025,25 @@
              
              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>
                  )
@@ -967,11 +1081,18 @@
    
    
     <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
@@ -993,9 +1114,13 @@
           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
@@ -1011,10 +1136,14 @@
    
     <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>
    
    
@@ -1025,7 +1154,9 @@
   </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}
@@ -1034,7 +1165,8 @@
                 WHERE tb.tkRate >=  #{tkRate} 
                     AND tb.`couponAmount` >=  #{couponAmount}
                     AND (tb.`couponAmount`/ tb.zkPrice)*100 > #{couponRatio}
                 ]]> )g
                 ]]>
        )g
          
          ON h.`sg_goods_id`= g.`id`   
 
@@ -1056,7 +1188,8 @@
                 WHERE tb.tkRate >=  #{tkRate} 
                       AND tb.`couponAmount` >=  #{couponAmount}
                       AND (tb.`couponAmount`/ tb.zkPrice)*100 > #{couponRatio}
                 ]]> )g
                 ]]>
        )g
          
          ON h.`sg_goods_id`= g.`id`   
 
@@ -1065,8 +1198,11 @@
    
    
    <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>
@@ -1127,7 +1263,8 @@
    <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>
        <!-- 在售价范围  -->
@@ -1156,11 +1293,14 @@
    
    <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'>
@@ -1170,8 +1310,19 @@
                <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>
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/RecommendUserGoodsServiceImpl.java
@@ -60,4 +60,19 @@
        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);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java
@@ -508,8 +508,8 @@
            // 加入通知
            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());
@@ -741,21 +741,21 @@
                }
                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);
                }
                // 插入二级子红包
@@ -789,21 +789,21 @@
                    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);
                    }
                }
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java
@@ -71,12 +71,10 @@
    @Resource
    private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
    @Override
    public int updateByPrimaryKeySelective(QualityFactory record) throws QualityFactoryException {
        return qualityFactoryMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public void deleteByTbAuctionId(Long auctionId) {
@@ -148,7 +146,6 @@
        labelGoodsMapper.deleteBatchByGoodsId(listGid);
    }
    @Override
    @Transactional
    public void deleteByGoodsId(List<String> ids) throws QualityFactoryException {
@@ -159,7 +156,6 @@
            }
        }
    }
    @Override
    public QualityFactory selectByPrimaryKey(Long id) throws QualityFactoryException {
@@ -416,11 +412,13 @@
        return qualityFactoryMapper.queryNeedUpdate(start, count, hour);
    }
    /**
     * 获取缓存
     * @param key 键
     * @param title 标签名称
     *
     * @param key
     *            键
     * @param title
     *            标签名称
     * @return
     */
    public String getLabelIdByRedis (String key, String title) throws Exception {
@@ -462,7 +460,6 @@
        List<Long> listDeleteQuality = new ArrayList<Long>();
        // 删除标签
        List<Long> listDeleteLabel = new ArrayList<Long>();
        
        List<QualityFactory> listUpdateQuality = new ArrayList<QualityFactory>();
@@ -555,7 +552,8 @@
                        } else {
                            /* 更新商品信息 */
                            TaoBaoGoodsBrief updateGoods = taoBaoGoodsUpdateService.getUpdateTaoBaoGoodsBrief(newGoodsBrief);
                            TaoBaoGoodsBrief updateGoods = taoBaoGoodsUpdateService
                                    .getUpdateTaoBaoGoodsBrief(newGoodsBrief);
                        
                            updateGoods.setId(id);
                            taoBaoGoodsBriefService.setGoodsBriefDefault(updateGoods);
@@ -636,7 +634,6 @@
        }
    }
    @Override
    public void autoInsertOrUpadateStorage(List<TaoBaoGoodsBrief> goodsList, List<Label> listLabs,
            BoutiqueAutoRule autoRule) throws Exception {
@@ -672,8 +669,6 @@
            }
        }
        // 商品id集合
        List<Long> listSystemTBid = new ArrayList<Long>();
@@ -689,7 +684,6 @@
        List<QualityFactory> listAddInsert = new ArrayList<QualityFactory>();
        // 进入精选商品列表
        List<QualityFactory> listAddUpdate = new ArrayList<QualityFactory>();
        // 插入商品淘宝ID集合
        List<Long> listAuctionId = new ArrayList<Long>();
@@ -766,7 +760,6 @@
                
                listGoodsUpdate.add(updateGoods);
                Long has9k9ID = null;
                /* 贴上标签   */
@@ -774,8 +767,10 @@
                    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);
@@ -818,7 +813,6 @@
                    }
                }
                /* 判断是否已经贴上标签 9k9标签 */
                if (list9Class.size() > 0) {
                    
@@ -843,7 +837,6 @@
                                }
                            }
                        }
                        
                        // 清空 9K9系列标签
                        for (LabelGoods labelGoods : listGlid) {
@@ -875,9 +868,10 @@
                    
                    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);
                            
@@ -1315,4 +1309,10 @@
        return lg;
    }
    @Override
    public List<QualityFactory> listByMinSalesCountOrderByCreateTimeDesc(int salesCount, int page, int pageSize) {
        return qualityFactoryMapper.listByMinSalesCountOrderByCreateTimeDesc(salesCount, (page - 1) * pageSize,
                pageSize);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgAccountDetailServiceImpl.java
@@ -11,6 +11,7 @@
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;
@@ -19,6 +20,9 @@
    @Resource
    private MsgAccountDetailMapper msgAccountDetailMapper;
    @Resource
    private UserMsgReadStateService userMsgReadStateService;
    @Override
    public void addMsgAccountDetail(MsgAccountDetail detail) throws MsgAccountDetailException {
@@ -32,6 +36,7 @@
        detail.setUpdateTime(new Date());
        detail.setRead(false);
        msgAccountDetailMapper.insertSelective(detail);
        userMsgReadStateService.addAccountMsgUnReadCount(detail.getUser().getId(), 1);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgInviteDetailServiceImpl.java
@@ -12,6 +12,7 @@
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
@@ -19,6 +20,9 @@
    @Resource
    private MsgInviteDetailMapper msgInviteDetailMapper;
    @Resource
    private UserMsgReadStateService userMsgReadStateService;
    @Override
    public void addMsgInviteDetail(MsgInviteDetail detail) throws MsgInviteDetailException {
@@ -52,6 +56,8 @@
            update.setRead(false);
            msgInviteDetailMapper.updateByPrimaryKeySelective(update);
        }
        userMsgReadStateService.addInviteMsgUnReadCount(detail.getUser().getId(), 1);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgMoneyDetailServiceImpl.java
@@ -12,6 +12,7 @@
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
@@ -19,6 +20,9 @@
    @Resource
    private MsgMoneyDetailMapper msgMoneyDetailMapper;
    @Resource
    private UserMsgReadStateService userMsgReadStateService;
    @Override
    public void addMsgMoneyDetail(MsgMoneyDetail detail) throws MsgMoneyDetailException {
@@ -80,7 +84,18 @@
            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
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOrderDetailServiceImpl.java
@@ -12,6 +12,7 @@
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
@@ -19,6 +20,9 @@
    @Resource
    private MsgOrderDetailMapper msgOrderDetailMapper;
    @Resource
    private UserMsgReadStateService userMsgReadStateService;
    @Override
    public void addMsgOrderDetail(MsgOrderDetail detail) throws MsgOrderDetailException {
@@ -44,6 +48,7 @@
            update.setBeiZhu(detail.getBeiZhu());
            msgOrderDetailMapper.updateByPrimaryKeySelective(update);
        }
        userMsgReadStateService.addOrderMsgUnReadCount(detail.getUser().getId(), 1);
    }
    @Override
@@ -76,12 +81,13 @@
            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);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserInviteMsgNotificationServiceImpl.java
@@ -1,29 +1,50 @@
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();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java
@@ -13,6 +13,7 @@
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;
@@ -21,6 +22,9 @@
    @Resource
    private UserSystemMsgMapper userSystemMsgMapper;
    @Resource
    private UserMsgReadStateService userMsgReadStateService;
    @Override
    public void addUserSystemMsg(Long uid, UserSystemMsgTypeEnum type, String title, String content, int timeTag,
@@ -50,6 +54,7 @@
            msg.setTimeTag(timeTag);
        }
        userSystemMsgMapper.insertSelective(msg);
        userMsgReadStateService.addSystemMsgUnReadCount(uid, 1);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java
@@ -541,6 +541,7 @@
        Extract updateExtract = new Extract();
        updateExtract.setId(extract.getId());
        updateExtract.setState(Constant.EXTRACT_PASS);
        updateExtract.setReceiveTime(new Date());
        updateExtract.setReason("提现成功");
        extractMapper.updateByPrimaryKeySelective(updateExtract);
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/RecommendUserGoodsService.java
@@ -4,6 +4,7 @@
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 {
@@ -18,6 +19,23 @@
     */
    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);
    /**
     * 获取推荐列表
@@ -37,4 +55,6 @@
     */
    public long countRecommend(Long uid);
    public RecommendUserGoods getLatestRecommendUserGoods(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityFactoryService.java
@@ -1,6 +1,5 @@
package com.yeshi.fanli.service.inter.lable;
import java.util.List;
import java.util.Map;
@@ -15,30 +14,32 @@
    
    /**
     * 选择性更新内容——不为空则更新该字段
     *
     * @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
     */
@@ -46,6 +47,7 @@
    
    /**
     * 根据淘宝id 删除精选库对应信息
     *
     * @param gid
     * @throws QualityFactoryException
     */
@@ -53,6 +55,7 @@
    /**
     * 根据淘宝id集合 批量删除精选库对应信息
     *
     * @param listId
     * @throws QualityFactoryException
     */
@@ -60,14 +63,15 @@
    /**
     * 根据淘宝id 删除
     *
     * @param auctionId
     * @throws QualityFactoryException
     */
    public void deleteByTbAuctionId(Long auctionId);
    /**
     * 统计商品id 是存在精品库
     *
     * @param goodsId
     * @return
     */
@@ -75,15 +79,16 @@
    
    /**
     * 批量入库--淘宝
     *
     * @param auctionIdList
     * @param admin
     * @throws Exception
     */
    public void addBatch(List<Long> auctionIdList, String las, AdminUser admin) throws Exception;
    /**
     * 精选库商品筛选
     *
     * @param start
     * @param count
     * @param key
@@ -113,22 +118,20 @@
     */
    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
@@ -136,25 +139,28 @@
     * @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
@@ -163,17 +169,21 @@
    /**
     * 统计更新数据量
     *
     * @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);
@@ -183,10 +193,9 @@
     */ 
    public long countQuery(String key, Integer goodsSource, Long classId, Long labId);
    /**
     * 更新精选库商品
     *
     * @param goodsList
     * @param systemCid
     * @param labels
@@ -194,26 +203,31 @@
    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
@@ -222,8 +236,20 @@
    /**
     * 根据精选库商品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);
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java
@@ -24,7 +24,7 @@
     */
    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);
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -135,7 +135,7 @@
            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) {//
@@ -249,7 +249,7 @@
                        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);
@@ -301,7 +301,7 @@
                    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));
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgUnReadNumVO.java
New file
@@ -0,0 +1,92 @@
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;
    }
}