Merge branch 'dev' into release
This commit is contained in:
commit
e88ed75624
|
|
@ -1,3 +1,7 @@
|
||||||
|
/**
|
||||||
|
* 抽象组件在业务层根据EntityDict的重新声明
|
||||||
|
* by Xc 20230807
|
||||||
|
*/
|
||||||
import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
|
import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
|
||||||
import AbsList from 'oak-frontend-base/es/components/list';
|
import AbsList from 'oak-frontend-base/es/components/list';
|
||||||
import AbsListPro from 'oak-frontend-base/es/components/listPro';
|
import AbsListPro from 'oak-frontend-base/es/components/listPro';
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,9 @@ export default OakComponent({
|
||||||
this.onPriceChange(value);
|
this.onPriceChange(value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const price2 = parseInt(value);
|
const price2 = Number(value);
|
||||||
if (!isNaN(price2)) {
|
if (!isNaN(price2)) {
|
||||||
this.onPriceChange(price2);
|
this.onPriceChange(Math.round(price2 * 100) / 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@ export default OakComponent({
|
||||||
},
|
},
|
||||||
isList: false,
|
isList: false,
|
||||||
properties: {
|
properties: {
|
||||||
accountId: '',
|
accountId: '', // 是否可以使用帐户中的余额抵扣
|
||||||
accountAvailMax: 0,
|
accountAvailMax: 0, // 本次交易可以使用的帐户中的Avail max值,调用者自己保证此数值的一致性,不要扣成负数
|
||||||
onSetPays: (pays) => undefined,
|
onSetPays: (pays) => undefined,
|
||||||
accountTips: '',
|
accountTips: '', // 使用余额支付的提示说明
|
||||||
autoStartPay: false,
|
autoStartPay: false,
|
||||||
},
|
},
|
||||||
formData({ data }) {
|
formData({ data }) {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ export type EmailConfig = {
|
||||||
html?: string;
|
html?: string;
|
||||||
codeDuration?: number;
|
codeDuration?: number;
|
||||||
digit?: number;
|
digit?: number;
|
||||||
|
emailSuffixes?: string[];
|
||||||
};
|
};
|
||||||
export type PfwConfig = {
|
export type PfwConfig = {
|
||||||
appId: string;
|
appId: string;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,17 @@ const triggers = [
|
||||||
asRoot: true,
|
asRoot: true,
|
||||||
fn: async ({ ids }, context, option) => {
|
fn: async ({ ids }, context, option) => {
|
||||||
for (const id of ids) {
|
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', {
|
const settlements = await context.select('settlement', {
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|
@ -26,8 +37,10 @@ const triggers = [
|
||||||
forUpdate: true,
|
forUpdate: true,
|
||||||
});
|
});
|
||||||
assert(settlements && settlements.length > 0);
|
assert(settlements && settlements.length > 0);
|
||||||
|
let amount = 0;
|
||||||
for (const settlement of settlements) {
|
for (const settlement of settlements) {
|
||||||
const { id: settlementId, price, accountId } = settlement;
|
const { id: settlementId, price, accountId } = settlement;
|
||||||
|
amount += price;
|
||||||
//创建对应的accountOper
|
//创建对应的accountOper
|
||||||
await context.operate('settlement', {
|
await context.operate('settlement', {
|
||||||
id: await generateNewIdAsync(),
|
id: await generateNewIdAsync(),
|
||||||
|
|
@ -50,6 +63,7 @@ const triggers = [
|
||||||
}
|
}
|
||||||
}, {});
|
}, {});
|
||||||
}
|
}
|
||||||
|
assert(order.price === amount);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export declare class ExternalPayUtilException<ED extends EntityDict> extends Oak
|
||||||
name: string;
|
name: string;
|
||||||
message: string;
|
message: string;
|
||||||
_module: string | undefined;
|
_module: string | undefined;
|
||||||
|
params: Record<string, any> | undefined;
|
||||||
opRecords: OpRecord<ED>[];
|
opRecords: OpRecord<ED>[];
|
||||||
tag1: string | undefined;
|
tag1: string | undefined;
|
||||||
tag2: boolean | undefined;
|
tag2: boolean | undefined;
|
||||||
|
|
|
||||||
|
|
@ -156,16 +156,17 @@ export default class WechatMpShipDebug {
|
||||||
sender: {
|
sender: {
|
||||||
name: from.name,
|
name: from.name,
|
||||||
mobile: from.phone,
|
mobile: from.phone,
|
||||||
country: from.area.parent.parent.name,
|
// country: from!.area!.parent!.parent!.name!, //国家
|
||||||
province: from.area.parent.name,
|
province: from.area.parent.parent.name, //省份
|
||||||
area: from.area.name,
|
city: from.area.parent.name, //市
|
||||||
address: from.detail,
|
area: from.area.name, // 区
|
||||||
|
address: from.detail, //详细地址
|
||||||
},
|
},
|
||||||
receiver: {
|
receiver: {
|
||||||
name: to.name,
|
name: to.name,
|
||||||
mobile: to.phone,
|
mobile: to.phone,
|
||||||
country: to.area.parent.parent.name,
|
province: to.area.parent.parent.name,
|
||||||
province: to.area.parent.name,
|
city: to.area.parent.name,
|
||||||
area: to.area.name,
|
area: to.area.name,
|
||||||
address: to.detail,
|
address: to.detail,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getWithdrawCreateData = void 0;
|
exports.getWithdrawCreateData = getWithdrawCreateData;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const types_1 = require("oak-domain/lib/types");
|
const types_1 = require("oak-domain/lib/types");
|
||||||
const uuid_1 = require("oak-domain/lib/utils/uuid");
|
const uuid_1 = require("oak-domain/lib/utils/uuid");
|
||||||
|
|
@ -211,4 +211,3 @@ async function getWithdrawCreateData(params, context) {
|
||||||
data.loss = totalLoss;
|
data.loss = totalLoss;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
exports.getWithdrawCreateData = getWithdrawCreateData;
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ export type EmailConfig = {
|
||||||
html?: string;
|
html?: string;
|
||||||
codeDuration?: number;
|
codeDuration?: number;
|
||||||
digit?: number;
|
digit?: number;
|
||||||
|
emailSuffixes?: string[];
|
||||||
};
|
};
|
||||||
export type PfwConfig = {
|
export type PfwConfig = {
|
||||||
appId: string;
|
appId: string;
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,17 @@ const triggers = [
|
||||||
asRoot: true,
|
asRoot: true,
|
||||||
fn: async ({ ids }, context, option) => {
|
fn: async ({ ids }, context, option) => {
|
||||||
for (const id of ids) {
|
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', {
|
const settlements = await context.select('settlement', {
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|
@ -29,8 +40,10 @@ const triggers = [
|
||||||
forUpdate: true,
|
forUpdate: true,
|
||||||
});
|
});
|
||||||
(0, assert_1.default)(settlements && settlements.length > 0);
|
(0, assert_1.default)(settlements && settlements.length > 0);
|
||||||
|
let amount = 0;
|
||||||
for (const settlement of settlements) {
|
for (const settlement of settlements) {
|
||||||
const { id: settlementId, price, accountId } = settlement;
|
const { id: settlementId, price, accountId } = settlement;
|
||||||
|
amount += price;
|
||||||
//创建对应的accountOper
|
//创建对应的accountOper
|
||||||
await context.operate('settlement', {
|
await context.operate('settlement', {
|
||||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||||
|
|
@ -53,6 +66,7 @@ const triggers = [
|
||||||
}
|
}
|
||||||
}, {});
|
}, {});
|
||||||
}
|
}
|
||||||
|
(0, assert_1.default)(order.price === amount);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export declare class ExternalPayUtilException<ED extends EntityDict> extends Oak
|
||||||
name: string;
|
name: string;
|
||||||
message: string;
|
message: string;
|
||||||
_module: string | undefined;
|
_module: string | undefined;
|
||||||
|
params: Record<string, any> | undefined;
|
||||||
opRecords: OpRecord<ED>[];
|
opRecords: OpRecord<ED>[];
|
||||||
tag1: string | undefined;
|
tag1: string | undefined;
|
||||||
tag2: boolean | undefined;
|
tag2: boolean | undefined;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
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 tslib_1 = require("tslib");
|
||||||
const types_1 = require("oak-domain/lib/types");
|
const types_1 = require("oak-domain/lib/types");
|
||||||
const DependentExceptions_1 = tslib_1.__importDefault(require("./DependentExceptions"));
|
const DependentExceptions_1 = tslib_1.__importDefault(require("./DependentExceptions"));
|
||||||
|
|
@ -68,4 +69,3 @@ function makeException(msg) {
|
||||||
}
|
}
|
||||||
return exception;
|
return exception;
|
||||||
}
|
}
|
||||||
exports.makeException = makeException;
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.registerGetPayStateResult = void 0;
|
exports.registerGetPayStateResult = registerGetPayStateResult;
|
||||||
const tslib_1 = require("tslib");
|
const tslib_1 = require("tslib");
|
||||||
const assert_1 = tslib_1.__importDefault(require("assert"));
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
||||||
let _PAY_STATE = '';
|
let _PAY_STATE = '';
|
||||||
function registerGetPayStateResult(payState) {
|
function registerGetPayStateResult(payState) {
|
||||||
_PAY_STATE = payState;
|
_PAY_STATE = payState;
|
||||||
}
|
}
|
||||||
exports.registerGetPayStateResult = registerGetPayStateResult;
|
|
||||||
class WechatPay {
|
class WechatPay {
|
||||||
wpProduct;
|
wpProduct;
|
||||||
constructor(wpProduct) {
|
constructor(wpProduct) {
|
||||||
|
|
|
||||||
|
|
@ -159,16 +159,17 @@ class WechatMpShipDebug {
|
||||||
sender: {
|
sender: {
|
||||||
name: from.name,
|
name: from.name,
|
||||||
mobile: from.phone,
|
mobile: from.phone,
|
||||||
country: from.area.parent.parent.name,
|
// country: from!.area!.parent!.parent!.name!, //国家
|
||||||
province: from.area.parent.name,
|
province: from.area.parent.parent.name, //省份
|
||||||
area: from.area.name,
|
city: from.area.parent.name, //市
|
||||||
address: from.detail,
|
area: from.area.name, // 区
|
||||||
|
address: from.detail, //详细地址
|
||||||
},
|
},
|
||||||
receiver: {
|
receiver: {
|
||||||
name: to.name,
|
name: to.name,
|
||||||
mobile: to.phone,
|
mobile: to.phone,
|
||||||
country: to.area.parent.parent.name,
|
province: to.area.parent.parent.name,
|
||||||
province: to.area.parent.name,
|
city: to.area.parent.name,
|
||||||
area: to.area.name,
|
area: to.area.name,
|
||||||
address: to.detail,
|
address: to.detail,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "oak-pay-business",
|
"name": "oak-pay-business",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"files": [
|
"files": [
|
||||||
"lib/**/*",
|
"lib/**/*",
|
||||||
|
|
@ -30,10 +30,10 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.3.1",
|
"classnames": "^2.3.1",
|
||||||
"dayjs": "^1.11.5",
|
"dayjs": "^1.11.5",
|
||||||
"oak-domain": "^5.1.22",
|
"oak-domain": "^5.1.24",
|
||||||
"oak-external-sdk": "^2.3.6",
|
"oak-external-sdk": "^2.3.6",
|
||||||
"oak-frontend-base": "^5.3.30",
|
"oak-frontend-base": "^5.3.31",
|
||||||
"oak-general-business": "~5.7.3",
|
"oak-general-business": "~5.7.4",
|
||||||
"react-markdown": "^9.0.3",
|
"react-markdown": "^9.0.3",
|
||||||
"wechat-pay-nodejs": "^0.2.3"
|
"wechat-pay-nodejs": "^0.2.3"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
* 抽象组件在业务层根据EntityDict的重新声明
|
* 抽象组件在业务层根据EntityDict的重新声明
|
||||||
* by Xc 20230807
|
* by Xc 20230807
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { EntityDict } from '../oak-app-domain';
|
import { EntityDict } from '../oak-app-domain';
|
||||||
|
|
@ -42,4 +43,4 @@ export {
|
||||||
Upsert,
|
Upsert,
|
||||||
|
|
||||||
ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef,
|
ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef,
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,9 @@ export default OakComponent({
|
||||||
this.onPriceChange(value);
|
this.onPriceChange(value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const price2 = parseInt(value);
|
const price2 = Number(value);
|
||||||
if (!isNaN(price2)) {
|
if (!isNaN(price2)) {
|
||||||
this.onPriceChange(price2);
|
this.onPriceChange(Math.round(price2 * 100) / 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,17 @@ const triggers: Trigger<EntityDict, 'order', BRC>[] = [
|
||||||
asRoot: true,
|
asRoot: true,
|
||||||
fn: async ({ ids }, context, option) => {
|
fn: async ({ ids }, context, option) => {
|
||||||
for (const id of ids) {
|
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', {
|
const settlements = await context.select('settlement', {
|
||||||
data: {
|
data: {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|
@ -31,8 +42,10 @@ const triggers: Trigger<EntityDict, 'order', BRC>[] = [
|
||||||
});
|
});
|
||||||
assert(settlements && settlements.length > 0);
|
assert(settlements && settlements.length > 0);
|
||||||
|
|
||||||
|
let amount = 0;
|
||||||
for (const settlement of settlements) {
|
for (const settlement of settlements) {
|
||||||
const { id: settlementId, price, accountId } = settlement;
|
const { id: settlementId, price, accountId } = settlement;
|
||||||
|
amount += price!;
|
||||||
//创建对应的accountOper
|
//创建对应的accountOper
|
||||||
await context.operate('settlement', {
|
await context.operate('settlement', {
|
||||||
id: await generateNewIdAsync(),
|
id: await generateNewIdAsync(),
|
||||||
|
|
@ -55,6 +68,7 @@ const triggers: Trigger<EntityDict, 'order', BRC>[] = [
|
||||||
}
|
}
|
||||||
}, {})
|
}, {})
|
||||||
}
|
}
|
||||||
|
assert(order.price === amount);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,16 +191,17 @@ export default class WechatMpShipDebug<ED extends EntityDict & BaseEntityDict, C
|
||||||
sender: {
|
sender: {
|
||||||
name: from!.name!,
|
name: from!.name!,
|
||||||
mobile: from!.phone!,
|
mobile: from!.phone!,
|
||||||
country: from!.area!.parent!.parent!.name!,
|
// country: from!.area!.parent!.parent!.name!, //国家
|
||||||
province: from!.area!.parent!.name!,
|
province: from!.area!.parent!.parent!.name!, //省份
|
||||||
area: from!.area!.name,
|
city: from!.area!.parent!.name!, //市
|
||||||
address: from!.detail!,
|
area: from!.area!.name, // 区
|
||||||
|
address: from!.detail!, //详细地址
|
||||||
},
|
},
|
||||||
receiver: {
|
receiver: {
|
||||||
name: to!.name!,
|
name: to!.name!,
|
||||||
mobile: to!.phone!,
|
mobile: to!.phone!,
|
||||||
country: to!.area!.parent!.parent!.name!,
|
province: to!.area!.parent!.parent!.name!,
|
||||||
province: to!.area!.parent!.name!,
|
city: to!.area!.parent!.name!,
|
||||||
area: to!.area!.name,
|
area: to!.area!.name,
|
||||||
address: to!.detail!,
|
address: to!.detail!,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue