Commit 4916da13 authored by hanfeng's avatar hanfeng

Merge branch 'base-modify' of http://10.5.52.3/youjj/cloud-platform into base-modify

parents 05516bc3 39460a79
......@@ -13,19 +13,16 @@ public class RabbitConstant {
public static final String ADMIN_TOPIC = ADMIN+ TOPIC_EXC;
public static final String ORDER = "order";
public static final String ORDER_TOPIC = ORDER+ TOPIC_EXC;
public static final String INTEGRAL = "integral";
public static final String INTEGRAL_TOPIC = INTEGRAL + TOPIC_EXC;
/**************************key*********************************/
public static final String KEY_APPUSER_REGISTER = "appUser.register";
public static final String KEY_APPUSER_AUTH = "appUser.auth";
public static final String KEY_ORDER_PAY = "order.pay";
public static final String KEY_ORDER_FINLISH = "order.finlish";
public static final String KEY_ORDER_CANCEL = "order.cancel";
public static final String KEY_REGISTER_SUCCESS = "register.success";
public static final String INTEGRAL_ROUTING_KEY = "integral_routing_key";
static {
exchangeTopicSet = new HashSet<String>() {{
add(ADMIN_TOPIC);
add(ORDER_TOPIC);
add(INTEGRAL_TOPIC);
}};
}
}
......@@ -50,7 +50,7 @@ import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.TimeUnit;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.KEY_REGISTER_SUCCESS;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*;
/**
* @author keliii
......@@ -340,12 +340,11 @@ public class AppPermissionService {
registerQueueDTO.setInParamDTO(new RegisterParamDTO(username, password, headimgurl,
nickname, mobilecode, openId, unionid, type, code, activityCode));
// 注册成功,发送队列
switch (sign){
case 1 :
mqSenderFeign.sendMessage(RabbitConstant.ADMIN_TOPIC, KEY_REGISTER_SUCCESS, JSONUtil.toJsonStr(registerQueueDTO));
mqSenderFeign.sendMessage(RabbitConstant.ADMIN_TOPIC, KEY_APPUSER_REGISTER, JSONUtil.toJsonStr(registerQueueDTO));
case 2 :
mqSenderFeign.sendMessage(RabbitConstant.ADMIN_TOPIC, KEY_REGISTER_SUCCESS, JSONUtil.toJsonStr(registerQueueDTO));
mqSenderFeign.sendMessage(RabbitConstant.ADMIN_TOPIC, KEY_APPUSER_AUTH, JSONUtil.toJsonStr(registerQueueDTO));
default:
break;
}
......
......@@ -121,11 +121,11 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
if(amout.compareTo(new BigDecimal("0.00"))>0&&list.size()>0){
for (UserCouponVo couponVo:list){
Integer status=2;
if(couponVo.getChannel()==1){
if(couponVo.getType()==1){
if (amout.compareTo(couponVo.getWithAmount())>=0){
status=1;
}
}else if (couponVo.getChannel()==3){
}else if (couponVo.getType()==3){
status=1;
}
......
......@@ -3,13 +3,10 @@ package com.xxfc.platform.activity.config;
import com.github.wxiaoqi.security.common.config.RabbitCommonConfig;
import com.github.wxiaoqi.security.common.config.rabbit.BindDTO;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.xxfc.platform.universal.constant.MQconstant;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*;
/**
* rabbitmq配置类
* 包含: 不知道什么orderWater队列
......@@ -26,12 +23,12 @@ public class RabbitActivityConfig extends RabbitCommonConfig {
public static final String INTEGRAL_HANDLE_QUEUE = "integral_handle_queue";
static {
myQueue = new ArrayList<BindDTO>(){{
add(new BindDTO(INTEGRAL_QUEUE, ORDER_TOPIC, "order.#"));
add(new BindDTO(POPULARZIE_0101_QUEUE, ADMIN_TOPIC, KEY_APPUSER_REGISTER));
add(new BindDTO(POPULARZIE_0101_QUEUE, ADMIN_TOPIC, KEY_APPUSER_AUTH));
add(new BindDTO(ACTIVITY_NEW_QUEUE, ADMIN_TOPIC, KEY_APPUSER_REGISTER));
add(new BindDTO(ACTIVITY_NEW_QUEUE, ADMIN_TOPIC, KEY_APPUSER_AUTH));
add(new BindDTO(INTEGRAL_HANDLE_QUEUE, MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY));
add(new BindDTO(INTEGRAL_QUEUE, RabbitConstant.ORDER_TOPIC, "order.#"));
add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register"));
add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.auth"));
add(new BindDTO(ACTIVITY_NEW_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register"));
add(new BindDTO(ACTIVITY_NEW_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.auth"));
add(new BindDTO(INTEGRAL_HANDLE_QUEUE, RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY));
}};
}
......
......@@ -11,6 +11,7 @@ import lombok.Data;
@Data
public class BannerVo {
private String title;
/**
* 封面地址
......
......@@ -39,6 +39,7 @@ public class BannerBiz extends BaseBiz<BannerMapper,Banner> {
BannerVo bannerVo = new BannerVo();
bannerVo.setCover(banner.getCover());
bannerVo.setUrl(banner.getUrl());
bannerVo.setTitle(banner.getTitle());
bannerVos.add(bannerVo);
});
return bannerVos;
......
......@@ -3,13 +3,13 @@ package com.xxfc.platform.im.biz;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.im.dto.MsgTypeEnum;
import com.xxfc.platform.im.dto.UpdateTypeEnum;
import com.xxfc.platform.im.entity.ImComment;
import com.xxfc.platform.im.entity.ImQuestion;
import com.xxfc.platform.im.mapper.ImCommentMapper;
import com.xxfc.platform.universal.constant.MQconstant;
import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -55,7 +55,7 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
jsonObject.put("userId", appUserDTO.getUserid());
jsonObject.put("channelId", newValue.getId());
jsonObject.put("integralRuleCode", "COMMENTPUBLISH");
mqSenderFeign.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
return ObjectRestResponse.succ();
}
......
......@@ -3,6 +3,7 @@ package com.xxfc.platform.im.biz;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
......@@ -11,7 +12,6 @@ import com.xxfc.platform.im.dto.QuestionParamDto;
import com.xxfc.platform.im.dto.UpdateTypeEnum;
import com.xxfc.platform.im.entity.ImQuestion;
import com.xxfc.platform.im.mapper.ImQuestionMapper;
import com.xxfc.platform.universal.constant.MQconstant;
import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -70,7 +70,7 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
jsonObject.put("userId", appUserDTO.getUserid());
jsonObject.put("channelId", newValue.getId());
jsonObject.put("integralRuleCode", "PUBLISH");
mqSenderFeign.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
return ObjectRestResponse.succ();
}
......
......@@ -2,13 +2,10 @@ package com.xxfc.platform.order.biz;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.admin.dto.RegisterParamDTO;
import com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO;
import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.IntervalUtil;
......@@ -26,7 +23,7 @@ import com.xxfc.platform.order.pojo.order.OrderListVo;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto;
import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.universal.dto.SmsTemplateDTO;
import com.xxfc.platform.universal.feign.MQSenderFeign;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.vo.OrderRefundVo;
import com.xxfc.platform.vehicle.common.RestResponse;
......@@ -43,10 +40,10 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.KEY_REGISTER_SUCCESS;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.universal.constant.DictionaryKey.*;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*;
/**
*
......@@ -89,6 +86,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
@Autowired
UserFeign userFeign;
@Autowired
MQSenderFeign mqSenderFeign;
@Autowired
OrderMsgBiz orderMsgBiz;
......@@ -279,6 +279,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//增加库存
tourFeign.stock(otd.getSpePriceId(), otd.getTotalNumber(), TourFeign.STOCK_PLUS);
}
//发送队列消息
sendQueue(baseOrder.getId(), OrderMQDTO.ORDER_PAY);
}else {
throw new BaseException(ResultCode.FAILED_CODE);
}
......@@ -485,6 +488,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//处理后台用户提醒短信的发送
orderMsgBiz.handelBgUserMsg4Pay(orvd, baseOrder, appUserDTO, OrderMsgBiz.RENT_PAY);
//发送队列消息
sendQueue(orvd.getOrderId(), OrderMQDTO.ORDER_PAY);
}
} else {
log.error(" order has payed , orderNo:{}, tradeNo:{} ", orderNo, tradeNo);
......@@ -524,7 +530,19 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
setOrderId(orderId);
setSign(sign);
}};
//mqSenderFeign.sendMessage(RabbitConstant.ADMIN_TOPIC, KEY_REGISTER_SUCCESS, JSONUtil.toJsonStr(orderMQDTO));
switch (sign) {
case 2:
mqSenderFeign.sendMessage(ORDER_TOPIC, KEY_ORDER_CANCEL, JSONUtil.toJsonStr(orderMQDTO));
break;
case 4:
mqSenderFeign.sendMessage(ORDER_TOPIC, KEY_ORDER_PAY, JSONUtil.toJsonStr(orderMQDTO));
break;
case 6:
mqSenderFeign.sendMessage(ORDER_TOPIC, KEY_ORDER_FINLISH, JSONUtil.toJsonStr(orderMQDTO));
break;
default:
break;
}
}catch (Exception e){
log.error(e.getMessage(), e);
}
......
package com.xxfc.platform.universal.constant;
public class MQconstant {
public static final String INTEGRAL_EXCHANGE = "integral_exchange";
public static final String INTEGRAL_ROUTING_KEY = "integral_routing_key";
}
......@@ -11,13 +11,13 @@ import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.*;
import com.alipay.api.response.*;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.HTTPSUtils;
import com.github.wxiaoqi.security.common.util.OrderUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.universal.constant.MQconstant;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.entity.OrderPay;
import com.xxfc.platform.universal.mapper.OrderPayMapper;
......@@ -157,8 +157,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
jsonObject.put("integralRuleCode", "BUYMEMBER");
}
log.info("支付订单号:orderNo = {}, orderType = {}", newValue.getOrderNo(), newValue.getChannel());
log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqServiceBiZ.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqServiceBiZ.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
if(StringUtils.isNotBlank(pay.getNotifyUrl())){
String url=pay.getNotifyUrl();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment