|
|
@@ -130,6 +130,18 @@ public class OrderQueryServiceImpl implements OrderQueryService {
|
|
|
@Value("${staking.constants.PROFIT_MODE_TEXT}")
|
|
|
private String PROFIT_MODE_TEXT;
|
|
|
|
|
|
+ @Value("${staking.constants.PROFIT_DISPLAY_UNCLAIMED}")
|
|
|
+ private String PROFIT_DISPLAY_UNCLAIMED ;
|
|
|
+
|
|
|
+ @Value("${staking.constants.PROFIT_DISPLAY_CLAIMED}")
|
|
|
+ private String PROFIT_DISPLAY_CLAIMED;
|
|
|
+
|
|
|
+ @Value("${staking.constants.WAIT_SETTLE_TEXT}")
|
|
|
+ private String WAIT_SETTLE_TEXT;
|
|
|
+
|
|
|
+ @Value("${staking.constants.SETTLE_REMARK}")
|
|
|
+ private String SETTLE_REMARK;
|
|
|
+
|
|
|
private static final String DEFAULT_LANGUAGE = "zh";
|
|
|
|
|
|
/** 订单展示状态:持仓中(HOLDING)。也用于尚未清算的已到期(MATURED)订单 */
|
|
|
@@ -141,6 +153,18 @@ public class OrderQueryServiceImpl implements OrderQueryService {
|
|
|
/** 订单展示状态:常规赎回完成(SETTLED) */
|
|
|
public static final String ORDER_SETTLED = "已完成";
|
|
|
|
|
|
+ /** 订单收益状态展示:收益待领取 */
|
|
|
+ public static final String PROFIT_STATUS = "收益待领取";
|
|
|
+
|
|
|
+ /** 订单展示状态:收益领取完成(CLAIMED) */
|
|
|
+ public static final String PROFIT_CLAIMED = "已领取";
|
|
|
+
|
|
|
+ /** 订单收益状态展示:等待18:00结算 */
|
|
|
+ public static final String PROFIT_WAIT_SETTLE = "等待 18:00 结算";
|
|
|
+
|
|
|
+ /** 订单展示状态:结算备注 */
|
|
|
+ public static final String PROFIT_SETTLE_REMARK = "系统每日 18:00 固定结算收益,若当日结算失败将自动补算,不影响累计收益。";
|
|
|
+
|
|
|
@Override
|
|
|
public Page<StakingOrderListVO> pageOrders(Long userId, StakingOrderQuery query, String localeName) {
|
|
|
// 1. 分页参数兜底:page 缺省 1、size 缺省 10(需求 6.9)
|
|
|
@@ -210,7 +234,16 @@ public class OrderQueryServiceImpl implements OrderQueryService {
|
|
|
// 6. 组装进行中详情命令并装配为契约 VO(需求 7.2、7.3、7.4)
|
|
|
OngoingOrderDetailAssembly assembly = new OngoingOrderDetailAssembly(
|
|
|
order, productName, lockDays, remainDays, shrinkThreshold, displayScale, profitList);
|
|
|
- return stakingOngoingOrderDetailConverter.toVo(assembly);
|
|
|
+ StakingOngoingOrderDetailVO vo = stakingOngoingOrderDetailConverter.toVo(assembly);
|
|
|
+ vo.setOrderStatus(ORDER_HOLDING.equals(vo.getOrderStatus()) ? resolveLocalizedText(ORDER_DISPLAY_HOLDING,localeName)
|
|
|
+ : ORDER_DEFLATED.equals(vo.getOrderStatus()) ? resolveLocalizedText(ORDER_DISPLAY_DEFLATED,localeName) : resolveLocalizedText(ORDER_DISPLAY_SETTLED,localeName));
|
|
|
+ List<StakingProfitItemVO> profits = vo.getProfitList();
|
|
|
+ for (StakingProfitItemVO profit : profits) {
|
|
|
+ profit.setProfitStatus(PROFIT_STATUS.equals(profit.getProfitStatus()) ? resolveLocalizedText(PROFIT_DISPLAY_UNCLAIMED,localeName) : PROFIT_CLAIMED.equals(profit.getProfitStatus()) ? resolveLocalizedText(PROFIT_DISPLAY_CLAIMED,localeName) :
|
|
|
+ PROFIT_WAIT_SETTLE.equals(profit.getProfitStatus()) ? resolveLocalizedText(WAIT_SETTLE_TEXT,localeName) : "");
|
|
|
+ profit.setRemark(PROFIT_SETTLE_REMARK.equals(profit.getRemark()) ? resolveLocalizedText(SETTLE_REMARK,localeName) : "");
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
}
|
|
|
|
|
|
@Override
|