yujian
2019-11-11 fdb089cb8bee6099efcbd7b0ca2672c63cbb6784
Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div

# Conflicts:
# fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java
29个文件已修改
2个文件已添加
773 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopOrderAdminController.java 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopOrderMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopOrder.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/shop/FuLuChargeException.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/MQJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderPayService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderService.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/charge/FuLuChargeApiUtil.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/shop/BanLiShopOrderGoodsVOFactory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/BanLiShopOrderMessageListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/redpack/RedPackMessageListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/homemodule/FloatImgDetailVO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/wx/WXPayUtil.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopOrderAdminController.java
New file
@@ -0,0 +1,177 @@
package com.yeshi.fanli.controller.admin.shop;
import java.io.PrintWriter;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderPayService;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/blOrder")
public class BanLiShopOrderAdminController {
    @Resource
    private BanLiShopOrderService banLiShopOrderService;
    @Resource
    private BanLiShopOrderPayService banLiShopOrderPayService;
    @Resource
    private UserInfoService userInfoService;
    /**
     * 获取订单列表
     *
     * @param callback
     * @param orderId
     *            -订单号 可为空
     * @param page
     *            -页码
     * @param state-状态数组
     *            [1,2]
     * @param uid
     *            用户ID
     * @param out
     */
    @RequestMapping(value = "listOrder")
    public void listOrder(String callback, String orderId, int page, String state, Long uid, PrintWriter out) {
        long count = 0;
        List<BanLiShopOrder> orderList = new ArrayList<>();
        if (!StringUtil.isNullOrEmpty(orderId)) {
            BanLiShopOrder order = banLiShopOrderService.selectByOrderNo(orderId);
            if (order != null) {
                orderList.add(order);
                count = 1;
            }
        } else {
            List<Integer> stateList = null;
            if (!StringUtil.isNullOrEmpty(state)) {
                net.sf.json.JSONArray array = net.sf.json.JSONArray.fromObject(state);
                for (int i = 0; i < array.size(); i++) {
                    if (stateList == null)
                        stateList = new ArrayList<>();
                    stateList.add(array.optInt(i));
                }
            }
            orderList = banLiShopOrderService.listByUidAndState(uid, stateList, page, Constant.PAGE_SIZE);
            count = banLiShopOrderService.countByUidAndState(uid, stateList);
        }
        GsonBuilder gb = new GsonBuilder();
        gb.registerTypeAdapter(java.util.Date.class, new JsonSerializer<Date>() {
            public JsonElement serialize(Date arg0, Type arg1, JsonSerializationContext arg2) {
                return new JsonPrimitive(TimeUtil.getGernalTime(arg0.getTime(), "yyyy-MM-dd HH:mm:ss"));
            }
        });
        PageEntity pe = new PageEntity(page, Constant.PAGE_SIZE, count,
                (int) (count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1));
        Gson gson = gb.create();
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("list", gson.toJson(orderList));
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
    }
    // 订单充值
    @RequestMapping(value = "charge")
    public void charge(String callback, Long id, String code, HttpServletRequest request, PrintWriter out) {
        /* 检验是否登陆 */
        AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
        if (admin == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆。"));
            return;
        }
        /* 检验是否通过验证 */
        String codeType = (String) request.getSession().getAttribute(Constant.SESSION_EXTRACT_VERIFY_RESULT);
        if (!"1".equals(codeType)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(9999, "邮箱验证未通过"));
            return;
        }
        try {
            banLiShopOrderPayService.charge(id);
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
        } catch (BanLiShopOrderException e) {
            e.printStackTrace();
            BanLiShopOrder order = new BanLiShopOrder(id);
            String stateDesc = String.format("错误码:%s 错误原因:%s", e.getCode() + "", e.getMsg());
            order.setStateDesc(stateDesc);
            order.setUpdateTime(new Date());
            banLiShopOrderService.udpateSelectiveByPrimaryKey(order);
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg())));
        }
    }
    @RequestMapping(value = "reject")
    public void reject(String callback, Long id, String desc,HttpServletRequest request, PrintWriter out) {
        /* 检验是否登陆 */
        AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
        if (admin == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("当前账户失效,请重新登陆。"));
            return;
        }
        /* 检验是否通过验证 */
        String codeType = (String) request.getSession().getAttribute(Constant.SESSION_EXTRACT_VERIFY_RESULT);
        if (!"1".equals(codeType)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(9999, "邮箱验证未通过"));
            return;
        }
        try {
            banLiShopOrderService.rejectOrder(id, desc);
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
        } catch (BanLiShopOrderException e) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg())));
        }
    }
    @RequestMapping(value = "getOrderDetail")
    public void getOrderDetail(String callback, Long id, PrintWriter out) {
        BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKey(id);
        if (order == null) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1, "订单不存在")));
            return;
        }
        // 查询用户信息
        UserInfo user = userInfoService.selectByPKey(order.getUid());
        JSONObject data = new JSONObject();
        data.put("order", order);
        data.put("user", user);
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java
@@ -15,6 +15,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.redpack.RedPackBalance;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
@@ -76,7 +77,7 @@
     * @param out
     */
    @RequestMapping(value = "goodsList")
    public void goodsList(AcceptData acceptData, int page, String callback, PrintWriter out) {
    public void goodsList(AcceptData acceptData, int page,Long uid, String callback, PrintWriter out) {
        if (page <= 0)
            page = 1;
        List<BanLiShopGoods> goodsList = banLiShopGoodsService.listGoods(null, BanLiShopGoods.STATE_ONLINE, page,
@@ -91,6 +92,14 @@
        }
        data.put("data", goodsList);
        data.put("count", count);
        RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
        if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
            data.put("redPackLock", true);
        } else {
            data.put("redPackLock", false);
        }
        if (!StringUtil.isNullOrEmpty(callback))
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        else
@@ -115,6 +124,7 @@
                            try {
                                banLiShopOrderPayService.payOrderByMoney(latestOrder.getId(),
                                        latestOrder.getMoneyPayment());
                                orderList = banLiShopOrderService.listByUid(uid, page, Constant.PAGE_SIZE);
                            } catch (BanLiShopOrderException e) {
                                e.printStackTrace();
                            }
@@ -124,7 +134,6 @@
                    }
                }
            }
        }
        List<BanLiShopOrderVO> voList = new ArrayList<>();
