Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
# Conflicts:
# fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
# fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml
| | |
| | | cacheKey = "rs-" + StringUtil.Md5(cacheKey);
|
| | | // jiedis原子性做拦截
|
| | | Jedis jedis = jedisPool.getResource();
|
| | | long threadId= Thread.currentThread().getId();
|
| | | LogHelper.test("进入拦截:"+cacheKey+"-"+threadId);
|
| | | try {
|
| | | Constant.waitingThreadSet.add(Thread.currentThread().getId());
|
| | | Constant.waitingThreadSet.add(threadId);
|
| | | long result = 0;
|
| | | long startTime = System.currentTimeMillis();
|
| | | // 等待响应
|
| | |
| | | LogHelper.error("触发并发锁:" + cacheAlias);
|
| | | LogHelper.error("redis键:" + cacheKey);
|
| | | if (result <= 0) {
|
| | | LogHelper.test("等待:"+threadId);
|
| | | try {
|
| | | Thread.sleep(50);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (System.currentTimeMillis() - startTime > 1000 * 60L) {
|
| | | if (System.currentTimeMillis() - startTime > 1000 * 30L) {
|
| | | Constant.waitingThreadSet.remove(Thread.currentThread().getId());
|
| | | out.print(JsonUtil.loadFalseResult("连接超时"));
|
| | | return null;
|
| | |
| | | } else {
|
| | | // 设置30秒处理时间
|
| | | jedis.expire(cacheKey, 30);
|
| | | LogHelper.test("获取到锁:"+threadId);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } finally {
|
| | | LogHelper.test("方法执行完毕:"+threadId);
|
| | | jedis.del(cacheKey);
|
| | | Constant.waitingThreadSet.remove(Thread.currentThread().getId());
|
| | | LogHelper.test("释放锁:"+threadId);
|
| | | }
|
| | | }
|
| | | } finally {
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.security.SignatureException;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.crypto.Mac;
|
| | |
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | | import com.yeshi.fanli.entity.config.push.PushMsgFactory;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopOrder;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.shop.BanLiShopOrderUtil;
|
| | | import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgDeviceReadStateService msgDeviceReadStateService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Resource
|
| | | private BanLiShopOrderService banLiShopOrderService;
|
| | |
|
| | | /**
|
| | | * 客服消息回调
|
| | |
| | | out.print("success");
|
| | | }
|
| | |
|
| | | |
| | | @RequestMapping(value = "banlishop/pay")
|
| | | public void banLiShopPay(PrintWriter out) {
|
| | | out.print("success");
|
| | | 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);
|
| | | if (isSuccess)
|
| | | if (map.get("return_code").equalsIgnoreCase("SUCCESS")
|
| | | && map.get("result_code").equalsIgnoreCase("SUCCESS")) {
|
| | | // 商户订单号
|
| | | String wxPayOrderNo = map.get("out_trade_no");
|
| | | // 订单号
|
| | | String orderNo = BanLiShopOrderUtil.getOrderNoFromWXPayOrderNo(wxPayOrderNo);
|
| | | if (!StringUtil.isNullOrEmpty(orderNo)) {
|
| | | BanLiShopOrder order = banLiShopOrderService.selectByOrderNo(orderNo);
|
| | | if (order != null) {// 支付成功消息推送
|
| | | 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);
|
| | | Map<String, String> returnMap = new HashMap<>();
|
| | | returnMap.put("return_code", "SUCCESS");
|
| | | returnMap.put("return_msg", "OK");
|
| | | out.print(WXUtil.loadWXMessage(returnMap));
|
| | | out.close();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.controller.client.v2.ShareControllerV2;
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
|
| | |
| | | }
|
| | |
|
| | | data.put("clickUrl", url);
|
| | | data.put("token",TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | | data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | | data.put("rule", configService.get("share_single_goods_rule"));
|
| | | data.put("pictUrl", TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
|
| | |
|
| | | String shareText = "";
|
| | | // 无券
|
| | | String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO : TaoBaoConstant.SHARE_PRICE_TM;
|
| | | String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO
|
| | | : TaoBaoConstant.SHARE_PRICE_TM;
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
|
| | | String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
|
| | |
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, false);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId,
|
| | | Constant.SOURCE_TYPE_TAOBAO, false);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
|
| | |
|
| | | // 计算推广红包
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value",null);
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value", null);
|
| | | BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
|
| | |
|
| | | // 推广红包 不能小于1
|
| | |
| | | data.put("pictUrl", TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
|
| | |
|
| | | // 无券
|
| | | String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO : TaoBaoConstant.SHARE_PRICE_TM;
|
| | | String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO
|
| | | : TaoBaoConstant.SHARE_PRICE_TM;
|
| | | String shareText = "";
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
|
| | |
| | | {
|
| | | String text = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
|
| | | if (StringUtil.isNullOrEmpty(text))
|
| | | text = configTaoLiJinService.getValueByKey("goods_share_text",new Date());
|
| | | text = configTaoLiJinService.getValueByKey("goods_share_text", new Date());
|
| | |
|
| | | shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
|
| | | .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
|
| | |
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, true);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId,
|
| | | Constant.SOURCE_TYPE_TAOBAO, true);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | try {
|
| | | userShareGoodsRecordService.takeEffectShareRecord(acceptData, shareId);
|
| | | } catch (UserShareGoodsRecordException eu) {
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | if (tljId != null) {
|
| | | String template = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
|
| | | if (StringUtil.isNullOrEmpty(template))
|
| | | template = configTaoLiJinService.getValueByKey("goods_share_text",new Date());
|
| | | template = configTaoLiJinService.getValueByKey("goods_share_text", new Date());
|
| | | return template;
|
| | | } else {
|
| | | String template = shareGoodsTextTemplateService.geteCouponTemplate(uid);
|
| | |
| | | @RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST)
|
| | | public void getShareTextTemplateRules(AcceptData acceptData, Long tljId, PrintWriter out) {
|
| | | if (tljId != null) {
|
| | | out.print(JsonUtil.loadTrueResult(configTaoLiJinService.getValueByKey("share_goods_rules",new Date())));
|
| | | out.print(JsonUtil.loadTrueResult(configTaoLiJinService.getValueByKey("share_goods_rules", new Date())));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | GoodsPicture goodsPicture = imgs.get(0);
|
| | | if (goodsPicture.getGoodState() == 1) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
|
| | | if (goods == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (goods.getState() != null && goods.getState() == 1) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (!goods.isCoupon()) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | TaoKeApiUtil.getSimpleGoodsInfo(goods.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | | } else {
|
| | |
|
| | | } else {
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | if (imgs == null || imgs.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("所有商品已抢光"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | int count = 0;
|
| | | for (GoodsPicture goodsPicture: imgs) {
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | if (goodsPicture.getGoodState() == 1) {
|
| | | count ++;
|
| | | count++;
|
| | | continue;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
|
| | | if (goods == null) {
|
| | | count ++;
|
| | | count++;
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | if (goods.getState() != null && goods.getState() == 1) {
|
| | | count ++;
|
| | | count++;
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | if (!goods.isCoupon()) {
|
| | | count ++;
|
| | | count++;
|
| | | continue;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (count >= imgs.size()) {
|
| | | out.print(JsonUtil.loadFalseResult("所有商品已抢光"));
|
| | | return;
|
| | |
| | | title = "给你推荐精选好物优惠券,购物前先领券,别错过优惠哦~";
|
| | | }
|
| | | data.put("title", title);
|
| | | data.put("content",String.format("我在%s发现了一个很好的商品,快来看看~",Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
|
| | | data.put("content", String.format("我在%s发现了一个很好的商品,快来看看~",
|
| | | Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
|
| | |
|
| | | // 分享奖金
|
| | | ClientTextStyleVO desc = dynamicInfo.getDesc();
|
| | |
| | | if (!StringUtil.isNullOrEmpty(shortLink)) {
|
| | | url = shortLink;
|
| | | }
|
| | |
|
| | | data.put("clickUrl", url);
|
| | |
|
| | | // 淘宝口令
|
| | |
| | | relationId = extraInfo.getRelationId();
|
| | | }
|
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
|
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
|
| | | |
| | | 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) { // 邀请分享
|
| | |
| | |
|
| | | @Resource
|
| | | private RedPackDetailService redPackDetailService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackGiveRecordService redPackGiveRecordService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackExchangeService redPackExchangeService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private RedPackWinInviteService redPackWinInviteService;
|
| | |
|
| | | @Resource
|
| | | private RedPackWinNewUserService redPackWinNewUserService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | |
| | | @Resource |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 统计
|
| | |
| | | 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"));
|
| | |
| | | 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());
|
| | |
| | | *
|
| | | * @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")
|
| | |
| | | }
|
| | | });
|
| | |
|
| | |
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 转换红包为真实金钱
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param amount
|
| | |
| | | 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();
|
| | |
| | | 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"));
|
| | |
| | | } 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));
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private String getERCodeContent(TaoBaoGoodsBrief goods, String token) {
|
| | | public static String getERCodeContent(TaoBaoGoodsBrief goods, String token) {
|
| | | String content = String.format("【%s】%s元", goods.getUserType() == 1 ? "T猫价" : "T宝价",
|
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
|
| | | content += "\n\r";
|
| | |
| | |
|
| | | try {
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | // 测试
|
| | | List<String> commentTexts = new ArrayList<>();
|
| | | commentTexts.add("口令1");
|
| | | commentTexts.add("口令2口令口令淘口令口令口令淘口令");
|
| | | commentTexts.add("口令3");
|
| | | commentTexts.add("口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令口令口令淘口令");
|
| | | shareInfo.setCommentTexts(commentTexts);
|
| | | shareInfo.setWxErCode("这是微信分享二维码内容");
|
| | |
|
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
|
| | |
|
| | |
| | | * @return |
| | | */ |
| | | long countByUid(@Param("stateList") List<Integer> stateList, @Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 根据订单号查询 |
| | | * @param orderNo |
| | | * @return |
| | | */ |
| | | BanLiShopOrder selectByOrderNo(String orderNo); |
| | | |
| | | } |
| | |
| | |
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | public abstract class BaseMQMsgBody {
|
| | | public class BaseMQMsgBody {
|
| | | private boolean test;// 是否是测试
|
| | |
|
| | | public BaseMQMsgBody() {
|
| | |
| | | orderFanLiActual(UserActive.class), // 订单实时到账
|
| | | orderFanLiDelay(UserActive.class), // 订单到账延时消息
|
| | | banLiShopOrderDelay(BanLiShopOrderMQMsg.class),// 板栗商城下单
|
| | | banLiShopOrderRefund(BanLiShopOrderMQMsg.class);//板栗商城订单退款
|
| | | banLiShopOrderRefund(BanLiShopOrderMQMsg.class),//板栗商城订单退款
|
| | | banLiShopOrderPaid(BanLiShopOrderMQMsg.class);//商城订单支付成功
|
| | |
|
| | | private final Class<?> clazz;
|
| | |
|
| | |
| | | private Date updateTime;
|
| | | @Column(name = "sg_weight")
|
| | | private Integer weight;
|
| | |
|
| | | @Column(name = "so_square_picture")
|
| | | private String squarePicture;// 方形图片
|
| | | // 套餐
|
| | | private List<BanLiShopGoodsSets> setsList;
|
| | | // 图片
|
| | |
| | | public void setWeight(Integer weight) {
|
| | | this.weight = weight;
|
| | | }
|
| | |
|
| | | public String getSquarePicture() {
|
| | | return squarePicture;
|
| | | }
|
| | |
|
| | | public void setSquarePicture(String squarePicture) {
|
| | | this.squarePicture = squarePicture;
|
| | | }
|
| | | }
|
| | |
| | | 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;// 订单支付时间
|
| | |
| | | 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")
|
| | |
| | | @Column(name = "so_order_goods_id")
|
| | | private BanLiShopOrderGoods orderGoods;
|
| | |
|
| | |
|
| | | public BanLiShopOrderGoods getOrderGoods() {
|
| | | return orderGoods;
|
| | | }
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!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.shop.BanLiShopGoodsMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.shop.BanLiShopGoods">
|
| | | <id column="sg_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="sg_title" property="title" jdbcType="VARCHAR" />
|
| | | <result column="sg_sales_count" property="salesCount" jdbcType="BIGINT" />
|
| | | <result column="sg_picture" property="picture" jdbcType="VARCHAR" />
|
| | | <result column="sg_desc" property="desc" jdbcType="VARCHAR" />
|
| | | <result column="sg_charge_type" property="chargeType" jdbcType="VARCHAR" />
|
| | | <result column="sg_state" property="state" jdbcType="INTEGER" />
|
| | | <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" />
|
| | | <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" />
|
| | | <result column="sg_title" property="title" jdbcType="VARCHAR" />
|
| | | <result column="sg_sales_count" property="salesCount" jdbcType="BIGINT" />
|
| | | <result column="sg_picture" property="picture" jdbcType="VARCHAR" />
|
| | | <result column="sg_desc" property="desc" jdbcType="VARCHAR" />
|
| | | <result column="sg_charge_type" property="chargeType" jdbcType="VARCHAR" />
|
| | | <result column="sg_state" property="state" jdbcType="INTEGER" />
|
| | | <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" />
|
| | | <association property="goodsClass" column="sg_class_id"
|
| | | javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass"
|
| | | select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper.selectByPrimaryKey" />
|
| | | <collection property="setsList" column="sg_id"
|
| | | select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsMapper.listDetailByGoodsId" />
|
| | | <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>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <select id="selectDetailByPrimaryKey" resultMap="BaseResultDetailMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <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>
|
| | | 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>
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | 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)
|
| | | 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})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_shop_goods
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">sg_id,</if>
|
| | | <if test="title != null">sg_title,</if>
|
| | | <if test="goodsClass != null">sg_class_id,</if>
|
| | | <if test="salesCount != null">sg_sales_count,</if>
|
| | | <if test="picture != null">sg_picture,</if>
|
| | | <if test="desc != null">sg_desc,</if>
|
| | | <if test="chargeType != null">sg_charge_type,</if>
|
| | | <if test="state != null">sg_state,</if>
|
| | | <if test="createTime != null">sg_create_time,</if>
|
| | | <if test="updateTime != null">sg_update_time,</if>
|
| | | <if test="weight != null">sg_weight,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if>
|
| | | <if test="goodsClass != null">#{goodsClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="salesCount != null">#{salesCount,jdbcType=BIGINT},</if>
|
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
|
| | | <if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
|
| | | <if test="chargeType != null">#{chargeType,jdbcType=VARCHAR},</if>
|
| | | <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="weight != null">#{weight,jdbcType=INTEGER}</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods">update
|
| | | yeshi_ec_shop_goods set sg_title =
|
| | | #{title,jdbcType=VARCHAR},sg_class_id =
|
| | | #{goodsClass.id,jdbcType=BIGINT},sg_sales_count =
|
| | | #{salesCount,jdbcType=BIGINT},sg_picture =
|
| | | #{picture,jdbcType=VARCHAR},sg_desc =
|
| | | #{desc,jdbcType=VARCHAR},sg_charge_type =
|
| | | #{chargeType,jdbcType=VARCHAR},sg_state =
|
| | | #{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}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
|
| | | update yeshi_ec_shop_goods
|
| | | <set>
|
| | | <if test="title != null">sg_title=#{title,jdbcType=VARCHAR},</if>
|
| | | <if test="goodsClass != null">sg_class_id=#{goodsClass.id,jdbcType=BIGINT},</if>
|
| | | <if test="salesCount != null">sg_sales_count=#{salesCount,jdbcType=BIGINT},</if>
|
| | | <if test="picture != null">sg_picture=#{picture,jdbcType=VARCHAR},</if>
|
| | | <if test="desc != null">sg_desc=#{desc,jdbcType=VARCHAR},</if>
|
| | | <if test="chargeType != null">sg_charge_type=#{chargeType,jdbcType=VARCHAR},</if>
|
| | | <if test="state != null">sg_state=#{state,jdbcType=INTEGER},</if>
|
| | | <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>
|
| | | </set>
|
| | | where sg_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | </mapper>
|
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!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.shop.BanLiShopGoodsMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.shop.BanLiShopGoods"> |
| | | <id column="sg_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="sg_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="sg_sales_count" property="salesCount" jdbcType="BIGINT" /> |
| | | <result column="sg_picture" property="picture" jdbcType="VARCHAR" /> |
| | | <result column="sg_desc" property="desc" jdbcType="VARCHAR" /> |
| | | <result column="sg_charge_type" property="chargeType" jdbcType="VARCHAR" /> |
| | | <result column="sg_state" property="state" jdbcType="INTEGER" /> |
| | | <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" /> |
| | | <result column="sg_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="sg_sales_count" property="salesCount" jdbcType="BIGINT" /> |
| | | <result column="sg_picture" property="picture" jdbcType="VARCHAR" /> |
| | | <result column="sg_desc" property="desc" jdbcType="VARCHAR" /> |
| | | <result column="sg_charge_type" property="chargeType" jdbcType="VARCHAR" /> |
| | | <result column="sg_state" property="state" jdbcType="INTEGER" /> |
| | | <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" /> |
| | | <collection property="setsList" column="sg_id" |
| | | select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsMapper.listDetailByGoodsId" /> |
| | | <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,so_square_picture |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectDetailByPrimaryKey" resultMap="BaseResultDetailMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <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> |
| | | 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> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | 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,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},#{squarePicture,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_shop_goods |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">sg_id,</if> |
| | | <if test="title != null">sg_title,</if> |
| | | <if test="goodsClass != null">sg_class_id,</if> |
| | | <if test="salesCount != null">sg_sales_count,</if> |
| | | <if test="picture != null">sg_picture,</if> |
| | | <if test="desc != null">sg_desc,</if> |
| | | <if test="chargeType != null">sg_charge_type,</if> |
| | | <if test="state != null">sg_state,</if> |
| | | <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=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="goodsClass != null">#{goodsClass.id,jdbcType=BIGINT},</if> |
| | | <if test="salesCount != null">#{salesCount,jdbcType=BIGINT},</if> |
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="desc != null">#{desc,jdbcType=VARCHAR},</if> |
| | | <if test="chargeType != null">#{chargeType,jdbcType=VARCHAR},</if> |
| | | <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="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 |
| | | yeshi_ec_shop_goods set sg_title = |
| | | #{title,jdbcType=VARCHAR},sg_class_id = |
| | | #{goodsClass.id,jdbcType=BIGINT},sg_sales_count = |
| | | #{salesCount,jdbcType=BIGINT},sg_picture = |
| | | #{picture,jdbcType=VARCHAR},sg_desc = |
| | | #{desc,jdbcType=VARCHAR},sg_charge_type = |
| | | #{chargeType,jdbcType=VARCHAR},sg_state = |
| | | #{state,jdbcType=INTEGER},sg_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},sg_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} ,sg_weight |
| | | =#{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 |
| | | <set> |
| | | <if test="title != null">sg_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="goodsClass != null">sg_class_id=#{goodsClass.id,jdbcType=BIGINT},</if> |
| | | <if test="salesCount != null">sg_sales_count=#{salesCount,jdbcType=BIGINT},</if> |
| | | <if test="picture != null">sg_picture=#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="desc != null">sg_desc=#{desc,jdbcType=VARCHAR},</if> |
| | | <if test="chargeType != null">sg_charge_type=#{chargeType,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">sg_state=#{state,jdbcType=INTEGER},</if> |
| | | <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> |
| | | </mapper> |
| | | |
| | |
| | | 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" /> |
| | |
| | | <if test="stateList!=null"> |
| | | <foreach collection="stateList" item="state" open=" and (" |
| | | close=")" separator=" or ">so_state=#{state}</foreach> |
| | | order by so_id desc limit #{start},#{count} |
| | | </if> |
| | | order by so_id desc limit #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="selectByOrderNo" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_shop_order where so_order_no = #{0} |
| | | </select> |
| | | |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long"> |
| | | select count(*) from yeshi_ec_shop_order where so_uid = #{uid} |
| | | <if test="stateList!=null"> |
| | |
| | | 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"> |
| | |
| | | <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> |
| | |
| | | #{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 = |
| | |
| | | </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> |
| | |
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.entity.wx.WXAPPInfo;
|
| | | import org.yeshi.utils.exception.WXOrderException;
|
| | | import org.yeshi.utils.wx.WXPayUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | |
| | | 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();
|
| | |
| | | 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, "消息发送失败");
|
| | |
| | | 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;
|
| | |
| | | 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 {
|
| | |
| | | BanLiShopOrder update = new BanLiShopOrder();
|
| | | update.setId(order.getId());
|
| | | update.setOrderNo(orderNo);
|
| | | order.setOrderNo(orderNo);
|
| | | banLiShopOrderMapper.updateByPrimaryKeySelective(update);
|
| | |
|
| | | // 订单添加成功 ,延时通知后续
|
| | |
| | | orderGoods.setSetName(set.getName());
|
| | | orderGoods.setState(set.getState());
|
| | | orderGoods.setZkPrice(set.getZkPrice());
|
| | | orderGoods.setPicture(goods.getSquarePicture());
|
| | | banLiShopOrderGoodsMapper.insertSelective(orderGoods);
|
| | | return orderGoods;
|
| | | }
|
| | |
| | |
|
| | | // 支付成功
|
| | | BanLiShopOrder update = new BanLiShopOrder();
|
| | | update.setId(orderId);
|
| | | update.setMoneyPaymentState(BanLiShopOrder.PAY_STATE_PAID);
|
| | | // 判断其他待支付项是否已经支付
|
| | | update.setUpdateTime(new Date());
|
| | |
| | |
|
| | | // 判断是否处于未付款
|
| | | 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);
|
| | |
| | | return order;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BanLiShopOrder selectByOrderNo(String orderNo) {
|
| | | return banLiShopOrderMapper.selectByOrderNo(orderNo);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @param order
|
| | | */
|
| | | public void udpateSelectiveByPrimaryKey(BanLiShopOrder order);
|
| | | |
| | | /**
|
| | | * 根据订单号查询
|
| | | * @param orderNo
|
| | | * @return
|
| | | */
|
| | | public BanLiShopOrder selectByOrderNo(String orderNo);
|
| | |
|
| | | }
|
| | |
| | | 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"));
|
| | |
| | | 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();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | 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;
|
| | |
| | | @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();
|
| | |
| | | // 使订单失效
|
| | | 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;
|
| | | }
|
| | |
| | | import org.yeshi.utils.exception.WXOrderException;
|
| | | import org.yeshi.utils.exception.WXPlaceOrderParamsException;
|
| | | import org.yeshi.utils.wx.WXPayUtil;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.shop.BanLiShopOrderUtil;
|
| | |
| | | */
|
| | | public static boolean refund(String orderNo, BigDecimal money) throws WXOrderException {
|
| | | boolean success = WXPayUtil.refund(BanLiShopOrderUtil.getWXPayOrderNo(orderNo), money, money, null,
|
| | | new WXAPPInfo(), MCH_ID, BanLiShopWXPayUtil.class.getClassLoader().getResourceAsStream(MCH_CERT_PATH));
|
| | | new WXAPPInfo(Constant.getWXAccount(null, null).getGzAppId(),
|
| | | Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY),
|
| | | MCH_ID, BanLiShopWXPayUtil.class.getClassLoader().getResourceAsStream(MCH_CERT_PATH));
|
| | | return success;
|
| | | }
|
| | |
|
| | |
| | | Constant.getWXAccount(null, null).getGzAppSecret(), MCH_ID, MCH_KEY));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否支付成功
|
| | | * |
| | | * @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
|
| | | * @param sign
|
| | | * @return
|
| | | */
|
| | | public static boolean signIsRight(Map<String, String> params, String sign) {
|
| | | String newSign = WXUtil.getSignMD5(params, MCH_KEY);
|
| | | return newSign.equalsIgnoreCase(sign);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | |
| | | // 分享文字
|
| | | @Expose
|
| | | private String shareText;
|
| | | |
| | |
|
| | | // 分享文字-无标题
|
| | | @Expose
|
| | | private String descText;
|
| | |
| | | // 分享金额
|
| | | @Expose
|
| | | private String shareMoney;
|
| | | |
| | |
|
| | | // 淘礼金红包
|
| | | @Expose
|
| | | private String spreadMoney;
|
| | | |
| | |
|
| | | // 淘礼金ID
|
| | | @Expose
|
| | | private String tljId;
|
| | | |
| | |
|
| | | // 淘礼金余额
|
| | | @Expose
|
| | | private String surplusMoney;
|
| | | |
| | |
|
| | | // 评论区文案 2.0.2新增
|
| | | @Expose
|
| | | private List<String> commentTexts;
|
| | |
|
| | | @Expose
|
| | | private String wxErCode;// 微信二维码内容
|
| | |
|
| | | public List<String> getCommentTexts() {
|
| | | return commentTexts;
|
| | | }
|
| | |
|
| | | public void setCommentTexts(List<String> commentTexts) {
|
| | | this.commentTexts = commentTexts;
|
| | | }
|
| | |
|
| | | public String getWxErCode() {
|
| | | return wxErCode;
|
| | | }
|
| | |
|
| | | public void setWxErCode(String wxErCode) {
|
| | | this.wxErCode = wxErCode;
|
| | | }
|
| | |
|
| | | public String getShareId() {
|
| | | return shareId;
|
| | | }
|
| | |
| | | <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>
|
| | |
| | | </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>
|
| | |
| | | package org.yeshi.utils.wx;
|
| | |
|
| | | import java.io.InputStream;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
| | | String entity = WXUtil.loadWXMessage(map);
|
| | |
|
| | | String result = HttpUtil.post("https://api.mch.weixin.qq.com/pay/unifiedorder", entity);
|
| | | System.out.println("统一下单结果:" + result);
|
| | | try {
|
| | | System.out.println("统一下单结果:" + new String( result.getBytes("GBK"),"UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | Map<String, String> resultMap = WXUtil.parseXML(result);
|
| | |
|
| | | return resultMap;
|