admin
2019-01-23 324aea6f8b2d36ea5b6fc1b03d29ad8dfae40259
Merge remote-tracking branch 'origin/master'

Conflicts:
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
19个文件已修改
1个文件已添加
740 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/QualityFactoryAdminController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/AppVersionInfoMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/AppVersionInfoMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/AppVersionServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/AppVersionService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityFactoryService.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/quality/QualityFactoryVO.java 299 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/druid.properties 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/QualityFactoryAdminController.java
@@ -11,8 +11,6 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
@@ -27,7 +25,6 @@
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.QualityFactoryException;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.lable.LabelGoodsService;
import com.yeshi.fanli.service.inter.lable.LabelService;
@@ -40,6 +37,9 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.quality.QualityFactoryVO;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/qualityFactory")
@@ -57,10 +57,6 @@
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
    @Resource
    private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
    @Resource
    private AdminUserService adminUserService;
    
    public static final int SALES_ASC = 1;
@@ -223,44 +219,12 @@
    }
    /**
     *
     * @param callback
     * @param pageIndex
     * @param key
     *            搜索
     * @param totalSales
     *            销售量
     * @param price
     *            价格
     * @param tkRate
     *            佣金比例
     * @param goodsSource
     * @param days
     * @param startZkPrice
     * @param endZkPrice
     * @param startBiz30day
     * @param endBiz30day
     * @param startWeight
     * @param endWeight
     * @param startTkRate
     * @param endTkRate
     * @param startAmount
     * @param endAmount
     * @param hasCoupon
     * @param freeShipment
     * @param isPrepay
     * @param payRate30
     * @param goodRate
     * @param rfdRate
     * 查询
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex,Integer pageSize, String key, Integer sort, 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, PrintWriter out) {
    public void query(String callback, Integer pageIndex,Integer pageSize,  Integer sort,
            QualityFactoryVO qualityFactoryVO, PrintWriter out) {
        try {
            if (pageSize == null)
@@ -305,11 +269,14 @@
                }
            }
            
            qualityFactoryVO.setPrice(price);
            qualityFactoryVO.setTkRate(tkRate);
            qualityFactoryVO.setTotalSales(totalSales);
            qualityFactoryVO.setPropor(propor);
            qualityFactoryVO.setStart((pageIndex - 1) * pageSize);
            qualityFactoryVO.setCount(pageSize);
            List<QualityFactory> selectionList = qualityFactoryService.query((pageIndex - 1) * pageSize, pageSize, key, totalSales,
                    price, tkRate, propor, goodsSource, days, startZkPrice, endZkPrice, startBiz30day, endBiz30day,
                    startWeight, endWeight, startTkRate, endTkRate, startAmount, endAmount, hasCoupon,
                    freeShipment, isPrepay, payRate30, goodRate, rfdRate, startPropor,  endPropor, gcid, keyType);
            List<QualityFactory> selectionList = qualityFactoryService.query(qualityFactoryVO);
            /* 暂无数据显示 */
            if (selectionList == null || selectionList.size() == 0) {
@@ -319,10 +286,7 @@
            /* 有数据:处理返回格式 */
            long count = qualityFactoryService.queryCount(key, goodsSource, days, startZkPrice, endZkPrice, startBiz30day,
                    endBiz30day, startWeight, endWeight, startTkRate, endTkRate, startAmount,
                    endAmount, hasCoupon, freeShipment, isPrepay, payRate30, goodRate, rfdRate,
                    startPropor, endPropor, gcid, keyType);
            long count = qualityFactoryService.queryCount(qualityFactoryVO);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
@@ -360,7 +324,13 @@
                        if (auctionIdBuf != null && auctionIdBuf.length() > 0) {
                            String auctionIds = auctionIdBuf.toString();
                            String ids = auctionIds.substring(0, auctionIds.length() -1);
                            List<TaoBaoGoodsBrief> list = TaoKeApiUtil.getBatchGoodsInfos(ids);
                            List<TaoBaoGoodsBrief> list = null;
                            try {
                                list = TaoKeApiUtil.getBatchGoodsInfos(ids);
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (list != null && list.size() > 0) {
                                goodsBriefList.addAll(list);
                            }
@@ -373,7 +343,13 @@
                        // 大于40参数
                        String auctionIds = auctionIdBuf.toString();
                        String ids = auctionIds.substring(0, auctionIds.length() -1);
                        List<TaoBaoGoodsBrief> list = TaoKeApiUtil.getBatchGoodsInfos(ids);
                        List<TaoBaoGoodsBrief> list = null;
                        try {
                            list = TaoKeApiUtil.getBatchGoodsInfos(ids);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        if (list != null && list.size() > 0) {
                            goodsBriefList.addAll(list);
                        }
@@ -385,7 +361,13 @@
                        // 最后一个
                        String auctionIds = auctionIdBuf.toString();
                        String ids = auctionIds.substring(0, auctionIds.length() -1);
                        List<TaoBaoGoodsBrief> list = TaoKeApiUtil.getBatchGoodsInfos(ids);
                        List<TaoBaoGoodsBrief> list = null;
                        try {
                            list = TaoKeApiUtil.getBatchGoodsInfos(ids);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        if (list != null && list.size() > 0) {
                            goodsBriefList.addAll(list);
                        }
@@ -476,11 +458,11 @@
                
                
                
                // TODO /* 券后价--计算 */
                 /* 券后价--计算 */
                BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
                map.put("couponPrice", couponPrice);
                // TODO /* 预计收益: 公司、用户 */
                /* 预计收益: 公司、用户 */
                BigDecimal tkRateBrief = taoBaoGoodsBrief.getTkRate();
                BigDecimal zkPrice = taoBaoGoodsBrief.getZkPrice();
                BigDecimal profit = MoneyBigDecimalUtil.mul(tkRateBrief, zkPrice);
@@ -634,7 +616,6 @@
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
@@ -663,7 +644,6 @@
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
@@ -710,7 +690,6 @@
            
        } catch (QualityFactoryException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
@@ -780,7 +759,6 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            // TODO Auto-generated catch block
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
@@ -862,7 +840,6 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            // TODO Auto-generated catch block
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
@@ -881,13 +858,6 @@
    public void addBatchcGoodsLabel(String callback, String labIds, Long id, HttpServletRequest request, PrintWriter out) {
        try {
            // 获取当前操作用户
            AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
//            if (admin == null) {
//                out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆。")));
//                return;
//            }
            if (StringUtil.isNullOrEmpty(labIds)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未选择标签"));
                return;
@@ -907,7 +877,9 @@
            }
            TaoBaoGoodsBrief taoBaoGoodsBrief = taoBaoGoodsBriefService.selectByPrimaryKey(id);
            // 获取当前操作用户
            AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
            labelGoodsService.addBatchByLabId(taoBaoGoodsBrief, labIdList, admin);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java
@@ -467,11 +467,11 @@
                    }
                }
                // TODO /* 券后价--计算 */
                /* 券后价--计算 */
                BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
                map.put("couponPrice", couponPrice);
                // TODO /* 预计收益: 公司、用户 */
                /* 预计收益: 公司、用户 */
                BigDecimal tkRate = taoBaoGoodsBrief.getTkRate();
                BigDecimal zkPrice = taoBaoGoodsBrief.getZkPrice();
                BigDecimal profit = MoneyBigDecimalUtil.mul(tkRate, zkPrice);
@@ -696,7 +696,7 @@
                    BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
                    map.put("couponPrice", couponPrice);
                    // TODO /* 预计收益: 公司、用户 */
                    /* 预计收益: 公司、用户 */
                    BigDecimal zkPrice = taoBaoGoodsBrief.getZkPrice();
                    BigDecimal profit = MoneyBigDecimalUtil.mul(rate, zkPrice);
                    // 计算结果
@@ -752,7 +752,6 @@
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询异常"));
            e.printStackTrace();
        }
@@ -800,7 +799,6 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            // TODO Auto-generated catch block
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询异常"));
            e.printStackTrace();
        }
@@ -904,11 +902,11 @@
                // 来源 0 无 1淘宝 2 京东
                map.put("goodsSource", 1);
                // TODO /* 券后价--计算 */
                /* 券后价--计算 */
                BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
                map.put("couponPrice", couponPrice);
                // TODO /* 预计收益: 公司、用户 */
                /* 预计收益: 公司、用户 */
                BigDecimal tkRate = taoBaoGoodsBrief.getTkRate();
                BigDecimal zkPrice = taoBaoGoodsBrief.getZkPrice();
                BigDecimal profit = MoneyBigDecimalUtil.mul(tkRate, zkPrice);
@@ -1020,11 +1018,11 @@
                // 来源 0 无 1淘宝 2 京东
                map.put("goodsSource", 1);
                // TODO /* 券后价--计算 */
                /* 券后价--计算 */
                BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
                map.put("couponPrice", couponPrice);
                // TODO /* 预计收益: 公司、用户 */
                /* 预计收益: 公司、用户 */
                BigDecimal tkRate = taoBaoGoodsBrief.getTkRate();
                BigDecimal zkPrice = taoBaoGoodsBrief.getZkPrice();
                BigDecimal profit = MoneyBigDecimalUtil.mul(tkRate, zkPrice);
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java
@@ -36,6 +36,7 @@
import com.yeshi.fanli.service.inter.user.UserRankingsService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.account.UserUtil;
import net.sf.json.JSONArray;
@@ -80,6 +81,9 @@
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    @Resource
    private RedisManager redisManager;
    @RequestMapping(value = "/inviteGetMoney", method = RequestMethod.POST)
    public void everyDayTaskList(AcceptData acceptData, int pageIndex, PrintWriter out, String uid)
@@ -317,7 +321,15 @@
                return;
            }
            
            String inviteShortLink = redisManager.getInviteShortLink(uid);
            if (inviteShortLink != null && inviteShortLink.trim().length() > 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请1分钟后再试"));
                return;
            }
            String shortLink = UserUtil.getInviteShortLink(uid);
            // 缓存1分钟
            redisManager.setInviteShortLink(uid, shortLink);
            
            JSONObject data = new JSONObject();
            data.put("shortLink", shortLink);
@@ -374,10 +386,9 @@
        try {
            ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
            if (threeSale == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("无上级邀请人"));
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "无上级邀请人"));
                return;
            }
            
            UserInfo boss = threeSale.getBoss();
            if (boss == null) {
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -35,6 +35,7 @@
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.dto.HongBaoDTO;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.AccountDetails;
import com.yeshi.fanli.entity.bus.user.AccountMessage;
@@ -71,6 +72,7 @@
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
@@ -215,6 +217,9 @@
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private AppVersionService appVersionService;
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -504,11 +509,34 @@
        BigDecimal fanliHB = user.getTotalHongBao();
        user.setTotalHongBao(fanliHB);
        UserInfo filterForClientUser = UserUtil.filterForClientUser(user);
        // 1.5.0 版本之后返回新的等级
        String version = acceptData.getVersion();
        if (version != null && version.trim().length() > 0) {
            int versionCode = Integer.parseInt(version);
            String platform = acceptData.getPlatform();
            AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, "1.5.0");
            if (versionInfo != null) {
                int versionCode150 = versionInfo.getVersionCode();
                if (versionCode >= versionCode150) {
                    UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId());
                    if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
                        String picture = userInfoExtra.getUserRank().getPicture();
                        String icon = userInfoExtra.getUserRank().getIcon();
                        filterForClientUser.setRankNamePicture(picture);
                        filterForClientUser.setRankIcon(icon);
                    }
                }
            }
        }
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
        JSONObject data = new JSONObject();
        data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create()
                .toJson(UserUtil.filterForClientUser(user)));
        data.put("user",
                JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(filterForClientUser));
        data.put("first", 0);
        int spreadImgCount = spreadUserImgService.countUserSpreadImg(user.getId());
        long shareCount = userShareGoodsRecordService.countShareRecordByUid(user.getId());
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
@@ -9,23 +9,27 @@
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.DateUtil;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.order.CommonOrderException;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.vo.order.CommonOrderVO;
import com.yeshi.fanli.vo.user.UserInfoExtraVO;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/v1/user/order")
@@ -33,9 +37,15 @@
    
    @Resource
    private ConfigService configService;
    @Resource
    private AppVersionService appVersionService;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    
    @Resource
    private CommonOrderService commonOrderService;
@@ -199,6 +209,29 @@
            UserInfo userInfo = UserUtil.filterForClientUser(user);
            
            // 1.5.0 版本之后返回新的等级
            String version = acceptData.getVersion();
            if (version != null && version.trim().length() > 0) {
                int versionCode = Integer.parseInt(version);
                String platform = acceptData.getPlatform();
                AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, "1.5.0");
                if (versionInfo != null) {
                    int versionCode150 = versionInfo.getVersionCode();
                    if (versionCode >= versionCode150) {
                        UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId());                        if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
                            String picture = userInfoExtra.getUserRank().getPicture();
                            String icon = userInfoExtra.getUserRank().getIcon();
                            userInfo.setRankIcon(icon);
                            userInfo.setRankNamePicture(picture);
                        }
                    }
                }
            }
            JSONObject data = new JSONObject();
            data.put("userInfo", userInfo);
            
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/AppVersionInfoMapper.java
@@ -25,6 +25,17 @@
    List<AppVersionInfo> selectByPlatform(String platform);
    /**
     * 根据平台和版本获取版本信息
     *
     * @param platform
     * @param versionCode
     * @return
     */
    AppVersionInfo selectByPlatformAndVersion(@Param("platform") String platform,
            @Param("version") String version);
    /**
     * 根据平台和版本号获取版本信息
     * 
     * @param platform
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java
@@ -6,6 +6,7 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.vo.quality.QualityFactoryVO;
public interface QualityFactoryMapper {
@@ -76,53 +77,9 @@
    long countQueryNeedUpdate();
    // 精选库查询
    List<QualityFactory> query(@Param("start") long start, @Param("count") int count, @Param("key") String key,
            // 排序字段 :销量、价格、佣金
            @Param("totalSales") Integer totalSales, @Param("price") Integer price, @Param("tkRate") Integer tkRate,
            // 商品来源、入库时间
            @Param("propor") Integer propor, @Param("goodsSource") Integer goodsSource, @Param("days") Integer days,
            // 在售价范围
            @Param("startZkPrice") Integer startZkPrice, @Param("endZkPrice") Integer endZkPrice,
            // 月销量范围
            @Param("startBiz30day") Integer startBiz30day, @Param("endBiz30day") Integer endBiz30day,
            // 权重范围
            @Param("startWeight") Integer startWeight, @Param("endWeight") Integer endWeight,
            // 佣金比例范围
            @Param("startTkRate") Integer startTkRate, @Param("endTkRate") Integer endTkRate,
            // 券面额:减多少
            @Param("startAmount") Integer startAmount, @Param("endAmount") Integer endAmount,
            // 是否: 优惠券 、包邮
            @Param("hasCoupon") Integer hasCoupon, @Param("freeShipment") Integer freeShipment,
            // 是否:消费者保障 、成交转化
            @Param("isPrepay") Integer isPrepay, @Param("payRate30") Integer payRate30,
            // 是否:好评率、 退款率
            @Param("goodRate") Integer goodRate, @Param("rfdRate") Integer rfdRate,
            // 券比例: 券面值/在售价
            @Param("startPropor") Integer startPropor, @Param("endPropor") Integer endPropor,
            // 类目id 搜索此类型
            @Param("gcid") Long gcid, @Param("keyType") Integer keyType);
    List<QualityFactory> query(QualityFactoryVO qualityFactoryVO);
    long queryCount(@Param("key") String key, @Param("goodsSource") Integer goodsSource, @Param("days") Integer days,
            // 在售价范围
            @Param("startZkPrice") Integer startZkPrice, @Param("endZkPrice") Integer endZkPrice,
            // 月销量范围
            @Param("startBiz30day") Integer startBiz30day, @Param("endBiz30day") Integer endBiz30day,
            // 权重范围
            @Param("startWeight") Integer startWeight, @Param("endWeight") Integer endWeight,
            // 佣金比例范围
            @Param("startTkRate") Integer startTkRate, @Param("endTkRate") Integer endTkRate,
            // 券面额:减多少
            @Param("startAmount") Integer startAmount, @Param("endAmount") Integer endAmount,
            // 是否: 优惠券 、包邮
            @Param("hasCoupon") Integer hasCoupon, @Param("freeShipment") Integer freeShipment,
            // 是否:消费者保障 、成交转化
            @Param("isPrepay") Integer isPrepay, @Param("payRate30") Integer payRate30,
            // 是否:好评率、 退款率
            @Param("goodRate") Integer goodRate, @Param("rfdRate") Integer rfdRate,
            // 券比例: 券面值/在售价
            @Param("startPropor") Integer startPropor, @Param("endPropor") Integer endPropor,
            // 类目id
            @Param("gcid") Long gcid, @Param("keyType") Integer keyType);
    long queryCount(QualityFactoryVO qualityFactoryVO);
    /**
     * 统计商品数量
fanli/src/main/java/com/yeshi/fanli/mapping/AppVersionInfoMapper.xml
@@ -32,6 +32,14 @@
        #{0}
    </select>
    <select id="selectByPlatformAndVersion" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_app_version_code_map where avcm_platform =
        #{platform}
        and avcm_version=#{version}
    </select>
    <select id="selectByPlatformAndVersionCode" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
@@ -39,7 +47,6 @@
        #{platform}
        and avcm_version_code=#{versionCode}
    </select>
    <select id="listByPlatformAndMinVersionCode" resultMap="BaseResultMap">
        select
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -298,8 +298,8 @@
    <!-- 查询精选商品信息 -->
    <select id="query" resultMap="ResultMap">
    <select id="query" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO" resultMap="ResultMap">
        SELECT ts.* FROM (
        SELECT DISTINCT( tt.`sg_id`) AS id FROM
        yeshi_ec_quality_factory tt
@@ -458,7 +458,7 @@
    </select>
    <select id="queryCount" resultType="java.lang.Long">
    <select id="queryCount" parameterType="com.yeshi.fanli.vo.quality.QualityFactoryVO"  resultType="java.lang.Long">
        <!-- 根据条件统计所有标签数量 -->
        SELECT count(ts.sg_id) FROM (
        SELECT DISTINCT( tt.`sg_id`) AS id FROM
fanli/src/main/java/com/yeshi/fanli/service/impl/config/AppVersionServiceImpl.java
@@ -47,4 +47,9 @@
        return appVersionInfoMapper.selectByPlatformAndVersionCode(platform, versionCode);
    }
    @Override
    public AppVersionInfo getByPlatformAndVersion(String platform, String version) {
        return appVersionInfoMapper.selectByPlatformAndVersion(platform, version);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java
@@ -41,6 +41,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.quality.QualityFactoryVO;
@Service
public class QualityFactoryServiceImpl implements QualityFactoryService {
@@ -174,29 +175,13 @@
    }
    @Override
    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 {
        return qualityFactoryMapper.query(start, count, key, totalSales, price, tkRate, propor, goodsSource, days,
                startZkPrice, endZkPrice, startBiz30day, endBiz30day, startWeight, endWeight, startTkRate, endTkRate,
                startAmount, endAmount, hasCoupon, freeShipment, isPrepay, payRate30, goodRate, rfdRate, startPropor,
                endPropor, gcid, keyType);
    public List<QualityFactory> query(QualityFactoryVO qualityFactoryVO) throws QualityFactoryException {
        return qualityFactoryMapper.query(qualityFactoryVO);
    }
    @Override
    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 {
        return qualityFactoryMapper.queryCount(key, goodsSource, days, startZkPrice, endZkPrice, startBiz30day,
                endBiz30day, startWeight, endWeight, startTkRate, endTkRate, startAmount, endAmount, hasCoupon,
                freeShipment, isPrepay, payRate30, goodRate, rfdRate, startPropor, endPropor, gcid, keyType);
    public long queryCount(QualityFactoryVO qualityFactoryVO) throws QualityFactoryException {
        return qualityFactoryMapper.queryCount(qualityFactoryVO);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -334,6 +334,12 @@
    }
    
    @Override
    public UserInfoExtraVO getInfoExtraVOByUid(Long uid) {
        return userInfoExtraMapper.getInfoExtraVOByUid(uid);
    }
    @Override
    public String getUserInviteCode(Long uid) throws UserInfoExtraException {
        
        UserInfoExtra userInfoExtra = userInfoExtraMapper.getInfoExtraByUid(uid);
fanli/src/main/java/com/yeshi/fanli/service/inter/config/AppVersionService.java
@@ -37,4 +37,12 @@
     */
    public AppVersionInfo getAppVersionInfoListByPlatformAndVersion(String platform, int versionCode);
    /**
     * 根据版本号获取
     * @param platform
     * @param version
     * @return
     */
    public AppVersionInfo getByPlatformAndVersion(String platform, String version);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityFactoryService.java
