yujian
2019-12-07 29770e053a92f3f83f0f6f59ec04291ba41aa044
邀请激活  + 品牌
9个文件已修改
107 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassServiceImpl.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJFreeBuyGoodsServiceImpl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java
@@ -114,7 +114,6 @@
        try {
            List<BrandClass> list = brandClassService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
@@ -246,7 +246,6 @@
    @RequestMapping(value = "activationInvite")
    public void activationInvite(AcceptData acceptData, String callback, Long uid, String inviteCode, PrintWriter out) {
        try {
            if (uid == null || inviteCode == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不正确"));
                return;
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
@@ -843,7 +843,7 @@
            }
            
            String rule = configTaoLiJinService.getValueByKey("new_user_free_buy_list_rule");
            rule.replace("{链接}", configService.get("customer_service_link"));
            rule = rule.replace("{链接}", configService.get("customer_service_link"));
            
            data.put("state", state);
            data.put("balance","新人红包:" + balance.setScale(2) + "元");
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -683,7 +683,7 @@
    <select id="getUserInfoByInviteCode" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_user u
        LEFT JOIN yeshi_ec_user_info_extra uf ON uf.`uie_uid` =    u.`id`
        WHERE uf.`uie_invite_code_vip` = ${inviteCode} OR uf.`uie_invite_code` = ${inviteCode}
        WHERE uf.`uie_invite_code_vip` = #{inviteCode} OR uf.`uie_invite_code` = #{inviteCode}
        LIMIT 1
    </select>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml
@@ -136,7 +136,7 @@
    <select id="countByInviteCode" resultType="Long">
        SELECT IFNULL(COUNT(uie_id),0) FROM yeshi_ec_user_info_extra
        WHERE uie_invite_code = ${inviteCode} OR uie_invite_code_vip = ${inviteCode}
        WHERE uie_invite_code = #{inviteCode} OR uie_invite_code_vip = #{inviteCode}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassServiceImpl.java
@@ -51,38 +51,30 @@
    @Override
    public void saveObject(BrandClass record) throws BrandClassException, Exception{
        Long gcid = record.getGcid();
        if (gcid != null) {
            GoodsClass goodsClass = goodsClassService.selectByPrimaryKey(gcid);
            if (goodsClass != null) {
                record.setName(goodsClass.getName());
                record.setGoodsClass(goodsClass);
            }
        }
        if (gcid != null)
            record.setGoodsClass(new GoodsClass(gcid));
        
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
        if (name == null || name.trim().length() == 0)
            throw new BrandClassException(1, "名称和分类不能同时为空");
        }
        
        Integer state = record.getState();
        if (state == null) {
        if (state == null)
            record.setState(0);
        }
        record.setUpdateTime(new Date());
        
        Long id = record.getId();
        if (id == null) {
            record.setOrderBy(brandClassMapper.getMaxOrder() + 1);
            record.setCreateTime(new Date());
            record.setUpdateTime(new Date());
            brandClassMapper.insert(record);
        } else {
            BrandClass resultObj = brandClassMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
            if (resultObj == null)
                throw new BrandClassException(1, "修改内容已不存在");
            }
            record.setOrderBy(resultObj.getOrderBy());
            record.setCreateTime(resultObj.getCreateTime());
            record.setUpdateTime(new Date());
            brandClassMapper.updateByPrimaryKey(record);
        }
    }
@@ -90,26 +82,22 @@
    
    @Override
    public void updateOrder(Long id, Integer moveType) throws BrandClassException, Exception{
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1)))
            throw new BrandClassException(1, "传递的类型不正确");
        }
        
        if (id == null) {
        if (id == null)
            throw new BrandClassException(1, "ID不能为空");
        }
        
        BrandClass resultObj = brandClassMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
        if (resultObj == null)
            throw new BrandClassException(1, "操作数据已不存在");
        }
            
        Integer oldOrder = resultObj.getOrderBy();
        BrandClass changeObj = brandClassMapper.getByAdjoinOrder(oldOrder, moveType);
        
        if (changeObj == null ) {
        if (changeObj == null )
            throw new BrandClassException(1, "已经在最边缘,无可交换的位置");
        }
        // 交换排序序号
        resultObj.setOrderBy(changeObj.getOrderBy());
        changeObj.setOrderBy(oldOrder);
