oak-pay-business 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/aspects/withdraw.d.ts +4 -4
- package/es/checkers/order.js +39 -0
- package/es/components/account/detail/web.d.ts +1 -1
- package/es/components/account/detail/web.js +2 -2
- package/es/components/account/detail/web.pc.d.ts +1 -1
- package/es/components/account/detail/web.pc.js +2 -2
- package/es/components/account/detail/web.pc.module.less +68 -68
- package/es/components/accountOper/list/index.js +118 -6
- package/es/components/accountOper/list/index.json +10 -1
- package/es/components/accountOper/list/index.less +125 -0
- package/es/components/accountOper/list/index.xml +56 -0
- package/es/components/accountOper/list/locales/zh-CN.json +9 -1
- package/es/components/accountOper/list/mobile.module.less +48 -0
- package/es/components/accountOper/list/web.d.ts +12 -1
- package/es/components/accountOper/list/web.js +58 -24
- package/es/components/accountOper/list/web.module.less +27 -0
- package/es/components/accountOper/list/web.pc.d.ts +14 -2
- package/es/components/accountOper/list/web.pc.js +43 -8
- package/es/components/order/pay/index.js +1 -1
- package/es/components/order/pay/info.js +6 -6
- package/es/components/order/pay/info.module.less +24 -24
- package/es/components/order/pay/web.mobile.module.less +35 -35
- package/es/components/order/pay/web.pc.module.less +35 -35
- package/es/components/pay/detail/index.js +11 -0
- package/es/components/pay/detail/index.xml +10 -0
- package/es/components/pay/detail/locales/zh-CN.json +5 -1
- package/es/components/pay/detail/web.d.ts +1 -0
- package/es/components/pay/detail/web.js +12 -5
- package/es/components/pay/detail/web.pc.d.ts +1 -0
- package/es/components/pay/detail/web.pc.js +15 -5
- package/es/components/pay/list/web.pc.js +2 -0
- package/es/components/payConfig/upsert/offline/web.pc.module.less +4 -4
- package/es/components/payConfig/upsert/web.pc.module.less +10 -10
- package/es/components/withdraw/create/index.d.ts +1 -0
- package/es/components/withdraw/create/index.js +4 -0
- package/es/components/withdraw/create/index.xml +4 -0
- package/es/components/withdraw/create/locales/zh-CN.json +2 -1
- package/es/components/withdraw/create/web.d.ts +1 -0
- package/es/components/withdraw/create/web.js +6 -2
- package/es/components/withdraw/create/web.pc.d.ts +1 -0
- package/es/components/withdraw/create/web.pc.js +4 -1
- package/es/components/withdraw/display/web.pc.module.less +4 -2
- package/es/components/withdrawAccount/list/index.less +8 -0
- package/es/components/withdrawAccount/list/index.xml +6 -1
- package/es/configuration/attrUpdateMatrix.js +6 -1
- package/es/context/BackendRuntimeContext.d.ts +1 -1
- package/es/data/i18n.js +21 -3
- package/es/entities/Order.d.ts +4 -3
- package/es/entities/Order.js +1 -0
- package/es/locales/common/zh_CN.json +1 -0
- package/es/locales/error/zh-CN.json +4 -0
- package/es/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Order/Schema.d.ts +11 -5
- package/es/oak-app-domain/Order/Storage.js +4 -5
- package/es/oak-app-domain/Order/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/System/Storage.js +1 -2
- package/es/utils/application.d.ts +1 -1
- package/es/utils/wpProductFrontend.js +1 -1
- package/lib/aspects/withdraw.d.ts +4 -4
- package/lib/checkers/order.js +39 -0
- package/lib/components/pay/detail/index.js +11 -0
- package/lib/configuration/attrUpdateMatrix.js +6 -1
- package/lib/context/BackendRuntimeContext.d.ts +1 -1
- package/lib/data/i18n.js +21 -3
- package/lib/entities/Order.d.ts +4 -3
- package/lib/entities/Order.js +1 -0
- package/lib/locales/common/zh_CN.json +1 -0
- package/lib/locales/error/zh-CN.json +4 -0
- package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/Order/Schema.d.ts +11 -5
- package/lib/oak-app-domain/Order/Storage.js +4 -5
- package/lib/oak-app-domain/Order/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/System/Storage.js +1 -2
- package/lib/utils/application.d.ts +1 -1
- package/lib/utils/wpProductFrontend.js +1 -1
- package/package.json +171 -200
- package/src/entities/Order.ts +4 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Tag, Card, QRCode, Form, Descriptions, Typography, Alert, Button, Modal, Radio } from 'antd';
|
|
2
|
+
import { Input, Tag, Card, QRCode, Form, Descriptions, Typography, Alert, Button, Modal, Radio } from 'antd';
|
|
3
3
|
import { CheckCircleOutlined } from '@ant-design/icons';
|
|
4
4
|
import { CentToString } from 'oak-domain/lib/utils/money';
|
|
5
5
|
import Styles from './web.pc.module.less';
|
|
@@ -8,8 +8,8 @@ import duration from 'dayjs/plugin/duration';
|
|
|
8
8
|
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
|
9
9
|
dayJs.extend(duration);
|
|
10
10
|
export function RenderOffline(props) {
|
|
11
|
-
const { pay, t, offline, offlines, updateOfflineId } = props;
|
|
12
|
-
const { iState, phantom3 } = pay;
|
|
11
|
+
const { pay, t, offline, offlines, updateOfflineId, updateExternalId } = props;
|
|
12
|
+
const { iState, phantom3, externalId } = pay;
|
|
13
13
|
const { type, channel, name, qrCode, color } = offline;
|
|
14
14
|
const [show, setShow] = useState(false);
|
|
15
15
|
const [showQrCode, setShowQrCode] = useState(false);
|
|
@@ -23,6 +23,12 @@ export function RenderOffline(props) {
|
|
|
23
23
|
<Tag color="red">
|
|
24
24
|
<span style={{ fontSize: 'large' }}>{phantom3}</span>
|
|
25
25
|
</Tag>
|
|
26
|
+
</Form.Item>,
|
|
27
|
+
<Form.Item key="externalId" label={<span className={Styles.bold}>{t('externalId.label')}</span>}>
|
|
28
|
+
<Input value={externalId || ''} onChange={({ currentTarget }) => {
|
|
29
|
+
const { value } = currentTarget;
|
|
30
|
+
updateExternalId(value);
|
|
31
|
+
}} placeholder={t('externalId.help')} disabled={iState !== 'paying'}/>
|
|
26
32
|
</Form.Item>
|
|
27
33
|
];
|
|
28
34
|
if (type === 'bank') {
|
|
@@ -123,7 +129,7 @@ function RenderWechatPay(props) {
|
|
|
123
129
|
return null;
|
|
124
130
|
}
|
|
125
131
|
function RenderPayMeta(props) {
|
|
126
|
-
const { pay, notSameApp, t, offlines, offline, updateOfflineId } = props;
|
|
132
|
+
const { pay, notSameApp, t, offlines, offline, updateOfflineId, updateExternalId } = props;
|
|
127
133
|
const { iState, entity } = pay;
|
|
128
134
|
if (entity !== 'offlineAccount' && notSameApp) {
|
|
129
135
|
return <Alert type='warning' message={t('notSameApp')}/>;
|
|
@@ -133,7 +139,7 @@ function RenderPayMeta(props) {
|
|
|
133
139
|
if (offline && offlines) {
|
|
134
140
|
return (<>
|
|
135
141
|
{iState === 'paying' && <Alert type='info' message={t('code.help')} style={{ marginBottom: 10 }}/>}
|
|
136
|
-
<RenderOffline t={t} pay={pay} offline={offline} offlines={offlines} updateOfflineId={updateOfflineId}/>
|
|
142
|
+
<RenderOffline t={t} pay={pay} offline={offline} offlines={offlines} updateOfflineId={updateOfflineId} updateExternalId={updateExternalId}/>
|
|
137
143
|
</>);
|
|
138
144
|
}
|
|
139
145
|
return null;
|
|
@@ -214,6 +220,10 @@ export default function Render(props) {
|
|
|
214
220
|
}
|
|
215
221
|
}
|
|
216
222
|
]);
|
|
223
|
+
}} updateExternalId={(externalId) => {
|
|
224
|
+
update({
|
|
225
|
+
externalId,
|
|
226
|
+
});
|
|
217
227
|
}}/>
|
|
218
228
|
</div>
|
|
219
229
|
<div className={Styles.btn}>
|
|
@@ -146,6 +146,8 @@ export default function Render(props) {
|
|
|
146
146
|
{offlines && <RenderOffline pay={spRow} t={t} offlines={offlines} offline={offlines.find(ele => ele.id === spRow.entityId)} updateOfflineId={(entityId) => updateItem({
|
|
147
147
|
entity: 'offlineAccount',
|
|
148
148
|
entityId
|
|
149
|
+
}, spId)} updateExternalId={(externalId) => updateItem({
|
|
150
|
+
externalId,
|
|
149
151
|
}, spId)}/>}
|
|
150
152
|
<Divider style={{ width: '80%', alignSelf: 'flex-end' }}/>
|
|
151
153
|
<Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} layout="horizontal" style={{ width: '100%', marginTop: 12 }}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
width: 100%;
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
5
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.empty {
|
|
2
|
-
min-height: 600px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.container {
|
|
6
|
-
width: 100%;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
1
|
+
.empty {
|
|
2
|
+
min-height: 600px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.container {
|
|
6
|
+
width: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
11
|
}
|
|
@@ -5,5 +5,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
|
|
5
5
|
onNewWithdrawAccount: () => void;
|
|
6
6
|
onCreateWithdraw: (id: string) => void;
|
|
7
7
|
onGoToHistory: () => void;
|
|
8
|
+
onGoToWaManage: () => void;
|
|
8
9
|
}>) => React.ReactElement;
|
|
9
10
|
export default _default;
|
|
@@ -10,6 +10,7 @@ export default OakComponent({
|
|
|
10
10
|
onNewWithdrawAccount: () => undefined,
|
|
11
11
|
onCreateWithdraw: (id) => undefined,
|
|
12
12
|
onGoToHistory: () => undefined,
|
|
13
|
+
onGoToWaManage: () => undefined,
|
|
13
14
|
},
|
|
14
15
|
formData({ features }) {
|
|
15
16
|
const { accountId, withdrawAccountFilter } = this.props;
|
|
@@ -220,6 +221,9 @@ export default OakComponent({
|
|
|
220
221
|
onGoToHistoryMp() {
|
|
221
222
|
const { onGoToHistory } = this.props;
|
|
222
223
|
onGoToHistory && onGoToHistory();
|
|
224
|
+
},
|
|
225
|
+
onGoToWaManageMp() {
|
|
226
|
+
this.props.onGoToWaManage();
|
|
223
227
|
}
|
|
224
228
|
},
|
|
225
229
|
});
|
|
@@ -105,6 +105,10 @@
|
|
|
105
105
|
<oak-icon name="coupons" size="18" color="@oak-color-primary" style="margin-right:8rpx;"/>
|
|
106
106
|
<span>{{t('gotoHistory')}}</span>
|
|
107
107
|
</view>
|
|
108
|
+
<view class="gotoHistory" bindtap="onGoToWaManageMp">
|
|
109
|
+
<oak-icon name="enterinto" size="18" color="@oak-color-primary" style="margin-right:8rpx;"/>
|
|
110
|
+
<span>{{t('gotoWaManage')}}</span>
|
|
111
|
+
</view>
|
|
108
112
|
<view class="footer">
|
|
109
113
|
<l-button
|
|
110
114
|
size="long"
|
|
@@ -21,6 +21,7 @@ export default function render(props: WebComponentProps<EntityDict, 'withdraw',
|
|
|
21
21
|
waFilter?: EntityDict['withdrawAccount']['Selection']['filter'];
|
|
22
22
|
userId: string;
|
|
23
23
|
onGoToHistory: () => void;
|
|
24
|
+
onGoToWaManage: () => void;
|
|
24
25
|
}, {
|
|
25
26
|
setValue: (v: string | number | null) => void;
|
|
26
27
|
switchHelp: (type: 'method' | 'loss') => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, Input, Result } from 'antd-mobile';
|
|
3
|
-
import { DownOutline, UpOutline, ReceiptOutline } from 'antd-mobile-icons';
|
|
3
|
+
import { DownOutline, UpOutline, ReceiptOutline, BankcardOutline } from 'antd-mobile-icons';
|
|
4
4
|
import Styles from './web.module.less';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import WithDrawAccountPicker from '../../withdrawAccount/list';
|
|
7
7
|
import WithdrawDisplay from '../display';
|
|
8
8
|
export default function render(props) {
|
|
9
|
-
const { account, value, refundAmount, manualAmount, avail, availYuan, valueYuan, manualAmountYuan, refundAmountYuan, showMethodHelp, showLossHelp, executale, withdrawCreate, withdrawable, withdrawLossText, chooseWa, waFilter, userId, onGoToHistory } = props.data;
|
|
9
|
+
const { account, value, refundAmount, manualAmount, avail, availYuan, valueYuan, manualAmountYuan, refundAmountYuan, showMethodHelp, showLossHelp, executale, withdrawCreate, withdrawable, withdrawLossText, chooseWa, waFilter, userId, onGoToHistory, onGoToWaManage } = props.data;
|
|
10
10
|
const { t, setValue, switchHelp, createWithdrawData, restartAll, createWithdraw, goBack, pickWithdrawChannel } = props.methods;
|
|
11
11
|
if (!withdrawable) {
|
|
12
12
|
return (<Result status='error' title={t('notSetYet')} description={<Button color="primary" onClick={() => goBack()}>
|
|
@@ -85,6 +85,10 @@ export default function render(props) {
|
|
|
85
85
|
<ReceiptOutline scale={1.4}/>
|
|
86
86
|
{t('gotoHistory')}
|
|
87
87
|
</div>
|
|
88
|
+
<div className={Styles.gotoHistory} onClick={onGoToWaManage}>
|
|
89
|
+
<BankcardOutline scale={1.4}/>
|
|
90
|
+
{t('gotoWaManage')}
|
|
91
|
+
</div>
|
|
88
92
|
<div style={{ flex: 1 }}/>
|
|
89
93
|
<Button className={Styles.btn} block color="primary" disabled={!executale} onClick={() => createWithdrawData()}>
|
|
90
94
|
{t('common::confirm')}
|
|
@@ -21,6 +21,7 @@ export default function render(props: WebComponentProps<EntityDict, 'withdraw',
|
|
|
21
21
|
waFilter?: EntityDict['withdrawAccount']['Selection']['filter'];
|
|
22
22
|
userId: string;
|
|
23
23
|
onGoToHistory: () => void;
|
|
24
|
+
onGoToWaManage: () => void;
|
|
24
25
|
}, {
|
|
25
26
|
setValue: (v: number | null) => void;
|
|
26
27
|
switchHelp: (type: 'method' | 'loss') => void;
|
|
@@ -6,7 +6,7 @@ import classNames from 'classnames';
|
|
|
6
6
|
import WithDrawAccountPicker from '../../withdrawAccount/list';
|
|
7
7
|
import WithdrawDisplay from '../display';
|
|
8
8
|
export default function render(props) {
|
|
9
|
-
const { account, value, refundAmount, manualAmount, avail, availYuan, valueYuan, manualAmountYuan, refundAmountYuan, showMethodHelp, showLossHelp, executale, withdrawCreate, withdrawable, withdrawLossText, chooseWa, waFilter, userId, onGoToHistory } = props.data;
|
|
9
|
+
const { account, value, refundAmount, manualAmount, avail, availYuan, valueYuan, manualAmountYuan, refundAmountYuan, showMethodHelp, showLossHelp, executale, withdrawCreate, withdrawable, withdrawLossText, chooseWa, waFilter, userId, onGoToHistory, onGoToWaManage } = props.data;
|
|
10
10
|
const { t, setValue, switchHelp, createWithdrawData, restartAll, createWithdraw, goBack, pickWithdrawChannel } = props.methods;
|
|
11
11
|
if (!withdrawable) {
|
|
12
12
|
return (<Result status="500" title="500" subTitle={t('notSetYet')} extra={<Button type="primary" onClick={() => goBack()}>
|
|
@@ -70,6 +70,9 @@ export default function render(props) {
|
|
|
70
70
|
<div className={Styles.gotoHistory} onClick={onGoToHistory}>
|
|
71
71
|
{t('gotoHistory')}
|
|
72
72
|
</div>
|
|
73
|
+
<div className={Styles.gotoHistory} onClick={onGoToWaManage}>
|
|
74
|
+
{t('gotoWaManage')}
|
|
75
|
+
</div>
|
|
73
76
|
<div style={{ flex: 1 }}/>
|
|
74
77
|
<Button className={Styles.btn} size="large" type="primary" disabled={!executale} onClick={() => createWithdrawData()}>
|
|
75
78
|
{t('common::confirm')}
|
|
@@ -47,7 +47,9 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.refundItem {
|
|
50
|
-
width: 223px;
|
|
50
|
+
// width: 223px;
|
|
51
|
+
width: 100%;
|
|
52
|
+
box-sizing: border-box;
|
|
51
53
|
margin: 12px;
|
|
52
54
|
padding: 8px;
|
|
53
55
|
font-size: small;
|
|
@@ -77,7 +79,7 @@
|
|
|
77
79
|
margin-right: 4px;
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
|
-
|
|
82
|
+
|
|
81
83
|
.reason {
|
|
82
84
|
color: var(--oak-color-error);
|
|
83
85
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
<block wx:if="{{
|
|
1
|
+
<block wx:if="{{oakLoading || oakExecuting}}">
|
|
2
|
+
<view class="loading">
|
|
3
|
+
<l-loading show="{{true}}" type="circle" />
|
|
4
|
+
</view>
|
|
5
|
+
</block>
|
|
6
|
+
<block wx:elif="{{!withdrawAccounts.length}}">
|
|
2
7
|
<view class="warningContainer">
|
|
3
8
|
<oak-icon name="prompt_fill" size="48" color="#FF8F1F" />
|
|
4
9
|
<view>{{t('noData')}}</view>
|
|
@@ -67,7 +67,12 @@ const attrUpdateMatrix = {
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
externalId: {
|
|
70
|
-
actions: ['startPaying', 'succeedPaying'],
|
|
70
|
+
actions: ['startPaying', 'succeedPaying', 'update'],
|
|
71
|
+
filter: {
|
|
72
|
+
iState: {
|
|
73
|
+
$in: ['unpaid', 'paying'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
71
76
|
},
|
|
72
77
|
},
|
|
73
78
|
refund: {
|
|
@@ -15,7 +15,7 @@ export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDic
|
|
|
15
15
|
type?: number | undefined;
|
|
16
16
|
systemId?: number | undefined;
|
|
17
17
|
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
|
|
18
|
-
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").
|
|
18
|
+
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
|
|
19
19
|
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
|
|
20
20
|
domainId?: number | undefined;
|
|
21
21
|
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;
|
package/es/data/i18n.js
CHANGED
|
@@ -52,7 +52,15 @@ const i18ns = [
|
|
|
52
52
|
language: "zh-CN",
|
|
53
53
|
module: "oak-pay-business",
|
|
54
54
|
position: "src/components/accountOper/list",
|
|
55
|
-
data: {
|
|
55
|
+
data: {
|
|
56
|
+
"history": "账户历史",
|
|
57
|
+
"chooseMonth": "选择月份",
|
|
58
|
+
"type": {
|
|
59
|
+
"both": "全部",
|
|
60
|
+
"in": "仅收入",
|
|
61
|
+
"out": "仅支出"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
56
64
|
},
|
|
57
65
|
{
|
|
58
66
|
id: "65d19e4723a89c25e3c10a87013af430",
|
|
@@ -198,11 +206,15 @@ const i18ns = [
|
|
|
198
206
|
},
|
|
199
207
|
"code": {
|
|
200
208
|
"label": "转帐凭证号",
|
|
201
|
-
"help": "
|
|
209
|
+
"help": "请在转帐时于留言中附上转帐凭证号,便于人工核对。若转账时忘记附上,则请准确填写转账流水号。"
|
|
202
210
|
},
|
|
203
211
|
"channel": {
|
|
204
212
|
"change": "更换",
|
|
205
213
|
"prefix": "渠道"
|
|
214
|
+
},
|
|
215
|
+
"externalId": {
|
|
216
|
+
"label": "转账流水号",
|
|
217
|
+
"help": "转账成功后有唯一流水号,将之正确填入可减少财务人员核对时的错误概率,给您带来更大便利"
|
|
206
218
|
}
|
|
207
219
|
}
|
|
208
220
|
},
|
|
@@ -449,7 +461,8 @@ const i18ns = [
|
|
|
449
461
|
"overflowManualAmount": "提现额度不能超过人工划款的额度"
|
|
450
462
|
},
|
|
451
463
|
"innerLogic": "自动运算",
|
|
452
|
-
"gotoHistory": "提现历史"
|
|
464
|
+
"gotoHistory": "提现历史",
|
|
465
|
+
"gotoWaManage": "提现账户管理"
|
|
453
466
|
}
|
|
454
467
|
},
|
|
455
468
|
{
|
|
@@ -696,6 +709,7 @@ const i18ns = [
|
|
|
696
709
|
"enter": "请输入",
|
|
697
710
|
"change": "修改",
|
|
698
711
|
"finish": "完成",
|
|
712
|
+
"loadMore": "加载更多",
|
|
699
713
|
"pay": {
|
|
700
714
|
"symbol": "¥",
|
|
701
715
|
"scale": "元"
|
|
@@ -735,6 +749,10 @@ const i18ns = [
|
|
|
735
749
|
},
|
|
736
750
|
"system": {
|
|
737
751
|
"withdrawLossUnSet": "系统的提现规则尚未设置,请联系管理员"
|
|
752
|
+
},
|
|
753
|
+
"order": {
|
|
754
|
+
"payAmountNotEnough": "支付的额度总和不足",
|
|
755
|
+
"nonePay": "没有传入支付信息"
|
|
738
756
|
}
|
|
739
757
|
}
|
|
740
758
|
},
|
package/es/entities/Order.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { String, Price, Boolean, Datetime } from 'oak-domain/lib/types/DataType';
|
|
1
|
+
import { String, Text, Price, Boolean, Datetime } from 'oak-domain/lib/types/DataType';
|
|
2
2
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
3
3
|
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
|
4
4
|
import { Schema as User } from 'oak-general-business/lib/entities/User';
|
|
@@ -9,12 +9,13 @@ export interface Schema extends EntityShape {
|
|
|
9
9
|
paid: Price;
|
|
10
10
|
refunded: Price;
|
|
11
11
|
title: String<32>;
|
|
12
|
-
desc:
|
|
13
|
-
timeoutAt
|
|
12
|
+
desc: Text;
|
|
13
|
+
timeoutAt?: Datetime;
|
|
14
14
|
creator: User;
|
|
15
15
|
entity: String<32>;
|
|
16
16
|
entityId: String<64>;
|
|
17
17
|
settled: Boolean;
|
|
18
|
+
allowPartialPay?: Boolean;
|
|
18
19
|
system: System;
|
|
19
20
|
opers: AccountOper[];
|
|
20
21
|
}
|
package/es/entities/Order.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "name": "帐号操作", "attr": { "account": "帐号", "type": "类型", "totalPlus": "余额变化", "availPlus": "可用余额变化", "refundablePlus": "可退款余额变化", "total": "操作后余额", "avail": "操作后可用余额", "refundable": "操作后可退款余额", "entity": "关联对象", "entityId": "关联对象Id" }, "v": { "type": { "deposit": "充值", "withdraw": "提现", "consume": "消费", "loan": "抵押", "repay": "偿还", "withdrawBack": "
|
|
1
|
+
{ "name": "帐号操作", "attr": { "account": "帐号", "type": "类型", "totalPlus": "余额变化", "availPlus": "可用余额变化", "refundablePlus": "可退款余额变化", "total": "操作后余额", "avail": "操作后可用余额", "refundable": "操作后可退款余额", "entity": "关联对象", "entityId": "关联对象Id" }, "v": { "type": { "deposit": "充值", "withdraw": "提现", "consume": "消费", "loan": "抵押", "repay": "偿还", "withdrawBack": "提现未遂", "earn": "赚取", "encash": "兑现", "tax": "渠道费", "taxRefund": "渠道费用退还", "cutoffRefundable": "削减可自由退额度", "refund": "退款", "refundFailure": "退款失败" } } }
|
|
@@ -3,7 +3,7 @@ import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue,
|
|
|
3
3
|
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
|
4
4
|
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "oak-domain/lib/types/Entity";
|
|
5
5
|
import { Action, ParticularAction, IState } from "./Action";
|
|
6
|
-
import { Price, String, Datetime, Boolean } from "oak-domain/lib/types/DataType";
|
|
6
|
+
import { Price, String, Text, Datetime, Boolean } from "oak-domain/lib/types/DataType";
|
|
7
7
|
import * as User from "../User/Schema";
|
|
8
8
|
import * as System from "../System/Schema";
|
|
9
9
|
import * as Pay from "../Pay/Schema";
|
|
@@ -13,12 +13,13 @@ export type OpSchema = EntityShape & {
|
|
|
13
13
|
paid: Price;
|
|
14
14
|
refunded: Price;
|
|
15
15
|
title: String<32>;
|
|
16
|
-
desc:
|
|
17
|
-
timeoutAt
|
|
16
|
+
desc: Text;
|
|
17
|
+
timeoutAt?: Datetime | null;
|
|
18
18
|
creatorId: ForeignKey<"user">;
|
|
19
19
|
entity: String<32>;
|
|
20
20
|
entityId: String<64>;
|
|
21
21
|
settled: Boolean;
|
|
22
|
+
allowPartialPay?: Boolean | null;
|
|
22
23
|
systemId: ForeignKey<"system">;
|
|
23
24
|
iState?: IState | null;
|
|
24
25
|
};
|
|
@@ -28,12 +29,13 @@ export type Schema = EntityShape & {
|
|
|
28
29
|
paid: Price;
|
|
29
30
|
refunded: Price;
|
|
30
31
|
title: String<32>;
|
|
31
|
-
desc:
|
|
32
|
-
timeoutAt
|
|
32
|
+
desc: Text;
|
|
33
|
+
timeoutAt?: Datetime | null;
|
|
33
34
|
creatorId: ForeignKey<"user">;
|
|
34
35
|
entity: String<32>;
|
|
35
36
|
entityId: String<64>;
|
|
36
37
|
settled: Boolean;
|
|
38
|
+
allowPartialPay?: Boolean | null;
|
|
37
39
|
systemId: ForeignKey<"system">;
|
|
38
40
|
iState?: IState | null;
|
|
39
41
|
creator: User.Schema;
|
|
@@ -61,6 +63,7 @@ type AttrFilter = {
|
|
|
61
63
|
entity: Q_StringValue;
|
|
62
64
|
entityId: Q_StringValue;
|
|
63
65
|
settled: Q_BooleanValue;
|
|
66
|
+
allowPartialPay: Q_BooleanValue;
|
|
64
67
|
systemId: Q_StringValue;
|
|
65
68
|
system: System.Filter;
|
|
66
69
|
iState: Q_EnumValue<IState>;
|
|
@@ -86,6 +89,7 @@ export type Projection = {
|
|
|
86
89
|
entity?: number;
|
|
87
90
|
entityId?: number;
|
|
88
91
|
settled?: number;
|
|
92
|
+
allowPartialPay?: number;
|
|
89
93
|
systemId?: number;
|
|
90
94
|
system?: System.Projection;
|
|
91
95
|
iState?: number;
|
|
@@ -141,6 +145,8 @@ export type SortAttr = {
|
|
|
141
145
|
entityId: number;
|
|
142
146
|
} | {
|
|
143
147
|
settled: number;
|
|
148
|
+
} | {
|
|
149
|
+
allowPartialPay: number;
|
|
144
150
|
} | {
|
|
145
151
|
systemId: number;
|
|
146
152
|
} | {
|
|
@@ -22,13 +22,9 @@ export const desc = {
|
|
|
22
22
|
},
|
|
23
23
|
desc: {
|
|
24
24
|
notNull: true,
|
|
25
|
-
type: "
|
|
26
|
-
params: {
|
|
27
|
-
length: 64
|
|
28
|
-
}
|
|
25
|
+
type: "text"
|
|
29
26
|
},
|
|
30
27
|
timeoutAt: {
|
|
31
|
-
notNull: true,
|
|
32
28
|
type: "datetime"
|
|
33
29
|
},
|
|
34
30
|
creatorId: {
|
|
@@ -54,6 +50,9 @@ export const desc = {
|
|
|
54
50
|
notNull: true,
|
|
55
51
|
type: "boolean"
|
|
56
52
|
},
|
|
53
|
+
allowPartialPay: {
|
|
54
|
+
type: "boolean"
|
|
55
|
+
},
|
|
57
56
|
systemId: {
|
|
58
57
|
notNull: true,
|
|
59
58
|
type: "ref",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "name": "订单", "attr": { "price": "订单金额", "paid": "已支付金额", "refunded": "已退款金额", "iState": "订单状态", "title": "订单标题", "desc": "订单描述", "timeoutAt": "过期时间", "creator": "创建者", "entity": "关联对象", "entityId": "关联对象Id", "settled": "是否结算", "opers": "相关帐户操作", "system": "所属系统" }, "action": { "startPaying": "开始支付", "payAll": "全部支付", "payPartially": "部分支付", "payNone": "支付失败", "timeout": "过期", "cancel": "放弃", "startRefunding": "开始退款", "refundAll": "完全退款", "refundNone": "退款失败", "refundPartially": "部分退款", "settle": "结算" }, "v": { "iState": { "paid": "已付款", "partiallyPaid": "部分支付", "paying": "支付中", "unpaid": "待付款", "timeout": "已超时", "cancelled": "已取消", "refunded": "已退款", "partiallyRefunded": "已部分退款", "refunding": "退款中" } } }
|
|
1
|
+
{ "name": "订单", "attr": { "price": "订单金额", "paid": "已支付金额", "refunded": "已退款金额", "iState": "订单状态", "title": "订单标题", "desc": "订单描述", "timeoutAt": "过期时间", "allowPartialPay": "允许部分支付", "creator": "创建者", "entity": "关联对象", "entityId": "关联对象Id", "settled": "是否结算", "opers": "相关帐户操作", "system": "所属系统" }, "action": { "startPaying": "开始支付", "payAll": "全部支付", "payPartially": "部分支付", "payNone": "支付失败", "timeout": "过期", "cancel": "放弃", "startRefunding": "开始退款", "refundAll": "完全退款", "refundNone": "退款失败", "refundPartially": "部分退款", "settle": "结算" }, "v": { "iState": { "paid": "已付款", "partiallyPaid": "部分支付", "paying": "支付中", "unpaid": "待付款", "timeout": "已超时", "cancelled": "已取消", "refunded": "已退款", "partiallyRefunded": "已部分退款", "refunding": "退款中" } } }
|
|
@@ -14,7 +14,7 @@ export declare const mergedProjection: {
|
|
|
14
14
|
type?: number | undefined;
|
|
15
15
|
systemId?: number | undefined;
|
|
16
16
|
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
|
|
17
|
-
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").
|
|
17
|
+
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
|
|
18
18
|
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
|
|
19
19
|
domainId?: number | undefined;
|
|
20
20
|
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;
|
|
@@ -3,7 +3,7 @@ export declare function getWithdrawCreateData(params: {
|
|
|
3
3
|
accountId: string;
|
|
4
4
|
price: number;
|
|
5
5
|
withdrawAccountId?: string;
|
|
6
|
-
}, context: BRC): Promise<(Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "
|
|
6
|
+
}, context: BRC): Promise<(Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
|
7
7
|
id: string;
|
|
8
8
|
} & {
|
|
9
9
|
accountId: string;
|
|
@@ -17,7 +17,7 @@ export declare function getWithdrawCreateData(params: {
|
|
|
17
17
|
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
18
18
|
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
19
19
|
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
20
|
-
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "
|
|
20
|
+
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
|
21
21
|
id: string;
|
|
22
22
|
} & {
|
|
23
23
|
accountId: string;
|
|
@@ -31,7 +31,7 @@ export declare function getWithdrawCreateData(params: {
|
|
|
31
31
|
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
32
32
|
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
33
33
|
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
34
|
-
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "
|
|
34
|
+
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
|
35
35
|
id: string;
|
|
36
36
|
} & {
|
|
37
37
|
account?: undefined;
|
|
@@ -45,7 +45,7 @@ export declare function getWithdrawCreateData(params: {
|
|
|
45
45
|
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
46
46
|
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
47
47
|
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
|
|
48
|
-
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "
|
|
48
|
+
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
|
49
49
|
id: string;
|
|
50
50
|
} & {
|
|
51
51
|
account?: undefined;
|
package/lib/checkers/order.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
5
5
|
const executor_1 = require("oak-domain/lib/utils/executor");
|
|
6
|
+
const types_1 = require("oak-domain/lib/types");
|
|
6
7
|
const checkers = [
|
|
7
8
|
{
|
|
8
9
|
type: 'logical',
|
|
@@ -23,6 +24,44 @@ const checkers = [
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
},
|
|
27
|
+
{
|
|
28
|
+
type: 'logicalData',
|
|
29
|
+
entity: 'order',
|
|
30
|
+
action: 'startPaying',
|
|
31
|
+
checker: (operation, context) => {
|
|
32
|
+
const { data, filter } = operation;
|
|
33
|
+
(0, assert_1.default)(typeof filter.id === 'string');
|
|
34
|
+
return (0, executor_1.pipeline)(() => context.select('order', {
|
|
35
|
+
data: {
|
|
36
|
+
id: 1,
|
|
37
|
+
price: 1,
|
|
38
|
+
paid: 1,
|
|
39
|
+
refunded: 1,
|
|
40
|
+
iState: 1,
|
|
41
|
+
},
|
|
42
|
+
filter: {
|
|
43
|
+
id: filter.id,
|
|
44
|
+
},
|
|
45
|
+
}, {}), (orders) => {
|
|
46
|
+
const [order] = orders;
|
|
47
|
+
const { price, paid, iState, allowPartialPay } = order;
|
|
48
|
+
(0, assert_1.default)(['unpaid', 'partiallyRefunded'].includes(iState) && paid === 0);
|
|
49
|
+
const { pay$order: pays } = data;
|
|
50
|
+
if (!(pays instanceof Array) || !pays.length) {
|
|
51
|
+
throw new types_1.OakInputIllegalException('order', ['pay$order'], 'error::order.nonePay');
|
|
52
|
+
}
|
|
53
|
+
let amount = 0;
|
|
54
|
+
pays.forEach(({ action, data }) => {
|
|
55
|
+
(0, assert_1.default)(action === 'create');
|
|
56
|
+
const { price } = data;
|
|
57
|
+
amount += price;
|
|
58
|
+
});
|
|
59
|
+
if (!allowPartialPay && amount !== price) {
|
|
60
|
+
throw new types_1.OakInputIllegalException('order', ['pay$order'], 'error::order.payAmountNotEnough');
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
},
|
|
26
65
|
{
|
|
27
66
|
// 订单结算,将收入分帐到相关的Account中
|
|
28
67
|
type: 'logicalData',
|