From 4b0e743d96a0057e89207173a23f20e10d80fbff Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 10 Apr 2024 20:05:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?:sparkles:=E6=96=B0=E5=A2=9E=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7=E9=95=BF?= =?UTF-8?q?=E6=B2=99=E4=BD=8F=E6=88=BF=E5=85=AC=E7=A7=AF=E9=87=91=E6=AF=8F?= =?UTF-8?q?=E6=9C=88=E6=B1=87=E7=BC=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" new file mode 100644 index 0000000..95d3dda --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" @@ -0,0 +1 @@ + {"mMap":{"tableName":"AppMessage","description":"账户类型:住房公积金账户\n业务日期:20240410\n业务描述:汇缴[202404]\n业务金额:2154\n账户余额:29625.63","source":"长沙住房公积金","arg":"msgId","type":5,"appId":"","msgId":60287,"title":"公积金账户资金变动提醒"}} \ No newline at end of file From 230842c4c2eaa00a89194d63ef62e8c6ff82e641 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 10 Apr 2024 20:07:39 +0800 Subject: [PATCH 2/6] =?UTF-8?q?:sparkles:=E6=96=B0=E5=A2=9E=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7=E9=95=BF?= =?UTF-8?q?=E6=B2=99=E4=BD=8F=E6=88=BF=E5=85=AC=E7=A7=AF=E9=87=91=E6=AF=8F?= =?UTF-8?q?=E6=9C=88=E6=B1=87=E7=BC=B4=20#33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main.js" | 49 +++++++++++++++++++ .../main.test.js" | 25 ++++++++++ ...7\346\234\210\346\261\207\347\274\264.txt" | 1 + 3 files changed, 75 insertions(+) create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.js" create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.test.js" create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.js" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.js" new file mode 100644 index 0000000..5790f62 --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.js" @@ -0,0 +1,49 @@ +import { RuleObject } from "../../../../utils/RuleObject"; +import { BillType } from "../../../../utils/BillType"; +import { Currency } from "../../../../utils/Currency"; + + +export function get(data) { + data = JSON.parse(data); + let mapItem = data.mMap; + if (mapItem.source!=="长沙住房公积金") return null; + if (mapItem.title==="公积金账户资金变动提醒") { + let result = { + type: null, + money: 0, + fee: 0, + shopName: "", + shopItem: "", + accountNameFrom: "", + accountNameTo: "", + currency: Currency['人民币'], + time: null, + channel:mapItem.title + }; + let text = mapItem.description; + let regex = /账户类型:(.*?)\n业务日期:(.*?)\n业务描述:(.*?)\n业务金额:(.*?)\n账户余额:.*/; + let match = text.match(regex); + if (match) { + if (match[3].includes("汇缴")) { + result.type = BillType.Income; + } + result.time = match[2]; + result.shopName = mapItem.source; + result.shopItem = match[3]; + result.money = parseFloat(match[4]); + result.accountNameFrom = match[1]; + } + return new RuleObject( + result.type, + result.money, + result.shopName, + result.shopItem, + result.accountNameFrom, + result.accountNameTo, + result.fee, + result.currency, + result.time, + result.channel + ); + } +} \ No newline at end of file diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.test.js" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.test.js" new file mode 100644 index 0000000..947286f --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/main.test.js" @@ -0,0 +1,25 @@ +const { get } = require('./main'); +const fs = require('fs'); +const path = require('path'); + +test("长沙住房公积金每月汇缴", () => { + + const dataFilePath = path.join(__dirname, 'tests', '长沙住房公积金每月汇缴.txt'); + // 使用readFileSync来同步读取文件内容 + const data = fs.readFileSync(dataFilePath, 'utf8') + + let result = get(data); + + expect(result).toEqual({ + type: 1, + money: 2154, + fee: 0, + shopName: '长沙住房公积金', + shopItem: '汇缴[202404]', + accountNameFrom: '住房公积金账户', + accountNameTo: '', + currency: 'CNY', + time: "20240410", + channel: '公积金账户资金变动提醒' + }); +}) diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" new file mode 100644 index 0000000..95d3dda --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221/tests/\351\225\277\346\262\231\344\275\217\346\210\277\345\205\254\347\247\257\351\207\221\346\257\217\346\234\210\346\261\207\347\274\264.txt" @@ -0,0 +1 @@ + {"mMap":{"tableName":"AppMessage","description":"账户类型:住房公积金账户\n业务日期:20240410\n业务描述:汇缴[202404]\n业务金额:2154\n账户余额:29625.63","source":"长沙住房公积金","arg":"msgId","type":5,"appId":"","msgId":60287,"title":"公积金账户资金变动提醒"}} \ No newline at end of file From 0ce18b8c1579e890b0586b44b1276a9d74c30eb9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 10 Apr 2024 21:02:13 +0800 Subject: [PATCH 3/6] =?UTF-8?q?:sparkles:=E6=96=B0=E5=A2=9E=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7=E9=95=BF?= =?UTF-8?q?=E6=B2=99=E9=93=B6=E8=A1=8C=E6=94=AF=E4=BB=98=E5=AE=9D=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=8F=96=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main.js" | 49 +++++++++++++++++++ .../main.test.js" | 25 ++++++++++ ...7\344\273\230\345\217\226\345\207\272.txt" | 1 + 3 files changed, 75 insertions(+) create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" new file mode 100644 index 0000000..62da8df --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" @@ -0,0 +1,49 @@ +import { RuleObject } from "../../../../utils/RuleObject"; +import { BillType } from "../../../../utils/BillType"; +import { Currency } from "../../../../utils/Currency"; + + +export function get(data) { + data = JSON.parse(data); + let mapItem = data.mMap; + if (mapItem.source!=="长沙银行") return null; + if (mapItem.title==="交易成功提醒") { + let result = { + type: null, + money: 0, + fee: 0, + shopName: "", + shopItem: "", + accountNameFrom: "", + accountNameTo: "", + currency: null, + time: null, + channel:"长沙银行"+mapItem.title + }; + let text = mapItem.description; + let regex = /交易时间:(.*?)\n交易类型:(.*?)(个人账户:尾号(\d{4}))\n交易金额:人民币(.*?)元\n账户余额:.*?元\n交易说明:(.*)/; + let match = text.match(regex); + if (match) { + if (match[2].includes("支付取出")) { + result.type = BillType.Expend; + } + result.time = match[1]; + result.shopItem = match[5]; + result.money = parseFloat(match[4]); + result.accountNameFrom =`长沙银行(${match[3]})`; + result.currency = Currency['人民币']; + } + return new RuleObject( + result.type, + result.money, + result.shopName, + result.shopItem, + result.accountNameFrom, + result.accountNameTo, + result.fee, + result.currency, + result.time, + result.channel + ); + } +} \ No newline at end of file diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" new file mode 100644 index 0000000..3cd9bfa --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" @@ -0,0 +1,25 @@ +const { get } = require('./main'); +const fs = require('fs'); +const path = require('path'); + +test("长沙住房公积金每月汇缴", () => { + + const dataFilePath = path.join(__dirname, 'tests', '长沙银行支付宝支付取出.txt'); + // 使用readFileSync来同步读取文件内容 + const data = fs.readFileSync(dataFilePath, 'utf8') + + let result = get(data); + + expect(result).toEqual({ + type: 0, + money: 200, + fee: 0, + shopName: '', + shopItem: '中国电信股份有限公司全渠道运营中心-商品...', + accountNameFrom: '长沙银行(2754)', + accountNameTo: '', + currency: 'CNY', + time: "04月10日09:03", + channel: '长沙银行交易成功提醒' + }); +}) diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" new file mode 100644 index 0000000..272b628 --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" @@ -0,0 +1 @@ + {"mMap":{"tableName":"AppMessage","description":"交易时间:04月10日09:03\n交易类型:支付宝支付取出(个人账户:尾号2754)\n交易金额:人民币200.00元\n账户余额:19,720.27元\n交易说明:中国电信股份有限公司全渠道运营中心-商品...","source":"长沙银行","arg":"msgId","type":5,"appId":"","msgId":60255,"title":"交易成功提醒"}} \ No newline at end of file From 8e445a9cb89748491c3ace42e89b44b749d038eb Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 10 Apr 2024 21:02:13 +0800 Subject: [PATCH 4/6] =?UTF-8?q?:sparkles:=E6=96=B0=E5=A2=9E=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7=E9=95=BF?= =?UTF-8?q?=E6=B2=99=E9=93=B6=E8=A1=8C=E6=94=AF=E4=BB=98=E5=AE=9D=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=8F=96=E5=87=BA=20#31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main.js" | 49 +++++++++++++++++++ .../main.test.js" | 25 ++++++++++ ...7\344\273\230\345\217\226\345\207\272.txt" | 1 + 3 files changed, 75 insertions(+) create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" create mode 100644 "src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" new file mode 100644 index 0000000..62da8df --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.js" @@ -0,0 +1,49 @@ +import { RuleObject } from "../../../../utils/RuleObject"; +import { BillType } from "../../../../utils/BillType"; +import { Currency } from "../../../../utils/Currency"; + + +export function get(data) { + data = JSON.parse(data); + let mapItem = data.mMap; + if (mapItem.source!=="长沙银行") return null; + if (mapItem.title==="交易成功提醒") { + let result = { + type: null, + money: 0, + fee: 0, + shopName: "", + shopItem: "", + accountNameFrom: "", + accountNameTo: "", + currency: null, + time: null, + channel:"长沙银行"+mapItem.title + }; + let text = mapItem.description; + let regex = /交易时间:(.*?)\n交易类型:(.*?)(个人账户:尾号(\d{4}))\n交易金额:人民币(.*?)元\n账户余额:.*?元\n交易说明:(.*)/; + let match = text.match(regex); + if (match) { + if (match[2].includes("支付取出")) { + result.type = BillType.Expend; + } + result.time = match[1]; + result.shopItem = match[5]; + result.money = parseFloat(match[4]); + result.accountNameFrom =`长沙银行(${match[3]})`; + result.currency = Currency['人民币']; + } + return new RuleObject( + result.type, + result.money, + result.shopName, + result.shopItem, + result.accountNameFrom, + result.accountNameTo, + result.fee, + result.currency, + result.time, + result.channel + ); + } +} \ No newline at end of file diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" new file mode 100644 index 0000000..3cd9bfa --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/main.test.js" @@ -0,0 +1,25 @@ +const { get } = require('./main'); +const fs = require('fs'); +const path = require('path'); + +test("长沙住房公积金每月汇缴", () => { + + const dataFilePath = path.join(__dirname, 'tests', '长沙银行支付宝支付取出.txt'); + // 使用readFileSync来同步读取文件内容 + const data = fs.readFileSync(dataFilePath, 'utf8') + + let result = get(data); + + expect(result).toEqual({ + type: 0, + money: 200, + fee: 0, + shopName: '', + shopItem: '中国电信股份有限公司全渠道运营中心-商品...', + accountNameFrom: '长沙银行(2754)', + accountNameTo: '', + currency: 'CNY', + time: "04月10日09:03", + channel: '长沙银行交易成功提醒' + }); +}) diff --git "a/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" new file mode 100644 index 0000000..272b628 --- /dev/null +++ "b/src/rule/app/com.tencent.mm/\345\276\256\344\277\241\345\205\254\344\274\227\345\217\267\351\225\277\346\262\231\351\223\266\350\241\214/tests/\351\225\277\346\262\231\351\223\266\350\241\214\346\224\257\344\273\230\345\256\235\346\224\257\344\273\230\345\217\226\345\207\272.txt" @@ -0,0 +1 @@ + {"mMap":{"tableName":"AppMessage","description":"交易时间:04月10日09:03\n交易类型:支付宝支付取出(个人账户:尾号2754)\n交易金额:人民币200.00元\n账户余额:19,720.27元\n交易说明:中国电信股份有限公司全渠道运营中心-商品...","source":"长沙银行","arg":"msgId","type":5,"appId":"","msgId":60255,"title":"交易成功提醒"}} \ No newline at end of file From 7a8b696a2ce3b926ddf40a7fdf77504735767a34 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 10 Apr 2024 21:33:31 +0800 Subject: [PATCH 5/6] =?UTF-8?q?:sparkles:=E6=96=B0=E5=A2=9E=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=94=AF=E4=BB=98=E5=AE=9D=E4=BA=B2=E6=83=85=E5=8D=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=20#32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\272\262\346\203\205\345\215\241\346\224\257\344\273\230.txt" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/tests/\346\224\257\344\273\230\345\256\235\344\272\262\346\203\205\345\215\241\346\224\257\344\273\230.txt" diff --git "a/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/tests/\346\224\257\344\273\230\345\256\235\344\272\262\346\203\205\345\215\241\346\224\257\344\273\230.txt" "b/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/tests/\346\224\257\344\273\230\345\256\235\344\272\262\346\203\205\345\215\241\346\224\257\344\273\230.txt" new file mode 100644 index 0000000..f9c5838 --- /dev/null +++ "b/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/tests/\346\224\257\344\273\230\345\256\235\344\272\262\346\203\205\345\215\241\346\224\257\344\273\230.txt" @@ -0,0 +1 @@ + [{"mk":240450123544200019,"st":1,"isSc":0,"appId":"","mct":1712723745000,"pl":"{\"templateType\":\"BN\",\"commandType\":\"UPDATE\",\"withPushNfc\":\"Y\",\"expireLink\":\"\",\"msgType\":\"TODO\",\"icon\":\"https:\/\/gw.alipayobjects.com\/mdn\/rms_f96971\/afts\/img\/A*leNcS41oUu0AAAAAAAAAAABkARQnAQ\",\"link\":\"alipays:\/\/platformapi\/startapp?appId=20000003&actionType=toBillDetails&tradeNO=2024041004200106001019049767&bizType=PPAY?tagid=MB_SEND_PUSH_WALLET_NEW\",\"businessId\":\"PAY_HELPER_CARD_2088512606574244\",\"msgId\":\"3873c9591038f08e088ec85ac8e0b0d600424\",\"templateCode\":\"00059_00094_zfzs001\",\"templateId\":\"WALLET-BILL@BLPaymentHelper\",\"title\":\"付款成功\",\"content\":\"{\\\"status\\\":\\\"付款成功\\\",\\\"date\\\":\\\"04月10日\\\",\\\"amountTip\\\":\\\"\\\",\\\"money\\\":\\\"55.00\\\",\\\"unit\\\":\\\"元\\\",\\\"infoTip\\\":\\\"\\\",\\\"failTip\\\":\\\"\\\",\\\"goto\\\":\\\"alipays:\/\/platformapi\/startapp?appId=20000003&actionType=toBillDetails&tradeNO=2024041004200106001019049767&bizType=PPAY\\\",\\\"content\\\":[{\\\"title\\\":\\\"付款方式:\\\",\\\"content\\\":\\\"北京银行信用购(原花呗)\\\"},{\\\"title\\\":\\\"交易对象:\\\",\\\"content\\\":\\\"173******86(未实名)\\\"}],\\\"ad\\\":[],\\\"actions\\\":[{\\\"name\\\":\\\"\\\",\\\"url\\\":\\\"\\\"},{\\\"name\\\":\\\"查看详情\\\",\\\"url\\\":\\\"alipays:\/\/platformapi\/startapp?appId=20000003&actionType=toBillDetails&tradeNO=2024041004200106001019049767&bizType=PPAY\\\"}]}\",\"linkName\":\"\",\"bizName\":\"支付助手\",\"msgCategory\":\"bill\",\"scm\":\"27.gotone.card.3873c9591038f08e088ec85ac8e0b0d600424.MB_SEND_PUSH_WALLET_NEW.null.payment_assist.43545.11069.2019062521000502094325.990\",\"assistInfo\":\"{\\\"showInFriendTab\\\":false,\\\"icon\\\":\\\"https:\/\/gw.alipayobjects.com\/mdn\/rms_f96971\/afts\/img\/A*ZapXT6AjvG0AAAAAAAAAAABkARQnAQ\\\",\\\"reminderType\\\":\\\"point\\\",\\\"hiddenMsgHeader\\\":false,\\\"title\\\":\\\"支付助手\\\",\\\"reminderTypeModifyEnable\\\":false,\\\"assistId\\\":\\\"payment_assist\\\",\\\"desc\\\":\\\"支付宝资金变动通知\\\"}\",\"ih\":\"{\\\"extInfo\\\":{},\\\"iid\\\":\\\"105\\\",\\\"ioty\\\":\\\"aor\\\",\\\"itemBasicInfo\\\":{\\\"dn\\\":\\\"服务提醒\\\",\\\"ic\\\":\\\"https:\/\/gw.alipayobjects.com\/zos\/bmw-prod\/b96c31e0-64ba-4cbb-9a64-73ff17d701fd.webp\\\",\\\"lk\\\":\\\"alipays:\/\/platformapi\/startapp?appId=20000235&source=friendTab\\\"},\\\"itemUserRelation\\\":{\\\"ilf\\\":\\\"N\\\",\\\"uc\\\":{\\\"top\\\":\\\"0\\\",\\\"notDisturb\\\":\\\"1\\\"},\\\"version\\\":0},\\\"ity\\\":\\\"105\\\",\\\"moty\\\":\\\"u\\\",\\\"msgInfo\\\":{\\\"bm\\\":\\\"付款成功¥55.00 \\\",\\\"cmid\\\":\\\"3873c9591038f08e088ec85ac8e0b0d600424\\\",\\\"lmt\\\":1712723744833,\\\"msrid\\\":\\\"00059_00094_zfzs001\\\",\\\"ncs\\\":\\\"N\\\",\\\"rps\\\":\\\"num\\\",\\\"sam\\\":\\\"Y\\\",\\\"ssrid\\\":\\\"PAY_HELPER_CARD_2088512606574244\\\",\\\"urn\\\":1}}\",\"bizMonitor\":\"{\\\"serviceCode\\\":\\\"MB_SEND_PUSH_WALLET_NEW\\\",\\\"bizName\\\":\\\"\\\",\\\"createTime\\\":1712723744967,\\\"businessId\\\":\\\"PAY_HELPER_CARD_2088512606574244\\\",\\\"messageId\\\":\\\"3873c9591038f08e088ec85ac8e0b0d600424\\\",\\\"messageTitle\\\":\\\"付款成功\\\",\\\"pid\\\":\\\"2088732136474061\\\",\\\"templateId\\\":\\\"WALLET-BILL@BLPaymentHelper\\\",\\\"status\\\":\\\"\\\"}\",\"languageType\":\"zh-Hans\",\"subscribeConfig\":\"0\",\"gmtCreate\":1712723744833,\"gmtValid\":1715315744825,\"operate\":\"SEND\",\"templateName\":\"支付助手\",\"homePageTitle\":\"付款成功¥55.00 \",\"status\":\"\",\"extraInfo\":\"{\\\"topSubContent\\\":\\\"付款成功\\\",\\\"preValue\\\":\\\"¥\\\",\\\"languageType\\\":\\\"zh-Hans\\\",\\\"isPaymentMsg\\\":true,\\\"assistName2\\\":\\\"交易对象\\\",\\\"assistName3\\\":\\\"\\\",\\\"assistName1\\\":\\\"付款方式\\\",\\\"templateId\\\":\\\"WALLET-FWC@remindNumber\\\",\\\"content\\\":\\\"55.00\\\",\\\"linkName\\\":\\\"\\\",\\\"assistMsg3\\\":\\\"\\\",\\\"sceneExt2\\\":{\\\"sceneUrl\\\":\\\"alipays:\/\/platformapi\/startapp?appId=20000003&actionType=toBillDetails&tradeNO=2024041004200106001019049767&bizType=PPAY\\\",\\\"sceneType\\\":\\\"nativeApp\\\",\\\"sceneName\\\":\\\"亲情卡\\\",\\\"sceneIcon\\\":\\\"http:\/\/appstoreisvpic.alipayobjects.com\/5d109f2d-971e-414d-86ce-74177a801855.jpg\\\"},\\\"assistMsg2\\\":\\\"173******86(未实名)\\\",\\\"assistMsg1\\\":\\\"北京银行信用购(原花呗)\\\",\\\"assistName4\\\":\\\"\\\",\\\"assistMsg5\\\":\\\"\\\",\\\"assistMsg4\\\":\\\"\\\",\\\"assistName5\\\":\\\"\\\",\\\"buttonLink\\\":\\\"\\\",\\\"cardAdInfo\\\":{\\\"p14\\\":{\\\"bizMonitor\\\":{\\\"marketingUniqueId\\\":\\\"MUfc5358afc71b45b79d22981075c457dd\\\",\\\"marketingRuleId\\\":\\\"MR17530a7808ea4d99935fd8da3ee81181\\\",\\\"style\\\":\\\"singleLineText3\\\",\\\"marketingItemId\\\":\\\"MIb45d6a9220ae4e94ae68f06ad7badac8\\\"},\\\"expireTime\\\":1744259744900,\\\"marketingUniqueId\\\":\\\"MUfc5358afc71b45b79d22981075c457dd\\\",\\\"minClientVersion\\\":\\\"10.1.98\\\",\\\"recommendTemplateId\\\":\\\"singleLineText3\\\",\\\"viewInfo\\\":{\\\"arrowIcon\\\":\\\"https:\/\/img.alicdn.com\/tfs\/TB1fN1OdggP7K4jSZFqXXamhVXa-32-52.png\\\",\\\"actionType\\\":\\\"link\\\",\\\"actionUrl\\\":\\\"alipays:\/\/platformapi\/startapp?appId=2021001160630824&source=socialMessage&page=%2Fpages%2Fcard-detail%2Findex%3FselfRole%3DPAYER%26partnerUserId%3D2088732136474061%26source%3DsocialMessage%26jumpFrom%3DsocialMessage%26groupId%3D2088620128372649\\\",\\\"text\\\":\\\"管理亲情卡\\\",\\\"textColor\\\":\\\"#333333\\\"}},\\\"p116\\\":{\\\"bizMonitor\\\":{\\\"marketingUniqueId\\\":\\\"MU4948c414be4e495a944d76ae7a3d6cbb\\\",\\\"outBizId\\\":\\\"LIFE_MSG_TEXT|AMTT202303091019436279|202311280460607296\\\",\\\"marketingRuleId\\\":\\\"MR9b1daa035f8440668c2cd692768d3308\\\",\\\"style\\\":\\\"actionLine2\\\",\\\"marketingItemId\\\":\\\"MIe2bc161773614c6cb36a9dc4968a0908\\\"},\\\"expireTime\\\":1744259744966,\\\"marketingUniqueId\\\":\\\"MU4948c414be4e495a944d76ae7a3d6cbb\\\",\\\"minClientVersion\\\":\\\"10.1.98\\\",\\\"recommendTemplateId\\\":\\\"actionLine2\\\",\\\"viewInfo\\\":{\\\"btnName\\\":\\\"支付奖励\\\",\\\"actionType\\\":\\\"link\\\",\\\"tagIcon\\\":\\\"https:\/\/mdn.alipayobjects.com\/huamei_cke3ep\/afts\/img\/A*s1xhTYe-_PQAAAAAAAAAAAAADk1-AQ\/original\\\",\\\"tagColor\\\":\\\"#FF6011\\\",\\\"actionUrl\\\":\\\"alipays:\/\/platformapi\/startapp?appId=68687805&url=https%3A%2F%2Frender.alipay.com%2Fp%2Fyuyan%2F180020380000000023%2Fhome-page.html%3Fbid%3D202311280460607296%26source%3DLIFE_MSG_TEXT%26chInfo%3DLIFE_MSG_TEXT%26passInfo%3D%7B%22ttci%22%3A%22AMTT202303091019436279%22%2C%22ch%22%3A%22LIFE_MSG_TEXT%22%2C%22pci%22%3A%2210025391698%22%2C%22obn%22%3A%222024041004200106001019049767%22%7D\\\",\\\"tag\\\":\\\"领4积分去兑公交红包\\\"}}}}\"}"}] \ No newline at end of file From c321cbaa5c3d5ba1dab2039ecc8980ba3b993e6b Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 10 Apr 2024 21:39:03 +0800 Subject: [PATCH 6/6] =?UTF-8?q?:sparkles:=E6=96=B0=E5=A2=9E=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=94=AF=E4=BB=98=E5=AE=9D=E4=BA=B2=E6=83=85=E5=8D=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=20#32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main.js" | 1 + .../main.test.js" | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git "a/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.js" "b/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.js" index 5e1a161..c025434 100644 --- "a/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.js" +++ "b/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.js" @@ -149,6 +149,7 @@ function handleLink(pl, result) { case pl.link.includes("bizType=B_TRANSFER"): //支付宝发红包 case pl.link.includes("bizType=TRADE"): //支付宝消费 case pl.link.includes("bizType=PREAUTHPAY"): //支付宝预授权消费 + case pl.link.includes("bizType=PPAY"): //支付宝亲情卡消费 result.type = BillType.Expend; break; case pl.link.includes("bizType=D_TRANSFER"): //支付宝转账收款 diff --git "a/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.test.js" "b/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.test.js" index 23fc2a7..777649f 100644 --- "a/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.test.js" +++ "b/src/rule/app/com.eg.android.AlipayGphone/\346\224\257\344\273\230\345\256\235\346\266\210\346\201\257\347\233\222\345\255\220/main.test.js" @@ -216,4 +216,22 @@ test("支付宝预授权消费", () => { }); }) +test("支付宝亲情卡消费", () => { + const dataFilePath = path.join(__dirname, 'tests', '支付宝亲情卡支付.txt'); + // 使用readFileSync来同步读取文件内容 + const data = fs.readFileSync(dataFilePath, 'utf8') + let result = get(data); + expect(result).toEqual({ + type: 0, + money: 55, + fee: 0, + shopName: "173******86(未实名)", + shopItem: "", + accountNameFrom: "北京银行信用购(原花呗)", + accountNameTo: "", + currency: "CNY", + time: 1712723745000, + channel: "支付宝付款成功" + }); +})