Commit 5612dbd2 authored by 周健威's avatar 周健威

添加提示和省内外旅游退款逻辑

parent 1faaf47b
......@@ -238,4 +238,7 @@ public class OrderTourDetail implements Serializable {
@ApiModelProperty(value = "出发的站点id")
private Integer siteId;
@Column(name = "is_outside")
@ApiModelProperty(value = "是否省外 1--省外;0--省内")
private Integer isOutside;
}
......@@ -7,8 +7,8 @@ import lombok.Data;
/**
* 订单查询类
*/
@Data
public class QueryOrderDTO extends PageParam {
@Data
public class QueryOrderDTO extends PageParam {
@ApiModelProperty(hidden = false)
private Integer crtUser;
......@@ -32,4 +32,6 @@ import lombok.Data;
@ApiModelProperty(value = "订单类型 1--租车;2--旅游; 3--会员订单")
private Integer type;
}
\ No newline at end of file
private String multiTypes;
}
\ No newline at end of file
......@@ -191,15 +191,32 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
setOrderId(baseOrder.getId());
}});
//如果超过出发时间,不能取消订单
//根据时间处理goodsAmount
//获取出发时间 到现在 距离时间
Long timeLag = orvd.getStartTime() - System.currentTimeMillis();
if(timeLag < 0) {
throw new BaseException(ResultCode.FAILED_CODE, new HashSet<String>(){{
add("已超过出发时间,不能取消订单");
}});
}
//退款流程
rentRefundProcess(hasUpdateOrder, orvd.getDeposit(), orvd.getStartTime(), APP_ORDER+ "_"+ RENT_REFUND);
rentRefundProcess(hasUpdateOrder, orvd.getDeposit(), timeLag, APP_ORDER+ "_"+ RENT_REFUND);
}else if (OrderTypeEnum.TOUR.getCode().equals(baseOrder.getType())) {
OrderTourDetail otd = orderTourDetailBiz.selectOne(new OrderTourDetail(){{
setOrderId(baseOrder.getId());
}});
Long timeLag = otd.getStartTime() - System.currentTimeMillis();
//判断是省内还是省外
String key = TOUR_IN_REFUND;
if(SYS_TRUE.equals(otd.getIsOutside())) {
key = TOUR_REFUND;
}
//退款流程
rentRefundProcess(hasUpdateOrder, otd.getStartTime(), APP_ORDER+ "_"+ TOUR_REFUND);
rentRefundProcess(hasUpdateOrder, timeLag, APP_ORDER+ "_"+ key);
}
}
......@@ -253,10 +270,10 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* 租车退款流程(含押金)
* @param baseOrder
* @param depositAmont
* @param startTime
* @param timeLag 与开始时间的时间差
* @param dicParentKey
*/
private void rentRefundProcess(BaseOrder baseOrder, BigDecimal depositAmont, Long startTime, String dicParentKey) {
private void rentRefundProcess(BaseOrder baseOrder, BigDecimal depositAmont, Long timeLag, String dicParentKey) {
//计算退款金额
// 1、押金 + 租金(规则扣除)
BigDecimal refundGoodsAmount = baseOrder.getGoodsAmount();
......@@ -268,7 +285,6 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//根据时间处理goodsAmount
//获取出发时间 到现在 距离时间
Long timeLag = startTime - System.currentTimeMillis();
Integer hourLag = Long.valueOf(timeLag/(1000L * 60L * 60L)).intValue();
Map<String, com.xxfc.platform.universal.entity.Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
......
......@@ -119,6 +119,9 @@ public class OrderTourService extends AbstractOrderHandle<OrderTourDetailBiz, To
bo.setStartCity(sysRegion.getId().intValue());
bo.setStartCityName(sysRegion.getName());
//设置省内,省外
bo.setIsOutside(bo.getTourGood().getIsOutside());
//设置verificationId 核销id
bo.setVerificationId(tourFeign.entityList(BeanUtil.beanToMap(new TourGoodVerification(){{
setSpeId(bo.getSpePriceId());
......
......@@ -86,6 +86,14 @@
</foreach>
)
</if>
<if test="multiTypes != null">
and
(
<foreach collection="multiTypes.split(',')" index="tIndex" item="typeEntity" separator=" or ">
type = #{typeEntity}
</foreach>
)
</if>
</where>
order by crt_time desc
</select>
......
......@@ -13,10 +13,11 @@ public class DictionaryKey {
public static final String UNIVERSAL_PAY ="UNIVERSAL_PAY";
/**
* 租车,旅游退款
* 租车,旅游(省内、省外)退款
*/
public static final String RENT_REFUND ="RENT_REFUND";
public static final String TOUR_REFUND ="TOUR_REFUND";
public static final String TOUR_IN_REFUND ="TOUR_IN_REFUND";
/**
* 租车:公司司机租金、免赔费用、违章预备金
......
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