admin
2019-11-06 eed89d185cc54187353b03966296498b8495c442
商城订单相关bug修改
15个文件已修改
318 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/mq/BaseMQMsgBody.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoods.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopOrder.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/email/MailSenderUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/shop/BanLiShopOrderGoodsVOFactory.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/BanLiShopOrderMessageListener.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/env-dev/rocket/consumer.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
@@ -171,7 +171,10 @@
    @RequestMapping(value = "banlishop/pay")
    public void banLiShopPay(HttpServletRequest request, PrintWriter out) {
        Map<String, String> map = WXUtil.parseXML(request);
        JSONObject json = JSONObject.fromObject(map);
        LogHelper.test("商城微信支付回调:" + json.toString());
        String sign = map.get("sign");
        map.remove("sign");
        boolean isSuccess = BanLiShopWXPayUtil.signIsRight(map, sign);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -1077,6 +1077,16 @@
                    data.put("clickUrl", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
                    data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
                    // 测试
                    List<String> commentTexts = new ArrayList<>();
                    commentTexts.add("口令1");
                    commentTexts.add("口令2口令口令淘口令口令口令淘口令");
                    commentTexts.add("口令3");
                    commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
                    data.put("commentTexts", commentTexts);
                    data.put("wxErCode", "这是微信分享二维码内容");
                }
            } else if (cid == 4) { // 邀请分享
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -62,22 +62,21 @@
    @Resource
    private RedPackDetailService redPackDetailService;
    @Resource
    @Resource
    private RedPackGiveRecordService redPackGiveRecordService;
    @Resource
    @Resource
    private RedPackExchangeService redPackExchangeService;
    @Resource
    @Resource
    private RedPackWinInviteService redPackWinInviteService;
    @Resource
    @Resource
    private UserInfoService userInfoService;
    @Resource
    @Resource
    private UserInfoExtraService userInfoExtraService;
    /**
     * 统计
@@ -137,10 +136,10 @@
        tips.add("你也可以选择使用红包,享受给力折扣。");
        String giveMin = redPackConfigService.getValueByKey("give_money_min");
        String giveMax = redPackConfigService.getValueByKey("give_money_max");
        // 正在提现金额
        BigDecimal extractingMoney = redPackExchangeService.countMoneyByUidAndState(uid, RedPackExchange.STATE_INIT);
        JSONObject data = new JSONObject();
        data.put("balance", balance.setScale(2).toString());
        data.put("helpLink", redPackConfigService.getValueByKey("desc_help_link"));
@@ -148,15 +147,15 @@
        data.put("giveMax", giveMax);
        data.put("giveDesc", "注:红包赠送金额至少" + giveMin + "元至多" + giveMax + "元");
        if (extractingMoney != null && extractingMoney.compareTo(zero) > 0)
        if (extractingMoney != null && extractingMoney.compareTo(zero) > 0)
            data.put("extractingInfo", "提现中:¥" + extractingMoney.setScale(2));
        data.put("extractShortage", tips);
        data.put("extractMin", redPackConfigService.getValueByKey("extract_money_min"));
        data.put("extractMax", redPackConfigService.getValueByKey("extract_money_max"));
        data.put("extractBanlenMin", redPackConfigService.getValueByKey("extract_banlen_min"));
        data.put("extractDesc", "注:3个工作日内完成审核,红包提现成功后将会进入到余额。");
        data.put("useLink", redPackConfigService.getValueByKey("use_link"));
        data.put("todayWin", todayWin.setScale(2).toString());
@@ -175,9 +174,12 @@
     * 
     * @param acceptData
     * @param uid
     * @param index      List最末的主键ID
     * @param year       年份
     * @param month      月份
     * @param index
     *            List最末的主键ID
     * @param year
     *            年份
     * @param month
     *            月份
     * @param out
     */
    @RequestMapping(value = "getMoneyDetails")
@@ -243,7 +245,6 @@
            }
        });
        Gson gson = gsonBuilder.create();
        JSONObject data = new JSONObject();
