admin
2019-05-16 afcb6a261981209b4f76953dad8a6ecaa990e85d
品牌券增加版本控制
1个文件已修改
39 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -28,7 +28,7 @@
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
import sun.security.krb5.internal.ccache.CCacheInputStream;
@Service
public class SpecialServiceImpl implements SpecialService {
@@ -48,16 +48,14 @@
    @Resource
    private ConfigService configService;
    @Override
    public Special selectByPrimaryKey(Long id) {
        return specialMapper.selectByPrimaryKey(id);
    }
    @Override
    public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record, String jumpType)
            throws SpecialException, Exception{
    public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record,
            String jumpType) throws SpecialException, Exception {
        
        Long cardId = record.getCardId();
        if (cardId == null) {
@@ -142,8 +140,6 @@
                resultObj.setSubPicture(null);
            }
            
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
@@ -162,7 +158,6 @@
                record.setSubPicture(resultObj.getSubPicture());
            }
            
            if (icon != null && icon.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getIcon());
@@ -179,9 +174,9 @@
        }
    }
    
    /**
     * 上传图片
     *
     * @param file
     * @return
     * @throws Exception
@@ -203,6 +198,7 @@
    /**
     * 删除图片-不更新数据库
     *
     * @param record
     * @throws Exception
     */
@@ -211,7 +207,6 @@
            COSManager.getInstance().deleteFile(picture);
        }
    }
    
    @Override
    @Transactional
@@ -245,7 +240,6 @@
        specialMapper.updateByPrimaryKey(resultObj);
        specialMapper.updateByPrimaryKey(exchangeObject);
    }
    
    @Override
    @Transactional
@@ -283,7 +277,6 @@
        return specialMapper.deleteBatchByCardID(list);
    }
    
    @Override
    public List<Special> listQueryByCard(long start, int count, Long card, String key){
        
@@ -316,12 +309,10 @@
        return list;
    }
    
    @Override
    public long countlistQueryByCard(Long card, String key) {
        return specialMapper.countlistQueryByCard(card, key);
    }
    
    @Override
    @Cacheable(value = "configCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
@@ -329,13 +320,11 @@
        return specialMapper.listBySystemAndCard(card, systemId);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
    public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
        return specialMapper.listPageBySystemAndCard(start, count, card, systemId);
    }
    
    @Override
    @Cacheable(value = "configCache", key = "'listCacheSpecialToIndex'")
@@ -357,7 +346,6 @@
        handlelist(listArc);
        arcMap.put("list", JsonUtil.getApiCommonGson().toJson(listArc));
        
        // 首页-活动区域(女王节)
        JSONObject activityMap = new JSONObject();
        List<Special> listActivity = null;
@@ -377,11 +365,20 @@
                activityMap.put("bottomPicture", special.getBottomPicture());
            }
        }
        // 数据处理
        // 品牌券
        // >=1.5.40后的版本可以用
        if (("android".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) > 39)
                || "ios".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) > 48)
            if (listActivity != null)
                for (int i = 0; i < listActivity.size(); i++) {
                    if ("品牌券".equalsIgnoreCase(listActivity.get(i).getName())) {
                        listActivity.get(i).setJumpDetail(jumpDetailV2Service.getByTypeCache("hot_cakes"));
                    }
                }
        handlelist(listActivity);
        activityMap.put("list", JsonUtil.getApiCommonGson().toJson(listActivity));
        
        // 首页-方形专题(品牌券、母婴...)
        JSONObject blockJsonMap = new JSONObject();
@@ -411,9 +408,9 @@
        return specialMapper.listByPlaceKey(placeKey);
    }
    
    /**
     * 处理 数据
     *
     * @param list
     */
    public void handlelist(List<Special> list) {