admin
2019-08-19 9c09cead959dbeef292628f345e5f80c30fc3d17
Merge remote-tracking branch 'origin/mater-1.6.0' into div
16个文件已修改
292 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderMapper.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDebt.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/pdd/PDDOrder.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateOrderJob.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/pdd/PDDOrderMapper.xml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDebtServiceImpl.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/BindingAccountServiceImpl.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/OrderProcessService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -141,16 +141,15 @@
    @Resource
    private UserAccountBindingHistoryService userAccountBindingHistoryService;
    @Resource
    private HomeNavbarUserService homeNavbarUserService;
    @Resource
    private UserInfoDeleteRecordService userInfoDeleteRecordService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -920,8 +919,6 @@
        }
        redisManager.cacheCommonString(key, "1", 120);
        // 支付宝绑定
        ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount, account);
@@ -940,9 +937,15 @@
                "PERM_AML_NOT_REALNAME_REV", "PAYEE_USER_INFO_ERROR", "PAYEE_ACC_OCUPIED",
                "PERMIT_CHECK_PERM_IDENTITY_THEFT", "PERMIT_NON_BANK_LIMIT_PAYEE", "EXCEED_LIMIT_UNRN_DM_AMOUNT" };
        try {
            BigDecimal balance = user.getMyHongBao();
            BindingAccount bindingAccount = bindingAccountService.changeAlipayBindingWithVerify(uid, name, account);
            out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
                    "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。"));
            // 余额充足
            if (balance.compareTo(new BigDecimal("0.1")) >= 0)
                out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
                        "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。"));
            else
                out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
                        "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。注:此0.1元将会在后续产生的余额中合理扣除,敬请知晓。"));
        } catch (AlipayTransferException e1) {
            if (e1.getSubCode().equalsIgnoreCase("PAYEE_NOT_EXIST")) {
                String msg = "系统未能成功转账0.1元,提现账号信息有误,请核对后重新填写。";
@@ -1166,7 +1169,7 @@
                        } catch (Exception e) {
                            LogHelper.errorDetailInfo(e);
                        }
                        /* 同步未登录之前设备抽奖数据 */
                        try {
                            int platformType = 0;
@@ -1180,15 +1183,15 @@
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
                            /* 新人红包 */
                            try {
                                userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(),  device);
                                userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(), device);
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                        }
                    }
                });
            }
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("source")Integer source);
            @Param("day") Integer day, @Param("source") Integer source);
    /**
     * 统计用户订单 并订单号分组
@@ -37,7 +37,8 @@
     */
    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("source")Integer source);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day,
            @Param("source") Integer source);
    /**
     * 判断部分失效状态
@@ -75,7 +76,8 @@
     * @param uid
     * @return
     */
    Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day, @Param("source") Integer source);
    Map<String, BigDecimal> countHistoryOrder(@Param("uid") Long uid, @Param("day") Integer day,
            @Param("source") Integer source);
    /**
     * 昨日总订单-根据红包类型 自购 邀请 分享
@@ -84,8 +86,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("source")Integer source);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day,
            @Param("source") Integer source);
    /**
     * 奖金订单数量
@@ -94,7 +96,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("source")Integer source);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source") Integer source);
    /**
     * 奖金统计
@@ -103,7 +105,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("source")Integer source);
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source") Integer source);
    /**
     * 奖金统计
@@ -112,7 +114,8 @@
     * @return
     */
    Map<String, Object> countBonusOrderMoneyAndNumber(@Param("uid") Long uid, @Param("type") Integer type,
            @Param("day") Integer day, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source")Integer source);
            @Param("day") Integer day, @Param("startTime") String startTime, @Param("endTime") String endTime,
            @Param("source") Integer source);
    int countByOrderNOAndOrderType(@Param("orderNO") String orderNO, @Param("orderType") int orderType);
