Commit 85170e22 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 48b8d584 264fac02
...@@ -51,8 +51,12 @@ public abstract class RabbitCommonConfig { ...@@ -51,8 +51,12 @@ public abstract class RabbitCommonConfig {
if(null != myQueue) { if(null != myQueue) {
myQueue.forEach(en -> { myQueue.forEach(en -> {
//避免一个队列绑定多个exchange+key 时 再次创建queueBean
if(null == applicationContext.getBean(StrUtil.toCamelCase(en.getQueue()), Queue.class)) {
registerBean(StrUtil.toCamelCase(en.getQueue()), Queue.class, en.getQueue(), Boolean.TRUE); registerBean(StrUtil.toCamelCase(en.getQueue()), Queue.class, en.getQueue(), Boolean.TRUE);
registerBean(StrUtil.toCamelCase(en.getQueue())+ "Binding", Binding.class, en.getQueue(), Binding.DestinationType.QUEUE, en.getExchange(), en.getKey(), Collections.EMPTY_MAP); }
String bindName = StrUtil.toCamelCase(en.getQueue())+ "Binding"+ en.getExchange()+ "_"+ en.getKey();
registerBean(bindName, Binding.class, en.getQueue(), Binding.DestinationType.QUEUE, en.getExchange(), en.getKey(), Collections.EMPTY_MAP);
}); });
} }
} }
......
...@@ -33,4 +33,6 @@ public class RentVehiclePriceVO extends OrderPriceVO{ ...@@ -33,4 +33,6 @@ public class RentVehiclePriceVO extends OrderPriceVO{
BigDecimal damageSafePrice; BigDecimal damageSafePrice;
@ApiModelProperty(value = "费用详情") @ApiModelProperty(value = "费用详情")
private String costDetail; private String costDetail;
@ApiModelProperty(value = "优惠券扣除的费用")
private BigDecimal couponAmount;
} }
...@@ -53,4 +53,8 @@ public class TourPriceVO extends OrderPriceVO{ ...@@ -53,4 +53,8 @@ public class TourPriceVO extends OrderPriceVO{
//总人数 //总人数
@ApiModelProperty(value = "总人数") @ApiModelProperty(value = "总人数")
private Integer totalNumber; private Integer totalNumber;
//优惠券
@ApiModelProperty(value = "优惠券扣除的费用")
private BigDecimal couponAmount;
} }
...@@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.*; ...@@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.persistence.Column; import javax.persistence.Column;
import java.util.Arrays;
import java.util.List;
@Controller @Controller
@RequestMapping("orderRentVehicle") @RequestMapping("orderRentVehicle")
...@@ -79,6 +81,7 @@ public class OrderRentVehicleController extends CommonBaseController { ...@@ -79,6 +81,7 @@ public class OrderRentVehicleController extends CommonBaseController {
setHasMemberRight(vo.getHasMemberRight()); setHasMemberRight(vo.getHasMemberRight());
}}); }});
bo.setAppUserDTO(userFeign.userDetailByToken(BaseContextHandler.getToken()).getData()); bo.setAppUserDTO(userFeign.userDetailByToken(BaseContextHandler.getToken()).getData());
bo.setTickerNo(StrUtil.isNotBlank(vo.getTickerNos())? Arrays.asList(vo.getTickerNos().split(",")):null);
orderRentVehicleService.initDetailSecond(bo); orderRentVehicleService.initDetailSecond(bo);
return ObjectRestResponse.succ(orderRentVehicleService.calculatePrice(bo)); return ObjectRestResponse.succ(orderRentVehicleService.calculatePrice(bo));
} }
...@@ -117,5 +120,10 @@ public class OrderRentVehicleController extends CommonBaseController { ...@@ -117,5 +120,10 @@ public class OrderRentVehicleController extends CommonBaseController {
*/ */
@ApiModelProperty(value = "是否使用出租免费天数") @ApiModelProperty(value = "是否使用出租免费天数")
private Integer rentFreeDay; private Integer rentFreeDay;
/**
* 优惠券*
*/
private String tickerNos;
} }
} }
\ No newline at end of file
...@@ -156,6 +156,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -156,6 +156,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
@Override @Override
public RentVehiclePriceVO calculatePrice(RentVehicleBO detail) { public RentVehiclePriceVO calculatePrice(RentVehicleBO detail) {
BigDecimal realAmount = BigDecimal.ZERO;
BigDecimal orderAmount = BigDecimal.ZERO; BigDecimal orderAmount = BigDecimal.ZERO;
BigDecimal goodsAmount = BigDecimal.ZERO; BigDecimal goodsAmount = BigDecimal.ZERO;
BigDecimal vehicleAmount = BigDecimal.ZERO; BigDecimal vehicleAmount = BigDecimal.ZERO;
...@@ -243,6 +244,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -243,6 +244,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//总价格(包含押金) //总价格(包含押金)
orderAmount = orderAmount.add(goodsAmount).add(vehicleModel.getDeposit()); orderAmount = orderAmount.add(goodsAmount).add(vehicleModel.getDeposit());
realAmount = orderAmount.subtract(couponAmount);
//生成订单明细 //生成订单明细
RentVehiclePriceVO rvp = new RentVehiclePriceVO(){{ RentVehiclePriceVO rvp = new RentVehiclePriceVO(){{
...@@ -254,9 +256,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -254,9 +256,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
setVehicleNum(1); setVehicleNum(1);
setDriverNum(1); setDriverNum(1);
}}; }};
rvp.setCouponAmount(couponAmount);
rvp.setOrderAmount(orderAmount); rvp.setOrderAmount(orderAmount);
rvp.setGoodsAmount(goodsAmount); rvp.setGoodsAmount(goodsAmount);
rvp.setRealAmount(orderAmount); rvp.setRealAmount(realAmount);
rvp.setDriverAmount(driverAmount); rvp.setDriverAmount(driverAmount);
rvp.setVehicleAmount(vehicleAmount); rvp.setVehicleAmount(vehicleAmount);
rvp.setDamageSafeAmount(damageSafeAmount); rvp.setDamageSafeAmount(damageSafeAmount);
......
...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException; ...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.activity.entity.Coupon; import com.xxfc.platform.activity.entity.Coupon;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.order.biz.OrderCostDetailBiz; import com.xxfc.platform.order.biz.OrderCostDetailBiz;
import com.xxfc.platform.order.biz.OrderTemplateBiz; import com.xxfc.platform.order.biz.OrderTemplateBiz;
import com.xxfc.platform.order.biz.OrderTourDetailBiz; import com.xxfc.platform.order.biz.OrderTourDetailBiz;
...@@ -78,6 +79,9 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To ...@@ -78,6 +79,9 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
@Autowired @Autowired
ThirdFeign thirdFeign; ThirdFeign thirdFeign;
@Autowired
ActivityFeign activityFeign;
@Autowired @Autowired
public HttpServletRequest request; public HttpServletRequest request;
...@@ -149,12 +153,16 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To ...@@ -149,12 +153,16 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
@Override @Override
public TourPriceVO calculatePrice(TourBO detail) { public TourPriceVO calculatePrice(TourBO detail) {
BigDecimal realAmount = BigDecimal.ZERO;
BigDecimal orderAmount = BigDecimal.ZERO; BigDecimal orderAmount = BigDecimal.ZERO;
BigDecimal goodsAmount = BigDecimal.ZERO; BigDecimal goodsAmount = BigDecimal.ZERO;
BigDecimal tourAmount = BigDecimal.ZERO; BigDecimal tourAmount = BigDecimal.ZERO;
BigDecimal realAmount = BigDecimal.ZERO; BigDecimal couponAmount = BigDecimal.ZERO;
BigDecimal insureAmount = BigDecimal.ZERO; BigDecimal insureAmount = BigDecimal.ZERO;
//当前用户
AppUserDTO dto = detail.getAppUserDTO();
if(StrUtil.isNotBlank(detail.getTourUserIds())) { if(StrUtil.isNotBlank(detail.getTourUserIds())) {
List<TourUser> users = new ArrayList<TourUser>(); List<TourUser> users = new ArrayList<TourUser>();
if(StrUtil.isNotBlank(detail.getTourUserIds())) { if(StrUtil.isNotBlank(detail.getTourUserIds())) {
...@@ -198,6 +206,9 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To ...@@ -198,6 +206,9 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
//优惠券处理 //优惠券处理
//待完成 //待完成
if(null != detail.getTickerNo() && detail.getTickerNo().size() > 0) {
couponAmount = activityFeign.use(dto.getUserid(), detail.getTickerNo().get(0), detail.getOrder().getNo(), channel, goodsAmount, ActivityFeign.TYPE_NO_USE);
}
//总价 //总价
tourAmount = tourAmount.add(tourSpePriceVo.getTotalPrice()).add(tourSpePriceVo.getTotalChildPrice()); tourAmount = tourAmount.add(tourSpePriceVo.getTotalPrice()).add(tourSpePriceVo.getTotalChildPrice());
...@@ -205,11 +216,14 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To ...@@ -205,11 +216,14 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
goodsAmount = goodsAmount.add(tourAmount); goodsAmount = goodsAmount.add(tourAmount);
//总价格 //总价格
orderAmount = orderAmount.add(goodsAmount).add(insureAmount); orderAmount = orderAmount.add(goodsAmount).add(insureAmount);
//真实价格 //真实价格
realAmount = realAmount.add(tourSpePriceVo.getRealPrice()).add(tourSpePriceVo.getRealChildPrice()).add(insureAmount); realAmount = realAmount.add(tourSpePriceVo.getRealPrice()).add(tourSpePriceVo.getRealChildPrice()).add(insureAmount).subtract(couponAmount);
//生成订单明细 //生成订单明细
TourPriceVO tpv = BeanUtil.toBean(tourSpePriceVo, TourPriceVO.class); TourPriceVO tpv = BeanUtil.toBean(tourSpePriceVo, TourPriceVO.class);
tpv.setCouponAmount(couponAmount);
tpv.setOrderAmount(orderAmount); tpv.setOrderAmount(orderAmount);
tpv.setGoodsAmount(goodsAmount); tpv.setGoodsAmount(goodsAmount);
tpv.setRealAmount(realAmount); tpv.setRealAmount(realAmount);
......
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