yujian
2019-07-10 aad0554cc7f18a6ec05e2e5e646b5e501d41617d
冲突文件
9个文件已修改
1个文件已添加
397 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderMapper.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoUtil.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -655,7 +655,7 @@
            taoBaoGoodsBriefExtra.setAuctionUrl(tb.getAuctionUrl());
            if (uid != null && !"".equals(uid.trim())) {
                CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid),
                        Long.parseLong(id));
                        Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO);
                data.put("collection", collectionGoods != null ? true : false);
            }
@@ -915,7 +915,7 @@
        // 判断收藏
        if (!StringUtil.isNullOrEmpty(uid)) {
            CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid),
                    Long.parseLong(id));
                    Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO);
            data.put("collected", collectionGoods != null ? true : false);
        } else
            data.put("collected", false);
@@ -1181,7 +1181,7 @@
    // 获取浏览记录
    @RequestMapping(value = "getscanhistory", method = RequestMethod.POST)
    public void getScanHistory(AcceptData acceptData, String uid, int page, Integer source, PrintWriter out) {
    public void getScanHistory(AcceptData acceptData, String uid, int page, Integer goodsType, PrintWriter out) {
        if (page < 0) {
            out.print(JsonUtil.loadFalseResult(1, "page不小于0"));
            return;
@@ -1195,10 +1195,10 @@
        }
        
        List<ScanHistoryV2> list = scanHistoryV2Service.getScanHistoryByDeviceOrUid(
                StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), page, 20, source);
                StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), page, 20, goodsType);
        
        long count = scanHistoryV2Service.getCountByDeviceOrUid(
                        StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), source);
                        StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), goodsType);
        
        JSONObject data = new JSONObject();
        data.put("count", count);
@@ -1235,10 +1235,10 @@
    }
    @RequestMapping(value = "deletescanhistory", method = RequestMethod.POST)
    public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids, PrintWriter out) {
    public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids,
            Integer goodsType, PrintWriter out) {
        BusinessSystem sys = businessSystemService.getBusinessSystem(acceptData.getPlatform(),
                acceptData.getPackages());
        if (sys == null) {
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
@@ -1249,11 +1249,11 @@
            for (String auctionIdStr : idStr) {
                scanHistoryV2Service.deleteByAuctionIdAndDeviceOrUid(
                        StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(),
                        Long.parseLong(auctionIdStr));
                        Long.parseLong(auctionIdStr), goodsType);
            }
        } else {
            scanHistoryV2Service.deleteByDeviceOrUid(StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid),
                    acceptData.getDevice());
                    acceptData.getDevice(), goodsType);
        }
        out.print(JsonUtil.loadTrueResult(""));
@@ -2022,7 +2022,7 @@
        if (uid == null) {
            data.put("collected", false);
        } else {
            CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id);
            CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, Constant.SOURCE_TYPE_TAOBAO);
            data.put("collected", collectionGoods != null ? true : false);
        }