@@ -218,7 +227,7 @@
            if (order.getMoneyPayment() != null && order.getMoneyPayment().compareTo(new BigDecimal(0)) > 0) {
                // 走微信支付
                String payUrl = BanLiShopWXPayUtil.getWXH5PayUrl(order.getOrderNo(), request.getRemoteAddr(),
                        order.getOrderGoods().getGoodsName(), order.getMoneyPayment());
                        order.getOrderGoods().getGoodsName(), order.getMoneyPayment(), acceptData.getPlatform());
                if (StringUtil.isNullOrEmpty(payUrl)) {
                    if (!StringUtil.isNullOrEmpty(callback))
                        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(102, "微信支付创建失败")));
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -17,6 +17,7 @@
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.fasterxml.jackson.core.util.VersionUtil;
import com.yeshi.fanli.controller.client.v2.ShareControllerV2;
import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
@@ -1073,7 +1074,8 @@
                    }
                    TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
                    TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
                    if (!com.yeshi.fanli.util.VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(),
                            acceptData.getVersion()))
                    data.put("clickUrl", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
                    data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
@@ -1084,8 +1086,7 @@
                    commentTexts.add("口令3");
                    commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
                    data.put("commentTexts", commentTexts);
                    data.put("wxErCode", "这是微信分享二维码内容");
                    data.put("wxErCode", ShareControllerV2.getERCodeContent(goods, taoBaoLink.getTaoToken()));
                    
                }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -80,7 +80,6 @@
    @Resource
    private RedPackWinNewUserService redPackWinNewUserService;
    
    /**
     * s 首页配置信息
     * 
@@ -145,7 +144,6 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * s 首页配置信息
     * 
@@ -182,6 +180,10 @@
                floatImgVO.setJumpDetail(jumpDetail);
                floatImgVO.setShowTime(floatAD.getShowMode());
                floatImgVO.setAccountLogin(floatAD.isJumpNeedLogin());
                if (floatAD.getPlaySound() != null)
                    floatImgVO.setPlaySound(floatAD.getPlaySound());// 默认都播放音效
                else
                    floatImgVO.setPlaySound(false);
                listVO.add(floatImgVO);
            }
        }
@@ -192,7 +194,6 @@
        // 领券帮助链接,1.5.2后生效
        String couponHelp = configService.get("taobao_coupon_help");
        data.put("couponHelpUrl", couponHelp);
        
        // 判断新老用户 显示热门功能按钮滑动
        UserActiveLog da = null;
@@ -211,7 +212,6 @@
                configService.getByVersion("hot_function_url", platform, Integer.parseInt(acceptData.getVersion())));
        out.print(JsonUtil.loadTrueResult(data));
    }
    
    /**
     * 消息中心弹框
@@ -316,7 +316,8 @@
            data.put("goodsDetail", false);// 不需要拦截商品详情
        }
//TODO 前端需要处理        
//        if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
        // if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(),
        // acceptData.getVersion())) {
//            JSONObject js = new JSONObject();
//            String jsStr = configService.get("url_extract_id");
//            String md5 = StringUtil.Md5(jsStr);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -29,6 +29,7 @@
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.redpack.RedPackBalance;
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackExchange;
import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
@@ -380,10 +381,18 @@
            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"));
        data.put("shareLink", UserInviteUtil.getShareUrl(uid));
        RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
        if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
            data.put("redPackLock", true);
        } else {
            data.put("redPackLock", false);
        }
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
@@ -398,9 +407,9 @@
            out.print(JsonUtil.loadTrueResult(data));
    }
    
    /**
     * 新人红包详情
     *
     * @param acceptData
     * @param uid
     * @param out
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -67,6 +67,7 @@
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
@@ -264,7 +265,6 @@
            commentTexts.add("口令3");
            commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
            shareInfo.setCommentTexts(commentTexts);
            shareInfo.setWxErCode("这是微信分享二维码内容");
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
@@ -318,8 +318,12 @@
            }
            shareInfo.setDescText(descText);
            // 测试
            // 2.0.2之前
            if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
            shareInfo.setClickUrl(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
            shareInfo.setWxErCode(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
            // 提示图文内容
            String imgs = configService.get("goods_share_notify_imgs");
            JSONArray array = JSONArray.fromObject(imgs);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopOrderMapper.java
@@ -20,7 +20,7 @@
     * @param count
     * @return
     */
    List<BanLiShopOrder> listByUid(@Param("stateList") List<Integer> stateList, @Param("uid") Long uid,
    List<BanLiShopOrder> listByUidAndState(@Param("stateList") List<Integer> stateList, @Param("uid") Long uid,
            @Param("start") long start, @Param("count") int count);
    /**
@@ -30,10 +30,11 @@
     * @param uid
     * @return
     */
    long countByUid(@Param("stateList") List<Integer> stateList, @Param("uid") Long uid);
    long countByUidAndState(@Param("stateList") List<Integer> stateList, @Param("uid") Long uid);
    
    /**
     * 根据订单号查询
     *
     * @param orderNo
     * @return
     */
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java
@@ -88,6 +88,9 @@
    @Column(name = "fa_state")
    private Integer state;
    @Column(name = "fa_play_sound")
    private Boolean playSound;//是否播放音效
    // 创建时间
    @Column(name = "fa_create_time")
    private Date createTime;
@@ -239,4 +242,12 @@
        this.type = type;
    }
    
    public Boolean getPlaySound() {
        return playSound;
    }
    public void setPlaySound(Boolean playSound) {
        this.playSound = playSound;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopOrder.java
@@ -30,6 +30,14 @@
    public final static int STATE_REJECT_REFUND_FAIL = 15;// 审核拒绝-退款失败
    public final static int STATE_SUCCESS = 20;// 交易成功
    public BanLiShopOrder(Long id) {
        super();
        this.id = id;
    }
    public BanLiShopOrder() {
    }
    @Column(name = "so_id")
    private Long id;
    @Column(name = "so_uid")
@@ -76,7 +84,6 @@
    private Date updateTime;// 更新时间
    @Column(name = "so_order_goods_id")
    private BanLiShopOrderGoods orderGoods;
    public BanLiShopOrderGoods getOrderGoods() {
        return orderGoods;
fanli/src/main/java/com/yeshi/fanli/exception/shop/FuLuChargeException.java
New file
@@ -0,0 +1,26 @@
package com.yeshi.fanli.exception.shop;
import com.yeshi.fanli.exception.BaseException;
/**
 * 福禄充值异常
 *
 * @author Administrator
 *
 */
public class FuLuChargeException extends BaseException {
    public static int CODE_BALANCE_NOT_ENOUGH = 2004;// 账户余额不足
    public static int CODE_ORDER_NO_EXIST = 4010;// 订单号已经存在
    private static final long serialVersionUID = 572112205824229000L;
    public FuLuChargeException(int code, String msg) {
        super(code, msg);
    }
    public FuLuChargeException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/job/MQJob.java
@@ -53,7 +53,7 @@
                SendResult sendResult = producer.send(msg);
                if (sendResult != null) {
                    mqUnSendInfoService.deleteByPrimaryKey(sendInfo.getId());
                    LogHelper.mqInfo("消息重发成功", sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody());
                    LogHelper.mqInfo("消息重发成功",sendResult.getMessageId(), sendInfo.getTopic(), sendInfo.getTag(), sendInfo.getBody());
                }
            }
    }
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java
@@ -95,8 +95,8 @@
        mqLogger.error(error);
    }
    
    public static void mqInfo(String extraInfo, String topic, String tag, Object data) {
        String info = extraInfo+"\n"+ "topic:" + topic + "\ntag:" + tag + "\nbody:" + data;
    public static void mqInfo(String extraInfo,String msgId, String topic, String tag, Object data) {
        String info = extraInfo+"\nmsgId"+msgId + "\ntopic:" + topic + "\ntag:" + tag + "\nbody:" + data;
        mqLogger.info(info);
    }
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml
@@ -2,14 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.homemodule.FloatADMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.FloatAD">
    <id column="fa_id" property="id" jdbcType="BIGINT"/>
    <result column="fa_name" property="name" jdbcType="VARCHAR"/>
    <result column="fa_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="fa_show_mode" property="showMode" jdbcType="VARCHAR"/>
    <result column="fa_params" property="params" jdbcType="VARCHAR"/>
    <result column="fa_jump_need_login" property="jumpNeedLogin" jdbcType="VARCHAR"/>
        <result column="fa_jump_need_login" property="jumpNeedLogin"
            jdbcType="VARCHAR" />
    <result column="fa_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="fa_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="fa_position" property="position" jdbcType="VARCHAR"/>
@@ -18,19 +18,33 @@
    <result column="fa_state" property="state" jdbcType="INTEGER"/>
    <result column="fa_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="fa_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    <association property="jumpDetail"  column="fa_jumpid" javaType="com.yeshi.fanli.entity.common.JumpDetailV2">
        <result column="fa_play_sound" property="playSound" jdbcType="BOOLEAN" />
        <association property="jumpDetail" column="fa_jumpid"
            javaType="com.yeshi.fanli.entity.common.JumpDetailV2">
            <id column="fa_jumpid" property="id" jdbcType="BIGINT" />    
    </association>
    
  </resultMap>
  <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}
    <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time,fa_play_sound
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad
        (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time,fa_id,fa_play_sound)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{playSound,jdbcType=BOOLEAN})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_float_ad
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">fa_id,</if>
      <if test="name != null">fa_name,</if>
