From 96a81ced33085ff73050fe6156e98d5eef72bbe3 Mon Sep 17 00:00:00 2001 From: unknown <627433532@qq.com> Date: Mon, 15 Apr 2024 10:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=B6=88=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uca/notification/NotifyReversalOrder.java | 50 ------------------- .../uca/notification/NotifyReversalParam.java | 29 ----------- 2 files changed, 79 deletions(-) delete mode 100644 zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalOrder.java delete mode 100644 zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalParam.java diff --git a/zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalOrder.java b/zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalOrder.java deleted file mode 100644 index a6e0da0c..00000000 --- a/zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalOrder.java +++ /dev/null @@ -1,50 +0,0 @@ -package io.vertx.mod.fm.uca.notification; - -import cn.vertxup.fm.domain.tables.daos.FBillDao; -import cn.vertxup.fm.domain.tables.pojos.FBill; -import io.horizon.spi.feature.Transit; -import io.vertx.core.Future; -import io.vertx.core.json.JsonObject; -import io.vertx.mod.fm.cv.Addr; -import io.vertx.up.annotations.Address; -import io.vertx.up.annotations.Subscribe; -import io.vertx.up.commune.config.XHeader; -import io.vertx.up.eon.KName; -import io.vertx.up.unity.Ux; - -/** - * 冲账提醒处理 - * - * @author lang : 2024-04-03 - */ -public class NotifyReversalOrder { - /* - * 冲账提交专用提醒模型,此处为基础站内信模式 - * 1. 如果 WebSocket 存在订阅,那么此处才会执行,若没有开浏览器,则不会执行 - * 2. 发送完成之后,消息会直接发送到浏览器中,使用回调模式来创建消息历史,只存在 SENT 和 HISTORY 两种状态 - */ - @Subscribe("reversal-order") - @Address(Addr.Notify.REVERSAL_ORDER) - public Future submitNotify(final JsonObject input, final XHeader header) { - return Ux.Jooq.on(FBillDao.class).fetchOneAsync("key",input.getString("billId")).compose(bill->{ - JsonObject entries = new JsonObject(); - entries.put(KName.Finance.AMOUNT,input.getString("amount")); - entries.put(KName.Finance.SERIAL,input.getString("serial")); - entries.put(KName.Finance.REALNAME,input.getString("realname")); - entries.put(KName.Finance.ROOMNUMBER,bill.getModelKey()); - entries.put(KName.Finance.CREATEDAT,input.getString("createdAt")); - entries.put(KName.SIGMA, header.getSigma()); - entries.put(KName.APP_ID, header.getAppId()); - entries.put(KName.Finance.NAME,"冲账"); - return Ux.future(entries); - }).compose(massger->{ - JsonObject entries = new JsonObject(); - entries.put(KName.DATA,massger); - entries.put(KName.SIGMA, header.getSigma()); - entries.put(KName.APP_ID, header.getAppId()); - entries.put(KName.MESSAGE, "NOTIFY.REVERSAL.ORDER"); - return Ux.channel(Transit.class, JsonObject::new, stub -> stub.message(entries)) - .compose(message -> Ux.future(NotifyReversalParam.response(message, input))); - }); - } -} diff --git a/zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalParam.java b/zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalParam.java deleted file mode 100644 index b1df88ef..00000000 --- a/zero-fm/src/main/modulat/io/vertx/mod/fm/uca/notification/NotifyReversalParam.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.vertx.mod.fm.uca.notification; - -import io.vertx.core.json.JsonObject; -import io.vertx.up.commune.config.XHeader; -import io.vertx.up.eon.KName; - -import java.util.Objects; - -/** - * @author lang : 2024-04-04 - */ -class NotifyReversalParam { - - static JsonObject normalized(final JsonObject input, final XHeader header) { - final JsonObject params = new JsonObject(); - if (Objects.nonNull(header)) { - params.put(KName.SIGMA, header.getSigma()); - params.put(KName.APP_ID, header.getAppId()); - } - params.put(KName.DATA, input); - return params; - } - - static JsonObject response(final JsonObject message, final JsonObject input) { - final JsonObject response = message.copy(); - response.put("request", input); - return response; - } -} -- Gitee