yujian
2019-06-20 bf5d1b405c759de3faa42af37b1f10f42823b105
Merge remote-tracking branch 'origin/master'

Conflicts:
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
28个文件已修改
4个文件已添加
619 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/TestController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5QualityGoodsController.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/recommend/RecommendGoodsDeleteHistoryMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/taobao/SuperTaoBaoGoodsDao.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/common/CommonContentResult.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/recommend/RecommendGoodsDeleteHistory.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/s618/SuperTaoBaoGoods.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/recommend/RecommendGoodsDeleteHistoryMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgDeviceReadStateMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoShopMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/RecommendGoodsDeleteHistoryServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOrderMsgNotificationServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsActivityServiceImpl.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandClassShopService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/recommend/RecommendGoodsDeleteHistoryService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoGoodsActivityService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoShopService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/VersionUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/taobao/TbImgUtil.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
@@ -71,6 +71,8 @@
        } catch (IOException e) {
            e.printStackTrace();
        }
        LogHelper.test("美洽:body----" + sb.toString());
        String sign = "";
        try {
@@ -99,7 +101,7 @@
                    "android".equalsIgnoreCase(deviceOS) ? 1 : 2, 1, msg, new Date());
        }
        LogHelper.test("美洽:body----" + sb.toString());
    }
    public String sign(String raw_body) throws java.security.SignatureException {
fanli/src/main/java/com/yeshi/fanli/controller/TestController.java
@@ -223,6 +223,13 @@
        ehCacheCacheManager.getCacheManager().clearAll();
    }
    @RequestMapping(value = "removeRedisCache")
    public void removeRedisCache(String key, PrintWriter out) {
        redisManager.removeCommonString(key);
    }
    @RequestMapping(value = "testConfig")
    public void getTestConfig(PrintWriter pw) {
        pw.print(configService.get("test"));
fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java
@@ -37,14 +37,13 @@
@Controller
@RequestMapping("admin/new/api/v1/brand")
public class BrandShopAdminController {
    @Resource
    private BrandClassService brandClassService;
    @Resource
    private BrandClassShopService brandClassShopService;
    /**
     * 保存信息
     * 
@@ -55,7 +54,7 @@
    @RequestMapping(value = "save")
    public void save(String callback, BrandClass brandClass, PrintWriter out) {
        try {
            brandClassService.saveObject(brandClass);
            brandClassService.saveObject(brandClass);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (BrandClassException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -65,8 +64,6 @@
        }
    }
    /**
     * 修改排序
     * 
@@ -86,20 +83,20 @@
            e.printStackTrace();
        }
    }
    /**
     * 查询
     *
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key  模糊查询:说明、标识
     * @param key
     *            模糊查询:说明、标识
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key,
            Integer state, PrintWriter out) {
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
            PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
@@ -116,14 +113,14 @@
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            long count = brandClassService.countQuery(key, state);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            GsonBuilder gsonBuilder = new GsonBuilder();
            gsonBuilder.serializeNulls();
            gsonBuilder.serializeNulls();
            Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
            JSONObject data = new JSONObject();
@@ -138,9 +135,9 @@
        }
    }
    /**
     * 删除
     *
     * @param callback
     * @param idArray
     * @param out
@@ -154,22 +151,24 @@
                return;
            }
            Gson gson = new Gson();
            List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
            List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
            }.getType());
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
                return;
            }
            int count = brandClassService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除[" + count + "]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
     * 筛选列表
     *
     * @param callback
     * @param out
     */
@@ -184,14 +183,14 @@
            List<Object> result_list = new ArrayList<Object>();
            if (list != null && list.size() > 0) {
                for (BrandClass record: list) {
                    Map<String,Object> map =new HashMap<String,Object>();
                for (BrandClass record : list) {
                    Map<String, Object> map = new HashMap<String, Object>();
                    map.put("key", record.getId());
                    map.put("value", record.getName());
                    result_list.add(map);
                }
            }
            JSONObject data = new JSONObject();
            data.put("result_list", result_list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
@@ -201,14 +200,14 @@
        }
    }
    /**
     * 查询
     *
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key  模糊查询:说明、标识
     * @param key
     *            模糊查询:说明、标识
     * @param out
     */
    @RequestMapping(value = "queryTaoBaoShop")
@@ -217,59 +216,58 @@
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            TaoBaoShopInfoDTO  taoBaoShopInfoDTO = TaoKeApiUtil.searchShop(key, pageIndex, pageSize);
            TaoBaoShopInfoDTO taoBaoShopInfoDTO = TaoKeApiUtil.searchShop(key, pageIndex, pageSize);
            List<TaoBaoShopInfo> listInfo = taoBaoShopInfoDTO.getListInfo();
            if (listInfo == null || listInfo.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            List<Long> listShopId = new ArrayList<Long>();
            for (TaoBaoShopInfo taoBaoShopInfo: listInfo) {
            for (TaoBaoShopInfo taoBaoShopInfo : listInfo) {
                listShopId.add(taoBaoShopInfo.getUserId());
            }
            // 已存在数据库中
            List<BrandClassShop> listExist = brandClassShopService.getExistByShopIds(listShopId);
            JSONArray array = new JSONArray();
            for (TaoBaoShopInfo taoBaoShopInfo: listInfo) {
            for (TaoBaoShopInfo taoBaoShopInfo : listInfo) {
                String name = "";
                if (listExist != null && listExist.size() > 0) {
                    Long userId = taoBaoShopInfo.getUserId();
                    for (BrandClassShop brandClassShop: listExist) {
                    for (BrandClassShop brandClassShop : listExist) {
                        TaoBaoShop shop = brandClassShop.getShop();
                        if (shop !=null && userId == shop.getId() || userId.equals(shop.getId()) ) {
                        if (shop != null && userId == shop.getId() || userId.equals(shop.getId())) {
                            BrandClass brandClass = brandClassShop.getBrandClass();
                            name = brandClass.getName();
                        }
                    }
                }
                JSONObject innerData = new JSONObject();
                innerData.put("cname", name);
                innerData.put("shopInfo", taoBaoShopInfo);
                array.add(innerData);
            }
            JSONObject data = new JSONObject();
            data.put("pe", taoBaoShopInfoDTO.getPage());
            data.put("result_list",array);
            data.put("result_list", array);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 添加店铺入库
     * 
@@ -278,20 +276,21 @@
     * @param out
     */
    @RequestMapping(value = "saveShopInfo")
    public void saveShopInfo(String callback,Long cid, String idArray, PrintWriter out) {
    public void saveShopInfo(String callback, Long cid, String idArray, PrintWriter out) {
        try {
            if (StringUtil.isNullOrEmpty(idArray)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
                return;
            }
            Gson gson = new Gson();
            List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
            List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
            }.getType());
            String shopIds = brandClassShopService.saveShopInfo(cid,list);
            String shopIds = brandClassShopService.saveShopInfo(cid, list);
            if (StringUtil.isNullOrEmpty(shopIds)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
            } else {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("以下店铺ID:"+ shopIds + ",未添加成功"));
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("以下店铺ID:" + shopIds + ",未添加成功"));
            }
        } catch (BrandClassShopException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -300,20 +299,20 @@
            e.printStackTrace();
        }
    }
    /**
     * 查询
     *
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key  模糊查询:说明、标识
     * @param key
     *            模糊查询:说明、标识
     * @param out
     */
    @RequestMapping(value = "queryClassShop")
    public void queryClassShop(String callback, Integer pageIndex, Integer pageSize, String key,
            Long cid , Integer state, PrintWriter out) {
    public void queryClassShop(String callback, Integer pageIndex, Integer pageSize, String key, Long cid,
            Integer state, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
@@ -324,20 +323,21 @@
        }
        try {
            List<BrandClassShop> list = brandClassShopService.listQuery((pageIndex - 1) * pageSize, pageSize, key, cid, state);
            List<BrandClassShop> list = brandClassShopService.listQuery((pageIndex - 1) * pageSize, pageSize, key, cid,
                    state);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            long count = brandClassShopService.countQuery(key, cid, state);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            GsonBuilder gsonBuilder = new GsonBuilder();
            gsonBuilder.serializeNulls();
            gsonBuilder.serializeNulls();
            Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
            JSONObject data = new JSONObject();
@@ -352,7 +352,6 @@
        }
    }
    /**
     * 保存信息
     * 
@@ -362,14 +361,14 @@
     */
    @RequestMapping(value = "saveClassShop")
    public void saveClassShop(String callback, Long id, Long cid, String shopName, Integer state, Integer top,
            HttpServletRequest request, PrintWriter out) {
            String key, HttpServletRequest request, PrintWriter out) {
        try {
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                brandClassShopService.changeShopInfo(fileRequest.getFile("file"), id, cid, shopName, state, top);
            }else{
                brandClassShopService.changeShopInfo(null, id, cid, shopName, state, top);
            }
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                brandClassShopService.changeShopInfo(fileRequest.getFile("file"), id, cid, shopName, state, top, key);
            } else {
                brandClassShopService.changeShopInfo(null, id, cid, shopName, state, top, key);
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (BrandClassShopException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -378,8 +377,7 @@
            e.printStackTrace();
        }
    }
    /**
     * 修改排序
     * 
@@ -399,10 +397,10 @@
            e.printStackTrace();
        }
    }
    /**
     * 删除
     *
     * @param callback
     * @param idArray
     * @param out
@@ -415,15 +413,16 @@
                return;
            }
            Gson gson = new Gson();
            List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
            List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
            }.getType());
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
                return;
            }
            brandClassShopService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5QualityGoodsController.java
@@ -38,9 +38,11 @@
import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsActivityService;
import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -56,7 +58,7 @@
    @Resource
    private QualityFactoryService selectionGoodsService;
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
@@ -89,10 +91,12 @@
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private ConfigService configService;
    @Resource
    private TaoBaoGoodsActivityService taoBaoGoodsActivityService;
    /**
     * 9.9商品
@@ -114,7 +118,8 @@
     */
    @RequestMapping(value = "get19k9")
    public void get19k9(String callback, Integer page, Long mcid, PrintWriter out) {
        get9k9ClassGoods(callback, out, page, 500, new BigDecimal(319.9), new BigDecimal(9.9), new BigDecimal(19.9), mcid);
        get9k9ClassGoods(callback, out, page, 500, new BigDecimal(319.9), new BigDecimal(9.9), new BigDecimal(19.9),
                mcid);
    }
@@ -126,7 +131,8 @@
     */
    @RequestMapping(value = "get29k9")
    public void get29k9(String callback, Integer page, Long mcid, PrintWriter out) {
        get9k9ClassGoods(callback, out, page, 500, new BigDecimal(429.9), new BigDecimal(19.9), new BigDecimal(29.9), mcid);
        get9k9ClassGoods(callback, out, page, 500, new BigDecimal(429.9), new BigDecimal(19.9), new BigDecimal(29.9),
                mcid);
    }
@@ -138,7 +144,8 @@
     */
    @RequestMapping(value = "get49k9")
    public void get49k9(String callback, Integer page, Long mcid, PrintWriter out) {
        get9k9ClassGoods(callback, out, page, 500, new BigDecimal(549.9), new BigDecimal(29.9), new BigDecimal(49.9), mcid);
        get9k9ClassGoods(callback, out, page, 500, new BigDecimal(549.9), new BigDecimal(29.9), new BigDecimal(49.9),
                mcid);
    }
    /**
@@ -153,7 +160,7 @@
     * @param out
     */
    public void get9k9ClassGoods(String callback, PrintWriter out, Integer page, Integer biz30day, BigDecimal zkPrice,
            BigDecimal minQuanPrice, BigDecimal maxQuanPrice,  Long mcid) {
            BigDecimal minQuanPrice, BigDecimal maxQuanPrice, Long mcid) {
        try {
            if (page == null || page <= 0) {
                page = 1;
@@ -171,15 +178,16 @@
            }
            // 根据标签id 查询数据
            List<QualityFactory> listQuery = qualityGoodsService.get9k9ClassGoods((page-1)*pageSize, pageSize, biz30day, zkPrice,
                    minQuanPrice, maxQuanPrice, mergeCids);
            List<QualityFactory> listQuery = qualityGoodsService.get9k9ClassGoods((page - 1) * pageSize, pageSize,
                    biz30day, zkPrice, minQuanPrice, maxQuanPrice, mergeCids);
            if (listQuery == null || listQuery.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "没有更多了"));
                return;
            }
            // 总条数
            long count = qualityGoodsService.count9k9ClassGoods(biz30day, zkPrice, minQuanPrice, maxQuanPrice, mergeCids);
            long count = qualityGoodsService.count9k9ClassGoods(biz30day, zkPrice, minQuanPrice, maxQuanPrice,
                    mergeCids);
            JSONArray array = new JSONArray();
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
@@ -195,6 +203,23 @@
                array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null)));
            }
            // 618活动
            if (System.currentTimeMillis() < TimeUtil.convertToTimeTemp("2019-06-19", "yyyy-MM-dd")) {
                if (mcid == null || mcid == 0) {
                    count = taoBaoGoodsActivityService.countByPrice(minQuanPrice,
                            maxQuanPrice.add(new BigDecimal("0.1")));
                    List<TaoBaoGoodsBrief> goodsList = taoBaoGoodsActivityService.listByPrice(minQuanPrice,
                            maxQuanPrice.add(new BigDecimal("0.1")), page, pageSize);
                    if (goodsList != null) {
                        array.clear();
                        for (TaoBaoGoodsBrief goods : goodsList) {
                            array.add(gson
                                    .toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion.toString(), null)));
                        }
                    }
                }
            }
            JSONObject data = new JSONObject();
            data.put("count", count);
            data.put("result_list", array);
