yujian
2019-04-17 17652cd5b8892862832dee0cf3978ce144942a1f
分类图片返回版本区分
3个文件已修改
31 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsClassService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java
@@ -800,7 +800,19 @@
    @RequestMapping(value = { "getcategory" }, method = { org.springframework.web.bind.annotation.RequestMethod.POST })
    public void getcategory(AcceptData acceptData, PrintWriter out) {
        try {
            List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache();
            boolean changePicture = false;
            String version = acceptData.getVersion();
            int tversion = Integer.parseInt(version);
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform) && tversion > 38) {
                changePicture = true;
            } else if (tversion > 47){
                changePicture = true;
            }
            List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache(changePicture);
            if (listCache == null) {
                listCache = new ArrayList<Map<String, Object>>();
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java
@@ -284,8 +284,8 @@
    
    
    @Override
    @Cacheable(value="classCache",key="'getClassListAllCache'")
    public List<Map<String, Object>> getClassListAllCache() throws Exception {
    @Cacheable(value="classCache",key="'getClassListAllCache'+#changePicture")
    public List<Map<String, Object>> getClassListAllCache(boolean changePicture) throws Exception {
        List<GoodsClass> goodsClassList = goodsClassMapper.getEffectiveClass();
        if (goodsClassList == null || goodsClassList.size() == 0) {
@@ -312,10 +312,21 @@
                    GoodsSubClass goodsSubClass = iterator.next();
                    GoodsClass goodsClassInner = goodsSubClass.getRootClass();
                    if (goodsClass.getId() == goodsClassInner.getId()) {
                        // 1.5.3新版图片替换
                        if (changePicture) {
                            String pictureSecond = goodsSubClass.getPictureSecond();
                            if (pictureSecond != null && pictureSecond.trim().length() > 0) {
                                goodsSubClass.setPicture(pictureSecond);
                            }
                        }
                        // 对应下子分类
                        subClassList.add(goodsSubClass);
                        iterator.remove();
                    }
                }
            }
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsClassService.java
@@ -79,7 +79,7 @@
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> getClassListAllCache() throws Exception;
    public List<Map<String, Object>> getClassListAllCache(boolean changePicture) throws Exception;
    /**