@@ -47,7 +61,9 @@
      <if test="state != null">fa_state,</if>
      <if test="createTime != null">fa_create_time,</if>
      <if test="updateTime != null">fa_update_time,</if>
    </trim>values
            <if test="playSound != null">fa_play_sound,</if>
        </trim>
        values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
@@ -64,17 +80,35 @@
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="playSound != null">#{playSound,jdbcType=BOOLEAN}</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad set fa_name = #{name,jdbcType=VARCHAR},fa_picture = #{picture,jdbcType=VARCHAR},fa_show_mode = #{showMode,jdbcType=VARCHAR},fa_jumpid = #{jumpDetail.id,jdbcType=BIGINT},fa_params = #{params,jdbcType=VARCHAR},fa_jump_need_login = #{jumpNeedLogin,jdbcType=VARCHAR},fa_start_time = #{startTime,jdbcType=TIMESTAMP},fa_end_time = #{endTime,jdbcType=TIMESTAMP},fa_position = #{position,jdbcType=VARCHAR},fa_order = #{order,jdbcType=INTEGER},fa_type = #{type,jdbcType=INTEGER},fa_state = #{state,jdbcType=INTEGER},fa_create_time = #{createTime,jdbcType=TIMESTAMP},fa_update_time = #{updateTime,jdbcType=TIMESTAMP} where fa_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update
        yeshi_ec_float_ad set fa_name = #{name,jdbcType=VARCHAR},fa_picture =
        #{picture,jdbcType=VARCHAR},fa_show_mode =
        #{showMode,jdbcType=VARCHAR},fa_jumpid =
        #{jumpDetail.id,jdbcType=BIGINT},fa_params =
        #{params,jdbcType=VARCHAR},fa_jump_need_login =
        #{jumpNeedLogin,jdbcType=VARCHAR},fa_start_time =
        #{startTime,jdbcType=TIMESTAMP},fa_end_time =
        #{endTime,jdbcType=TIMESTAMP},fa_position =
        #{position,jdbcType=VARCHAR},fa_order =
        #{order,jdbcType=INTEGER},fa_type = #{type,jdbcType=INTEGER},fa_state
        = #{state,jdbcType=INTEGER},fa_create_time =
        #{createTime,jdbcType=TIMESTAMP},fa_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,fa_play_sound
        =#{playSound,jdbcType=BOOLEAN} where fa_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">
        update yeshi_ec_float_ad
    <set>
      <if test="name != null">fa_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">fa_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="showMode != null">fa_show_mode=#{showMode,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">fa_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if>
      <if test="params != null">fa_params=#{params,jdbcType=VARCHAR},</if>
      <if test="jumpNeedLogin != null">fa_jump_need_login=#{jumpNeedLogin,jdbcType=VARCHAR},</if>
            <if test="jumpNeedLogin != null">fa_jump_need_login=#{jumpNeedLogin,jdbcType=VARCHAR},
            </if>
      <if test="startTime != null">fa_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">fa_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="position != null">fa_position=#{position,jdbcType=VARCHAR},</if>