@@ -275,10 +276,9 @@
        }
    }
    /**
     * 转换红包为真实金钱
     *
     * @param acceptData
     * @param uid
     * @param amount
@@ -298,32 +298,33 @@
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
        }
    }
    /**
     * 红包邀请进度
     *
     * @param acceptData
     * @param page
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getRewardList", method = RequestMethod.POST)
    public void getRewardList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
    @RequestMapping(value = "getRewardList")
    public void getRewardList(AcceptData acceptData, Integer page, Long uid, String callback, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (page == null || page < 1) {
            out.print(JsonUtil.loadFalseResult(1, "页码不正确"));
            return;
        }
        List<RedPackWinInviteVO> list = new ArrayList<RedPackWinInviteVO>();
        List<RedPackWinInvite> listRecord = redPackWinInviteService.getRewardList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
        List<RedPackWinInvite> listRecord = redPackWinInviteService.getRewardList((page - 1) * Constant.PAGE_SIZE,
                Constant.PAGE_SIZE, uid);
        if (listRecord != null && !listRecord.isEmpty()) {
            for (RedPackWinInvite record: listRecord) {
            for (RedPackWinInvite record : listRecord) {
                UserInfo user = null;
                RedPackWinInviteVO winVO = new RedPackWinInviteVO();
                RedPackWinInviteTypeEnum type = record.getType();
@@ -339,27 +340,29 @@
                list.add(winVO);
            }
        }
        JSONObject data = new JSONObject();
        data.put("count", redPackWinInviteService.countRewardRecord(uid));
        data.put("list", JsonUtil.getApiCommonGson().toJson(list));
        out.print(JsonUtil.loadTrueResult(data));
        data.put("list", JsonUtil.getApiCommonGson().toJson(list));
        if (!StringUtil.isNullOrEmpty(callback)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        } else
            out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 用户基础信息
     *
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getBasicInfo", method = RequestMethod.POST)
    public void getBasicInfo(AcceptData acceptData, Long uid, PrintWriter out) {
    @RequestMapping(value = "getBasicInfo")
    public void getBasicInfo(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("balance", redPackBalanceService.getBalance(uid));
        data.put("ruleLink", redPackConfigService.getValueByKey("invite_reward_rule_link"));
@@ -369,6 +372,10 @@
        } else {
            data.put("inviteCode", "");
        }
        out.print(JsonUtil.loadTrueResult(data));
        if (!StringUtil.isNullOrEmpty(callback)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        } else
            out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/mq/BaseMQMsgBody.java
@@ -2,7 +2,7 @@
import com.yeshi.fanli.util.Constant;
public abstract class BaseMQMsgBody {
public  class BaseMQMsgBody {
    private boolean test;// 是否是测试
    public BaseMQMsgBody() {
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoods.java
@@ -39,7 +39,8 @@
    private Date updateTime;
    @Column(name = "sg_weight")
    private Integer weight;
    @Column(name = "so_square_picture")
    private String squarePicture;// 方形图片
    // 套餐
    private List<BanLiShopGoodsSets> setsList;
    // 图片
@@ -155,4 +156,12 @@
    public void setWeight(Integer weight) {
        this.weight = weight;
    }
    public String getSquarePicture() {
        return squarePicture;
    }
    public void setSquarePicture(String squarePicture) {
        this.squarePicture = squarePicture;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopOrder.java
@@ -44,13 +44,13 @@
    private BigDecimal hongBaoPayment;// 红包支付金额
    @Column(name = "so_payment_hongbao_state")
    private Integer hongBaoPaymentState;// 支付金额状态
    @Column(name = "so_payment_money")
    private BigDecimal balancePayment;// 余额支付金额
    @Column(name = "so_payment_money_state")
    private Integer balancePaymentState;// 余额金额状态
    @Column(name = "so_payment_balance")
    private BigDecimal moneyPayment;// 现金支付金额
    private BigDecimal balancePayment;// 余额支付金额
    @Column(name = "so_payment_balance_state")
    private Integer balancePaymentState;// 余额金额状态
    @Column(name = "so_payment_money")
    private BigDecimal moneyPayment;// 现金支付金额
    @Column(name = "so_payment_money_state")
    private Integer moneyPaymentState;// 现金金额状态
    @Column(name = "so_pay_time")
    private Date payTime;// 订单支付时间
@@ -64,7 +64,6 @@
    private String stateDesc;// 状态简介
    @Column(name = "so_charge_account_type")
    private ChargeTypeEnum chargeAccountType;// 充值账号类型
    @Column(name = "so_charge_account")
    private String chargeAccount;// 充值账号
    @Column(name = "so_charge_account2")
@@ -78,6 +77,7 @@
    @Column(name = "so_order_goods_id")
    private BanLiShopOrderGoods orderGoods;
    public BanLiShopOrderGoods getOrderGoods() {
        return orderGoods;
    }
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml
@@ -13,11 +13,12 @@
        <result column="sg_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="sg_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="sg_weight" property="weight" jdbcType="INTEGER" />
        <result column="so_square_picture" property="squarePicture"
            jdbcType="VARCHAR" />
        <association property="goodsClass" column="sg_class_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass">
            <id column="sg_class_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <resultMap id="BaseResultDetailMap" type="com.yeshi.fanli.entity.shop.BanLiShopGoods">
        <id column="sg_id" property="id" jdbcType="BIGINT" />
@@ -30,6 +31,8 @@
        <result column="sg_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="sg_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="sg_weight" property="weight" jdbcType="INTEGER" />
        <result column="so_square_picture" property="squarePicture"
            jdbcType="VARCHAR" />
        <association property="goodsClass" column="sg_class_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass"
            select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper.selectByPrimaryKey" />
@@ -38,7 +41,7 @@
        <collection property="imgList" column="sg_id"
            select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsImgMapper.listByGoodsId" />
    </resultMap>
    <sql id="Base_Column_List">sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight
    <sql id="Base_Column_List">sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight,so_square_picture
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -52,34 +55,24 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods where sg_id = #{0}
    </select>
    <select id="listGoods" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods where sg_title like '${key}%'
        <if test="state!=null">
            and sg_state=#{state}
        </if>
        <if test="state!=null">and sg_state=#{state}</if>
        order by sg_weight desc limit #{start},#{count}
    </select>
    <select id="countGoods" resultType="java.lang.Long">
        select
        count(*)
        from yeshi_ec_shop_goods where sg_title like '${key}%'
        <if test="state!=null">
            and sg_state=#{state}
        </if>
        select count(*) from yeshi_ec_shop_goods where sg_title like '${key}%'
        <if test="state!=null">and sg_state=#{state}</if>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT}
    </delete>
        yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_shop_goods
        (sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight)
        (sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight,so_square_picture)
        values
        (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsClass.id,jdbcType=BIGINT},#{salesCount,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR},#{chargeType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER})
        (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsClass.id,jdbcType=BIGINT},#{salesCount,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR},#{chargeType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER},#{squarePicture,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods"
        useGeneratedKeys="true" keyProperty="id">
@@ -96,6 +89,7 @@
            <if test="createTime != null">sg_create_time,</if>
            <if test="updateTime != null">sg_update_time,</if>
            <if test="weight != null">sg_weight,</if>
            <if test="squarePicture != null">so_square_picture,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -110,6 +104,7 @@
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER}</if>
            <if test="squarePicture != null">#{squarePicture,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods">update
@@ -123,7 +118,8 @@
        #{state,jdbcType=INTEGER},sg_create_time =
        #{createTime,jdbcType=TIMESTAMP},sg_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,sg_weight
        =#{weight,jdbcType=INTEGER} where sg_id = #{id,jdbcType=BIGINT}
        =#{weight,jdbcType=INTEGER} ,so_square_picture
        =#{squarePicture,jdbcType=VARCHAR} where sg_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
        update yeshi_ec_shop_goods
@@ -138,6 +134,8 @@
            <if test="createTime != null">sg_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">sg_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight !=null">sg_weight =#{weight,jdbcType=INTEGER},</if>
            <if test="squarePicture !=null">so_square_picture =#{squarePicture,jdbcType=VARCHAR},
            </if>
        </set>
        where sg_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml
@@ -10,13 +10,13 @@
            jdbcType="DECIMAL" />
        <result column="so_payment_hongbao_state" property="hongBaoPaymentState"
            jdbcType="INTEGER" />
        <result column="so_payment_money" property="balancePayment"
        <result column="so_payment_money" property="moneyPayment"
            jdbcType="DECIMAL" />
        <result column="so_payment_money_state" property="balancePaymentState"
        <result column="so_payment_money_state" property="moneyPaymentState"
            jdbcType="INTEGER" />
        <result column="so_payment_balance" property="moneyPayment"
        <result column="so_payment_balance" property="balancePayment"
            jdbcType="DECIMAL" />
        <result column="so_payment_balance_state" property="moneyPaymentState"
        <result column="so_payment_balance_state" property="balancePaymentState"
            jdbcType="INTEGER" />
        <result column="so_pay_time" property="payTime" jdbcType="TIMESTAMP" />
        <result column="so_reject_time" property="rejectTime" jdbcType="TIMESTAMP" />
@@ -93,7 +93,7 @@
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_shop_order
        (so_id,so_uid,so_order_no,so_goods_id,so_goods_set_id,so_payment_hongbao,so_payment_hongbao_state,so_payment_money,so_payment_money_state,so_payment_balance,so_payment_balance_state,so_pay_time,so_reject_time,so_success_time,so_state,so_state_desc,so_charge_account,so_charge_account2,so_beizhu,so_create_time,so_update_time,so_order_goods_id,so_charge_account_type)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{goods.id,jdbcType=BIGINT},#{goodsSet.id,jdbcType=BIGINT},#{hongBaoPayment,jdbcType=DECIMAL},#{hongBaoPaymentState,jdbcType=INTEGER},#{balancePayment,jdbcType=DECIMAL},#{balancePaymentState,jdbcType=INTEGER},#{moneyPayment,jdbcType=DECIMAL},#{moneyPaymentState,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP},#{rejectTime,jdbcType=TIMESTAMP},#{successTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{chargeAccount,jdbcType=VARCHAR},#{chargeAccount2,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderGoods.id,jdbcType=BIGINT},#{chargeAccountType,jdbcType=VARCHAR})
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{goods.id,jdbcType=BIGINT},#{goodsSet.id,jdbcType=BIGINT},#{hongBaoPayment,jdbcType=DECIMAL},#{hongBaoPaymentState,jdbcType=INTEGER},#{moneyPayment,jdbcType=DECIMAL},#{moneyPaymentState,jdbcType=INTEGER},#{balancePayment,jdbcType=DECIMAL},#{balancePaymentState,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP},#{rejectTime,jdbcType=TIMESTAMP},#{successTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{chargeAccount,jdbcType=VARCHAR},#{chargeAccount2,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderGoods.id,jdbcType=BIGINT},#{chargeAccountType,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder"
        useGeneratedKeys="true" keyProperty="id">
@@ -106,10 +106,10 @@
            <if test="goodsSet != null">so_goods_set_id,</if>
            <if test="hongBaoPayment != null">so_payment_hongbao,</if>
            <if test="hongBaoPaymentState != null">so_payment_hongbao_state,</if>
            <if test="balancePayment != null">so_payment_money,</if>
            <if test="balancePaymentState != null">so_payment_money_state,</if>
            <if test="moneyPayment != null">so_payment_balance,</if>
            <if test="moneyPaymentState != null">so_payment_balance_state,</if>
            <if test="balancePayment != null"> so_payment_balance,</if>
            <if test="balancePaymentState != null">so_payment_balance_state,</if>
            <if test="moneyPayment != null">so_payment_money,</if>
            <if test="moneyPaymentState != null">so_payment_money_state,</if>
            <if test="payTime != null">so_pay_time,</if>
            <if test="rejectTime != null">so_reject_time,</if>
            <if test="successTime != null">so_success_time,</if>
@@ -157,10 +157,10 @@
        #{goodsSet.id,jdbcType=BIGINT},so_payment_hongbao =
        #{hongBaoPayment,jdbcType=DECIMAL},so_payment_hongbao_state =
        #{hongBaoPaymentState,jdbcType=INTEGER},so_payment_money =
        #{balancePayment,jdbcType=DECIMAL},so_payment_money_state =
        #{balancePaymentState,jdbcType=INTEGER},so_payment_balance =
        #{moneyPayment,jdbcType=DECIMAL},so_payment_balance_state =
        #{moneyPaymentState,jdbcType=INTEGER},so_pay_time =
        #{moneyPayment,jdbcType=DECIMAL},so_payment_money_state =
        #{moneyPaymentState,jdbcType=INTEGER},so_payment_balance =
        #{balancePayment,jdbcType=DECIMAL},so_payment_balance_state =
        #{balancePaymentState,jdbcType=INTEGER},so_pay_time =
        #{payTime,jdbcType=TIMESTAMP},so_reject_time =
        #{rejectTime,jdbcType=TIMESTAMP},so_success_time =
        #{successTime,jdbcType=TIMESTAMP},so_state =
@@ -185,11 +185,11 @@
            </if>
            <if test="hongBaoPaymentState != null">so_payment_hongbao_state=#{hongBaoPaymentState,jdbcType=INTEGER},
            </if>
            <if test="balancePayment != null">so_payment_money=#{balancePayment,jdbcType=DECIMAL},</if>
            <if test="balancePaymentState != null">so_payment_money_state=#{balancePaymentState,jdbcType=INTEGER},
            <if test="balancePayment != null">so_payment_balance=#{balancePayment,jdbcType=DECIMAL},</if>
            <if test="balancePaymentState != null">so_payment_balance_state=#{balancePaymentState,jdbcType=INTEGER},
            </if>
            <if test="moneyPayment != null">so_payment_balance=#{moneyPayment,jdbcType=DECIMAL},</if>
            <if test="moneyPaymentState != null">so_payment_balance_state=#{moneyPaymentState,jdbcType=INTEGER},
            <if test="moneyPayment != null">so_payment_money=#{moneyPayment,jdbcType=DECIMAL},</if>
            <if test="moneyPaymentState != null">so_payment_money_state=#{moneyPaymentState,jdbcType=INTEGER},
            </if>
            <if test="payTime != null">so_pay_time=#{payTime,jdbcType=TIMESTAMP},</if>
            <if test="rejectTime != null">so_reject_time=#{rejectTime,jdbcType=TIMESTAMP},</if>
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java
@@ -165,7 +165,8 @@
        BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
        if (order == null)
            throw new BanLiShopOrderException(1, "订单不存在");
        if (order.getState() != BanLiShopOrder.STATE_REJECT)
        if (order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_FAIL
                || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_SUCCESS)
            throw new BanLiShopOrderException(2, "订单未被拒绝/订单已退款");
        BanLiShopOrder update = new BanLiShopOrder();
@@ -205,7 +206,7 @@
                    BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
                    Message message = new Message(MQTopicName.TOPIC_ORDER.name(),
                            OrderTopicTagEnum.banLiShopOrderRefund.name(), new Gson().toJson(msg).getBytes());
                    message.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L);// 延时24小时通知检测微信退款状态
                    message.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60 *5L);// 延时24小时通知检测微信退款状态
                    SendResult result = producer.send(message);
                    if (result == null) {
                        throw new BanLiShopOrderException(8, "消息发送失败");
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java
@@ -10,6 +10,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.yeshi.utils.exception.WXOrderException;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.Producer;
@@ -45,6 +46,7 @@
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
import com.yeshi.fanli.util.shop.BanLiShopOrderUtil;
import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
@Service
public class BanLiShopOrderServiceImpl implements BanLiShopOrderService {
@@ -151,6 +153,7 @@
        orderGoods.setSetName(set.getName());
        orderGoods.setState(set.getState());
        orderGoods.setZkPrice(set.getZkPrice());
        orderGoods.setPicture(goods.getSquarePicture());
        banLiShopOrderGoodsMapper.insertSelective(orderGoods);
        return orderGoods;
    }
@@ -319,6 +322,28 @@
        // 判断是否处于未付款
        if (order.getState() == BanLiShopOrder.STATE_NO_PAY) {
            /**
             * 查询是否已经微信支付
             */
            if (order.getMoneyPayment() != null) {
                try {
                    boolean isS = BanLiShopWXPayUtil.isPaySuccess(order.getOrderNo());
                    if (isS)// 支付成功,重新发送支付成功消息
                    {
                        BanLiShopOrderMQMsg msg = new BanLiShopOrderMQMsg(order.getId(), order.getUid());
                        Message message = new Message(MQTopicName.TOPIC_ORDER.name(),
                                OrderTopicTagEnum.banLiShopOrderPaid.name(), new Gson().toJson(msg).getBytes());
                        producer.send(message);
                        return;
                    }
                } catch (WXOrderException e) {
                    e.printStackTrace();
                } catch (Exception e) {
                }
            }
            BanLiShopOrder update = new BanLiShopOrder();
            update.setId(id);
            update.setStateDesc(desc);
