yujian
2019-10-28 43ae450db3ce85b425169e4fcef6ac7c25407f52
2.0.2
22个文件已修改
965 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/brand/BrandGoodsCaheDao.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/brand/BrandShopCaheDao.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/TokenRecord.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 496 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandGoodsCaheService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandInfoService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandShopCaheService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/TimeUtil.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/ShopInfoVOFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/ClientTextStyleVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java
@@ -22,11 +22,11 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.yeshi.utils.CsvUtil;
import org.yeshi.utils.DateUtil;
import org.yeshi.utils.IPUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.entity.wx.RedPackRecord;
import org.yeshi.utils.wx.WXRedPackUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -1165,7 +1165,7 @@
        }
        try {
            List<RedPackRecord> list = CsvUtil.getCsvData(file, RedPackRecord.class);
            List<RedPackRecord> list = WXRedPackUtil.readCsv(file.getInputStream());
            extractService.updateManualExtractRecord(list);
            out.print(JsonUtil.loadTrueResult("上传成功"));
        } catch (ExtractException e) {
@@ -1176,6 +1176,15 @@
        }
    }
    public static String getValue(String[] item,int index){
        if(item.length > index){
            String value = item[index];
            return value;
        }
        return "";
    }
    /**
     * 预览红包发生人
     * 
@@ -1225,5 +1234,5 @@
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -1,6 +1,8 @@
package com.yeshi.fanli.controller.client.v1;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
@@ -12,6 +14,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
import com.yeshi.fanli.entity.bus.user.UserActiveLog;
import com.yeshi.fanli.entity.config.AppHomeFloatImg;
@@ -19,6 +22,7 @@
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.homemodule.FloatADService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
@@ -28,6 +32,7 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.VersionUtil;
import net.sf.json.JSONObject;
@@ -67,6 +72,10 @@
    @Resource
    private UserActiveLogService userActiveLogService;
    @Resource
    private SwiperPictureService swiperPictureService;
    /**
     * s 首页配置信息
@@ -242,6 +251,14 @@
            JSONObject source = JSONObject.fromObject(configService.getByVersion("taobao_cart_jump_detail",
                    acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
            data.put("taoBaoCart", source);
            if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
                // 我的界面banner
                List<SwiperPicture> banner = swiperPictureService.getByBannerCard("index_top");
                if (banner == null)
                    banner = new ArrayList<SwiperPicture>();
                data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
            }
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("获取失败"));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/BrandControllerV2.java
@@ -349,7 +349,7 @@
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getList", method = RequestMethod.POST)
//    @RequestMapping(value = "getList", method = RequestMethod.POST)
    public void getList(AcceptData acceptData, Integer page, Long cid, Long uid, PrintWriter out) {
        if (page == null || page < 1) {
            out.print(JsonUtil.loadFalseResult("页码不正确"));
@@ -391,7 +391,7 @@
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getShopInfoV2", method = RequestMethod.POST)
//    @RequestMapping(value = "getShopInfoV2", method = RequestMethod.POST)
    public void getShopInfoV2(AcceptData acceptData, Integer page, Long id, Long uid, PrintWriter out) {
        
        if (id == null) {
@@ -551,7 +551,7 @@
     *            精选1, 足迹列表2
     * @param out
     */
    @RequestMapping(value = "getHistoryV2", method = RequestMethod.POST)