@@ -83,89 +117,74 @@
      <if test="state != null">fa_state=#{state,jdbcType=INTEGER},</if>
      <if test="createTime != null">fa_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">fa_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where fa_id = #{id,jdbcType=BIGINT}
            <if test="playSound !=null">fa_play_sound =#{playSound,jdbcType=BOOLEAN},</if>
        </set>
        where fa_id = #{id,jdbcType=BIGINT}
  </update>
  <delete id="deleteByPrimaryKeyList" parameterType="java.util.List">
    delete from yeshi_ec_float_ad
    WHERE fa_id in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
        delete from yeshi_ec_float_ad WHERE fa_id in
        <foreach collection="list" item="item" open="(" separator=","
            close=")">#{item}</foreach>
  </delete> 
  <select id="listQuery" resultMap="BaseResultMap">
      SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_float_ad fd
      WHERE 1=1
          <if test="key != null and key !='' ">
              AND fd.`fa_name` LIKE '%${key}%'
          </if>
          <if test="state != null">
               AND fd.`fa_state` =  #{state}
          </if>
      ORDER BY fd.`fa_position`,fd.`fa_order`
      LIMIT ${start},${count}
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_float_ad fd WHERE 1=1
        <if test="key != null and key !='' ">AND fd.`fa_name` LIKE '%${key}%'</if>
        <if test="state != null">AND fd.`fa_state` = #{state}</if>
        ORDER BY fd.`fa_position`,fd.`fa_order` LIMIT ${start},${count}
  </select>
  <select id="countQuery" resultType="java.lang.Long">
      SELECT IFNULL(COUNT(fd.`fa_id`),0) FROM yeshi_ec_float_ad fd
      WHERE 1=1
          <if test="key != null and key !='' ">
              AND fd.`fa_name` LIKE '%${key}%'
          </if>
          <if test="state != null">
               AND fd.`fa_state` =  #{state}
          </if>
        SELECT IFNULL(COUNT(fd.`fa_id`),0) FROM yeshi_ec_float_ad fd WHERE 1=1
        <if test="key != null and key !='' ">AND fd.`fa_name` LIKE '%${key}%'</if>
        <if test="state != null">AND fd.`fa_state` = #{state}</if>
  </select>
   <select id="getMaxOrderByPosition" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(fa_order),0) FROM yeshi_ec_float_ad
        WHERE fa_position = #{position}
    <select id="getMaxOrderByPosition" resultType="java.lang.Integer">SELECT
        IFNULL(MAX(fa_order),0) FROM yeshi_ec_float_ad WHERE fa_position =
        #{position}
  </select>
   <select id="getByAdjoinOrder" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_float_ad fd
        WHERE  fd.`fa_position` = #{position}
        <if test="type == -1">
            AND fd.`fa_order` <![CDATA[<]]> #{order}
            ORDER BY fd.`fa_order` desc
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_float_ad fd WHERE fd.`fa_position` = #{position}
        <if test="type == -1">AND
            fd.`fa_order` <![CDATA[<]]>
            #{order} ORDER BY fd.`fa_order` desc
        </if>
        <if test="type == 1">
            AND fd.`fa_order` <![CDATA[>]]> #{order}
            ORDER BY fd.`fa_order`
        <if test="type == 1">AND
            fd.`fa_order` <![CDATA[>]]>
            #{order} ORDER BY fd.`fa_order`
        </if>
        LIMIT 1
   </select>
    <select id="countByPosition" resultType="java.lang.Integer">
         SELECT IFNULL(COUNT(fd.`fa_id`),0) FROM yeshi_ec_float_ad fd
         WHERE fd.`fa_position` = #{position}
    <select id="countByPosition" resultType="java.lang.Integer">SELECT
        IFNULL(COUNT(fd.`fa_id`),0) FROM yeshi_ec_float_ad fd WHERE
        fd.`fa_position` = #{position}
   </select>
   <select id="ListByPrimaryKey" parameterType="java.util.List" resultMap="BaseResultMap">
       SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_float_ad
       WHERE fa_id in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
    <select id="ListByPrimaryKey" parameterType="java.util.List"
        resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List" />
        FROM yeshi_ec_float_ad WHERE fa_id in
        <foreach collection="list" item="item" open="(" separator=","
            close=")">#{item}</foreach>
   </select>
       <select id="getEffectiveFloatAD" resultMap="BaseResultMap">
           SELECT * FROM yeshi_ec_float_ad fd
        WHERE fd.`fa_position` = #{position} AND fd.`fa_state` = 1
               AND IF(fd.`fa_start_time` IS NULL,TRUE,fd.`fa_start_time` <![CDATA[<=]]> NOW())
               AND IF(fd.`fa_end_time` IS NULL,TRUE,fd.`fa_end_time` <![CDATA[>=]]> NOW())
               <if test="type != null">
                   AND fa_type = #{type}
               </if>
        ORDER BY fd.`fa_order`
        LIMIT 1
    <select id="getEffectiveFloatAD" resultMap="BaseResultMap">SELECT
        * FROM yeshi_ec_float_ad fd WHERE fd.`fa_position` = #{position} AND
        fd.`fa_state` = 1 AND IF(fd.`fa_start_time` IS
        NULL,TRUE,fd.`fa_start_time`<![CDATA[<=]]>
        NOW()) AND IF(fd.`fa_end_time` IS NULL,TRUE,fd.`fa_end_time` <![CDATA[>=]]>
        NOW())
        <if test="type != null">AND fa_type = #{type}</if>
        ORDER BY fd.`fa_order` LIMIT 1
       </select>
       <select id="getValidFloatAD" resultMap="BaseResultMap">
           SELECT * FROM yeshi_ec_float_ad fd
        WHERE fd.`fa_position` = #{position} AND fd.`fa_state` = 1
               AND IF(fd.`fa_start_time` IS NULL,TRUE,fd.`fa_start_time` <![CDATA[<=]]> NOW())
               AND IF(fd.`fa_end_time` IS NULL,TRUE,fd.`fa_end_time` <![CDATA[>=]]> NOW())
               <if test="type != null">
                   AND fa_type = #{type}
               </if>
    <select id="getValidFloatAD" resultMap="BaseResultMap">SELECT
        * FROM yeshi_ec_float_ad fd WHERE fd.`fa_position` = #{position} AND
        fd.`fa_state` = 1 AND IF(fd.`fa_start_time` IS
        NULL,TRUE,fd.`fa_start_time`<![CDATA[<=]]>
        NOW()) AND IF(fd.`fa_end_time` IS NULL,TRUE,fd.`fa_end_time` <![CDATA[>=]]>
        NOW())
        <if test="type != null">AND fa_type = #{type}</if>
        ORDER BY fd.`fa_order` 
       </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml
@@ -61,10 +61,15 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_order where so_id = #{0} for update
    </select>
    <select id="listByUid" resultMap="BaseResultMap">
    <select id="listByUidAndState" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_order where so_uid = #{uid}
        from yeshi_ec_shop_order where 1=1
        <if test="uid!=null">
            and so_uid = #{uid}
        </if>
        <if test="stateList!=null">
            <foreach collection="stateList" item="state" open=" and ("
                close=")" separator=" or ">so_state=#{state}</foreach>
@@ -80,15 +85,20 @@
    </select>
    <select id="countByUid" resultType="java.lang.Long">
        select count(*) from yeshi_ec_shop_order where so_uid = #{uid}
    <select id="countByUidAndState" resultType="java.lang.Long">
        select count(*) from yeshi_ec_shop_order where 1=1
        <if test="uid!=null">
            and so_uid = #{uid}
        </if>
        <if test="stateList!=null">
            <foreach collection="stateList" item="state" open=" and ("
                close=")" separator=" or ">so_state=#{state}</foreach>
        </if>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_order where so_id = #{id,jdbcType=BIGINT}</delete>
        yeshi_ec_shop_order where so_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder"
        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)
@@ -173,7 +183,8 @@
        #{updateTime,jdbcType=TIMESTAMP} ,so_order_goods_id
        =#{orderGoods.id,jdbcType=BIGINT} ,so_charge_account_type
        =#{chargeAccountType,jdbcType=VARCHAR} where so_id =
        #{id,jdbcType=BIGINT}</update>
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder">
        update yeshi_ec_shop_order
        <set>
@@ -185,7 +196,8 @@
            </if>
            <if test="hongBaoPaymentState != null">so_payment_hongbao_state=#{hongBaoPaymentState,jdbcType=INTEGER},
            </if>
            <if test="balancePayment != null">so_payment_balance=#{balancePayment,jdbcType=DECIMAL},</if>
            <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_money=#{moneyPayment,jdbcType=DECIMAL},</if>
@@ -204,7 +216,8 @@
            <if test="updateTime != null">so_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderGoods !=null">so_order_goods_id =#{orderGoods.id,jdbcType=BIGINT},</if>
            <if test="chargeAccountType !=null">so_charge_account_type
                =#{chargeAccountType,jdbcType=VARCHAR},</if>
                =#{chargeAccountType,jdbcType=VARCHAR},
            </if>
        </set>
        where so_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java
@@ -154,6 +154,18 @@
        if (setList != null)
            for (BanLiShopGoodsSets set : setList)
                banLiShopGoodsSetService.deleteByPrimaryKey(set.getId());
    }
    @Override
    public void addSalesCount(Long id, int count) {
        BanLiShopGoods goods = selectByPrimaryKey(id);
        if (goods != null) {
            BanLiShopGoods update = new BanLiShopGoods(id);
            update.setSalesCount(goods.getSalesCount() + count);
            update.setUpdateTime(new Date());
            updateSelectiveByPrimaryKey(goods);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java
@@ -127,7 +127,6 @@
            }
    }
    
    @Override
    public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId) {
        return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key, goodsId);