@@ -2161,7 +2161,7 @@
        // 是否加入选品库: 0未加入 1 已加入
        boolean storageState = false;
        if (uid != null) {
            storageState = userGoodsStorageService.isExistStorage(uid, id);
            storageState = userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_TAOBAO);
        }
        data.put("storageState", storageState);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -251,7 +251,7 @@
            data.put("shareMoney", "¥" + shareMoney.toString());
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId);
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
                data.put("shareId", shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
@@ -415,7 +415,7 @@
            data.put("shareMoney", "¥" + shareMoney.toString());
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId);
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
                data.put("shareId", shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
@@ -585,7 +585,7 @@
    @RequestMapping(value = "sharedetail", method = RequestMethod.POST)
    public void shareDetail(AcceptData acceptData, Long uid, Long auctionId, String type, PrintWriter out) {
        try {
            userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId);
            userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
            out.print(JsonUtil.loadTrueResult("分享成功"));
        } catch (UserShareGoodsRecordException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
@@ -59,9 +59,14 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.goods.MoneyInfoVO;
import com.yeshi.fanli.vo.goods.OtherInfo;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.tlj.SpreadHongBao;
import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
@@ -565,4 +570,94 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    
    /**
     * 分享爆款商品-限于淘礼金
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getShareGoodsV2", method = RequestMethod.POST)
    public void getShareGoodsV2(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
        List<ShareHotGoods> listHot = shareHotGoodsService.listByDay(day);
        if (listHot == null) {
            listHot = new ArrayList<ShareHotGoods>();
        }
        JSONArray array = new JSONArray();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        boolean isNewUser = userInfoExtraService.isNewUser(uid);
        if (isNewUser) {
            // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
            long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
            if (countRecord > 0) {
                isNewUser = false;
            }
        }
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        for (ShareHotGoods hotGoods : listHot) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            // 计算推广红包
            String warningRate = configTaoLiJinService.getValueByKey("warning_value");
            BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, taoBaoGoodsBrief);
            // 推广红包 不能小于1
            if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
                continue;
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            // 去掉标签
            detailVO.setLabels(null);
            MoneyInfoVO moneyInfo = detailVO.getMoneyInfo();
            OtherInfo otherInfo = new OtherInfo();
            SpreadHongBao spreadHongBao = new SpreadHongBao();
            // 显示类型
            if (isNewUser) {
                moneyInfo.setMoneyType(1);
                spreadHongBao.setName("推广红包");
                spreadHongBao.setMoney(" ¥1");
            } else {
                moneyInfo.setMoneyType(2);
                spreadHongBao.setName("推广红包");
                spreadHongBao.setMoney(" ¥" + spreadMoney);
            }
            detailVO.setMoneyInfo(moneyInfo);
            otherInfo.setSpreadHongBao(spreadHongBao);
            detailVO.setOtherInfo(otherInfo);
            array.add(gson.toJson(detailVO));
        }
        executor.execute(new Runnable() {
            @Override
            public void run() {
                // 过期
                userTaoLiJinOriginService.overdueHongBao(uid);
            }
        });
        JSONObject data = new JSONObject();
        data.put("count", array.size());
        data.put("list", array);
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderMapper.java
@@ -25,7 +25,7 @@
    List<CommonOrderVO> listUserOrder(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
            @Param("state") Integer state, @Param("type") Integer type, @Param("orderState") Integer orderState,
            @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime,
            @Param("day") Integer day);
            @Param("day") Integer day, @Param("source")Integer source);
    /**
     * 统计用户订单 并订单号分组
@@ -37,7 +37,7 @@
     */
    long countUserOrder(@Param("uid") Long uid, @Param("state") Integer state, @Param("type") Integer type,
            @Param("orderState") Integer orderState, @Param("orderNo") String orderNo,
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day, @Param("source")Integer source);
    /**
     * 判断部分失效状态
@@ -75,7 +75,7 @@
     * @param uid
     * @return
     */
    Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day);
    Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day, @Param("source") Integer source);
    /**
     * 昨日总订单-根据红包类型 自购 邀请 分享
@@ -84,7 +84,8 @@
     * @return
     */
    Map<String, BigDecimal> countByUidAndOrderState(@Param("uid") Long uid, @Param("type") Integer type,
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day,
            @Param("source")Integer source);
    /**
     * 奖金订单数量
@@ -93,7 +94,7 @@
     * @return
     */
    long countBonusOrderNumber(@Param("uid") Long uid, @Param("type") Integer type, @Param("day") Integer day,
            @Param("startTime") String startTime, @Param("endTime") String endTime);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source);
    /**
     * 奖金统计
@@ -102,7 +103,7 @@
     * @return
     */
    BigDecimal countBonusOrderMoney(@Param("uid") Long uid, @Param("type") Integer type, @Param("day") Integer day,
            @Param("startTime") String startTime, @Param("endTime") String endTime);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source);
    /**
     * 奖金统计
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -328,6 +328,7 @@
        MAX(co_settle_time) AS co_settle_time, co_order_by, co_create_time,
        co_update_time
    </sql>
    <select id="listUserOrder" resultMap="ResultMap">
        <!-- 查询用户订单 -->
        SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, hb.hb_state AS
@@ -347,11 +348,15 @@
        <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
        <!-- 订单时间 -->
        <include refid="SELECT_PARAM_HONGBAO_STATE" />
        <!-- 红包状态 -->
        <!-- 订单号查询 -->
        <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if>
        <!-- 订单来源 -->
        <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY
        co.co_third_create_time DESC LIMIT ${start},${count}
    </select>
    <select id="countUserOrder" resultType="java.lang.Long">
        <!-- 统计用户订单数量 -->
        SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM
@@ -368,8 +373,11 @@
        <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
        <!-- 订单时间 -->
        <include refid="SELECT_PARAM_HONGBAO_STATE" />
        <!-- 红包状态 -->
        <!-- 订单号查询 -->
        <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if>
        <!-- 订单来源 -->
        <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type` )A
    </select>
    <select id="listOrderGoodsInfo" resultMap="ResultMap"
@@ -387,6 +395,8 @@
        </foreach>
        GROUP BY tc.`co_order_no`,tc.`co_order_goods_id`
    </select>
    <select id="countHistoryOrder" resultType="java.util.HashMap">
        <!-- 统计历史订单数量 -->
        SELECT SUM(A.self)AS totalSelf,SUM(A.shared)AS
@@ -418,7 +428,13 @@
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),
            DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1
        </if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)YX UNION ALL
        <!-- 订单来源 -->
        <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)YX
        UNION ALL
        <!-- 分享订单 -->
        SELECT 0 AS self,IFNULL(COUNT(ho_id),0) AS shared,0 AS invite FROM
        (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
@@ -445,7 +461,13 @@
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),
            DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1
        </if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)WQ UNION ALL
        <!-- 订单来源 -->
        <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)WQ
        UNION ALL
        <!-- 邀请订单 -->
        SELECT 0 AS self,0 AS shared,IFNULL(COUNT(ho_id),0) AS invite FROM
        (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
@@ -472,8 +494,13 @@
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),
            DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1
        </if>
        <!-- 订单来源 -->
        <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A
    </select>
    <select id="countByUidAndOrderState" resultType="java.util.HashMap">
        SELECT SUM(A.valid)AS totalValid, SUM(A.proces)AS
        totalProces,SUM(A.Invalid)AS totalInvite FROM (
@@ -487,7 +514,12 @@
        WHERE hb.hb_id IS NOT NULL <![CDATA[AND co.`co_state` <> 3]]>
        AND (co.`co_state_whole_order` =1 OR co.`co_state_whole_order` = 2)
        <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
        GROUP BY co.`co_order_no`, co.`co_source_type`)YX UNION ALL
            <!-- 订单来源 -->
            <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)YX
        UNION ALL
        <!-- 维权订单 -->
        SELECT 0 AS valid,IFNULL(COUNT(ho_id),0) AS proces,0 AS Invalid FROM
        (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
@@ -497,7 +529,12 @@
        LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
        WHERE hb.hb_id IS NOT NULL AND co.`co_state` = 3
        <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
        GROUP BY co.`co_order_no`, co.`co_source_type`)WQ UNION ALL
            <!-- 订单来源 -->
            <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)WQ
        UNION ALL
        <!-- 失效订单 -->
        SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(ho_id),0) AS Invalid FROM
        (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT *
@@ -507,6 +544,8 @@
        LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
        WHERE hb.hb_id IS NOT NULL AND co.`co_state_whole_order` = 3
        <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
            <!-- 订单来源 -->
            <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A
    </select>
    <select id="countBonusOrderNumber" resultType="java.lang.Long">
@@ -519,6 +558,8 @@
        LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
        WHERE hb.hb_id IS NOT NULL
        <include refid="SELECT_PARAM_ORDER_CREATE_TIME" />
        <!-- 订单来源 -->
        <if test="source != null">AND co.co_source_type = #{source}</if>
        GROUP BY co.`co_order_no`, co.`co_source_type` )A
    </select>
    <select id="countBonusOrderMoney" resultType="java.math.BigDecimal">
@@ -537,6 +578,8 @@
            AND co.`co_state` = 2
            <!-- 上月 :统计已收货 -->
        </if>
        <!-- 订单来源 -->
        <if test="source != null">AND co.co_source_type = #{source}</if>
    </select>
    <select id="countBonusOrderMoneyAndNumber" resultType="java.util.HashMap">
        SELECT COUNT(*) AS totalNum, CAST(SUM(moneys) AS DECIMAL(19,2)) AS
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
@@ -49,6 +50,7 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory;
import com.yeshi.fanli.util.factory.goods.CommonOrderFactory;
import com.yeshi.fanli.util.jd.JDApiUtil;
@@ -138,26 +140,26 @@
    @Override
    public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
            Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
            Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
            throws CommonOrderException {
        return commonOrderMapper.listUserOrder(start, count, uid, state, type, orderState, orderNo, startTime, endTime,
                dateType);
                dateType, source);
    }
    @Override
    public long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
            String startTime, String endTime, Integer dateType) throws CommonOrderException {
        return commonOrderMapper.countUserOrder(uid, state, type, orderState, orderNo, startTime, endTime, dateType);
            String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException {
        return commonOrderMapper.countUserOrder(uid, state, type, orderState, orderNo, startTime, endTime, dateType, source);
    }
    @Override
    public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, Integer orderState,
            String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException {
    public List<CommonOrderVO> getOrderByUid(AcceptData acceptData,Integer page, Long uid, Integer state, Integer type, Integer orderState,
            String orderNo, String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException {
        int pageSize = Constant.PAGE_SIZE;
        List<CommonOrderVO> listOrder = listGroupOrderNoByUid((page - 1) * pageSize, pageSize, uid, state, type,
                orderState, orderNo, startTime, endTime, dateType);
                orderState, orderNo, startTime, endTime, dateType, source);
        // 订单信息为空
        if (listOrder == null || listOrder.size() == 0) {
@@ -173,24 +175,24 @@
        }
        // 数据加工重新组织
        listDataFactory(listOrder, listGoods, uid);
        listDataFactory(acceptData, listOrder, listGoods, uid);
        return listOrder;
    }
    @Override
    public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day) {
        return commonOrderMapper.countHistoryOrder(uid, day);
    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) {
        return commonOrderMapper.countBonusOrderNumber(uid, type, day, startTime, endTime);
    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) {
        return commonOrderMapper.countBonusOrderMoney(uid, type, day, startTime, endTime);
    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
@@ -201,11 +203,11 @@
    @Override
    public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
            Integer day) {
        return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day);
            Integer day, Integer source) {
        return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day, source);
    }
    public void listDataFactory(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
    public void listDataFactory(AcceptData acceptData, List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
        List<String> listNo = new ArrayList<String>();
        for (CommonOrderVO commonOrderVO : listOrder) {
@@ -272,13 +274,19 @@
                    listOrderGoods.add(commonGoodsVO);
                    Integer orderType = commonOrder.getOrderType();
                    Integer orderType = order.getOrderType();
                    if (orderType == null) {
                        String shopType = commonGoodsVO.getShopType();
                        if (CommonOrderGoodsVO.TYPE_TAOBAO.equalsIgnoreCase(shopType)) {
                            commonOrder.setOrderType(1);
                            order.setOrderType(1);
                        } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) {
                            commonOrder.setOrderType(2);
                            order.setOrderType(2);
                        }
                        if (Constant.SOURCE_TYPE_JD == sourceType2) {
                            order.setOrderType(3);
                        } else if (Constant.SOURCE_TYPE_PDD == sourceType2) {
                            order.setOrderType(4);
                        }
                    }
@@ -997,15 +1005,6 @@
        return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime);
    }
    @Override
    public CommonOrderVO getInfoByOrderNo(Long uid, String orderNo) throws CommonOrderException {
        List<CommonOrderVO> list = getOrderByUid(1, uid, null, null, null, orderNo, null, null, null);
        if (list == null || list.size() == 0) {
            return null;
        } else {
            return list.get(0);
        }
    }
    @Override
    public CommonOrderVO getCommonOrderByOrderNo(Long uid, String orderNo, Integer orderState)
@@ -1100,30 +1099,6 @@
        return commonOrderVO;
    }
    @Override
    public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer hongBaoState, String orderNo)
            throws CommonOrderException {
        List<CommonOrderVO> listOrder = commonOrderMapper.getCouponHongbaoByOrderNo(uid, hongBaoState, orderNo);
        // 订单信息为空
        if (listOrder == null || listOrder.size() == 0) {
            listOrder = new ArrayList<CommonOrderVO>();
            return listOrder;
        }
        // 商品信息
        List<CommonOrderVO> listGoods = commonOrderMapper.listOrderGoodsInfo(listOrder);
        // 订单商品为空
        if (listGoods == null || listGoods.size() == 0) {
            return listOrder;
        }
        // 数据加工重新组织
        listDataFactory(listOrder, listGoods, uid);
        return listOrder;
    }
    @Override
    public JSONObject getRewardJumpInfo(String orderNo) {
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java
@@ -40,6 +40,7 @@
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
@@ -422,7 +423,7 @@
            return null;
        }
        List<CommonGoods> listGoods = commonGoodsService.getByListGoodsId(listGoodsId);
        List<CommonGoods> listGoods = commonGoodsService.getByListGoodsId(listGoodsId, Constant.SOURCE_TYPE_TAOBAO);
        if (listGoods == null || listGoods.size() == 0) {
            return null;
        }
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.jd.JDOrder;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.pdd.PDDOrder;
@@ -46,7 +47,7 @@
     * @throws CommonOrderException
     */
    public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
            Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
            Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
            throws CommonOrderException;
    /**
@@ -62,7 +63,7 @@
     * @throws CommonOrderException
     */
    long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
            String startTime, String endTime, Integer dateType) throws CommonOrderException;
            String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException;
    /**
     * 移动段订单列表
@@ -75,8 +76,8 @@
     *            到账状态
     * @return
     */
    public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, Integer orderState,
            String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
    public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, Integer orderState,
            String orderNo, String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException;
    /**
     * 统计订单-根据红包类型 自购 邀请 分享
@@ -84,7 +85,7 @@
     * @param uid
     * @return
     */
    public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day);
    public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day, Integer source);
    /**
     * 统计订单
@@ -92,7 +93,7 @@
     * @param uid
     * @return
     */
    public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime);
    public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime, Integer source);
    /**
     * 统计订单
@@ -100,7 +101,7 @@
     * @param uid
     * @return
     */
    public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime);
    public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime, Integer source);
    /**
     * 统计奖金订单数量、金额
@@ -125,7 +126,7 @@
     * @return
     */
    public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
            Integer day);
            Integer day, Integer source);
    /**
     * 根据订单号与订单类型查询订单
@@ -223,26 +224,6 @@
    public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
            String startTime, String endTime) throws CommonOrderException;
    /**
     * 根据订单号获取信息
     *
     * @param orderNo
     * @return
     * @throws CommonOrderException
     */
    public CommonOrderVO getInfoByOrderNo(Long uid, String orderNo) throws CommonOrderException;
    /**
     * 查询券奖励金额以及订单信息
     *
     * @param uid
     * @param state
     * @param orderNo
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer state, String orderNo)
            throws CommonOrderException;
    /**
     * 查询订单
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoUtil.java
New file
@@ -0,0 +1,83 @@
package com.yeshi.fanli.util.pinduoduo;
import java.math.BigDecimal;
import org.yeshi.utils.BigDecimalUtil;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
public class PinDuoDuoUtil {
    /**
     * 商品佣金计算
     * @param goods
     * @param rate
     * @return
     */
    public static BigDecimal getGoodsFanLiMoney(PDDGoodsDetail goods, BigDecimal rate) {
        BigDecimal money = null;
        BigDecimal price = new BigDecimal(goods.getMinNormalPrice());
        BigDecimal promotionRate = new BigDecimal(goods.getPromotionRate());
        Boolean hasCoupon = goods.getHasCoupon();
        if (hasCoupon == null || !hasCoupon) {
            money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(
                    MoneyBigDecimalUtil.mul(price, promotionRate),new BigDecimal("0.001")),
                    MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
        } else {
            BigDecimal amount = new BigDecimal(goods.getCouponDiscount());
            BigDecimal startFree = new BigDecimal(goods.getCouponMinOrderAmount());
            if (startFree.compareTo(price) <= 0 && price.compareTo(amount) > 0) {
                BigDecimal finalPrice = price.subtract(amount);
                money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil
                        .mul(MoneyBigDecimalUtil.mul(finalPrice, promotionRate), new BigDecimal("0.001")),
                        MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
            } else {// 不能用券
                money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(
                        MoneyBigDecimalUtil.mul(price,promotionRate), new BigDecimal("0.001")),
                        MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
            }
        }
        return BigDecimalUtil.getWithNoZera(money);
    }
    /**
     * 计算商品券后价,没有券则返回原价
     *
     * @param goodsBrief
     * @return
     */
    public static BigDecimal getQuanPrice(PDDGoodsDetail goods) {
        BigDecimal price = new BigDecimal(goods.getMinNormalPrice());
        Boolean hasCoupon = goods.getHasCoupon();
        if (hasCoupon == null || !hasCoupon) {
            return price;
        }
        BigDecimal amount = new BigDecimal(goods.getCouponDiscount());
        BigDecimal startFree = new BigDecimal(goods.getCouponMinOrderAmount());
        if (startFree.compareTo(price) <= 0) {
            BigDecimal quanPrice = MoneyBigDecimalUtil.sub(price, amount);
            return quanPrice;
        } else {
            return price;
        }
    }
    public static String getSaleCount(long count) {
        String salesCountMidea = null;
        if (count < 10000) {
            salesCountMidea = count + "";
        } else {
            double sales = count;
            salesCountMidea = String.format("%.1f", sales / 10000);
            salesCountMidea = salesCountMidea + "万";
        }
        return salesCountMidea;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -705,6 +705,8 @@
        tg.setReservePrice(tb.getReservePrice());
        tg.setUserType(tb.getUserType());
        tg.setShopTitle(tb.getShopTitle());
        tg.setTkRate(tb.getTkRate());
        tg.setSellerId(tb.getSellerId());
        tg.setState(tb.getState()); // 状态:2018-12-03
        if (tb.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {