feat: 补齐客户端/管理端服务模块与数据库 schema,完善登录短信、法大大签署及公共函数

This commit is contained in:
2026-10-14 21:55:08 +08:00
parent 3481fda7a0
commit 55bcf96889
545 changed files with 28151 additions and 415 deletions
@@ -0,0 +1,78 @@
'use strict';
const dayjs = require("dayjs");
const OpenSdk = require('../../../../util/base').default;
const sdk = new OpenSdk({
appId: '8a81c1db8fc5238d01910b9e312d0692',
appKey: 'a15ceac60f5b464eb758c4fe7800ee9f'
})
module.exports = {
/**
* XXXnameXXX
* @url admin/old/sys/refund 前端调用的url参数地址
* data 请求参数
* @param {String} params1 参数1
*/
main: async (event) => {
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
let {uid, orderStatus, refundRefuseReason} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
await vk.baseDao.updateById({
dbName: "jjx-order",
id: data.id,
dataJson: {
orderStatus,
refundRefuseReason
}
});
const order = await vk.baseDao.findByWhereJson({
dbName: "jjx-order",
whereJson: {
_id: data.id
}
})
let refundData = {
queryUrl: 'https://api-mop.chinaums.com/v1/netpay/bills/refund',
timestamp: dayjs().format('YYYYMMDDHHmmss'),
nonce: 'rp84ufhfn20yneo3tp',
content: {
requestTimestamp: dayjs().format('YYYY-MM-DD HH:mm:ss'),
// mid: '8984501521190CF',
// tid: '20713432',
mid: '898450100002303',
tid: 'G5SBN2XJ',
instMid: 'QRPAYDEFAULT',
billNo: order.orderNo,
billDate: dayjs(order.payTime).format('YYYY-MM-DD'),
refundAmount: order.payAmount * 100
}
}
console.log('退款数据', refundData)
if (orderStatus === 6) {
console.log('退款执行')
sdk.exec(refundData).then(res => {
const result = JSON.parse(res);
console.log('退款结果', result)
// if (result.errCode === 'SUCCESS') {
// }
}).catch(err => {
console.log('退款失败', err)
}).finally(() => {
console.log('退款最后执行')
})
}
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}