diff --git a/web-api/ruoyi-admin/src/main/java/com/ruoyi/api/PortalVideoController.java b/web-api/ruoyi-admin/src/main/java/com/ruoyi/api/PortalVideoController.java index 8d42093..42ed67a 100644 --- a/web-api/ruoyi-admin/src/main/java/com/ruoyi/api/PortalVideoController.java +++ b/web-api/ruoyi-admin/src/main/java/com/ruoyi/api/PortalVideoController.java @@ -194,6 +194,7 @@ public class PortalVideoController extends BaseController { aiOrder.setMode(mode); aiOrder.setIsBackfilled(0); applyOrderImages(aiOrder, req); + aiOrder.setExtStatus(0); if (req.getDuration() != null) { aiOrder.setDuration(req.getDuration()); } else if (body.getDuration() != null) { diff --git a/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/service/impl/AiOrderServiceImpl.java b/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/service/impl/AiOrderServiceImpl.java index 6bbab29..6ae72c7 100644 --- a/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/service/impl/AiOrderServiceImpl.java +++ b/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/service/impl/AiOrderServiceImpl.java @@ -58,8 +58,11 @@ public class AiOrderServiceImpl implements IAiOrderService { @Autowired private IAiStatisticsService aiStatisticsService; - // 任务成功时流水表备注 - private static final String TASK_SUCCESS_BALANCE_REMARK = "order.number.generation.successes"; + // 流水表:任务成功时回补 + private static final String TASK_SUCCESS_BACK_FILL_REMARK = "order.number.generation.successbackfill"; + + // 流水表:提交任务时预扣 + private static final String TASK_SUBMIT_REMARK = "order.number.generation.submit"; /** * 查询订单管理 @@ -183,6 +186,7 @@ public class AiOrderServiceImpl implements IAiOrderService { aiOrder.setType(aiType); aiOrder.setResult(null); if (isReduceBalance) { + aiOrder.setPreDeductAmount(aiManager.getPrice()); aiOrder.setAmount(aiManager.getPrice()); } else { // 不按aimanager扣减的,等提交任务再按实扣减 @@ -194,7 +198,7 @@ public class AiOrderServiceImpl implements IAiOrderService { // 执行余额变更 if (isReduceBalance) { aiUserService.addUserBalance(orderno, SecurityUtils.getAiUserId() - , NumberUtil.mul(-1, aiManager.getPrice()), getChangerType(aiType)); + , NumberUtil.mul(-1, aiManager.getPrice()), getChangerType(aiType), TASK_SUBMIT_REMARK); } return aiOrder; } @@ -322,7 +326,7 @@ public class AiOrderServiceImpl implements IAiOrderService { if (addAmount.compareTo(new BigDecimal(0)) != 0) { // 回补 aiUserService.addUserBalance(order.getOrderNum(), order.getUserId(), addAmount, - BalanceChangerConstants.REFUND, TASK_SUCCESS_BALANCE_REMARK); + BalanceChangerConstants.REFUND, TASK_SUCCESS_BACK_FILL_REMARK); } }