Commit 6f3d2e9b authored by 周健威's avatar 周健威

修改代码

parent a6794c9d
...@@ -52,7 +52,9 @@ public abstract class RabbitCommonConfig { ...@@ -52,7 +52,9 @@ public abstract class RabbitCommonConfig {
if(null != myQueue) { if(null != myQueue) {
myQueue.forEach(en -> { myQueue.forEach(en -> {
//避免一个队列绑定多个exchange+key 时 再次创建queueBean //避免一个队列绑定多个exchange+key 时 再次创建queueBean
if(null == applicationContext.getBean(StrUtil.toCamelCase(en.getQueue()), Queue.class)) { try {
Queue queue = applicationContext.getBean(StrUtil.toCamelCase(en.getQueue()), Queue.class);
}catch (Exception e) {
registerBean(StrUtil.toCamelCase(en.getQueue()), Queue.class, en.getQueue(), Boolean.TRUE); registerBean(StrUtil.toCamelCase(en.getQueue()), Queue.class, en.getQueue(), Boolean.TRUE);
} }
String bindName = StrUtil.toCamelCase(en.getQueue())+ "Binding"+ en.getExchange()+ "_"+ en.getKey(); String bindName = StrUtil.toCamelCase(en.getQueue())+ "Binding"+ en.getExchange()+ "_"+ en.getKey();
......
...@@ -148,6 +148,9 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -148,6 +148,9 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
//支付后更新优惠卷状态 //支付后更新优惠卷状态
public BigDecimal useTickerNo(Integer userId, String TickerNo, String orderNo,Integer channel,BigDecimal amout,Integer type){ public BigDecimal useTickerNo(Integer userId, String TickerNo, String orderNo,Integer channel,BigDecimal amout,Integer type){
BigDecimal couponAmout=new BigDecimal("0.00"); BigDecimal couponAmout=new BigDecimal("0.00");
if(couponAmout.compareTo(amout) >= 0) {
return BigDecimal.ZERO;
}
if (userId==null||userId==0||StringUtils.isBlank(TickerNo)){ if (userId==null||userId==0||StringUtils.isBlank(TickerNo)){
log.error("----参数不能为空"); log.error("----参数不能为空");
return couponAmout; return couponAmout;
...@@ -183,10 +186,13 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -183,10 +186,13 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
Integer type = coupon.getType(); Integer type = coupon.getType();
if (type != null) { if (type != null) {
BigDecimal useAmout = coupon.getUsedAmount(); BigDecimal useAmout = coupon.getUsedAmount();
if (amout.compareTo(useAmout) > 0) {
if (type == 3 || (type == 1 && (amout.compareTo(coupon.getWithAmount()) >= 0))) { if (type == 3 || (type == 1 && (amout.compareTo(coupon.getWithAmount()) >= 0))) {
//couponAmout = amout.subtract(useAmout); //couponAmout = amout.subtract(useAmout);
couponAmout=useAmout; if (amout.compareTo(useAmout) > 0) {
couponAmout= useAmout;
}else {
couponAmout= amout;
} }
} }
} }
......
...@@ -22,16 +22,13 @@ import java.util.ArrayList; ...@@ -22,16 +22,13 @@ import java.util.ArrayList;
public class RabbitActivityConfig extends RabbitCommonConfig { public class RabbitActivityConfig extends RabbitCommonConfig {
public static final String INTEGRAL_QUEUE = "integral_queue"; public static final String INTEGRAL_QUEUE = "integral_queue";
// public static final String POPULARZIE_REGISTER_QUEUE = "popularzie.register.queue";
// public static final String POPULARZIE_AUTH_QUEUE = "popularzie.auth.queue";
public static final String POPULARZIE_0101_QUEUE = "popularzie.0101.queue"; public static final String POPULARZIE_0101_QUEUE = "popularzie.0101.queue";
static { static {
myQueue = new ArrayList<BindDTO>(){{ myQueue = new ArrayList<BindDTO>(){{
add(new BindDTO(INTEGRAL_QUEUE, RabbitConstant.ORDER_TOPIC, "order.#")); add(new BindDTO(INTEGRAL_QUEUE, RabbitConstant.ORDER_TOPIC, "order.#"));
add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.#")); add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register"));
// add(new BindDTO(POPULARZIE_REGISTER_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register")); add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.auth"));
// add(new BindDTO(POPULARZIE_AUTH_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.login"));
}}; }};
} }
......
...@@ -124,6 +124,7 @@ public class OrderRentVehicleController extends CommonBaseController { ...@@ -124,6 +124,7 @@ public class OrderRentVehicleController extends CommonBaseController {
/** /**
* 优惠券* * 优惠券*
*/ */
@ApiModelProperty(value = "优惠卷卷号")
private String tickerNos; private String tickerNos;
} }
} }
\ No newline at end of file
...@@ -141,6 +141,11 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -141,6 +141,11 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
} }
} }
//如果有使用优惠券,则扣减
// if(BigDecimal.ZERO.compareTo(bo.getOrder().getCouponAmount()) >= 0) {
//
// }
super.handleDetail(bo); super.handleDetail(bo);
//发送定时取消订单(数据字典设置--5分钟) //发送定时取消订单(数据字典设置--5分钟)
......
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