记得上下班打卡 | git大法好,push需谨慎

Commit 074c2c2d authored by jiangxiulong's avatar jiangxiulong

canRefundPriceExpress

parent 520e3db1
...@@ -104,6 +104,9 @@ public class KylinOrderTicketPreVo implements Serializable, Cloneable { ...@@ -104,6 +104,9 @@ public class KylinOrderTicketPreVo implements Serializable, Cloneable {
@ApiModelProperty(value = "快递状态") @ApiModelProperty(value = "快递状态")
private Integer expressStatus; private Integer expressStatus;
@ApiModelProperty(value = "可退的快递费金额")
private BigDecimal canRefundPriceExpress;
private static final KylinOrderTicketPreVo obj = new KylinOrderTicketPreVo(); private static final KylinOrderTicketPreVo obj = new KylinOrderTicketPreVo();
public static KylinOrderTicketPreVo getNew() { public static KylinOrderTicketPreVo getNew() {
......
...@@ -87,22 +87,6 @@ public class KylinOrderTicketsRefundServiceImpl { ...@@ -87,22 +87,6 @@ public class KylinOrderTicketsRefundServiceImpl {
return ResponseDto.failure(ErrorMapping.get("20003")); return ResponseDto.failure(ErrorMapping.get("20003"));
} }
} }
// 可退快递费
// 快递费 判断是否是最后一张入场人票 减去已经退的快递费
BigDecimal canRefundPriceExpress = BigDecimal.valueOf(0);
// 正在和已经退的快递票金额 正在和已经退的票数量
Integer refundNum = 0;
BigDecimal priceExpressOld = BigDecimal.valueOf(0);
for (KylinOrderRefundsVo refundVo : kylinOrderRefundsVoBaseList) {
int status = refundVo.getStatus();
if (status != KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL && status != KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT) { //退款流程未完成和已完成的
refundNum ++;
priceExpressOld = priceExpressOld.add(refundVo.getPriceExpress());
}
}
if (refundNum + 1 == orderTicketVo.getNumber()) {
canRefundPriceExpress = orderTicketVo.getPriceExpress().subtract(priceExpressOld);
}
// 入场人 数据脱敏/退款 // 入场人 数据脱敏/退款
List<KylinOrderTicketEntitiesVo> kylinOrderTicketEntitiesVoList = orderTicketVo.getEntitiesVoList(); List<KylinOrderTicketEntitiesVo> kylinOrderTicketEntitiesVoList = orderTicketVo.getEntitiesVoList();
List<KylinOrderTicketEntitiesPreRefundVo> kylinOrderTicketEntitiesPreRefundVos = ObjectUtil.getKylinOrderTicketEntitiesPreRefundVoArrayList(); List<KylinOrderTicketEntitiesPreRefundVo> kylinOrderTicketEntitiesPreRefundVos = ObjectUtil.getKylinOrderTicketEntitiesPreRefundVoArrayList();
...@@ -120,9 +104,6 @@ public class KylinOrderTicketsRefundServiceImpl { ...@@ -120,9 +104,6 @@ public class KylinOrderTicketsRefundServiceImpl {
BigDecimal chargesRatio = getChargesRatio(orderTicketVo.getUseStart(), performanceVo.getIsRefundPoundage()); BigDecimal chargesRatio = getChargesRatio(orderTicketVo.getUseStart(), performanceVo.getIsRefundPoundage());
BigDecimal chargesPrice = item.getPriceCanRefund().multiply(chargesRatio).setScale(2, BigDecimal.ROUND_HALF_UP); BigDecimal chargesPrice = item.getPriceCanRefund().multiply(chargesRatio).setScale(2, BigDecimal.ROUND_HALF_UP);
item.setPriceCanRefund(item.getPriceCanRefund().subtract(chargesPrice)); item.setPriceCanRefund(item.getPriceCanRefund().subtract(chargesPrice));
if (item.getPriceCanRefund().compareTo(BigDecimal.ZERO) == 1) {
item.setPriceCanRefund(item.getPriceCanRefund().add(canRefundPriceExpress));
}
item.setChargesRatio(chargesRatio); item.setChargesRatio(chargesRatio);
item.setChargesPrice(chargesPrice); item.setChargesPrice(chargesPrice);
...@@ -144,6 +125,22 @@ public class KylinOrderTicketsRefundServiceImpl { ...@@ -144,6 +125,22 @@ public class KylinOrderTicketsRefundServiceImpl {
// 快递状态 // 快递状态
Integer orderExpressStatus = dataUtils.getOrderExpressInfo(orderTicketVo.getOrderTicketsId()); Integer orderExpressStatus = dataUtils.getOrderExpressInfo(orderTicketVo.getOrderTicketsId());
vo.setExpressStatus(orderExpressStatus); vo.setExpressStatus(orderExpressStatus);
// 可退快递费
// 快递费 判断是否是最后一张入场人票 减去已经退的快递费
BigDecimal canRefundPriceExpress = BigDecimal.valueOf(0);
// 正在和已经退的快递票金额 正在和已经退的票数量
Integer refundNum = 0;
BigDecimal priceExpressOld = BigDecimal.valueOf(0);
for (KylinOrderRefundsVo refundVo : kylinOrderRefundsVoBaseList) {
int status = refundVo.getStatus();
if (status != KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL && status != KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT) { //退款流程未完成和已完成的
refundNum ++;
priceExpressOld = priceExpressOld.add(refundVo.getPriceExpress());
}
}
if (refundNum + 1 == orderTicketVo.getNumber()) {
canRefundPriceExpress = orderTicketVo.getPriceExpress().subtract(priceExpressOld);
}
// 整理返回数据 // 整理返回数据
BeanUtils.copyProperties(orderTicketVo, vo); BeanUtils.copyProperties(orderTicketVo, vo);
vo.setIsRefundPoundage(performanceVo.getIsRefundPoundage()); vo.setIsRefundPoundage(performanceVo.getIsRefundPoundage());
...@@ -155,6 +152,7 @@ public class KylinOrderTicketsRefundServiceImpl { ...@@ -155,6 +152,7 @@ public class KylinOrderTicketsRefundServiceImpl {
vo.setIsTrueName(performanceVo.getIsTrueName()); vo.setIsTrueName(performanceVo.getIsTrueName());
vo.setIsRefundExpress(performanceVo.getIsRefundExpress()); vo.setIsRefundExpress(performanceVo.getIsRefundExpress());
vo.setEntitiesPreRefundVos(kylinOrderTicketEntitiesPreRefundVos); vo.setEntitiesPreRefundVos(kylinOrderTicketEntitiesPreRefundVos);
vo.setCanRefundPriceExpress(canRefundPriceExpress);
return ResponseDto.success(vo); return ResponseDto.success(vo);
} catch (Exception e) { } catch (Exception e) {
log.error("toOrderRefundDetailsException", e); log.error("toOrderRefundDetailsException", e);
......
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