//    @RequestMapping(value = "getHistoryV2", method = RequestMethod.POST)
    public void getHistoryV2(AcceptData acceptData, Integer page, Long uid, Integer type, PrintWriter out) {
        if (type == null) {
            out.print(JsonUtil.loadFalseResult("类型不正确"));
@@ -623,7 +623,7 @@
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getListV3", method = RequestMethod.POST)
    @RequestMapping(value = "getList", method = RequestMethod.POST)
    public void getListV3(AcceptData acceptData, Integer page, Long cid, Long uid, PrintWriter out) {
        if (page == null || page < 1) {
            out.print(JsonUtil.loadFalseResult("页码不正确"));
@@ -666,7 +666,7 @@
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getShopInfoV3", method = RequestMethod.POST)
    @RequestMapping(value = "getShopInfoV2", method = RequestMethod.POST)
    public void getShopInfoV3(AcceptData acceptData, Integer page, Long id, Long uid, PrintWriter out) {
        if (id == null) {
            out.print(JsonUtil.loadFalseResult("缺失店铺id"));
@@ -739,7 +739,7 @@
     *            精选1, 足迹列表2
     * @param out
     */
    @RequestMapping(value = "getHistoryV3", method = RequestMethod.POST)
    @RequestMapping(value = "getHistoryV2", method = RequestMethod.POST)
    public void getHistoryV3(AcceptData acceptData, Integer page, Long uid, Integer type, PrintWriter out) {
        if (type == null) {
            out.print(JsonUtil.loadFalseResult("类型不正确"));
@@ -762,7 +762,8 @@
        List<BrandInfo> list = new ArrayList<BrandInfo>();
        if (listRecord != null && listRecord.size() > 0) {
            for (BrandInfoRecord history : listRecord) {
                list.add(history.getBrandInfo());
                if (history.getBrandInfo() != null)
                    list.add(history.getBrandInfo());
            }
        }
        
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -61,6 +61,7 @@
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.goods.OtherInfo;
import com.yeshi.fanli.vo.goods.SpikeTimeVO;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.search.SearchKeyTOPVO;
import com.yeshi.fanli.vo.search.SearchKeyVO;
@@ -247,7 +248,14 @@
            }
        }
        JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web");
        JumpDetailV2 jumpDetail = null;
        if(VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
            jumpDetail = jumpDetailV2Service.getByTypeCache("spike_goods_list");
        } else {
            jumpDetail = jumpDetailV2Service.getByTypeCache("web");
        }
        if (array == null) {
            array = new JSONArray();
@@ -334,6 +342,100 @@
        return root;
    }
    /**
     * 限时秒杀列表
     * @param acceptData
     * @param page
     * @param auctionId
     * @param time
     * @param out
     */
    @RequestMapping("getSpikTime")
    public void getSpikTime(AcceptData acceptData, PrintWriter out) {
        List<SpikeTimeVO> list = new ArrayList<SpikeTimeVO>();
        SpikeTimeVO spikeTime1 = new SpikeTimeVO();
        spikeTime1.setTime("08:00");
        spikeTime1.setState("进行中");
        spikeTime1.setRequestTime("2408");
        SpikeTimeVO spikeTime2 = new SpikeTimeVO();
        spikeTime2.setTime("10:00");
        spikeTime2.setState("进行中");
        spikeTime2.setChecked(true);
        spikeTime2.setRequestTime("2410");
        SpikeTimeVO spikeTime3 = new SpikeTimeVO();
        spikeTime3.setTime("13:00");
        spikeTime3.setState("即将开始");
        spikeTime3.setRequestTime("2413");
        SpikeTimeVO spikeTime4 = new SpikeTimeVO();
        spikeTime4.setTime("15:00");
        spikeTime4.setState("即将开始");
        spikeTime4.setRequestTime("2415");
        list.add(spikeTime1);
        list.add(spikeTime2);
        list.add(spikeTime3);
        list.add(spikeTime4);
        JSONObject data = new JSONObject();
        data.put("count", list.size());
        data.put("list", list);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 限时秒杀列表
     * @param acceptData
     * @param page
     * @param auctionId
     * @param time
     * @param out
     */
    @RequestMapping("getSpikeGoodsList")
    public void getSpikeGoodsList(AcceptData acceptData, Integer page, Long goodsId, String qtime, PrintWriter out) {
        List<DaTaoKeDetailV2> detailList0 = daTaoKeGoodsDetailV2Service.getDingDongQiangData(qtime);
        if (detailList0 == null)
            detailList0 = new ArrayList<>();
        List<DaTaoKeDetailV2> detailList = new ArrayList<>();
        detailList.addAll(detailList0);
        JSONArray array = new JSONArray();
        if (page == 1 && goodsId != null && detailList != null) {
            for (int i = 0; i < detailList.size(); i++) {
                if (detailList.get(i).getGoodsId().longValue() == goodsId) {
                    DaTaoKeDetailV2 goods = detailList.get(i);
                    detailList.remove(i);
                    detailList.add(0, goods);
                    break;
                }
            }
        }
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        if (detailList != null) {
            BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
            BigDecimal shareRate = hongBaoManageService.getShareRate();
            for (DaTaoKeDetailV2 detail : detailList) {
                array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(detail), null, fanLiRate, shareRate)));
            }
        }
        JSONObject data = new JSONObject();
        data.put("count", detailList.size());
        data.put("list", array);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 金币兑换信息
     * 
fanli/src/main/java/com/yeshi/fanli/dao/brand/BrandGoodsCaheDao.java
@@ -63,6 +63,18 @@
    
    
    /**
     * 品牌id
     * @param brandId
     */
    public void removeByBrandId(Long brandId) {
        Query query = new Query();
        query.addCriteria(Criteria.where("brandId").lt(brandId));
        mongoTemplate.remove(query, BrandGoodsCahe.class);
    }
    /**
     * 删除根据时间
     * 
     * @param id
@@ -79,4 +91,17 @@
            );
        mongoTemplate.remove(query, BrandGoodsCahe.class);
    }
    /**
     * 删除根据时间
     *
     * @param id
     * @return
     */
    public void removeAgoByDate(Date createTime) {
        Query query = new Query();
        query.addCriteria(Criteria.where("createTime").lt(createTime));
        mongoTemplate.remove(query, BrandGoodsCahe.class);
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/brand/BrandShopCaheDao.java
@@ -58,6 +58,17 @@
    
    
    /**
     * 品牌id
     * @param brandId
     */
    public void removeByBrandId(Long brandId) {
        Query query = new Query();
        query.addCriteria(Criteria.where("brandId").lt(brandId));
        mongoTemplate.remove(query, BrandShopCahe.class);
    }
    /**
     * 删除根据时间
     * 
     * @param id
@@ -74,4 +85,16 @@
            );
        mongoTemplate.remove(query, BrandShopCahe.class);
    }
    /**
     * 删除根据时间
     *
     * @param id
     * @return
     */
    public void removeAgoByDate(Date createTime) {
        Query query = new Query();
        query.addCriteria(Criteria.where("createTime").lt(createTime));
        mongoTemplate.remove(query, BrandShopCahe.class);
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/TokenRecord.java
@@ -16,7 +16,7 @@
    
    // 口令类型
    public enum TokenTypeEnum {
        freeCoupon("免单券"), rebatePercentCoupon("返利比提成奖励券"),taoLiJin("推广红包"), ;
        freeCoupon("免单券"), rebatePercentCoupon("返利比提成奖励券"),taoLiJin("推广红包"),redPack("红包") ;
        private final String desc;
        private TokenTypeEnum(String desc) {
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java
@@ -33,6 +33,7 @@
                                        ""), buyScore("购买积分", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""), extract("提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png",
                                                ""), extractVerify("提现验证", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""), extractReject("提现被拒", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""),orderReward("返利奖励金","http://img.flqapp.com/resource/money_detail/icon_order_reward.png",""),repeatStatistic("重复统计返利/奖金扣除","http://img.flqapp.com/resource/money_detail/icon_fanli.png",""),
        elmeFanli("饿了么返利到账","http://img.flqapp.com/resource/money_detail/icon_fanli.png",""),
        redPackExchange("红包提现到余额", "http://img.flqapp.com/resource/money_detail/icon_score.png",""),
        extractAutoWX("自动提现", "http://img.flqapp.com/resource/money_detail/icon_extract.png", ""), extractAutoWXRefund("自动提现失败", "http://img.flqapp.com/resource/money_detail/icon_extract.png", "");
        
fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java
@@ -1,10 +1,13 @@
package com.yeshi.fanli.job;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.yeshi.utils.DateUtil;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.brand.BrandInfoService;
import com.yeshi.fanli.util.Constant;
@@ -36,5 +39,20 @@
            brandInfoService.addShopAndGoods((page - 1) * 100, 100);
        }
    }
    /**
     * 清理前一天的
     */
//    @Scheduled(cron = "0 10 0 * * ? ")
    public void removeAgoByDate() {
        if (!Constant.IS_TASK)
            return;
        try {
            brandInfoService.removeAgoByDate(DateUtil.reduceDay(1, new Date()));
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -705,8 +705,10 @@
        SELECT u.* FROM `yeshi_ec_user_info_extra` t
        LEFT JOIN  `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
        WHERE t.`uie_auto_extract` = 1 AND t.uie_active_time <![CDATA[>=]]> #{beganDate} AND  t.uie_active_time <![CDATA[<]]> #{endDate}
            AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
            AND u.`state` = 0 AND u.`my_hongBao` <![CDATA[>=]]> #{money} 
            AND u.`wx_open_id` IS NOT NULL AND LENGTH(TRIM(u.`wx_open_id`)) <![CDATA[>]]> 0
            AND u.`wx_open_id` NOT LIKE 'o_b9%'
        LIMIT #{start},#{count}
    </select>
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandGoodsCaheServiceImpl.java
@@ -81,6 +81,10 @@
        filter.setSort(TaoBaoUtil.SORT_SALE_HIGH_TO_LOW);
        TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(filter);
        
        // 删除店铺
        brandShopCaheService.removeByDateAndType(brandInfo.getId(), 11, date);
        // 组织商品 + 添加店铺
        int count = 0;
        if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null 
                && searchResult.getTaoBaoGoodsBriefs().size() > 0) {
@@ -110,9 +114,10 @@
                }
            }
        }
        // 删除之前的
        brandGoodsCaheDao.removeByDate(brandInfo.getId(), 1 , date);
        return count;
    }
    
@@ -132,6 +137,10 @@
        JDSearchResult result = null;
        String way = configService.get("jd_api_search_key");
        Date date = new Date();
        // 删除店铺
        brandShopCaheService.removeByDateAndType(brandInfo.getId(), 20, date);
        for (int i=0; i < 2;i ++) {
            if ("1".equals(way)) {
                JDFilter filterAPI = new JDFilter();
@@ -152,29 +161,31 @@
                result = JDUtil.searchByKey(jdfilter);
            }
            
            if (result != null) {
            if (result != null && result.getGoodsList() != null && result.getGoodsList().size() > 0) {
                boolean addShop = true;
                List<JDGoods> goodsList = result.getGoodsList();
                if (goodsList != null && goodsList.size() > 0) {
                    for (JDGoods goods : goodsList) {
                        BrandGoodsCahe brandGoods = new BrandGoodsCahe();
                        brandGoods.setBrandId(brandInfo.getId());
                        brandGoods.setWeight((int) (Math.random() * 1000));
                        brandGoods.setGoodsJD(goods);
                        brandGoods.setGoodsType(2);
                        brandGoods.setCreateTime(date);
                        brandGoodsCaheDao.insert(brandGoods);
                        if (count == 0) {
                            JDShopInfo shopInfo = goods.getShopInfo();
                            if(shopInfo != null) {
                                brandShopCaheService.addBrandShopJD(brandInfo, shopInfo);
                            }
                for (JDGoods goods : goodsList) {
                    BrandGoodsCahe brandGoods = new BrandGoodsCahe();
                    brandGoods.setBrandId(brandInfo.getId());
                    brandGoods.setWeight((int) (Math.random() * 1000));
                    brandGoods.setGoodsJD(goods);
                    brandGoods.setGoodsType(2);
                    brandGoods.setCreateTime(date);
                    brandGoodsCaheDao.insert(brandGoods);
                    JDShopInfo shopInfo = goods.getShopInfo();
                    if (addShop && shopInfo != null) {
                        // 包含该品牌名称
                        String shopName = shopInfo.getShopName();
                        if (!StringUtil.isNullOrEmpty(shopName) && shopName.contains(brandInfo.getName())) {
                            brandShopCaheService.addBrandShopJD(brandInfo, shopInfo);
                            addShop = false;
                        }
                        count ++;
                        if (count >= 50) {
                            break;
                        }
                    }
                    count ++;
                    if (count >= 50) {
                        break;
                    }
                }
            }
@@ -202,9 +213,11 @@
        pddfilter.setPage(1);
        pddfilter.setPageSize(100);
        pddfilter.setSortType(6);
        Date date = new Date();
        int count = 0;
        PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
        int count = 0;
        Date date = new Date();
        if (result != null) {
            List<PDDGoodsDetail> goodsList = result.getGoodsList();
            if (goodsList != null && goodsList.size() > 0) {
@@ -223,14 +236,14 @@
                }
            }
        }
        // 删除之前
        brandGoodsCaheDao.removeByDate(brandInfo.getId(), 3, date);
        // 删除之前店铺
        brandShopCaheService.removeByDateAndType(brandInfo.getId(), 30, date);
        // 添加店铺
        brandShopCaheService.addBrandShopPDD(brandInfo);
        
        // 删除之前
        brandGoodsCaheDao.removeByDate(brandInfo.getId(), 3, date);
        return count;
    }
    
    
@@ -243,4 +256,14 @@
    public long countByBrandId(Long brandId){
        return brandGoodsCaheDao.countByBrandId(brandId);
    }
    @Override
    public void removeAgoByDate(Date createTime) {
        brandGoodsCaheDao.removeAgoByDate(createTime);
    }
    @Override
    public void removeByBrandId(Long brandId) {
        brandGoodsCaheDao.removeByBrandId(brandId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java
@@ -122,6 +122,17 @@
            record.setCreateTime(resultObj.getCreateTime());
            record.setUpdateTime(new Date());
            brandInfoMapper.updateByPrimaryKey(record);
            if (state == 0){
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        brandGoodsCaheService.removeByBrandId(id);
                        brandShopCaheService.removeByBrandId(id);
                    }
                });
            }
        }
        if (state == 1) {
@@ -160,6 +171,16 @@
    
    @Override
    public int deleteBatchByPrimaryKey(List<Long> list) {
        executor.execute(new Runnable() {
            @Override
            public void run() {
                for (Long id: list) {
                    brandGoodsCaheService.removeByBrandId(id);
                    brandShopCaheService.removeByBrandId(id);
                }
            }
        });
        return brandInfoMapper.deleteBatchByPrimaryKey(list);
    }
@@ -225,6 +246,18 @@
        return brandClassShopService.countBrandShopinfo(cid);
    }
    @Override
    public void removeAgoByDate(Date date) {
        // 删除商品
        brandGoodsCaheService.removeAgoByDate(date);
        // 删除店铺
        brandShopCaheService.removeAgoByDate(date);
    }
    @Override
    public void addShopAndGoods(long start, int count) {
        List<BrandInfo> list = brandInfoMapper.listValidAll(start, count);
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java
@@ -43,16 +43,11 @@
        if (taoBaoShop == null)
            return true;
        
        Date date = new Date();
        BrandShopCahe brandShop = new BrandShopCahe();
        brandShop.setBrandId(brandId);
        brandShop.setShop(ShopInfoVOFactory.convertTaoBaoShop(taoBaoShop));
        brandShop.setCreateTime(date);
        brandShop.setCreateTime(new Date());
        brandShopCaheDao.insert(brandShop);
        // 删除店铺
        brandShopCaheDao.removeByDate(brandId, 11, date);
        return false;
    }
    
@@ -65,16 +60,13 @@
     */
    @Override
    public void addBrandShopJD(BrandInfo brandInfo, JDShopInfo shopInfo) {
        Date date = new Date();
        ShopInfoVO shopInfoVO = ShopInfoVOFactory.convertJDShop(shopInfo);
        shopInfoVO.setShopIcon(brandInfo.getIcon());
        BrandShopCahe brandShop = new BrandShopCahe();
        brandShop.setBrandId(brandInfo.getId());
        brandShop.setShop(shopInfoVO);
        brandShop.setCreateTime(date);
        brandShop.setCreateTime(new Date());
        brandShopCaheDao.save(brandShop);
        brandShopCaheDao.removeByDate(brandInfo.getId(), 20, date);
    }
    
    
@@ -96,36 +88,34 @@
        pddfilter.setPageSize(100);
        pddfilter.setSortType(6);
        pddfilter.setMerchantType(3);
        PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
        if (result != null) {
        if (result != null && result.getGoodsList() != null && result.getGoodsList().size() > 0) {
            boolean addShop = true;
            List<PDDGoodsDetail> goodsList = result.getGoodsList();
            if (goodsList != null && goodsList.size() > 0) {
                for (PDDGoodsDetail goods : goodsList) {
                    String mallName = goods.getMallName();
                    if(goods.getMallId() != null && !StringUtil.isNullOrEmpty(mallName) && mallName.contains(brandInfo.getName())){
                        shopInfoVO = new ShopInfoVO();
                        shopInfoVO.setId(goods.getMallId().toString());
                        shopInfoVO.setShopName(mallName);
                        break;
                    }
            for (PDDGoodsDetail goods : goodsList) {
                // 包含店铺id 、包含品牌名称
                String mallName = goods.getMallName();
                if(addShop && !StringUtil.isNullOrEmpty(mallName) && mallName.contains(brandInfo.getName())
                        && goods.getMallId() != null){
                    shopInfoVO = new ShopInfoVO();
                    shopInfoVO.setId(goods.getMallId().toString());
                    shopInfoVO.setShopName(mallName);
                    addShop = false;
                    break;
                }
            }
        }
        
        if (shopInfoVO != null) {
            shopInfoVO.setShopIcon(brandInfo.getIcon());
            shopInfoVO.setUserType(30);
            shopInfoVO.setShopLink("https://mobile.yangkeduo.com/mall_page.html?mall_id=" + shopInfoVO.getId());
            Date date = new Date();
            BrandShopCahe brandShop = new BrandShopCahe();
            brandShop.setBrandId(brandInfo.getId());
            brandShop.setShop(shopInfoVO);
            brandShop.setCreateTime(date);
            brandShop.setCreateTime(new Date());
            brandShopCaheDao.insert(brandShop);
            brandShopCaheDao.removeByDate(brandInfo.getId(), 30, date);
        }
    }
    
@@ -135,4 +125,22 @@
    public List<BrandShopCahe> getByBrandId(Long brandId){
        return brandShopCaheDao.getByBrandId(brandId);
    }
    @Override
    public void removeAgoByDate(Date createTime) {
        brandShopCaheDao.removeAgoByDate(createTime);
    }
    @Override
    public void removeByBrandId(Long brandId) {
        brandShopCaheDao.removeByBrandId(brandId);
    }
    @Override
    public void removeByDateAndType(Long brandId, int type, Date date) {
        brandShopCaheDao.removeByDate(brandId, type, date);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java
@@ -1152,15 +1152,15 @@
        
        String billno = redPackRecord.getBillno();
        if (!StringUtil.isNullOrEmpty(billno)) {
            updeteRecord.setBillno(billno.replace("`", ""));
            updeteRecord.setBillno(billno.replace("`", "").replace("'", ""));
        }
        
        String detailno = redPackRecord.getDetailno();
        if (!StringUtil.isNullOrEmpty(detailno)) {
            updeteRecord.setDetailno(detailno.replace("`", ""));
            updeteRecord.setDetailno(detailno.replace("`", "").replace("'", ""));
        }
        
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        String rcvTime = redPackRecord.getRcvTime();
        if (!StringUtil.isNullOrEmpty(rcvTime)) {
            try {
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -1,7 +1,6 @@
package com.yeshi.fanli.service.impl.order;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -201,414 +200,7 @@
        return listOrder;
    }
    @Override
    public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day, Integer source) {
        return commonOrderMapper.countHistoryOrder(uid, day, source);
    }
    @Override
    public long countBonusOrderNumber(Long uid, Integer type, Integer day, String startTime, String endTime,
            Integer source) {
        return commonOrderMapper.countBonusOrderNumber(uid, type, day, startTime, endTime, source);
    }
    @Override
    public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer day, String startTime, String endTime,
            Integer source) {
        return commonOrderMapper.countBonusOrderMoney(uid, type, day, startTime, endTime, source);
    }
    @Override
    public Map<String, Object> countBonusOrderMoneyAndNumber(Long uid, Integer type, Integer day, String startTime,
            String endTime, Integer source) {
        return commonOrderMapper.countBonusOrderMoneyAndNumber(uid, type, day, startTime, endTime, source);
    }
    @Override
    public Long countUserOrderToApp(Long uid, Integer type, String startTime, String endTime,
            Integer day, Integer source, Integer state, Integer stateOrder) {
        return commonOrderMapper.countUserOrderToApp(uid, type, startTime, endTime, day, source, state, stateOrder);
    }
    private BigDecimal getWeiQuanMoney(List<TaoBaoWeiQuanOrder> listWQ, int sourceType, Long uid) {
        BigDecimal weiQuanMoney = new BigDecimal(0);
        if (listWQ != null && listWQ.size() > 0) {
            for (TaoBaoWeiQuanOrder weiQuanOrder : listWQ) {
                String tradeId = weiQuanOrder.getOrderItemId();
                // 查询红包
                List<String> tradeList = new ArrayList<>();
                tradeList.add(tradeId);
                List<HongBaoV2> hongBaoList = hongBaoV2Service.listBySourceTypeAndTradeIdListAndUid(sourceType, uid,
                        tradeList);
                if (hongBaoList != null && hongBaoList.size() > 0) {
                    CommonOrder commonOrder = commonOrderMapper.selectBySourceTypeAndTradeId(sourceType, tradeId);
                    if (commonOrder != null && commonOrder.getSettlement().compareTo(new BigDecimal(0)) > 0) {
                        BigDecimal wqMoney = MoneyBigDecimalUtil
                                .mul(hongBaoList.get(0).getMoney(), weiQuanOrder.getMoney())
                                .divide(commonOrder.getSettlement(), 2, BigDecimal.ROUND_UP);
                        if (wqMoney.compareTo(hongBaoList.get(0).getMoney()) > 0)
                            wqMoney = hongBaoList.get(0).getMoney();
                        weiQuanMoney = weiQuanMoney.add(wqMoney);
                    }
                }
            }
        }
        return weiQuanMoney;
    }
    public void listDataFactory(AcceptData acceptData, List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods,
            Long uid) {
        List<String> listTB = new ArrayList<String>();
        List<String> listJD = new ArrayList<String>();
        List<String> listPDD = new ArrayList<String>();
        for (CommonOrderVO commonOrderVO : listOrder) {
            Integer sourceType = commonOrderVO.getSourceType();
            if (sourceType == null) {
                continue;
            } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
                listTB.add(commonOrderVO.getOrderNo());
            } else if (sourceType == Constant.SOURCE_TYPE_JD) {
                listJD.add(commonOrderVO.getOrderNo());
            } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
                listPDD.add(commonOrderVO.getOrderNo());
            }
        }
        List<UserSystemCouponRecord> listRecordTB = null;
        if (listTB.size() > 0) {
            listRecordTB = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_TAOBAO, listTB);
        }
        List<UserSystemCouponRecord> listRecordJD = null;
        if (listJD.size() > 0) {
            listRecordJD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_JD, listJD);
        }
        List<UserSystemCouponRecord> listRecordPDD = null;
        if (listPDD.size() > 0) {
            listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD);
        }
        /* 组合商品信息 */
        for (CommonOrderVO commonOrder : listGoods) {
            CommonOrderGoods goods = commonOrder.getCommonOrderGoods();
            if (goods == null) {
                continue;
            }
            String orderNo1 = commonOrder.getOrderNo();
            Integer sourceType = commonOrder.getSourceType();
            for (CommonOrderVO order : listOrder) {
                String orderNo2 = order.getOrderNo();
                Integer sourceType2 = order.getSourceType();
                // 来源、订单号相同
                if (sourceType.equals(sourceType2) && orderNo1.equals(orderNo2)) {
                    // 加入商品信息
                    List<CommonOrderGoodsVO> listOrderGoods = order.getListOrderGoods();
                    CommonOrderGoodsVO commonGoodsVO = new CommonOrderGoodsVO();
                    try {
                        PropertyUtils.copyProperties(commonGoodsVO, goods);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    commonGoodsVO.setGoodsType(sourceType2);
                    String picture = commonGoodsVO.getPicture();
                    if (!StringUtil.isNullOrEmpty(picture) && !picture.contains("320x320")) {
                        commonGoodsVO.setPicture(TbImgUtil.getTBSize320Img(picture));
                    }
                    Integer hongBaoType = order.getHongBaoType();
                    // 邀请订单信息保护
                    if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
                            || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
                            || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
                        Map<String, String> titleMap = new HashMap<String, String>();
                        titleMap.put("content", "为保障用户隐私,商品信息已隐藏!");
                        titleMap.put("fontColor", "#888888");
                        titleMap.put("bottomColor", "#E9E9E9");
                        commonGoodsVO.setTitle(null);
                        commonGoodsVO.setGoodsTitle(titleMap);
                    }
                    // 购买数量
                    commonGoodsVO.setActualCount(commonOrder.getTotalCount() + "件");
                    BigDecimal totalSettlement = commonOrder.getTotalSettlement();
                    if (totalSettlement == null || totalSettlement.compareTo(new BigDecimal(0)) <= 0) {
                        totalSettlement = commonOrder.getTotalPayment();
                    }
                    // 实付款
                    commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement);
                    Integer orderType = order.getOrderType();
                    if (orderType == null) {
                        String shopType = commonGoodsVO.getShopType();
                        if (CommonOrderGoodsVO.TYPE_TAOBAO.equalsIgnoreCase(shopType)) {
                            order.setOrderType(1);
                        } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) {
                            order.setOrderType(2);
                        }
                    }
                    listOrderGoods.add(commonGoodsVO);
                    break;
                }
            }
        }
        SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd");
        // 是否存在奖励券
        // boolean hasRewardCoupon =
        // userSystemCouponService.hasRewardCoupon(uid);
        boolean hasRewardCoupon = userSystemCouponService.getIncludeNotExchange(uid);
        boolean exchangeCoupon = userSystemCouponService.getIncludeExchange(uid);
        // 2019.8.1开始返回维权信息
        Date august = null;
        try {
            august = TimeUtil.parse("2019-08-01");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        /* 组织订单状态 等信息 */
        for (CommonOrderVO order : listOrder) {
            Date thirdCreateTime = order.getThirdCreateTime();
            if (thirdCreateTime != null) {
                order.setDownTime("下单时间:" + format.format(thirdCreateTime));
                order.setObtainTime(thirdCreateTime.getTime());
            }
            Date settleTime = order.getSettleTime();
            if (settleTime != null) {
                order.setReceiveTime("收货时间:" + format.format(settleTime));
            }
            Integer sourceType2 = order.getSourceType();
            if (sourceType2 == Constant.SOURCE_TYPE_TAOBAO) {
                Integer orderType = order.getOrderType();
                if (orderType == null) {
                    order.setOrderType(1);
                }
            } else if (sourceType2 == Constant.SOURCE_TYPE_JD) {
                order.setOrderType(3);
            } else if (sourceType2 == Constant.SOURCE_TYPE_PDD) {
                order.setOrderType(4);
            }
            /* 订单状态 转换处理 */
            String orderStateContent = "";
            Map<String, String> orderStateMap = new HashMap<String, String>();
            // 订单状态
            Integer orderState = order.getState();
            // 红包状态
            Integer hongBaoState = order.getHongBaoState();
            Integer stateWholeOrder = order.getStateWholeOrder();
            if (CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO == stateWholeOrder) {
                // 整个订单部分失效:判断真实状态 订单、红包
                CommonOrderVO buFenOrder = commonOrderMapper.getBuFenOrderState(uid, order.getOrderNo());
                if (buFenOrder != null) {
                    // 有效的订单状态
                    orderState = buFenOrder.getState();
                    // 有效的红包状态
                    hongBaoState = buFenOrder.getHongBaoState();
                }
            }
            BigDecimal hongBao = order.getHongBao();
            if (hongBao == null) {
                hongBao = new BigDecimal(0);
            }
            if (CommonOrder.STATE_FK == orderState) {
                orderStateContent = "已付款";
            } else if (CommonOrder.STATE_JS == orderState) {
                orderStateContent = "已收货";
            } else if (CommonOrder.STATE_SX == orderState) {
                orderStateContent = "未付款/已退款";
            } else if (CommonOrder.STATE_WQ == orderState) {
                orderStateContent = "已维权";
                Integer sourceType = order.getSourceType();
                if (sourceType != null && sourceType == Constant.SOURCE_TYPE_TAOBAO) {
                    /* 订单维权 判断是否全部维权 */
                    List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
                            .selectListByOrderIdAndState(order.getOrderNo(), "维权成功");
                    boolean isPart = false;// 默认失效
                    BigDecimal weiQuanMoney = getWeiQuanMoney(listWQ, sourceType, uid);
                    if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
                        if (isPart) {
                            hongBaoState = HongBaoV2.STATE_BUFENSHIXIAO; // 部分失效
                        } else {
                            hongBaoState = HongBaoV2.STATE_SHIXIAO; // 全部失效
                        }
                    } else {
                        // 2019.8.1 返回维权信息
                        if (settleTime != null && august != null && settleTime.getTime() > august.getTime()) {
                            orderStateContent = "维权成功";
                            WeiQuanInfo weiQuanInfo = new WeiQuanInfo();
                            weiQuanInfo.setOldHongBao("¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
                            // if (isPart) {
                            weiQuanInfo
                                    .setWqHongBao("维权:-¥" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
                            hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney);
                            // } else {
                            // weiQuanInfo
                            // .setWqHongBao("维权:-¥" + weiQuanMoney.setScale(2,
                            // BigDecimal.ROUND_DOWN).toString());
                            // hongBao = MoneyBigDecimalUtil.sub(hongBao,
                            // weiQuanMoney);
                            // }
                            order.setWeiQuanInfo(weiQuanInfo);
                        }
                    }
                }
            }
            orderStateMap.put("content", orderStateContent);
            orderStateMap.put("fontColor", "#666666");
            order.setOrderState(orderStateMap);
            String hongbaoInfo = "";
            // 订单标识
            List<String> signList = new ArrayList<String>();
            Integer hongBaoType = order.getHongBaoType();
            if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) { // 自购
                hongbaoInfo = "返利";
                order.setOrderOrigin("1");
                order.setHongBaoTypePic(CommonOrder.TYPE_FANLI);
                signList.add(CommonOrder.TYPE_FANLI);
            } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) { // 分享
                hongbaoInfo = "奖金";
                order.setOrderOrigin("2");
                order.setHongBaoTypePic(CommonOrder.TYPE_SHARE);
                signList.add(CommonOrder.TYPE_SHARE);
            } else if (HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
                // 邀请订单 (下级的分享订单)
                hongbaoInfo = "奖金";
                order.setOrderOrigin("3");
                order.setHongBaoTypePic(CommonOrder.TYPE_INVITE);
                signList.add(CommonOrder.TYPE_INVITE);
            } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
                    || HongBaoV2.TYPE_ERJI == hongBaoType) {  // 邀请订单
                hongbaoInfo = "奖金";
                order.setOrderOrigin("3");
                order.setHongBaoTypePic(CommonOrder.TYPE_INVITE);
                signList.add(CommonOrder.TYPE_INVITE);
                // 版本区分:2-0-2
                if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
                    InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), sourceType2);
                    if (orderSubsidy != null) {
                        ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
                        if (orderSubsidy.getState() == InviteOrderSubsidy.STATE_SUBSIDIZED) {
                            subsidyInfo.setColor("#E5005C");
                            subsidyInfo.setContent("已补贴¥" + orderSubsidy.getMoney());
                        } else {
                            subsidyInfo.setColor("#888888");
                            subsidyInfo.setContent("补贴¥" + orderSubsidy.getMoney());
                            // 解释信息(问号)
                            List<String> subsidyList = new ArrayList<String>();
                            subsidyList.add("额外补贴能否获得由系统算法自动判断,人为无法干涉;");
                            subsidyList.add("额外补贴到账时间以及金额请以实际到账为准;");
                            subsidyList.add("额外补贴产生后将会在消息-资金消息中提醒你。");
                            order.setSubsidyList(subsidyList);
                        }
                        order.setSubsidy(subsidyInfo);
                    }
                }
            }
            String hongBaoDate = null;
            String hongBaoState_Str = "";
            String hongbaoInfoFontColor = "#E5005C";
            String stateContent = "";
            String stateFontColor = "#E5005C";
            Integer orderHongBaoState = null;
            if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) {
                orderHongBaoState = 1;
                stateContent = "未到账";
                hongBaoState_Str = "预估";
                Date preAccountTime = order.getPreAccountTime();
                if (preAccountTime != null)
                    hongBaoDate = "预计到账时间:" + formatday.format(preAccountTime);
            } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) {
                orderHongBaoState = 3;
                stateContent = "已到账";
                Date accountTime = order.getAccountTime();
                if (accountTime != null)
                    hongBaoDate = "到账时间:" + formatday.format(accountTime);
            } else if (HongBaoV2.STATE_BUFENSHIXIAO == hongBaoState) {
                stateContent = "部分失效";
                orderHongBaoState = 3;
                Date accountTime = order.getAccountTime();
                if (accountTime != null)
                    hongBaoDate = "到账时间:" + formatday.format(accountTime);
            } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) {
                orderHongBaoState = 4;
                stateContent = "已失效";
                hongbaoInfoFontColor = "#888888";
            }
            order.setHongBaoState(orderHongBaoState);
            order.setHongBaoDate(hongBaoDate);
            if (!StringUtil.isNullOrEmpty(order.getStateDesc()))
                stateContent = stateContent + "-" + order.getStateDesc();
            Map<String, String> stateMap = new HashMap<String, String>();
            stateMap.put("content", stateContent);
            stateMap.put("fontColor", stateFontColor);
            order.setAccountState(stateMap);
            hongbaoInfo = hongBaoState_Str + hongbaoInfo;
            Map<String, String> hongBaoMap = new HashMap<String, String>();
            hongBaoMap.put("content", hongbaoInfo + " ¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
            hongBaoMap.put("fontColor", hongbaoInfoFontColor);
            order.setHongBaoInfo(hongBaoMap);
            Integer sourceType = order.getSourceType();
            // 非自购的订单 不显示返利、免单详情
            if (HongBaoV2.TYPE_ZIGOU != hongBaoType) {
                order.setSignList(signList);
            } else {
                // 奖励订单、免单 使用记录
                if (sourceType == null) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType, null,
                            signList, acceptData);
                } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
                            listRecordTB, signList, acceptData);
                } else if (sourceType == Constant.SOURCE_TYPE_JD) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
                            listRecordJD, signList, acceptData);
                } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
                            listRecordPDD, signList, acceptData);
                }
            }
            // 分享、邀请 隐藏订单号
            if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType || HongBaoV2.TYPE_YAOQING == hongBaoType
                    || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType
                    || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
                order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo()));
            }
        }
    }
    /**
     * 订单: 免单标识 奖励标识
     * 
@@ -707,7 +299,7 @@
                    Date thirdCreateTime = order.getThirdCreateTime();
                    if (thirdCreateTime != null) {
                        long downOrderTime = thirdCreateTime.getTime();
                        long limitDate = Long.parseLong("1573315200000"); // TODO 日期待确定2019-11-10
                        long limitDate = Long.parseLong("1571760000000"); // TODO 日期待确定2019-11-10
                        if (downOrderTime > limitDate) {
                            newEdition = true;
                            Date endDay = DateUtil.plusDayDate(4, thirdCreateTime);
@@ -752,9 +344,13 @@
                    rewardStyleVO.setColor("#E5005C");
                    rewardStyleVO.setBottomColor("#FFDCEA");
                    if (!newEdition) {
                        rewardStyleVO.setContent("返利奖励 >");
                        if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
                            rewardStyleVO.setContent("使用奖励券 >");
                        } else {
                            rewardStyleVO.setContent("返利奖励 >");
                        }
                    } else if (canUse) {
                        rewardStyleVO.setContent("返利奖励 ");
                        rewardStyleVO.setContent("使用奖励券");
                        
                        ClientTextStyleVO txt1 = new ClientTextStyleVO();
                        txt1.setContent("剩");
@@ -765,6 +361,7 @@
                        txt2.setContent(num);
                        txt2.setColor("#E5005C");
                        txt2.setBottomColor("#FFDCEA");
                        txt2.setFontSize("1.33");
                        
                        ClientTextStyleVO txt3 = new ClientTextStyleVO();
                        txt3.setContent(unit + "关闭 >");
@@ -1065,21 +662,20 @@
                    InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), sourceType);
                    if (orderSubsidy != null) {
                        ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
                        subsidyInfo.setContent("(补贴¥" + orderSubsidy.getMoney() + ")");
                        if (orderSubsidy.getState() == InviteOrderSubsidy.STATE_SUBSIDIZED) {
                            subsidyInfo.setColor("#E5005C");
                            subsidyInfo.setContent("已补贴¥" + orderSubsidy.getMoney());
                        } else {
                            subsidyInfo.setColor("#888888");
                            subsidyInfo.setContent("补贴¥" + orderSubsidy.getMoney());
                            // 解释信息(问号)
                            List<String> subsidyList = new ArrayList<String>();
                            subsidyList.add("额外补贴能否获得由系统算法自动判断,人为无法干涉;");
                            subsidyList.add("额外补贴到账时间以及金额请以实际到账为准;");
                            subsidyList.add("额外补贴产生后将会在消息-资金消息中提醒你。");
                            order.setSubsidyList(subsidyList);
                        }
                        order.setSubsidy(subsidyInfo);
                        // 解释信息(问号)
                        List<String> subsidyList = new ArrayList<String>();
                        subsidyList.add("额外补贴能否获得由系统算法自动判断,人为无法干涉;");
                        subsidyList.add("额外补贴到账时间以及金额请以实际到账为准;");
                        subsidyList.add("额外补贴产生后将会在消息-资金消息中提醒你。");
                        order.setSubsidyList(subsidyList);
                    }
                }
            }
@@ -1173,6 +769,64 @@
        }
    }
    
    @Override
    public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day, Integer source) {
        return commonOrderMapper.countHistoryOrder(uid, day, source);
    }
    @Override
    public long countBonusOrderNumber(Long uid, Integer type, Integer day, String startTime, String endTime,
            Integer source) {
        return commonOrderMapper.countBonusOrderNumber(uid, type, day, startTime, endTime, source);
    }
    @Override
    public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer day, String startTime, String endTime,
            Integer source) {
        return commonOrderMapper.countBonusOrderMoney(uid, type, day, startTime, endTime, source);
    }
    @Override
    public Map<String, Object> countBonusOrderMoneyAndNumber(Long uid, Integer type, Integer day, String startTime,
            String endTime, Integer source) {
        return commonOrderMapper.countBonusOrderMoneyAndNumber(uid, type, day, startTime, endTime, source);
    }
    @Override
    public Long countUserOrderToApp(Long uid, Integer type, String startTime, String endTime,
            Integer day, Integer source, Integer state, Integer stateOrder) {
        return commonOrderMapper.countUserOrderToApp(uid, type, startTime, endTime, day, source, state, stateOrder);
    }
    private BigDecimal getWeiQuanMoney(List<TaoBaoWeiQuanOrder> listWQ, int sourceType, Long uid) {
        BigDecimal weiQuanMoney = new BigDecimal(0);
        if (listWQ != null && listWQ.size() > 0) {
            for (TaoBaoWeiQuanOrder weiQuanOrder : listWQ) {
                String tradeId = weiQuanOrder.getOrderItemId();
                // 查询红包
                List<String> tradeList = new ArrayList<>();
                tradeList.add(tradeId);
                List<HongBaoV2> hongBaoList = hongBaoV2Service.listBySourceTypeAndTradeIdListAndUid(sourceType, uid,
                        tradeList);
                if (hongBaoList != null && hongBaoList.size() > 0) {
                    CommonOrder commonOrder = commonOrderMapper.selectBySourceTypeAndTradeId(sourceType, tradeId);
                    if (commonOrder != null && commonOrder.getSettlement().compareTo(new BigDecimal(0)) > 0) {
                        BigDecimal wqMoney = MoneyBigDecimalUtil
                                .mul(hongBaoList.get(0).getMoney(), weiQuanOrder.getMoney())
                                .divide(commonOrder.getSettlement(), 2, BigDecimal.ROUND_UP);
                        if (wqMoney.compareTo(hongBaoList.get(0).getMoney()) > 0)
                            wqMoney = hongBaoList.get(0).getMoney();
                        weiQuanMoney = weiQuanMoney.add(wqMoney);
                    }
                }
            }
        }
        return weiQuanMoney;
    }
    
    @Override
    public List<CommonOrder> listBySourceTypeAndOrderId(int sourceType, String orderId) {
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandGoodsCaheService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.brand;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.entity.brand.BrandGoodsCahe;
@@ -24,6 +25,10 @@
     */
    public List<BrandGoodsCahe> getByBrandId(int start, int count, Long brandId);
    public void removeByBrandId(Long brandId);
    /**
     * 统计品牌商品数量
     * @param brandId
@@ -31,4 +36,10 @@
     */
    public long countByBrandId(Long brandId);
    /**
     * 删除之前的
     * @param createTime
     */
    public void removeAgoByDate(Date createTime);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandInfoService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.brand;