@@ -205,7 +230,6 @@
            LogHelper.errorDetailInfo(e);
        }
    }
    /**
     * 9.9商品-每日必抢
@@ -253,7 +277,6 @@
        queryEverydayRob(callback, out, page, new BigDecimal(549.9), new BigDecimal(29.9), new BigDecimal(49.9));
    }
    /**
     * 每日必抢
@@ -305,7 +328,7 @@
            } else {
                count = 50;
            }
            JSONObject data = new JSONObject();
            data.put("count", count);
            data.put("result_list", array);
@@ -553,7 +576,7 @@
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                    .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            BigDecimal proportion =manageService.getFanLiRate();
            BigDecimal proportion = manageService.getFanLiRate();
            /* 遍历列表数据 */
            for (TaoBaoGoodsBrief taoBaoGoodsBrief : listMaterial) {
@@ -774,7 +797,7 @@
        int pageSize = Constant.PAGE_SIZE;
        int type = qualityFlashSaleService.getNowType();
        TaoBaoGoodsBrief goodsBrief = null;
        if (page == 1 && auctionId != null) {
            List<TaoBaoGoodsBrief> list = taoBaoGoodsBriefService.queryByAuctionId(auctionId);
@@ -784,9 +807,9 @@
        }
        if (goodsBrief != null) {
            pageSize = pageSize -1;
            pageSize = pageSize - 1;
        }
        List<QualityFactory> listQuery = qualityGoodsService.listQueryByFlashSale((page - 1) * pageSize, pageSize);
        // 精选库数据为空
@@ -807,7 +830,7 @@
        if (goodsBrief != null) {
            array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null)));
        }
        // 遍历列表数据
        for (QualityFactory quality : listQuery) {
@@ -815,7 +838,7 @@
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            if (goodsBrief != null && auctionId.equals(taoBaoGoodsBrief.getAuctionId())) {
                continue;
            }
@@ -972,7 +995,8 @@
            return;
        }
        long count = qualityGoodsService.countQueryByRebateAmount(proportion.toString(), startAmount, endAmount, tkRate);
        long count = qualityGoodsService.countQueryByRebateAmount(proportion.toString(), startAmount, endAmount,
                tkRate);
        // 精选库数据处理返回 前端
        JSONArray array = new JSONArray();