@@ -9,6 +9,7 @@
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.QualityFactoryException;
import com.yeshi.fanli.vo.quality.QualityFactoryVO;
public interface QualityFactoryService {
@@ -89,45 +90,11 @@
    /**
     * 精选库商品筛选
     * 
     * @param start
     * @param count
     * @param key
     * @param totalSales
     * @param price
     * @param tkRate
     * @param goodsSource
     * @param days
     * @param startZkPrice
     * @param endZkPrice
     * @param startBiz30day
     * @param endBiz30day
     * @param startWeight
     * @param endWeight
     * @param startTkRate
     * @param endTkRate
     * @param startAmount
     * @param endAmount
     * @param hasCoupon
     * @param freeShipment
     * @param isPrepay
     * @param payRate30
     * @param goodRate
     * @param rfdRate
     * @return
     * @throws QualityFactoryException
     */
    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;
    public List<QualityFactory> query(QualityFactoryVO qualityFactoryVO) 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(QualityFactoryVO qualityFactoryVO) throws QualityFactoryException;
    /**
     * 批量设置权重 + 随机权重
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java
@@ -60,5 +60,12 @@
     * @throws UserInfoExtraException
     */
    public String getUserInviteCode(Long uid) throws UserInfoExtraException;
    /**
     * 获取用户额外信息全部衍生信息
     * @param uid
     * @return
     */
    public UserInfoExtraVO getInfoExtraVOByUid(Long uid);
    
}
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -13,7 +13,7 @@
public class Constant {
    public static boolean IS_TASK = false;
    // 外网环境
    public static boolean IS_OUTNET = false;
    public static boolean IS_OUTNET = true;
    public static boolean IS_TEST = true;
@@ -72,25 +72,21 @@
    public static final String EXTRACT_MIN_MONEY = "extract_min_money";
    public static final String MYLIKE = "mylike";
    public static final String MYDYNAMIC = "mydynamic";
    public static final String TAOBAO_AUTH_APPKEY="24980167";
    public static final String TAOBAO_AUTH_APPSECRET="e0a2e05deabf5ce039b52e5b492d5382";
    public static final String TAOBAO_AUTH_APPKEY = "24980167";
    public static final String TAOBAO_AUTH_APPSECRET = "e0a2e05deabf5ce039b52e5b492d5382";
    // 来源-淘宝
    public static final int SOURCE_TYPE_TAOBAO = 1;
    // 来源-京东
    public static final int SOURCE_TYPE_JD = 2;
    // 自购-返利
    public static final int TYPE_REBATE= 1;
    public static final int TYPE_REBATE = 1;
    // 分享
    public static final int TYPE_SHAER = 2;
    // 邀请
    public static final int TYPE_INVITE = 3;
    public static WXGZConfig wxGZConfig;
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java
@@ -414,5 +414,42 @@
        String key = "smsstate-alipay-" + phone;
        return !StringUtil.isNullOrEmpty(getString(key));
    }
    /**
     * 缓存短连接1分钟
     * @param uid
     * @param shortlink
     */
    public void setInviteShortLink(long uid, String shortlink) {
        String value = "";
        String key = "invite-shortlink-" + uid;
        if (Constant.IS_OUTNET) {
            value = getCommonString(key);
            if (StringUtil.isNullOrEmpty(value)) {
                cacheCommonString(key, shortlink, 60);
            }
        }
    }
    /**
     * 获取用户短连接
     * @param uid
     * @return
     */
    public String getInviteShortLink(long uid) {
        String value = "";
        String key = "invite-shortlink-" + uid;
        if (Constant.IS_OUTNET)
            value = getCommonString(key);
        return value;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -324,10 +324,11 @@
                    goods.setPayRate30(1);
                if (item.optBoolean("free_shipment"))
                    goods.setFreeShipment(1);
                    goods.setFreeShipment(1);
                if ("1".equalsIgnoreCase(item.optString("material_lib_type")))
                    ;
                goodsList.add(goods);
            }
        }