@@ -138,4 +137,14 @@
        return banLiShopGoodsSetsMapper.countQuery(key, goodsId);
    }
    @Override
    public void addSalesCount(Long id, int count) {
        BanLiShopGoodsSets set = banLiShopGoodsSetsMapper.selectByPrimaryKey(id);
        BanLiShopGoodsSets update = new BanLiShopGoodsSets();
        update.setId(set.getId());
        update.setSalesCount(set.getSalesCount() + count);
        update.setStock(set.getStock() - count);
        banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(update);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java
@@ -7,6 +7,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.NumberUtil;
import org.yeshi.utils.exception.WXOrderException;
import com.aliyun.openservices.ons.api.Message;
@@ -20,9 +21,11 @@
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.entity.shop.ChargeTypeEnum;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.redpack.RedPackDetailException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.exception.shop.FuLuChargeException;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
@@ -30,6 +33,9 @@
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
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.StringUtil;
import com.yeshi.fanli.util.charge.FuLuChargeApiUtil;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
@@ -96,7 +102,10 @@
                    || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
                    && (order.getMoneyPaymentState() == null
                            || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
            {
                update.setState(BanLiShopOrder.STATE_PAID);
                update.setStateDesc("支付成功");
            }
        banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
        if (update.getState() != null && update.getState() == BanLiShopOrder.STATE_PAID) {
            paySuccess(order);
@@ -132,7 +141,10 @@
                    || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
                    && (order.getHongBaoPaymentState() == null
                            || order.getHongBaoPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
            {
                update.setState(BanLiShopOrder.STATE_PAID);
                update.setStateDesc("支付成功");
            }
        banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
        if (update.getState() != null && update.getState() == BanLiShopOrder.STATE_PAID) {
            paySuccess(order);
@@ -281,4 +293,54 @@
        }
    }
    @Transactional
    @Override
    public void charge(Long orderId) throws BanLiShopOrderException {
        BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKey(orderId);
        if (order == null)
            throw new BanLiShopOrderException(1, "订单不存在");
        if (order.getState() != BanLiShopOrder.STATE_PAID) {
            throw new BanLiShopOrderException(100, "订单不是处于付款状态");
        }
        if (order.getChargeAccountType() == ChargeTypeEnum.phone) {
            if (!StringUtil.isMobile(order.getChargeAccount())) {
                throw new BanLiShopOrderException(101, "电话号码格式不正确");
            }
        } else if (order.getChargeAccountType() == ChargeTypeEnum.qq) {
            if (!NumberUtil.isNumeric(order.getChargeAccount())) {
                throw new BanLiShopOrderException(101, "QQ号格式错误");
            }
        } else {
            throw new BanLiShopOrderException(102, "非充值商品");
        }
        // 获取福禄的套餐
        BanLiShopGoodsSets set = banLiShopGoodsSetService.selectByPrimaryKey(order.getGoodsSet().getId());
        if (set == null) {
            throw new BanLiShopOrderException(104, "商品套餐已下线");
        }
        if (StringUtil.isNullOrEmpty(set.getChargeFuLuNum())) {
            throw new BanLiShopOrderException(105, "福禄充值ID为空");
        }
        // 改变状态为成功
        BanLiShopOrder update = new BanLiShopOrder(order.getId());
        update.setState(BanLiShopOrder.STATE_SUCCESS);
        update.setStateDesc("充值成功");
        update.setUpdateTime(new Date());
        update.setSuccessTime(new Date());
        banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
        try {
            if (Constant.IS_TEST) {
                FuLuChargeApiUtil.shaXiangCharge(set.getChargeFuLuNum(), "banlishop" + order.getOrderNo(),
                        order.getChargeAccount());
            } else
                FuLuChargeApiUtil.charge(set.getChargeFuLuNum(), "banlishop" + order.getOrderNo(),
                        order.getChargeAccount());
        } catch (FuLuChargeException e) {
            throw new BanLiShopOrderException(e.getCode(), e.getMsg());
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java
@@ -140,6 +140,10 @@
        order.setOrderNo(orderNo);
        banLiShopOrderMapper.updateByPrimaryKeySelective(update);
        // 增加销量
        banLiShopGoodsSetService.addSalesCount(order.getGoodsSet().getId(), 1);
        banLiShopGoodsService.addSalesCount(order.getGoods().getId(), 1);
        // 订单添加成功 ,延时通知后续
        sendPlaceOrderMsg(order.getId(), order.getUid());
    }
@@ -186,12 +190,12 @@
    @Override
    public List<BanLiShopOrder> listByUid(Long uid, int page, int pageSize) {
        return banLiShopOrderMapper.listByUid(null, uid, (page - 1) * pageSize, pageSize);
        return banLiShopOrderMapper.listByUidAndState(null, uid, (page - 1) * pageSize, pageSize);
    }
    @Override
    public long countByUid(Long uid) {
        return banLiShopOrderMapper.countByUid(null, uid);
        return banLiShopOrderMapper.countByUidAndState(null, uid);
    }
    @Override
@@ -389,6 +393,7 @@
            update.setState(BanLiShopOrder.STATE_REJECT);
            update.setStateDesc(msg);
            update.setUpdateTime(new Date());
            update.setRejectTime(new Date());
            banLiShopOrderMapper.updateByPrimaryKeySelective(update);
            transactionManager.commit(transactionStatus);
        } catch (Exception e) {
@@ -452,4 +457,14 @@
        return banLiShopOrderMapper.selectByOrderNo(orderNo);
    }
    @Override
    public List<BanLiShopOrder> listByUidAndState(Long uid, List<Integer> stateList, int page, int pageSize) {
        return banLiShopOrderMapper.listByUidAndState(stateList, uid, (page - 1) * pageSize, pageSize);
    }
    @Override
    public long countByUidAndState(Long uid, List<Integer> stateList) {
        return banLiShopOrderMapper.countByUidAndState(stateList, uid);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java
@@ -78,5 +78,13 @@
     * @param id
     */
    public void deleteByPrimaryKey(Long id);
    /**
     * 增加销量
     * @param id
     * @param count
     */
    public void addSalesCount(Long id,int count);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java
@@ -76,5 +76,12 @@
    public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId);
    public long countQuery(String key, Long goodsId);
    /**
     * 销量增加
     * @param id
     * @param count
     */
    public void addSalesCount(Long id,int count);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderPayService.java
@@ -37,4 +37,12 @@
     * @throws BanLiShopOrderException
     */
    public void refund(Long orderId) throws BanLiShopOrderException;
    /**
     * 充值(按照订单号)
     *
     * @param orderId
     * @throws BanLiShopOrderException
     */
    public void charge(Long orderId) throws BanLiShopOrderException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderService.java
@@ -3,7 +3,6 @@
import java.math.BigDecimal;
import java.util.List;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
@@ -24,15 +23,16 @@
     */
    public void addOrder(BanLiShopOrder order) throws BanLiShopOrderException;
    
    /**
     * 构造订单
     *
     * @param pay
     * @param uid
     * @return
     * @throws BanLiShopOrderException
     */
    public BanLiShopOrder createOrder(Long goodsSetPayId,String chargeAccount,Long uid) throws BanLiShopOrderException;;
    public BanLiShopOrder createOrder(Long goodsSetPayId, String chargeAccount, Long uid)
            throws BanLiShopOrderException;;
    /**
     * 使订单失效
@@ -88,6 +88,26 @@
    public long countByUid(Long uid);
    /**
     * 根据用户ID,状态查询
     *
     * @param uid
     * @param stateList
     * @param page
     * @param pageSize
     * @return
     */
    public List<BanLiShopOrder> listByUidAndState(Long uid, List<Integer> stateList, int page, int pageSize);
    /**
     * 根据用户ID,状态查询
     *
     * @param uid
     * @param stateList
     * @return
     */
    public long countByUidAndState(Long uid, List<Integer> stateList);
    /**
     * 根据主键检索
     * 
     * @param id
@@ -104,6 +124,7 @@
    
    /**
     * 根据订单号查询
     *
     * @param orderNo
     * @return
     */
fanli/src/main/java/com/yeshi/fanli/util/charge/FuLuChargeApiUtil.java
@@ -9,6 +9,7 @@
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.PostMethod;
import com.yeshi.fanli.exception.shop.FuLuChargeException;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
@@ -22,16 +23,18 @@
 */
public class FuLuChargeApiUtil {
    //测试
//    private final static String APP_KEY = "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB";
//    private final static String APP_SECRET = "0a091b3aa4324435aab703142518a8f7";
    private final static String APP_KEY = "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB";
    private final static String APP_SECRET = "0a091b3aa4324435aab703142518a8f7";
    //正式
    private final static String APP_KEY = "CrtDnTh1E5eYY5D42T8uArVrl4GWq9AWR9ZrNC2qvXYIBMwOTuiJQy7YYaJSYlb6";
    private final static String APP_SECRET = "a5f6c827903e4b1eac6eb2ba2cf715be";
    // private final static String APP_KEY =
    // "CrtDnTh1E5eYY5D42T8uArVrl4GWq9AWR9ZrNC2qvXYIBMwOTuiJQy7YYaJSYlb6";
    // private final static String APP_SECRET =
    // "a5f6c827903e4b1eac6eb2ba2cf715be";
    @SuppressWarnings("deprecation")
    private static String post(String url, String body) {
        HttpClient client = new HttpClient();
        client.getHostConfiguration().setProxy("192.168.1.122", 8888);
        // client.getHostConfiguration().setProxy("192.168.1.122", 8888);
        PostMethod method = new PostMethod(url);
        method.addRequestHeader("Content-Type", "application/json;charset=UTF-8");
        method.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
@@ -47,9 +50,9 @@
        return null;
    }
    private static void baseRequest(String method, JSONObject bizContent) {
//        String url = "http://pre.openapi.fulu.com/api/getway";
        String url="http://openapi.fulu.com/api/getway";
    private static void baseRequest(String method, JSONObject bizContent) throws FuLuChargeException {
         String url = "http://pre.openapi.fulu.com/api/getway";
//        String url = "http://openapi.fulu.com/api/getway";
        Map<String, String> params = new HashMap<>();
        params.put("app_key", APP_KEY);
        params.put("method", method);
@@ -68,9 +71,24 @@
        params.put("sign", sign);
        String result = post(url, JSONObject.fromObject(params).toString());
        System.out.println(result);
        JSONObject json = JSONObject.fromObject(result);
        {
            if (json.optInt("code") != 0) {// 成功
                throw new FuLuChargeException(json.optInt("code"), json.optString("message"));
            } else {
            }
    }
    public static void charge(String goodsNo, String orderId, String account) {
    }
    /**
     * 充值
     *
     * @param goodsNo-商品编号
     * @param orderId-商户订单号
     * @param account-数量
     */
    public static void charge(String goodsNo, String orderId, String account) throws FuLuChargeException {
        JSONObject json = new JSONObject();
        json.put("charge_type", "爱奇艺会员");
        json.put("customer_order_no", orderId);
@@ -80,4 +98,17 @@
        baseRequest("fulu.order.direct.add", json);
    }
    /**
     * 沙箱充值
     */
    public static void shaXiangCharge(String goodsNo, String orderId, String account) throws FuLuChargeException {
        JSONObject json = new JSONObject();
        json.put("charge_type", "爱奇艺会员");
        json.put("customer_order_no", orderId);
        json.put("product_id", "10000586 ");
        json.put("charge_account", account);
        json.put("buy_num", "1");
        baseRequest("fulu.order.direct.add", json);
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/shop/BanLiShopOrderGoodsVOFactory.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.util.factory.shop;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.vo.shop.BanLiShopOrderGoodsVO;
import com.yeshi.fanli.vo.shop.BanLiShopOrderVO;
@@ -63,9 +64,9 @@
    private static String getPaidMoney(BanLiShopOrder order) {
        if (order.getMoneyPaymentState() == null || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_NOPAY
                || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_REFUND) {
            return "0";
            return "0.00";
        } else
            return order.getMoneyPayment().toString();
            return order.getMoneyPayment().setScale(2).toString();
    }
}
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/coupon/SystemCouponMessageListener.java
@@ -25,8 +25,8 @@
    @Override
    public Action consume(Message message, ConsumeContext context) {
        LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getTopic(), message.getTag(),
                new String(message.getBody()));
        LogHelper.mqInfo("consumer-SystemCouponMessageListener", message.getMsgID(), message.getTopic(),
                message.getTag(), new String(message.getBody()));
        String tag = message.getTag();
        BaseMQMsgBody baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
        if (baseBody.isTest() != Constant.IS_TEST)
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/BanLiShopOrderMessageListener.java
@@ -49,7 +49,7 @@
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogHelper.mqInfo("consumer:BanLiShopOrderMessageListener", message.getTopic(), message.getTag(),
        LogHelper.mqInfo("consumer:BanLiShopOrderMessageListener",message.getMsgID(), message.getTopic(), message.getTag(),
                new String(message.getBody()));
        String tag = message.getTag();
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java
@@ -66,7 +66,7 @@
        BaseMQMsgBody baseBody = new Gson().fromJson(new String(message.getBody()), BaseMQMsgBody.class);
        if (baseBody.isTest() != Constant.IS_TEST)
            return Action.ReconsumeLater;
        LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getTopic(), message.getTag(),
        LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getMsgID(),message.getTopic(), message.getTag(),
                new String(message.getBody()));
        String tag = message.getTag();
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/redpack/RedPackMessageListener.java
@@ -40,7 +40,7 @@
    @Override
    public Action consume(Message message, ConsumeContext context) {
        LogHelper.mqInfo("consumer-RedPackMessageListener", message.getTopic(), message.getTag(),
        LogHelper.mqInfo("consumer-RedPackMessageListener",message.getMsgID(), message.getTopic(), message.getTag(),
                new String(message.getBody()));
        String tag = message.getTag();
        if (tag == null)
fanli/src/main/java/com/yeshi/fanli/util/wx/BanLiShopWXPayUtil.java
@@ -33,7 +33,7 @@
     * @param money
     * @return
     */
    public static String getWXH5PayUrl(String orderNo, String ip, String goodsName, BigDecimal money) {
    public static String getWXH5PayUrl(String orderNo, String ip, String goodsName, BigDecimal money, String platform) {
        String wxOrderNo = BanLiShopOrderUtil.getWXPayOrderNo(orderNo);
        WXPlaceOrderParams params = new WXPlaceOrderParams();
        params.setBody(goodsName);
@@ -47,8 +47,14 @@
        params.setTradeType("MWEB");
        try {
            Map<String, String> map = WXPayUtil.produceOrder(params);
            return map.get("mweb_url") + "&redirect_url=" + URLEncoder
                    .encode("http://shop.banliapp.com/order.html?from=pay", "UTF-8");
            if ("ios".equalsIgnoreCase(platform))
                return map.get("mweb_url") + "&redirect_url="
                        + URLEncoder.encode("shop.banliapp.com://shop.banliapp.com/wx_pay_finish.html", "UTF-8");
            else
                return map.get("mweb_url") + "&redirect_url="
                        + URLEncoder.encode("http://shop.banliapp.com/wx_pay_finish.html", "UTF-8");
        } catch (WXPlaceOrderParamsException e) {
            e.printStackTrace();
        } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/vo/homemodule/FloatImgDetailVO.java
@@ -15,6 +15,16 @@
    private String showTime;
    @Expose
    private boolean accountLogin;
    @Expose
    private boolean playSound;
    public boolean isPlaySound() {
        return playSound;
    }
    public void setPlaySound(boolean playSound) {
        this.playSound = playSound;
    }
    public String getImg() {
        return img;
utils/src/main/java/org/yeshi/utils/wx/WXPayUtil.java
@@ -6,6 +6,7 @@
import java.util.HashMap;
import java.util.Map;
import org.dom4j.DocumentException;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.StringUtil;
import org.yeshi.utils.entity.wx.RedPackParams;
@@ -266,8 +267,27 @@
        map.put("out_trade_no", orderNo);
        map.put("sign", WXUtil.getSignMD5(map, app.getMchKey()));
        String result = HttpUtil.post("https://api.mch.weixin.qq.com/pay/orderquery", WXUtil.loadWXMessage(map));
        System.out.println("订单查询结果:" + result);
        Map<String, String> resultMap = WXUtil.parseXML(result);
        try {
            try {
                result = new String(result.getBytes("GBK"), "UTF-8");
            } catch (UnsupportedEncodingException e1) {
                e1.printStackTrace();
            }
            System.out.println("订单查询结果:" + new String(result.getBytes("GBK"), "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        Map<String, String> resultMap = null;
        try {
            resultMap = WXUtil.parseXML(result);
        } catch (Exception e) {
            try {
                result = new String(result.getBytes("GBK"), "UTF-8");
            } catch (UnsupportedEncodingException e1) {
                e1.printStackTrace();
            }
            resultMap = WXUtil.parseXML(result);
        }
        if ("SUCCESS".equalsIgnoreCase(resultMap.get("return_code"))
                && "SUCCESS".equalsIgnoreCase(resultMap.get("result_code"))) {
            if ("SUCCESS".equalsIgnoreCase(resultMap.get("trade_state")))// 支付成功
@@ -281,7 +301,8 @@
    /**
     * 
     * @param refundOrderNo -退款单号
     * @param refundOrderNo
     *            -退款单号
     * @param app
     * @return
     * @throws WXOrderException
@@ -295,7 +316,17 @@
        map.put("sign", WXUtil.getSignMD5(map, app.getMchKey()));
        String result = HttpUtil.post("https://api.mch.weixin.qq.com/pay/refundquery", WXUtil.loadWXMessage(map));
        System.out.println("订单查询结果:" + result);
        Map<String, String> resultMap = WXUtil.parseXML(result);
        Map<String, String> resultMap = null;
        try {
            resultMap = WXUtil.parseXML(result);
        } catch (Exception e) {
            try {
                result = new String(result.getBytes("GBK"), "UTF-8");
            } catch (UnsupportedEncodingException e1) {
                e1.printStackTrace();
            }
            resultMap = WXUtil.parseXML(result);
        }
        if ("SUCCESS".equalsIgnoreCase(resultMap.get("return_code"))
                && "SUCCESS".equalsIgnoreCase(resultMap.get("result_code"))) {
            if ("SUCCESS".equalsIgnoreCase(resultMap.get("refund_status_0")))// 退款成功