import java.util.Date;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
@@ -104,4 +105,11 @@
    public long countValidByCid(Long cid);
    /**
     * 删除之前的
     * @param date
     */
    public void removeAgoByDate(Date date);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/brand/BrandShopCaheService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.brand;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.dto.jd.JDShopInfo;
@@ -43,4 +44,15 @@
     */
    public void addBrandShopPDD(BrandInfo brandInfo);
    /**
     * 删除之前的
     * @param createTime
     */
    public void removeAgoByDate(Date createTime);
    public void removeByBrandId(Long brandId);
    public void removeByDateAndType(Long brandId, int type, Date date);
}
fanli/src/main/java/com/yeshi/fanli/util/TimeUtil.java
@@ -102,6 +102,12 @@
        }
        return 0;
    }
    public static String formatDate(Date time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        String date = sdf.format(time);
        return date;
    }
    public static long convertToTimeTemp(String st, String format) {
        Date date = new Date();
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java
@@ -384,6 +384,18 @@
            goodsInfo = loadYuShouInfo(goodsInfo, goods, pid, fanLiRate, shareRate);
        }
        if (Constant.IS_TEST) {
            // 添加标签
            List<ClientTextStyleVO> labels = goodsInfo.getLabels();
            if (labels == null)
                labels = new ArrayList<>();
            labels.add(new ClientTextStyleVO("预售", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("爆款", "#FF2B4E"));
            labels.add(new ClientTextStyleVO("超级划算", "#FF2B4E"));
            goodsInfo.setLabels(labels);
        }
        return goodsInfo;
    }
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/ShopInfoVOFactory.java
@@ -7,6 +7,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoShop;
import com.yeshi.fanli.entity.taobao.TaoBaoShopInfo;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.goods.ShopInfoVO;
@@ -58,6 +59,12 @@
        } else {
            shopInfoVO.setShopIcon(shop.getShopIcon());
        }
        String shopLink = shop.getShopLink();
        if (StringUtil.isNullOrEmpty(shopLink))
            shopLink = TaoBaoUtil.getShopLink(shop.getId());
        shopInfoVO.setShopLink(shopLink);
        return shopInfoVO;
    }
    
fanli/src/main/java/com/yeshi/fanli/vo/msg/ClientTextStyleVO.java
@@ -17,6 +17,9 @@
    private String bottomColor;
    @Expose
    private String img;
    @Expose
    private String fontSize = "1"; // 字体倍数
    public ClientTextStyleVO(String content, String color) {
        this.content = content;
@@ -74,4 +77,12 @@
    public void setBottomColor(String bottomColor) {
        this.bottomColor = bottomColor;
    }
    public String getFontSize() {
        return fontSize;
    }
    public void setFontSize(String fontSize) {
        this.fontSize = fontSize;
    }
}