fanli/src/main/java/com/yeshi/fanli/vo/quality/QualityFactoryVO.java
New file
@@ -0,0 +1,299 @@
package com.yeshi.fanli.vo.quality;
import java.io.Serializable;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
public class QualityFactoryVO extends QualityFactory implements Serializable {
    private static final long serialVersionUID = 1L;
    /* 筛选字段 */
    private String key;
    // 精确筛选
    private Integer keyType;
    // 类目id 搜索此类型
    private Long gcid;
    // 券比例
    private Integer propor;
    // 入库天数
    private Integer days;
    // 是否消费者保障
    private Integer isPrepay;
    // 是否成交转化
    private Integer payRate30;
    // 是否好评率、
    private Integer goodRate;
    // 是否退款率
    private Integer rfdRate;
    // 是否优惠券 、
    private Integer hasCoupon;
    // 是否包邮
    private Integer freeShipment;
    // 在售价范围
    private Integer startZkPrice;
    private Integer endZkPrice;
    // 月销量范围
    private Integer startBiz30day;
    private Integer endBiz30day;
    // 权重范围
    private Integer startWeight;
    private Integer endWeight;
    // 佣金比例范围
    private Integer startTkRate;
    private Integer endTkRate;
    // 券面额:减多少
    private Integer startAmount;
    private Integer endAmount;
    // 券比例: 券面值/在售价
    private Integer startPropor;
    private Integer endPropor;
    /* 排序字段 : 1 正序 2倒序 */
    // 销量
    private Integer totalSales;
    // 价格
    private Integer price;
    // 佣金
    private Integer tkRate;
    // 起始位置
    private long start;
    // 总条数
    private int count;
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public Integer getKeyType() {
        return keyType;
    }
    public void setKeyType(Integer keyType) {
        this.keyType = keyType;
    }
    public Long getGcid() {
        return gcid;
    }
    public void setGcid(Long gcid) {
        this.gcid = gcid;
    }
    public Integer getPropor() {
        return propor;
    }
    public void setPropor(Integer propor) {
        this.propor = propor;
    }
    public Integer getDays() {
        return days;
    }
    public void setDays(Integer days) {
        this.days = days;
    }
    public Integer getIsPrepay() {
        return isPrepay;
    }
    public void setIsPrepay(Integer isPrepay) {
        this.isPrepay = isPrepay;
    }
    public Integer getPayRate30() {
        return payRate30;
    }
    public void setPayRate30(Integer payRate30) {
        this.payRate30 = payRate30;
    }
    public Integer getGoodRate() {
        return goodRate;
    }
    public void setGoodRate(Integer goodRate) {
        this.goodRate = goodRate;
    }
    public Integer getRfdRate() {
        return rfdRate;
    }
    public void setRfdRate(Integer rfdRate) {
        this.rfdRate = rfdRate;
    }
    public Integer getHasCoupon() {
        return hasCoupon;
    }
    public void setHasCoupon(Integer hasCoupon) {
        this.hasCoupon = hasCoupon;
    }
    public Integer getFreeShipment() {
        return freeShipment;
    }
    public void setFreeShipment(Integer freeShipment) {
        this.freeShipment = freeShipment;
    }
    public Integer getStartZkPrice() {
        return startZkPrice;
    }
    public void setStartZkPrice(Integer startZkPrice) {
        this.startZkPrice = startZkPrice;
    }
    public Integer getEndZkPrice() {
        return endZkPrice;
    }
    public void setEndZkPrice(Integer endZkPrice) {
        this.endZkPrice = endZkPrice;
    }
    public Integer getStartBiz30day() {
        return startBiz30day;
    }
    public void setStartBiz30day(Integer startBiz30day) {
        this.startBiz30day = startBiz30day;
    }
    public Integer getEndBiz30day() {
        return endBiz30day;
    }
    public void setEndBiz30day(Integer endBiz30day) {
        this.endBiz30day = endBiz30day;
    }
    public Integer getStartWeight() {
        return startWeight;
    }
    public void setStartWeight(Integer startWeight) {
        this.startWeight = startWeight;
    }
    public Integer getEndWeight() {
        return endWeight;
    }
    public void setEndWeight(Integer endWeight) {
        this.endWeight = endWeight;
    }
    public Integer getStartTkRate() {
        return startTkRate;
    }
    public void setStartTkRate(Integer startTkRate) {
        this.startTkRate = startTkRate;
    }
    public Integer getEndTkRate() {
        return endTkRate;
    }
    public void setEndTkRate(Integer endTkRate) {
        this.endTkRate = endTkRate;
    }
    public Integer getStartAmount() {
        return startAmount;
    }
    public void setStartAmount(Integer startAmount) {
        this.startAmount = startAmount;
    }
    public Integer getEndAmount() {
        return endAmount;
    }
    public void setEndAmount(Integer endAmount) {
        this.endAmount = endAmount;
    }
    public Integer getStartPropor() {
        return startPropor;
    }
    public void setStartPropor(Integer startPropor) {
        this.startPropor = startPropor;
    }
    public Integer getEndPropor() {
        return endPropor;
    }
    public void setEndPropor(Integer endPropor) {
        this.endPropor = endPropor;
    }
    public Integer getTotalSales() {
        return totalSales;
    }
    public void setTotalSales(Integer totalSales) {
        this.totalSales = totalSales;
    }
    public Integer getPrice() {
        return price;
    }
    public void setPrice(Integer price) {
        this.price = price;
    }
    public Integer getTkRate() {
        return tkRate;
    }
    public void setTkRate(Integer tkRate) {
        this.tkRate = tkRate;
    }
    public long getStart() {
        return start;
    }
    public void setStart(long start) {
        this.start = start;
    }
    public int getCount() {
        return count;
    }
    public void setCount(int count) {
        this.count = count;
    }
}
fanli/src/main/resource/druid.properties
@@ -10,9 +10,9 @@
#druid.password=123456
#druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan_test
#druid.username=root
#druid.password=Yeshi2016@
druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan_test
druid.username=root
druid.password=Yeshi2016@
#druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan_test_online
@@ -27,9 +27,9 @@
#druid.password=Yeshi2016@
#外网本地测试
druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan_test
druid.username=root
druid.password=Yeshi2016@
#druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan_test
#druid.username=root
#druid.password=Yeshi2016@
druid.initialSize=10
druid.minIdle=6