@@ -1030,7 +1054,8 @@
        int pageSize = Constant.PAGE_SIZE;
        BigDecimal proportion = manageService.getFanLiRate();
        JSONArray array = qualityGoodsService.getRecommendToIndex((page - 1) * pageSize, pageSize, proportion.toString());
        JSONArray array = qualityGoodsService.getRecommendToIndex((page - 1) * pageSize, pageSize,
                proportion.toString());
        if (array == null) {
            out.print(JsonUtil.loadFalseResult("没有更多了"));
@@ -1046,7 +1071,7 @@
        out.print(JsonUtil.loadTrueResult(data));
        return;
    }
    /**
     * 超高奖金
     * 
@@ -1060,9 +1085,9 @@
        try {
            if (page == null || page < 1)
                page = 1;
            int pageSize = Constant.PAGE_SIZE;
            List<QualityFactory> listQuery = qualityGoodsService.listFreeGoods((page - 1) * pageSize, pageSize);
            if (listQuery == null || listQuery.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "没有更多了"));
@@ -1126,7 +1151,7 @@
                    continue; // 券后价大于10
                }
                TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                        proportion.toString(), null);
                // 将返利改为券后价
                TaoBaoHongBaoInfo taoBaoHongBaoInfo = extra.getTaoBaoHongBaoInfo();
@@ -1134,20 +1159,19 @@
                    taoBaoHongBaoInfo.setHongbao(extra.getQuanPrice());
                    taoBaoHongBaoInfo.setRate("¥" + extra.getQuanPrice());
                }
                array.add(gson.toJson(extra));
            }
            long count = qualityGoodsService.countFreeGoods();
            JSONObject data = new JSONObject();
            if (page == 1) {
                // 抽奖规则
                String rules = configService.get("free_goods_rule");
                data.put("ruleLink", rules);
            }
            data.put("count", count);
            data.put("result_list", array);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
@@ -1156,5 +1180,5 @@
            LogHelper.errorDetailInfo(e);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -1337,13 +1337,19 @@
                if (result != null && result.getTaoBaoGoodsBriefs() != null) {
                    // 筛选
                    List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
                    List<TaoBaoGoodsBriefExtra> goodsList = new ArrayList<>();
                    // 设备推荐
                    for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
                        if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && goods.getCouponAmount() != null
                                && goods.getCouponAmount().compareTo(new BigDecimal("5")) >= 0
                                && goods.getBiz30day() > 1000 && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite()))
                            goodsList.add(goods);
                                && goods.getBiz30day() > 1000 && !StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) {
                            TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods,
                                    proportion.toString(), "");
                            extra.setRecommend(true);
                            goodsList.add(extra);
                        }
                    }
                    try {
                        monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0,
@@ -1354,8 +1360,8 @@
                    Collections.shuffle(goodsList);
                    goodsList = goodsList.size() > 20 ? goodsList.subList(0, 20) : goodsList;
                    for (TaoBaoGoodsBrief goods : goodsList) {
                        array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion.toString(), "")));
                    for (TaoBaoGoodsBriefExtra goods : goodsList) {
                        array.add(gson.toJson(goods));
                    }
                } else {
                    try {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java
@@ -295,6 +295,12 @@
            } catch (UserCustomSettingsException e) {
            }
            if (VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion())) {
                int totalCount = msgDeviceReadStateService.getUnReadCount(acceptData.getDevice(),
                        "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2, MsgDeviceReadState.TYPE_KEFU);
                data.put("totalCount", totalCount);
            }
            out.print(JsonUtil.loadTrueResult(data));
            return;
        }
@@ -604,8 +610,8 @@
        } else
            vo.setRead(true);
        if(StringUtil.isNullOrEmpty(vo.getLatestMsg()))
        if (StringUtil.isNullOrEmpty(vo.getLatestMsg()))
            vo.setLatestMsg("[点击打开人工客服]");
        return vo;
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/goods/recommend/RecommendGoodsDeleteHistoryMapper.java
@@ -1,8 +1,20 @@
package com.yeshi.fanli.dao.mybatis.goods.recommend;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
public interface RecommendGoodsDeleteHistoryMapper extends BaseMapper<RecommendGoodsDeleteHistory> {
    /**
     * 批量查询商品是否在删除队列中
     *
     * @param goodsList
     * @return
     */
    List<RecommendGoodsDeleteHistory> listByGoodsInfo(@Param("device") String device,
            @Param("goodsList") List<RecommendGoodsDeleteHistory> goodsList);
}
fanli/src/main/java/com/yeshi/fanli/dao/taobao/SuperTaoBaoGoodsDao.java
New file
@@ -0,0 +1,43 @@
package com.yeshi.fanli.dao.taobao;
import java.math.BigDecimal;
import java.util.List;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.taobao.s618.SuperTaoBaoGoods;
@Repository
public class SuperTaoBaoGoodsDao extends MongodbBaseDao<SuperTaoBaoGoods> {
    public List<SuperTaoBaoGoods> listByMaxAndMinFinalPrice(BigDecimal minPrice, BigDecimal maxPrice, int start,
            int count) {
        Query query = new Query();
        Criteria ca = new Criteria();
        ca.andOperator(Criteria.where("finalPrice").lt(maxPrice.multiply(new BigDecimal(100)).intValue()),
                Criteria.where("finalPrice").gte(minPrice.multiply(new BigDecimal(100)).intValue()));
        query.addCriteria(ca);
        query.limit(count);
        query.skip(start);
        return mongoTemplate.find(query, SuperTaoBaoGoods.class);
    }
    public long countByMaxAndMinFinalPrice(BigDecimal minPrice, BigDecimal maxPrice) {
        Query query = new Query();
        Criteria ca = new Criteria();
        ca.andOperator(Criteria.where("finalPrice").lt(maxPrice.multiply(new BigDecimal(100)).intValue()),
                Criteria.where("finalPrice").gte(minPrice.multiply(new BigDecimal(100)).intValue()));
        query.addCriteria(ca);
        return mongoTemplate.count(query, SuperTaoBaoGoods.class);
    }
    public void deleteByMaxTime(long timeStamp) {
        Query query = new Query();
        query.addCriteria(Criteria.where("updateTime").lt(timeStamp));
        mongoTemplate.remove(query, SuperTaoBaoGoods.class);
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/common/CommonContentResult.java
@@ -1,10 +1,12 @@
package com.yeshi.fanli.dto.common;
import java.io.Serializable;
import java.util.List;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
public class CommonContentResult {
public class CommonContentResult implements Serializable {
    private static final long serialVersionUID = 1L;
    private List<TaoBaoGoodsBrief> goodsList;
    private long count;
fanli/src/main/java/com/yeshi/fanli/entity/goods/recommend/RecommendGoodsDeleteHistory.java
@@ -24,6 +24,15 @@
    @Column(name = "ud_beizhu")
    private String beiZhu;
    public RecommendGoodsDeleteHistory(Long goodsId, Integer goodsSource) {
        this.goodsId = goodsId;
        this.goodsSource = goodsSource;
    }
    public RecommendGoodsDeleteHistory() {
    }
    public Long getId() {
        return id;
    }
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java
@@ -43,7 +43,7 @@
    private boolean coupon; // 是否有券
    
    @Expose
    private boolean recommend = true; // 是否推荐
    private boolean recommend; // 是否推荐
    
    @Expose
    private String spreadMoney;// 推广红包
fanli/src/main/java/com/yeshi/fanli/entity/taobao/s618/SuperTaoBaoGoods.java
New file
@@ -0,0 +1,65 @@
package com.yeshi.fanli.entity.taobao.s618;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@Document(collection = "super_taobao_goods")
public class SuperTaoBaoGoods {
    @Id
    @Field
    private Long auctionId;
    @Indexed
    @Field
    private int finalPrice;// 分为单位
    @Field
    private TaoBaoGoodsBrief goods;
    @Field
    @Indexed
    private long updateTime;
    public long getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }
    public SuperTaoBaoGoods(Long auctionId, int finalPrice, TaoBaoGoodsBrief goods) {
        this.auctionId = auctionId;
        this.finalPrice = finalPrice;
        this.goods = goods;
    }
    public SuperTaoBaoGoods() {
    }
    public int getFinalPrice() {
        return finalPrice;
    }
    public void setFinalPrice(int finalPrice) {
        this.finalPrice = finalPrice;
    }
    public Long getAuctionId() {
        return auctionId;
    }
    public void setAuctionId(Long auctionId) {
        this.auctionId = auctionId;
    }
    public TaoBaoGoodsBrief getGoods() {
        return goods;
    }
    public void setGoods(TaoBaoGoodsBrief goods) {
        this.goods = goods;
    }
}
fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java
@@ -16,7 +16,9 @@
import com.yeshi.fanli.service.inter.lable.LabelService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsActivityService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.util.BeanUtil;
import com.yeshi.fanli.util.CMQManager;
import com.yeshi.fanli.util.Constant;
@@ -50,6 +52,9 @@
    @Resource
    private BrandClassShopService brandClassShopService;
    @Resource
    private TaoBaoGoodsActivityService taoBaoGoodsActivityService;
    // 动态商品更新 ,1个小时更新
    @Scheduled(cron = "0 0 */1 * * ?")
@@ -156,4 +161,13 @@
        brandClassShopService.updateShopGoods();
    }
    /**
     * 每小时更新一次
     */
    @Scheduled(cron = "0 0 0/1 * * ?")
    public void update618() {
        LogHelper.test("更新618商品");
        taoBaoGoodsActivityService.sysncS618Goods();
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/goods/recommend/RecommendGoodsDeleteHistoryMapper.xml
@@ -24,6 +24,21 @@
        from yeshi_ec_recommend_goods_user_delete where ud_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="listByGoodsInfo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_recommend_goods_user_delete where ud_device =
        #{device}
        <foreach collection="goodsList" item="item" open=" and ("
            close=")" separator=" or ">
            (
            ud_goods_id= #{item.goodsId} and ud_goods_source=#{item.goodsSource}
            )
        </foreach>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_recommend_goods_user_delete where ud_id =
        #{id,jdbcType=BIGINT}
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgDeviceReadStateMapper.xml
@@ -76,7 +76,7 @@
            <if test="unReadCount != null">#{unReadCount,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="latestContent != null">#{latestContent,jdbcType=VARCHAR}</if>
            <if test="latestContent != null">#{latestContent,jdbcType=VARCHAR},</if>
            <if test="latestContentTime != null">#{latestContentTime,jdbcType=TIMESTAMP}</if>
        </trim>
    </insert>
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoShopMapper.xml
@@ -204,11 +204,11 @@
    <select id="getShopByKey"  resultMap="BaseResultVOMap" >
        SELECT * FROM (SELECT COUNT(t.`id`) AS totalGoods,po.* FROM  yeshi_ec_taobao_shop_info po
                        LEFT JOIN `yeshi_ec_taobao_goods` t  ON t.`sellerId` = po.`tsi_id`
                        WHERE <![CDATA[t.`couponAmount` > 0 AND po.`tsi_key` LIKE '%${key}%'
                        WHERE <![CDATA[t.`couponAmount` > 0 AND  FIND_IN_SET(#{key},po.`tsi_key`)
                        GROUP BY t.`sellerId` HAVING totalGoods> 2]]>)A
        LEFT JOIN (SELECT t.*,po.`tsi_id` FROM  yeshi_ec_taobao_shop_info po
                    LEFT JOIN `yeshi_ec_taobao_goods` t  ON t.`sellerId` = po.`tsi_id`
                    WHERE<![CDATA[ t.`couponAmount` > 0 ]]>AND po.`tsi_key` LIKE '%${key}%'
                    WHERE<![CDATA[ t.`couponAmount` > 0 ]]>AND FIND_IN_SET(#{key},po.`tsi_key`)
                    ORDER BY t.`biz30day` DESC
                    LIMIT 3)B ON B.`tsi_id` = A.`tsi_id`
    </select>
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java
@@ -126,7 +126,7 @@
    @Override
    @Transactional
    public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top)
    public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top,String key)
            throws BrandClassShopException {
        if (id == null) {
@@ -148,7 +148,7 @@
        }
        // 自定义图片
        taoBaoShopService.changeInfo(file, shop.getId(), shopName);
        taoBaoShopService.changeInfo(file, shop.getId(), shopName,key);
        BrandClassShop updateshop = new BrandClassShop();
        updateshop.setState(state);
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java
@@ -6,6 +6,7 @@
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dto.common.CommonContentNav;
@@ -77,6 +78,9 @@
        return navList;
    }
    @Cacheable(value = "commonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
    @Override
    public CommonContentResult getContentList(CommonContentTypeEnum type, String cid, int page, int pageSize) {
        if (type == CommonContentTypeEnum._9k9)
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/RecommendGoodsDeleteHistoryServiceImpl.java
@@ -1,14 +1,22 @@
package com.yeshi.fanli.service.impl.goods.recommend;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.qcloud.cos.model.ListMultipartUploadsRequest;
import com.yeshi.fanli.dao.mybatis.goods.recommend.RecommendGoodsDeleteHistoryMapper;
import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
@@ -27,4 +35,28 @@
        recommendGoodsDeleteHistoryMapper.insertSelective(history);
    }
    @Override
    public List<TaoBaoGoodsBrief> filterGoods(String device, List<TaoBaoGoodsBrief> goodsList) {
        List<TaoBaoGoodsBrief> resultList = new ArrayList<>();
        if (goodsList == null || goodsList.size() == 0)
            return goodsList;
        Map<Long, TaoBaoGoodsBrief> resultMap = new ConcurrentHashMap<>();
        List<RecommendGoodsDeleteHistory> hlist = new ArrayList<>();
        for (TaoBaoGoodsBrief goods : goodsList) {
            hlist.add(new RecommendGoodsDeleteHistory(goods.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO));
            resultMap.put(goods.getAuctionId(), goods);
        }
        List<RecommendGoodsDeleteHistory> existList = recommendGoodsDeleteHistoryMapper.listByGoodsInfo(device, hlist);
        if (existList != null)
            for (RecommendGoodsDeleteHistory dh : existList)
                resultMap.remove(dh.getGoodsId());
        for (TaoBaoGoodsBrief goods : goodsList) {
            if (resultMap.get(goods.getAuctionId()) != null)
                resultList.add(resultMap.get(goods.getAuctionId()));
        }
        return resultList;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -26,6 +26,7 @@
import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
@@ -345,7 +346,7 @@
        }
        // 处理9.9包邮
        if (listArc != null && VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion()))
        if (listArc != null && VersionUtil.greaterThan_1_5_50(acceptData.getPlatform(), acceptData.getVersion())&&!Constant.IS_TEST)
            for (Special s : listArc) {
                if (s.getName().contains("9.9")) {// 9块9
                    s.setJumpDetail(jumpDetailV2Service.getByTypeCache("common_template"));
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOrderMsgNotificationServiceImpl.java
@@ -38,8 +38,9 @@
        }
        try {
            pushService.pushZNX(uid, Constant.znxConfig.getFanliOrderStatisticedTitle(),
                    Constant.znxConfig.getFanliOrderStatisticedMsg().replace("[订单号]", orderId), null, null);
            if (payMoney != null && payMoney.compareTo(new BigDecimal(0)) > 0)
                pushService.pushZNX(uid, Constant.znxConfig.getFanliOrderStatisticedTitle(),
                        Constant.znxConfig.getFanliOrderStatisticedMsg().replace("[订单号]", orderId), null, null);
        } catch (PushException e) {
            e.printStackTrace();
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsActivityServiceImpl.java
New file
@@ -0,0 +1,59 @@
package com.yeshi.fanli.service.impl.taobao;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.taobao.SuperTaoBaoGoodsDao;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.s618.SuperTaoBaoGoods;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsActivityService;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@Service
public class TaoBaoGoodsActivityServiceImpl implements TaoBaoGoodsActivityService {
    @Resource
    private SuperTaoBaoGoodsDao superTaoBaoGoodsDao;
    @Override
    public void sysncS618Goods() {
        long startTime = System.currentTimeMillis();
        for (int i = 0; i < 20; i++) {
            TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(18528, i + 1, 100);
            for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
                SuperTaoBaoGoods sg = new SuperTaoBaoGoods();
                sg.setAuctionId(goods.getAuctionId());
                sg.setGoods(goods);
                sg.setFinalPrice(TaoBaoUtil.getAfterUseCouplePrice(goods).multiply(new BigDecimal(100)).intValue());
                sg.setUpdateTime(System.currentTimeMillis());
                superTaoBaoGoodsDao.save(sg);
            }
        }
        // 删除更新时间比开始时间小的
        superTaoBaoGoodsDao.deleteByMaxTime(startTime);
    }
    @Override
    public List<TaoBaoGoodsBrief> listByPrice(BigDecimal minPrice, BigDecimal maxPrice, int page, int pageSize) {
        List<SuperTaoBaoGoods> list = superTaoBaoGoodsDao.listByMaxAndMinFinalPrice(minPrice, maxPrice,
                (page - 1) * pageSize, pageSize);
        List<TaoBaoGoodsBrief> newList = new ArrayList<>();
        if (list != null)
            for (SuperTaoBaoGoods goods : list)
                newList.add(goods.getGoods());
        return newList;
    }
    @Override
    public long countByPrice(BigDecimal minPrice, BigDecimal maxPrice) {
        return superTaoBaoGoodsDao.countByMaxAndMinFinalPrice(minPrice, maxPrice);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java
@@ -35,7 +35,7 @@
    @Resource
    private TaoBaoShopMapper taoBaoShopMapper;
    @Resource
    private HongBaoManageService hongBaoManageService;
@@ -81,7 +81,7 @@
    }
    @Override
    public void changeInfo(MultipartFile file, Long id, String shopName) {
    public void changeInfo(MultipartFile file, Long id, String shopName, String key) {
        TaoBaoShop taoBaoShop = taoBaoShopMapper.selectByPrimaryKey(id);
        if (taoBaoShop == null) {
            return;
@@ -113,6 +113,7 @@
        updateShop.setId(id);
        updateShop.setShopNameCustom(shopName);
        updateShop.setKey(key);
        taoBaoShopMapper.updateByPrimaryKeySelective(updateShop);
    }
@@ -161,7 +162,6 @@
        return shop;
    }
    @Override
    @Cacheable(value = "brandCache", key = "'getShopByKey-'+#key")
    public List<TaoBaoShopVO> getShopByKey(String key) {
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/dataoke/DaTaoKeGoodsDetailServiceImpl.java
@@ -46,6 +46,7 @@
                addGoodsList(result.getDetailList());
                totalCount += result.getDetailList().size();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        LogHelper.test("大淘客总共更新数据数量:" + totalCount);
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandClassShopService.java
@@ -55,7 +55,7 @@
     * @param state
     * @throws BrandClassShopException
     */
    public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top)
    public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top,String key)
            throws BrandClassShopException;
    
    
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/recommend/RecommendGoodsDeleteHistoryService.java
@@ -1,6 +1,9 @@
package com.yeshi.fanli.service.inter.goods.recommend;
import java.util.List;
import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
public interface RecommendGoodsDeleteHistoryService {
@@ -11,4 +14,13 @@
     */
    public void addRecommendGoodsDeleteHistory(RecommendGoodsDeleteHistory history);
    /**
     * 过滤已经删除的商品
     *
     * @param device
     * @param goodsList
     * @return
     */
    public List<TaoBaoGoodsBrief> filterGoods(String device, List<TaoBaoGoodsBrief> goodsList);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoGoodsActivityService.java
New file
@@ -0,0 +1,25 @@
package com.yeshi.fanli.service.inter.taobao;
import java.math.BigDecimal;
import java.util.List;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
/**
 * 淘宝活动服务
 *
 * @author Administrator
 *
 */
public interface TaoBaoGoodsActivityService {
    /**
     * 同步618商品到数据库
     */
    public void sysncS618Goods();
    public List<TaoBaoGoodsBrief> listByPrice(BigDecimal minPrice,BigDecimal maxPrice, int page, int pageSize);
    public long countByPrice(BigDecimal minPrice,BigDecimal maxPrice);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoShopService.java
@@ -47,7 +47,7 @@
     * @param id
     * @param shopName
     */
    public void changeInfo(MultipartFile file, Long id, String shopName);
    public void changeInfo(MultipartFile file, Long id, String shopName,String key);
    /**
     * 查询店铺信息、并返回钱3个商品数量
fanli/src/main/java/com/yeshi/fanli/util/VersionUtil.java
@@ -12,7 +12,7 @@
    public static boolean greaterThan_1_5_50(String platform, String versionCode) {
        if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 42))
                || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 51)))
                || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 52)))
            return true;
        else
            return false;
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
@@ -61,11 +61,31 @@
    static Gson gson = new Gson();
    private static String request(String url) {
        String result = null;
        while (result == null) {
            try {
                result = HttpUtil.get(url);
                if (result != null && result.startsWith("<html>"))
                    result = null;
            } catch (Exception e) {
                try {
                    Thread.sleep(400);
                } catch (InterruptedException e1) {
                }
            }
        }
        return result;
    }
    public static DaTaoKeApiResult goodsList(int page) {
        List<DaTaoKeDetail> list = new ArrayList<>();
        String url = String.format("http://api.dataoke.com/index.php?r=Port/index&type=total&appkey=%s&v=2&page=%s",
                Math.random() > 0.5 ? API_KEY : API_KEY_2, page + "");
        String result = HttpUtil.get(url);
        String result = request(url);
        JSONObject resultJson = JSONObject.fromObject(result);
        System.out.println(resultJson);
        JSONArray array = resultJson.optJSONArray("result");
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -1717,6 +1717,12 @@
        taoBaoGoods.setCouponTotalCount(detail.getCouponTotalNum());
        taoBaoGoods.setPictUrl(detail.getMainPic());
        taoBaoGoods.setPictUrlWhite(detail.getMainPic());
        if (taoBaoGoods.getPictUrl() != null && !taoBaoGoods.getPictUrl().startsWith("http"))
            taoBaoGoods.setPictUrl("https:" + taoBaoGoods.getPictUrl());
        if (taoBaoGoods.getPictUrlWhite() != null && !taoBaoGoods.getPictUrlWhite().startsWith("http"))
            taoBaoGoods.setPictUrlWhite("https:" + taoBaoGoods.getPictUrlWhite());
        taoBaoGoods.setSellerId(detail.getSellerId());
        taoBaoGoods.setShopTitle(detail.getShopName());
        taoBaoGoods.setTitle(detail.getDtitle());
utils/src/main/java/org/yeshi/utils/taobao/TbImgUtil.java
@@ -5,7 +5,6 @@
import org.yeshi.utils.StringUtil;
public class TbImgUtil {
    public static String getTBSize320Img(String url) {
        return getTBSizeImg(url, 320);
@@ -18,9 +17,6 @@
    public static String getTBSize320ImgWebp(String url) {
        return getTBSizeImgWebp(url, 320);
    }
    public static String getTBSize220ImgWebp(String url) {
        return getTBSizeImgWebp(url, 220);
@@ -29,7 +25,8 @@
    public static String getTBSizeImg(String url, int size) {
        if (StringUtil.isNullOrEmpty(url))
            return url;
        if (url.contains("img.alicdn.com")||url.contains("gw.alicdn.com"))  {
        if (url.contains("img.alicdn.com") || url.contains("gw.alicdn.com") || url.contains("gd1.alicdn.com")
                || url.contains("gd2.alicdn.com") || url.contains("gd3.alicdn.com") || url.contains("gd4.alicdn.com")) {
            boolean isMatch = Pattern.matches(".*[0-9]x[0-9].*", url);
            if (isMatch)
                return url;
@@ -42,7 +39,8 @@
    public static String getTBSizeImgWebp(String url, int size) {
        if (StringUtil.isNullOrEmpty(url))
            return url;
        if (url.contains("img.alicdn.com")||url.contains("gw.alicdn.com")) {
        if (url.contains("img.alicdn.com") || url.contains("gw.alicdn.com") || url.contains("gd1.alicdn.com")
                || url.contains("gd2.alicdn.com") || url.contains("gd3.alicdn.com") || url.contains("gd4.alicdn.com")) {
            boolean isMatch = Pattern.matches(".*[0-9]x[0-9].*", url);
            if (isMatch)
                return url;