@@ -121,16 +109,12 @@
    
    @Override
    public int deleteBatchByPrimaryKey(List<Long> list) {
        // 删除已匹配的分类关系
        brandClassShopService.deleteBatchByClassId(list);
        return brandClassMapper.deleteBatchByPrimaryKey(list);
    }
    
    @Override
    public List<BrandClass> listQuery(long start, int count, String key, Integer state) {
        List<BrandClass> listQuery = brandClassMapper.listQuery(start, count, key, state);
        if (listQuery == null || listQuery.size() == 0) {
            return listQuery;
@@ -154,7 +138,6 @@
    public long countQuery(String key, Integer state) {
        return brandClassMapper.countQuery(key, state);
    }
    
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJFreeBuyGoodsServiceImpl.java
@@ -164,7 +164,10 @@
    public List<TaoBaoGoodsBrief> listPreGoods(String key ,int page) {
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        // 大淘客筛选: 券后价 1-2区间 、综合排序
        DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, new BigDecimal(1), new BigDecimal(2), 1, page, 100, 0);
//        DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, new BigDecimal(1), new BigDecimal(2), 1, page, 100, 0);
        DaTaoKeGoodsResult result = DaTaoKeApiUtil.getGoodsList(key, null, new BigDecimal(1), new BigDecimal(2), 1, page, 100, 0);
        if (result != null && result.getGoodsList() != null) {
            for (DaTaoKeDetailV2 v2 : result.getGoodsList())
                goodsList.add(TaoBaoUtil.convert(v2));
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -324,6 +324,7 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException {
        if (uid == null || inviteCode == null) 
            throw new UserInfoExtraException(1, "激活信息不能为空");
@@ -383,6 +384,7 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void activationInviteWX(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException {
        if (uid == null || code == null)
            throw new UserInfoExtraException(1, "激活信息不完整");
@@ -501,6 +503,7 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void activeInviteWX(Long uid, WeiXinUser weiXinUser) throws UserInfoExtraException {
        if (uid == null || weiXinUser == null) {
            throw new UserInfoExtraException(1, "激活信息不完整");
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
@@ -472,7 +472,7 @@
            params.put("cids", cids);
        
        if (StringUtil.isNullOrEmpty(key))
            key = "";
            key = "%";
        params.put("keyWords", key);
        
        if (sort != null)
@@ -494,6 +494,54 @@
        return daTaoKeGoodsResult;
    }
    /**
     * 商品列表
     * @param key
     * @param cidList
     * @param priceLowerLimit
     * @param priceUpperLimit
     * @param couponPriceLowerLimit
     * @param pageId
     * @param pageSize
     * @param sort
     * @return
     */
    public static DaTaoKeGoodsResult getGoodsList(String key, List<Integer> cidList, BigDecimal priceLowerLimit,
            BigDecimal priceUpperLimit, Integer couponPriceLowerLimit, int pageId, int pageSize, Integer sort) {
        TaoKeAppInfo app = getRandomApp();
        DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
        Map<String, String> params = new TreeMap<>();
        params.put("version", "v1.1.0");
        params.put("appKey", app.getAppKey());
        params.put("pageSize", pageSize + "");
        params.put("pageId", pageId + "");
        if (priceLowerLimit != null)
            params.put("priceLowerLimit", priceLowerLimit + "");
        if (priceUpperLimit != null)
            params.put("priceUpperLimit", priceUpperLimit + "");
        if (couponPriceLowerLimit != null)
            params.put("couponPriceLowerLimit", couponPriceLowerLimit + "");
        if (sort != null)
            params.put("sort", sort +"");
        params.put("sign", getSign(params, app.getAppSecret()));
        String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-goods-list", params, new HashMap<>());
        JSONObject json = JSONObject.fromObject(result);
        JSONObject dataJson = json.optJSONObject("data");
        if (dataJson != null) {
            JSONArray array = dataJson.optJSONArray("list");
            if (array != null) {
                List<DaTaoKeDetailV2> list = parseDaTaoKeDetailV2List(array);
                daTaoKeGoodsResult.setGoodsList(list);
            }
            daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
            daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
        }
        return daTaoKeGoodsResult;
    }
    private static String getSign(Map<String, String> map, String secretKey) {
        if (map.size() == 0) {