Merge branch 'dev' into release

This commit is contained in:
Xu Chang 2025-05-08 16:42:52 +08:00
commit e88ed75624
19 changed files with 88 additions and 36 deletions

View File

@ -1,3 +1,7 @@
/**
* 抽象组件在业务层根据EntityDict的重新声明
* by Xc 20230807
*/
import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
import AbsList from 'oak-frontend-base/es/components/list';
import AbsListPro from 'oak-frontend-base/es/components/listPro';

View File

@ -87,9 +87,9 @@ export default OakComponent({
this.onPriceChange(value);
}
else {
const price2 = parseInt(value);
const price2 = Number(value);
if (!isNaN(price2)) {
this.onPriceChange(price2);
this.onPriceChange(Math.round(price2 * 100) / 100);
}
}
},

View File

@ -24,10 +24,10 @@ export default OakComponent({
},
isList: false,
properties: {
accountId: '',
accountAvailMax: 0,
accountId: '', // 是否可以使用帐户中的余额抵扣
accountAvailMax: 0, // 本次交易可以使用的帐户中的Avail max值调用者自己保证此数值的一致性不要扣成负数
onSetPays: (pays) => undefined,
accountTips: '',
accountTips: '', // 使用余额支付的提示说明
autoStartPay: false,
},
formData({ data }) {

View File

@ -19,6 +19,7 @@ export type EmailConfig = {
html?: string;
codeDuration?: number;
digit?: number;
emailSuffixes?: string[];
};
export type PfwConfig = {
appId: string;

View File

@ -10,6 +10,17 @@ const triggers = [
asRoot: true,
fn: async ({ ids }, context, option) => {
for (const id of ids) {
const [order] = await context.select('order', {
data: {
id: 1,
price: 1,
paid: 1,
}, filter: {
id,
}
}, {
forUpdate: true,
});
const settlements = await context.select('settlement', {
data: {
id: 1,
@ -26,8 +37,10 @@ const triggers = [
forUpdate: true,
});
assert(settlements && settlements.length > 0);
let amount = 0;
for (const settlement of settlements) {
const { id: settlementId, price, accountId } = settlement;
amount += price;
//创建对应的accountOper
await context.operate('settlement', {
id: await generateNewIdAsync(),
@ -50,6 +63,7 @@ const triggers = [
}
}, {});
}
assert(order.price === amount);
}
return;
}

View File

@ -11,6 +11,7 @@ export declare class ExternalPayUtilException<ED extends EntityDict> extends Oak
name: string;
message: string;
_module: string | undefined;
params: Record<string, any> | undefined;
opRecords: OpRecord<ED>[];
tag1: string | undefined;
tag2: boolean | undefined;

View File

@ -156,16 +156,17 @@ export default class WechatMpShipDebug {
sender: {
name: from.name,
mobile: from.phone,
country: from.area.parent.parent.name,
province: from.area.parent.name,
area: from.area.name,
address: from.detail,
// country: from!.area!.parent!.parent!.name!, //国家
province: from.area.parent.parent.name, //省份
city: from.area.parent.name, //市
area: from.area.name, // 区
address: from.detail, //详细地址
},
receiver: {
name: to.name,
mobile: to.phone,
country: to.area.parent.parent.name,
province: to.area.parent.name,
province: to.area.parent.parent.name,
city: to.area.parent.name,
area: to.area.name,
address: to.detail,
},

View File

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWithdrawCreateData = void 0;
exports.getWithdrawCreateData = getWithdrawCreateData;
const tslib_1 = require("tslib");
const types_1 = require("oak-domain/lib/types");
const uuid_1 = require("oak-domain/lib/utils/uuid");
@ -211,4 +211,3 @@ async function getWithdrawCreateData(params, context) {
data.loss = totalLoss;
return data;
}
exports.getWithdrawCreateData = getWithdrawCreateData;

View File

@ -19,6 +19,7 @@ export type EmailConfig = {
html?: string;
codeDuration?: number;
digit?: number;
emailSuffixes?: string[];
};
export type PfwConfig = {
appId: string;

View File

@ -13,6 +13,17 @@ const triggers = [
asRoot: true,
fn: async ({ ids }, context, option) => {
for (const id of ids) {
const [order] = await context.select('order', {
data: {
id: 1,
price: 1,
paid: 1,
}, filter: {
id,
}
}, {
forUpdate: true,
});
const settlements = await context.select('settlement', {
data: {
id: 1,
@ -29,8 +40,10 @@ const triggers = [
forUpdate: true,
});
(0, assert_1.default)(settlements && settlements.length > 0);
let amount = 0;
for (const settlement of settlements) {
const { id: settlementId, price, accountId } = settlement;
amount += price;
//创建对应的accountOper
await context.operate('settlement', {
id: await (0, uuid_1.generateNewIdAsync)(),
@ -53,6 +66,7 @@ const triggers = [
}
}, {});
}
(0, assert_1.default)(order.price === amount);
}
return;
}

View File

@ -11,6 +11,7 @@ export declare class ExternalPayUtilException<ED extends EntityDict> extends Oak
name: string;
message: string;
_module: string | undefined;
params: Record<string, any> | undefined;
opRecords: OpRecord<ED>[];
tag1: string | undefined;
tag2: boolean | undefined;

View File

@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeException = exports.StartPayFailure = exports.PayUnRefundable = exports.RefundExceedMax = exports.ExternalPayUtilException = exports.UploadShipException = void 0;
exports.StartPayFailure = exports.PayUnRefundable = exports.RefundExceedMax = exports.ExternalPayUtilException = exports.UploadShipException = void 0;
exports.makeException = makeException;
const tslib_1 = require("tslib");
const types_1 = require("oak-domain/lib/types");
const DependentExceptions_1 = tslib_1.__importDefault(require("./DependentExceptions"));
@ -68,4 +69,3 @@ function makeException(msg) {
}
return exception;
}
exports.makeException = makeException;

View File

@ -1,13 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerGetPayStateResult = void 0;
exports.registerGetPayStateResult = registerGetPayStateResult;
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
let _PAY_STATE = '';
function registerGetPayStateResult(payState) {
_PAY_STATE = payState;
}
exports.registerGetPayStateResult = registerGetPayStateResult;
class WechatPay {
wpProduct;
constructor(wpProduct) {

View File

@ -159,16 +159,17 @@ class WechatMpShipDebug {
sender: {
name: from.name,
mobile: from.phone,
country: from.area.parent.parent.name,
province: from.area.parent.name,
area: from.area.name,
address: from.detail,
// country: from!.area!.parent!.parent!.name!, //国家
province: from.area.parent.parent.name, //省份
city: from.area.parent.name, //市
area: from.area.name, // 区
address: from.detail, //详细地址
},
receiver: {
name: to.name,
mobile: to.phone,
country: to.area.parent.parent.name,
province: to.area.parent.name,
province: to.area.parent.parent.name,
city: to.area.parent.name,
area: to.area.name,
address: to.detail,
},

View File

@ -1,6 +1,6 @@
{
"name": "oak-pay-business",
"version": "3.0.1",
"version": "3.0.2",
"description": "",
"files": [
"lib/**/*",
@ -30,10 +30,10 @@
"dependencies": {
"classnames": "^2.3.1",
"dayjs": "^1.11.5",
"oak-domain": "^5.1.22",
"oak-domain": "^5.1.24",
"oak-external-sdk": "^2.3.6",
"oak-frontend-base": "^5.3.30",
"oak-general-business": "~5.7.3",
"oak-frontend-base": "^5.3.31",
"oak-general-business": "~5.7.4",
"react-markdown": "^9.0.3",
"wechat-pay-nodejs": "^0.2.3"
},

View File

@ -2,6 +2,7 @@
* EntityDict的重新声明
* by Xc 20230807
*/
// @ts-nocheck
import React from 'react';
import { EntityDict } from '../oak-app-domain';
@ -42,4 +43,4 @@ export {
Upsert,
ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef,
}
};

View File

@ -90,9 +90,9 @@ export default OakComponent({
this.onPriceChange(value);
}
else {
const price2 = parseInt(value);
const price2 = Number(value);
if (!isNaN(price2)) {
this.onPriceChange(price2);
this.onPriceChange(Math.round(price2 * 100) / 100);
}
}
},

View File

@ -14,6 +14,17 @@ const triggers: Trigger<EntityDict, 'order', BRC>[] = [
asRoot: true,
fn: async ({ ids }, context, option) => {
for (const id of ids) {
const [order] = await context.select('order', {
data: {
id: 1,
price: 1,
paid: 1,
}, filter: {
id,
}
}, {
forUpdate: true,
})
const settlements = await context.select('settlement', {
data: {
id: 1,
@ -31,8 +42,10 @@ const triggers: Trigger<EntityDict, 'order', BRC>[] = [
});
assert(settlements && settlements.length > 0);
let amount = 0;
for (const settlement of settlements) {
const { id: settlementId, price, accountId } = settlement;
amount += price!;
//创建对应的accountOper
await context.operate('settlement', {
id: await generateNewIdAsync(),
@ -55,6 +68,7 @@ const triggers: Trigger<EntityDict, 'order', BRC>[] = [
}
}, {})
}
assert(order.price === amount);
}
return;
}

View File

@ -191,16 +191,17 @@ export default class WechatMpShipDebug<ED extends EntityDict & BaseEntityDict, C
sender: {
name: from!.name!,
mobile: from!.phone!,
country: from!.area!.parent!.parent!.name!,
province: from!.area!.parent!.name!,
area: from!.area!.name,
address: from!.detail!,
// country: from!.area!.parent!.parent!.name!, //国家
province: from!.area!.parent!.parent!.name!, //省份
city: from!.area!.parent!.name!, //市
area: from!.area!.name, // 区
address: from!.detail!, //详细地址
},
receiver: {
name: to!.name!,
mobile: to!.phone!,
country: to!.area!.parent!.parent!.name!,
province: to!.area!.parent!.name!,
province: to!.area!.parent!.parent!.name!,
city: to!.area!.parent!.name!,
area: to!.area!.name,
address: to!.detail!,
},