@@ -171,11 +174,11 @@
    List<CommonOrderVO> listQuery(@Param("start") long start, @Param("count") int count,
            @Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state,
            @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime,
            @Param("endTime") String endTime, @Param("source")Integer source);
            @Param("endTime") String endTime, @Param("source") Integer source);
    /**
     *  订单列表查询(不包含子订单)
     * 订单列表查询(不包含子订单)
     *
     * @param start
     * @param count
     * @param keyType
@@ -191,18 +194,18 @@
    List<CommonOrderVO> listQueryWithNoChild(@Param("start") long start, @Param("count") int count,
            @Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state,
            @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime,
            @Param("endTime") String endTime, @Param("source")Integer source);
            @Param("endTime") String endTime, @Param("source") Integer source);
    /**
     * 统计
     */
    long countQuery(@Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state,
            @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime,
            @Param("endTime") String endTime, @Param("source")Integer source);
    long countQueryWithNoChild(@Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state,
            @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime,
            @Param("endTime") String endTime, @Param("source")Integer source);
            @Param("endTime") String endTime, @Param("source") Integer source);
    long countQueryWithNoChild(@Param("keyType") Integer keyType, @Param("key") String key,
            @Param("state") Integer state, @Param("type") Integer type, @Param("orderState") Integer orderState,
            @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("source") Integer source);
    /**
     * 根据来源类型与订单号查询列表
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDebt.java
@@ -15,12 +15,13 @@
@Table("yeshi_ec_user_debt")
public class UserMoneyDebt {
    public enum UserMoneyDebtTypeEnum {
        order("维权退款"), other("其他");
        order("维权退款"), other("其他"), extractVerify("提现账号验证");
        private final String desc;
        private UserMoneyDebtTypeEnum(String desc) {
            this.desc = desc;
        }
        public String getDesc() {
            return desc;
        }
fanli/src/main/java/com/yeshi/fanli/entity/pdd/PDDOrder.java
@@ -72,6 +72,9 @@
    @SerializedName("order_modify_at")
    @Column(name = "po_order_modify_at")
    private Long orderModifyAt;// 最后更新时间
    @SerializedName("order_receive_time")
    @Column(name = "po_order_receive_time")
    private Long orderReceiveTime;//收货时间
    @SerializedName("custom_parameters")
    @Column(name = "po_custom_parameters")
    private String customParameters;// 自定义参数
@@ -277,4 +280,13 @@
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public Long getOrderReceiveTime() {
        return orderReceiveTime;
    }
    public void setOrderReceiveTime(Long orderReceiveTime) {
        this.orderReceiveTime = orderReceiveTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java
@@ -66,7 +66,7 @@
        if (result != null && result.getOrderList() != null)
            saveJDOrders(result.getOrderList());
        // 查询上个小时的
        result = JDApiUtil.getOrderList(1, 200, new Date(now - 1000 * 60 * 60 * 24L), JDApiUtil.ORDER_TYPE_CREATETIME);
        result = JDApiUtil.getOrderList(1, 200, new Date(now - 1000 * 60 * 60L), JDApiUtil.ORDER_TYPE_CREATETIME);
        if (result != null && result.getOrderList() != null)
            saveJDOrders(result.getOrderList());
    }
fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateOrderJob.java
@@ -371,7 +371,14 @@
    public void doJob2() {
        if (!Constant.IS_TASK)
            return;
        doTaoBaoWeiQuanOrder(2);
        LogHelper.error("处理返利到账前置");
        try {
            doTaoBaoWeiQuanOrder(2);
        } catch (Exception e) {
        LogHelper.errorDetailInfo(e);
        }
        LogHelper.error("开始处理返利");
        orderProcessService.fanli();
    }
fanli/src/main/java/com/yeshi/fanli/mapping/pdd/PDDOrderMapper.xml
@@ -34,6 +34,8 @@
            jdbcType="BIGINT" />
        <result column="po_order_modify_at" property="orderModifyAt"
            jdbcType="BIGINT" />
        <result column="po_order_receive_time" property="orderReceiveTime"
            jdbcType="BIGINT" />
        <result column="po_custom_parameters" property="customParameters"
            jdbcType="VARCHAR" />
        <result column="po_order_settle_time" property="orderSettleTime"
@@ -42,7 +44,7 @@
        <result column="po_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="po_update_time" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time
    <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -64,9 +66,9 @@
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_pdd_order
        (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time)
        (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time)
        values
        (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderReceiveTime,jdbcType=BIGINT})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"
        useGeneratedKeys="true" keyProperty="id">
@@ -96,6 +98,7 @@
            <if test="orderId != null">po_order_id,</if>
            <if test="createTime != null">po_create_time,</if>
            <if test="updateTime != null">po_update_time,</if>
            <if test="orderReceiveTime != null">po_order_receive_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -123,6 +126,7 @@
            <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderReceiveTime != null">#{orderReceiveTime,jdbcType=BIGINT},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder">update
@@ -149,7 +153,8 @@
        #{orderSettleTime,jdbcType=BIGINT},po_order_id =
        #{orderId,jdbcType=VARCHAR},po_create_time =
        #{createTime,jdbcType=TIMESTAMP},po_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where po_id = #{id,jdbcType=BIGINT}
        #{updateTime,jdbcType=TIMESTAMP},po_order_receive_time =
        #{orderReceiveTime,jdbcType=BIGINT} where po_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder">
        update yeshi_ec_pdd_order
@@ -185,15 +190,19 @@
            <if test="orderId != null">po_order_id=#{orderId,jdbcType=VARCHAR},</if>
            <if test="createTime != null">po_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">po_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderReceiveTime != null">po_order_receive_time=#{orderReceiveTime,jdbcType=BIGINT},</if>
        </set>
        where po_id = #{id,jdbcType=BIGINT}
    </update>
    <!-- 统计 -->
    <sql id="Column_DateType">
        <if test="dateType == 1">FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') AS 'showDate'
        <if test="dateType == 1">FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') AS
            'showDate'
        </if>
        <if test="dateType == 2">FROM_UNIXTIME(po_order_create_time,'%m') AS 'showDate'</if>
        <if test="dateType == 3">FROM_UNIXTIME(po_order_create_time,'%Y') AS 'showDate'</if>
        <if test="dateType == 2">FROM_UNIXTIME(po_order_create_time,'%m') AS 'showDate'
        </if>
        <if test="dateType == 3">FROM_UNIXTIME(po_order_create_time,'%Y') AS 'showDate'
        </if>
    </sql>
    <sql id="Count_Select_DateType">
        <if test="startTime != null and startTime != '' ">
@@ -202,16 +211,18 @@
        <if test="endTime != null and endTime != '' ">
            AND FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}'
        </if>
        <if test="year != null and year != '' ">AND FROM_UNIXTIME(po_order_create_time,'%Y') = '${year}'</if>
        <if test="year != null and year != '' ">AND FROM_UNIXTIME(po_order_create_time,'%Y') = '${year}'
        </if>
    </sql>
    <sql id="Count_Group_DateType">
        <if test="dateType == 1">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d')</if>
        <if test="dateType == 1">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d')
        </if>
        <if test="dateType == 2">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m')</if>
        <if test="dateType == 3">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y')</if>
    </sql>
    <select id="countOrderNumber" resultType="java.util.HashMap">
        SELECT IFNULL(COUNT(`po_id`),0) AS showValue,
        <include refid="Column_DateType" />
@@ -220,6 +231,6 @@
        <include refid="Count_Group_DateType" />
        ORDER BY po_order_create_time
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDebtServiceImpl.java
@@ -9,8 +9,10 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper;
import com.yeshi.fanli.dao.mybatis.money.UserMoneyDebtMapper;
import com.yeshi.fanli.dao.mybatis.money.UserMoneyDebtReturnHistoryMapper;
import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.money.UserMoneyDebt;
import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
@@ -56,6 +58,9 @@
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private AlipayAccountValidNormalHistoryMapper alipayAccountValidNormalHistoryMapper;
    @Override
    public void addUserMoneyDebt(UserMoneyDebt debt) throws UserMoneyDebtException {
@@ -146,8 +151,8 @@
                }
                // 新版通知
                userMoneyMsgNotificationService.fanliOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),Constant.SOURCE_TYPE_TAOBAO, money,
                        userInfoService.getBalance(uid));
                userMoneyMsgNotificationService.fanliOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),
                        Constant.SOURCE_TYPE_TAOBAO, money, userInfoService.getBalance(uid));
                break;
            case HongBaoV2.TYPE_SHARE_GOODS:
@@ -158,8 +163,8 @@
                            weiQuanDrawBack, money);
                    userMoneyService.subUserMoney(uid, money, userMoneyDetail);
                    userMoneyMsgNotificationService.shareOrderWeiQuan(debt.getUid(), weiQuanDrawBack.getOrderId(),Constant.SOURCE_TYPE_TAOBAO,
                            money, userInfoService.getBalance(uid));
                    userMoneyMsgNotificationService.shareOrderWeiQuan(debt.getUid(), weiQuanDrawBack.getOrderId(),
                            Constant.SOURCE_TYPE_TAOBAO, money, userInfoService.getBalance(uid));
                } catch (UserMoneyDetailException e) {
                    throw new UserMoneyDebtException(12, "插入资金详情出错");
@@ -180,10 +185,25 @@
                }
                // 新版通知
                userMoneyMsgNotificationService.inviteOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),Constant.SOURCE_TYPE_TAOBAO, money,
                        userInfoService.getBalance(uid));
                userMoneyMsgNotificationService.inviteOrderWeiQuan(uid, weiQuanDrawBack.getOrderId(),
                        Constant.SOURCE_TYPE_TAOBAO, money, userInfoService.getBalance(uid));
                break;
            }
        } else if (debt.getType() == UserMoneyDebtTypeEnum.extractVerify) {// 提现验证
            // 新版资金记录
            AlipayAccountValidNormalHistory aliPayAccountHistory = alipayAccountValidNormalHistoryMapper
                    .selectByPrimaryKey(debt.getSourceId());
            if (aliPayAccountHistory == null)
                return;
            try {
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractAccountValid(aliPayAccountHistory,
                        money);
                userMoneyService.subUserMoney(aliPayAccountHistory.getUid(), money, userMoneyDetail);
            } catch (UserMoneyDetailException e) {
                throw new UserMoneyDebtException(12, "插入资金详情出错");
            }
            userMoneyMsgNotificationService.alipayAccountValid(aliPayAccountHistory);
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -844,9 +844,17 @@
                    goods = JDUtil.getGoodsFromWeb(itemOrder.getSkuId());
                }
                if (goods == null) {
                    goods = new JDGoods();
                    goods.setSkuName(itemOrder.getSkuName());
                    goods.setPrice(itemOrder.getPrice());
                    goods.setSkuId(itemOrder.getSkuId());
                }
                if (goods != null) {
                    cog = CommonOrderGoodsFactory.create(goods);
                }
                cog.setCreateTime(new Date());
                cog.setUpdateTime(new Date());
                commonOrderGoodsMapper.insertSelective(cog);
@@ -898,10 +906,9 @@
        if (!StringUtil.isNullOrEmpty(commonOrder.getTradeId()))
            oldCommonOrder = commonOrderMapper.selectBySourceTypeAndTradeId(commonOrder.getSourceType(),
                    commonOrder.getTradeId());
        else
            oldCommonOrder = commonOrderMapper.selectByOrderNoAndOrderTypeAndOrderBy(commonOrder.getOrderNo(),
                    commonOrder.getSourceType(), commonOrder.getOrderBy());
        else {
            throw new CommonOrderException(10, "交易ID为空");
        }
        if (oldCommonOrder == null)// 新增
        {
            commonOrder.setCreateTime(new Date());
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -18,6 +18,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.NumberUtil;
import com.google.gson.Gson;
import com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
@@ -463,8 +464,12 @@
    public void weiQuanOrder(List<TaoBaoWeiQuanOrder> orderList) {
        if (orderList != null)
            for (TaoBaoWeiQuanOrder order : orderList) {
                if (order.getState().contains("维权成功")) {
                    CMQManager.getInstance().addWeiQuanOrderMsg(order);
                try {
                    if (order.getState().contains("维权成功")) {
                        CMQManager.getInstance().addWeiQuanOrderMsg(order);
                    }
                } catch (Exception e) {
                    LogHelper.error("维权订单加入到队列出错:"+order!=null?new Gson().toJson(order):null);
                }
            }
    }
@@ -1018,7 +1023,7 @@
        // 加入订单
        Order oldOrder = orderMapper.selectOrderByOrderIdAndOrderType(jdOrder.getOrderId() + "",
                Constant.SOURCE_TYPE_JD);
        if (uid == null && oldOrder.getBeizhu().contains("补单"))
        if (uid == null && oldOrder != null && oldOrder.getBeizhu() != null && oldOrder.getBeizhu().contains("补单"))
            uid = oldOrder.getUserInfo().getId();
        if (uid == null)
@@ -1133,7 +1138,7 @@
        // 加入订单
        Order oldOrder = orderMapper.selectOrderByOrderIdAndOrderType(pddOrder.getOrderSn(), Constant.SOURCE_TYPE_PDD);
        if (uid == null && oldOrder.getBeizhu().contains("补单"))
        if (uid == null && oldOrder != null && oldOrder.getBeizhu() != null && oldOrder.getBeizhu().contains("补单"))
            uid = oldOrder.getUserInfo().getId();
        if (uid == null)
@@ -1207,4 +1212,25 @@
            }
        }
    }
    @Override
    public void repairCommonOrderByByTaoBaoOrder(String orderId) {
        //根据订单号查询淘宝订单
        List<TaoBaoOrder>  orderList=    taoBaoOrderService.getTaoBaoOrderByOrderId(orderId);
        if(orderList!=null)
            for(TaoBaoOrder order:orderList)
            {
                //根据交易ID查询常规订单
            CommonOrder commonOrder=    commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, order.getTradeId());
            //修复orderby
            if(commonOrder!=null)
            {CommonOrder update=new CommonOrder(commonOrder.getId());
            update.setOrderBy(order.getOrderBy());
            update.setUpdateTime(new Date());
            commonOrderService.updateByPrimaryKeySelective(update);
            }
            }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/BindingAccountServiceImpl.java
@@ -24,12 +24,16 @@
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.money.UserMoneyDebt;
import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.exception.AlipayAccountException;
import com.yeshi.fanli.exception.AlipayTransferException;
import com.yeshi.fanli.exception.BindingAccountException;
import com.yeshi.fanli.exception.money.UserMoneyDebtException;
import com.yeshi.fanli.exception.money.UserMoneyDetailException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
@@ -56,6 +60,8 @@
    private UserMoneyService userMoneyService;
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Resource
    private UserMoneyDebtService userMoneyDebtService;
    public List<BindingAccount> getBindingAccountByUid(long uid) {
        return bindingAccountMapper.selectByUid(uid);
@@ -140,7 +146,7 @@
        UserInfo userInfo = userInfoMapper.selectByPrimaryKeyForUpdate(uid);
        if (userInfo.getMyHongBao().compareTo(new BigDecimal("0")) <= 0)
            throw new AlipayAccountException(AlipayAccountException.CODE_NO_MONEY, "你的账户目前没有余额,无需绑定提现帐号。");
            throw new AlipayAccountException(AlipayAccountException.CODE_NO_MONEY, "你的账户无余额,无需绑定提现帐号。");
        // 需要转账验证
        BigDecimal money = new BigDecimal("0.1");
@@ -166,9 +172,27 @@
            }
        }
        // 扣款
        userMoneyService.subUserMoney(uid, money, userMoneyDetail);
        userMoneyMsgNotificationService.alipayAccountValid(history);
        // 余额充足
        if (userInfo.getMyHongBao().compareTo(money) >= 0) {
            // 扣款
            userMoneyService.subUserMoney(uid, money, userMoneyDetail);
            userMoneyMsgNotificationService.alipayAccountValid(history);
        } else {// 余额不足,暂时不扣款,加入借贷关系
            UserMoneyDebt debt = new UserMoneyDebt();
            debt.setCreateTime(new Date());
            debt.setLeftMoney(money);
            debt.setOriginMoney(money);
            debt.setSourceId(history.getId());
            debt.setType(UserMoneyDebtTypeEnum.extractVerify);
            debt.setUid(uid);
            try {
                userMoneyDebtService.addUserMoneyDebt(debt);
            } catch (UserMoneyDebtException e) {
                LogHelper.errorDetailInfo(e, "验证ID:" + history.getId(), "");
            }
        }
    }
    private void transferAlipayWithVerify(String account, String name)
fanli/src/main/java/com/yeshi/fanli/service/inter/order/OrderProcessService.java
@@ -100,5 +100,12 @@
     * @param pddOrder
     */
    public void processPDDOrder(PDDOrder pddOrder);
    /**
     * 根据淘宝订单的排序值修复常规订单的排序值
     * @param orderId
     */
    public void repairCommonOrderByByTaoBaoOrder(String orderId);
}
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
@@ -205,12 +205,13 @@
                public void run() {
                    while (true) {
                        try {
                            // 取16个订单
                            List<String> orderIds = CMQManager.getInstance().consumeTaoBaoOrderMsg(16);
                            Map<String, List<TaoBaoOrder>> map = new HashMap<>();
                            if (orderIds != null) {
                                for (String orderId : orderIds) {
                                    if (NumberUtil.isNumeric(orderId.trim())) {
                                        Map<String, List<TaoBaoOrder>> map = new HashMap<>();
                                        List<TaoBaoOrder> orderList = taoBaoOrderService
                                                .getTaoBaoOrderByOrderId(orderId);
                                        map.put(orderId, orderList);
@@ -569,7 +570,6 @@
                        }
                    } catch (Exception e) {
                        LogHelper.error("还款出错:" + e.getMessage());
                    }
                }
            }
@@ -634,17 +634,12 @@
                                    }
                                    PDDOrderCMQManager.getInstance().deletePDDOrder(key);
                                } catch (Exception e) {
                                    try {
                                        LogHelper.errorDetailInfo(e);
                                    } catch (Exception e1) {
                                        e1.printStackTrace();
                                    }
                                    LogHelper.errorDetailInfo(e);
                                }
                            }
                        }
                    } catch (Exception e) {
                        LogHelper.error("拼多多订单:" + e.getMessage());
                    }
                }
            }
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java
@@ -44,7 +44,10 @@
        } else if (3 == order.getOrderStatus()) {
            state = CommonOrder.STATE_FK;
        } else if (4 == order.getOrderStatus()) {
            state = CommonOrder.STATE_WQ;
            if (order.getOrderReceiveTime() == null || order.getOrderReceiveTime() == 0)
                state = CommonOrder.STATE_SX;
            else
                state = CommonOrder.STATE_WQ;
        } else if (5 == order.getOrderStatus()) {
            state = CommonOrder.STATE_JS;
        } else if (8 == order.getOrderStatus()) {
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java
@@ -28,6 +28,7 @@
import com.yeshi.fanli.dto.jd.JDShopInfo;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.jd.JDOrder;
import com.yeshi.fanli.entity.jd.JDOrderItem;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
@@ -617,6 +618,7 @@
        json.put("orderReq", orderReq);
        String result = baseRequest2("jd.union.open.order.query", null, json);
        System.out.println(result);
        JSONObject root = JSONObject.fromObject(result).optJSONObject("jd_union_open_order_query_response");
        if (root.optInt("code") == 0) {
            boolean hasMore = root.optBoolean("hasMore");
@@ -629,12 +631,33 @@
                List<JDOrder> orderList = new Gson().fromJson(date, typeToken);
                if (orderList != null)
                    for (JDOrder order : orderList) {
                        Map<Long, List<JDOrderItem>> map = new HashMap<>();
                        for (int i = 0; i < order.getOrderItemList().size(); i++) {
                            JDOrderItem orderItem = order.getOrderItemList().get(i);
                            if (map.get(orderItem.getSkuId()) == null)
                                map.put(orderItem.getSkuId(), new ArrayList<>());
                            map.get(orderItem.getSkuId()).add(orderItem);
                            order.getOrderItemList().get(i)
                                    .setTradeId(order.getOrderId() + "-" + order.getOrderItemList().get(i).getSkuId());
                            order.getOrderItemList().get(i).setOrderId(order.getOrderId());
                            order.getOrderItemList().get(i).setOrderBy(i + 1);
                        }
                        // 查询商品ID相同的子订单
                        for (Iterator<Long> its = map.keySet().iterator(); its.hasNext();) {
                            Long skuId = its.next();
                            if (map.get(skuId).size() > 1) {
                                int skuOrderBy = 1;
                                for (int i = 0; i < order.getOrderItemList().size(); i++) {
                                    JDOrderItem orderItem = order.getOrderItemList().get(i);
                                    if (orderItem.getSkuId().longValue() == skuId) {
                                        order.getOrderItemList().get(i).setTradeId(order.getOrderId() + "-"
                                                + order.getOrderItemList().get(i).getSkuId() + "-" + skuOrderBy++);
                                    }
                                }
                            }
                        }
                    }
                return new JDOrderResult(hasMore, orderList);
            }
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -22,7 +22,6 @@
import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
import com.yeshi.fanli.entity.pdd.PDDOrder;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
@@ -337,6 +336,7 @@
        map.put("page", page + "");
        map.put("page_size", pageSize + "");
        String result = baseRequest(map);
        System.out.println(result);
        JSONObject json = JSONObject.fromObject(result);
        JSONObject root = json.optJSONObject("order_list_get_response");
        if (root != null) {