fanli/src/main/java/com/yeshi/fanli/util/email/MailSenderUtil.java
@@ -99,7 +99,7 @@
            String content) {
        try {
            String url = String.format(
                    "http://111.230.142.62:8089/BuWan/email/sendEmail?fromAccount=%s&fromPwd=%s&toAccount=%s&title=%s&content=%s",
                    "http://193.112.34.40:9001/BuWan/email/sendEmail?fromAccount=%s&fromPwd=%s&toAccount=%s&title=%s&content=%s",
                    URLEncoder.encode(fromEmail, "UTF-8"), URLEncoder.encode(fromEmailPwd, "UTF-8"),
                    URLEncoder.encode(toEmail, "UTF-8"), URLEncoder.encode(title, "UTF-8"),
                    URLEncoder.encode(content, "UTF-8"));
fanli/src/main/java/com/yeshi/fanli/util/factory/shop/BanLiShopOrderGoodsVOFactory.java
@@ -36,21 +36,36 @@
        vo.setOrderId(order.getOrderNo());
        vo.setOrderTime(TimeUtil.getGernalTime(order.getCreateTime().getTime(), "yyyy-MM-dd HH:mm:ss"));
        // 需要确定订单状态输出
        if (order.getState() == BanLiShopOrder.STATE_INVALID) {
            vo.setState("订单失效");
            vo.setStateColor("#E5005C");
            vo.setStateDesc("未成功支付");
        if (order.getState() == BanLiShopOrder.STATE_INVALID || order.getState() == BanLiShopOrder.STATE_NO_PAY) {
            vo.setState("未付款");
            vo.setStateColor("#e5005c");
        } else if (order.getState() == BanLiShopOrder.STATE_PART_PAY) {
            vo.setState("未实付");
            vo.setStateColor("#e5005c");
        } else if (order.getState() == BanLiShopOrder.STATE_SUCCESS) {
            vo.setState("充值成功");
            vo.setStateColor("#2FB102");
            vo.setStateDesc("");
        } else {
            vo.setState("充值成功");
            vo.setStateColor("#2FB102");
            vo.setStateDesc("");
        } else if (order.getState() == BanLiShopOrder.STATE_REJECT
                || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_FAIL
                || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_PART_SUCCESS
                || order.getState() == BanLiShopOrder.STATE_REJECT_REFUND_SUCCESS) {// 拒绝了
            vo.setState("充值失败");
            vo.setStateColor("#e5005c");
        } else if (order.getState() == BanLiShopOrder.STATE_PAID) {
            vo.setState("审核中");
            vo.setStateColor("#777777");
        }
        vo.setStateDesc("实付款 ¥" + getPaidMoney(order));
        return vo;
    }
    private static String getPaidMoney(BanLiShopOrder order) {
        if (order.getMoneyPaymentState() == null || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_NOPAY
                || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_REFUND) {
            return "0";
        } else
            return order.getMoneyPayment().toString();
    }
}
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/BanLiShopOrderMessageListener.java
@@ -12,7 +12,10 @@
import com.yeshi.fanli.dto.mq.BaseMQMsgBody;
import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderPayService;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
@@ -29,15 +32,23 @@
    @Resource
    private BanLiShopOrderService banLiShopOrderService;
    @Resource
    private BanLiShopOrderPayService banLiShopOrderPayService;
    public BanLiShopOrderMessageListener() {
    }
    @Override
    public Action consume(Message message, ConsumeContext context) {
        BaseMQMsgBody baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
        if (baseBody.isTest() != Constant.IS_TEST)
            return Action.ReconsumeLater;
        BaseMQMsgBody baseBody = null;
        try {
            baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
            if (baseBody.isTest() != Constant.IS_TEST)
                return Action.ReconsumeLater;
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogHelper.mqInfo("consumer:BanLiShopOrderMessageListener", message.getTopic(), message.getTag(),
                new String(message.getBody()));
        String tag = message.getTag();
@@ -50,7 +61,27 @@
                    // 使订单失效
                    banLiShopOrderService.invalidOrderByOrderId(banLiShopOrderMQMsg.getOrderId(), "订单失效-长期未付款");
                return Action.CommitMessage;
            } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.banLiShopOrderPaid.name()))// 商城订单付款成功
            {
                BanLiShopOrderMQMsg msg = new Gson().fromJson(new String(message.getBody()), BanLiShopOrderMQMsg.class);
                BanLiShopOrder banLiOrder = banLiShopOrderService.selectByPrimaryKey(msg.getOrderId());
                try {
                    banLiShopOrderPayService.payOrderByMoney(banLiOrder.getId(), banLiOrder.getMoneyPayment());
                } catch (BanLiShopOrderException e) {
                    e.printStackTrace();
                }
                return Action.CommitMessage;
            } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.banLiShopOrderRefund.name()))// 商城退款订阅
            {
                BanLiShopOrderMQMsg msg = new Gson().fromJson(new String(message.getBody()), BanLiShopOrderMQMsg.class);
                try {
                    banLiShopOrderPayService.refund(msg.getOrderId());
                } catch (BanLiShopOrderException e) {
                    e.printStackTrace();
                }
                return Action.CommitMessage;
            }
        }
        return Action.CommitMessage;
    }
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java
@@ -79,6 +79,19 @@
    }
    /**
     * 是否支付成功
     *
     * @param orderNo
     * @return
     * @throws WXOrderException
     */
    public static boolean isPaySuccess(String orderNo) throws WXOrderException {
        return WXPayUtil.isPaySuccess(BanLiShopOrderUtil.getWXPayOrderNo(orderNo),
                new WXAPPInfo(Constant.getWXAccount(null, null).getGzAppId(),
                        Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY));
    }
    /**
     * 签名是否正确
     * 
     * @param params
fanli/src/main/resource/env-dev/rocket/consumer.xml
@@ -49,7 +49,7 @@
    <bean id="banLiShopOrderMessageListener"
        class="com.yeshi.fanli.util.rocketmq.consumer.order.BanLiShopOrderMessageListener"></bean> <!--Listener 配置 -->
    <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
    <bean id="orderTransactionConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
    <bean id="banLiShopOrderConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
        init-method="start" destroy-method="shutdown">
        <property name="properties"> <!--消费者配置信息 -->
            <props>
@@ -63,12 +63,12 @@
        </property>
        <property name="subscriptionTable">
            <map>
                <!-- 订阅下单延时消息 -->
                <entry value-ref="inviteOrderSubsidyMsgListener">
                <!-- 订阅下单延时消息,订单支付成功消息 -->
                <entry value-ref="banLiShopOrderMessageListener">
                    <key>
                        <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
                            <property name="topic" value="TOPIC_ORDER" />
                            <property name="expression" value="banLiShopOrderDelay" /><!--expression
                            <property name="expression" value="banLiShopOrderDelay||banLiShopOrderPaid||banLiShopOrderRefund" /><!--expression
                                即 Tag,可以设置成具体的 Tag,如 taga||tagb||tagc,也可设置成 *。 * 仅代表订阅所有 Tag,不支持通配 -->
                        </bean>
                    </key>