Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wenHuaBu_adminServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
wenHuaBu_adminServer
Commits
8c0ae52f
Commit
8c0ae52f
authored
Mar 19, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
91c8f432
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletions
+47
-1
order.ts
src/biz/member/order.ts
+43
-0
errorEnum.ts
src/config/errorEnum.ts
+4
-1
No files found.
src/biz/member/order.ts
View file @
8c0ae52f
...
...
@@ -334,4 +334,46 @@ export async function orderList({userId, type}) {
});
return
{
dataList
}
}
/**
* 个人页申请开发票(提前开票)
*/
export
async
function
applicationInvoice
({
id
})
{
let
orderInfo
=
await
find
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"invoiceStatus"
,
"advanceInvoice"
,
"invoiceAdd"
,
"state"
,
"advanceInvoice"
]);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
已开发票
)
throw
new
BizError
(
ERRORENUM
.
发票已开具不可重复提交
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
退回
)
throw
new
BizError
(
ERRORENUM
.
请求已被退回请重新申请
);
let
updateInfo
:
any
=
{
invoiceStatus
:
INVOICESTATUS
.
未开发票
};
if
(
orderInfo
.
state
==
ORDERSTATE
.
已支付
)
{
updateInfo
.
advanceInvoice
=
false
;
}
else
{
updateInfo
.
advanceInvoice
=
true
;
}
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
return
successResult
();
}
/**
* 重新申请发票
*/
export
async
function
reapplyInvoice
({
id
})
{
let
orderInfo
=
await
find
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"invoiceStatus"
,
"advanceInvoice"
,
"invoiceAdd"
,
"state"
,
"advanceInvoice"
]);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
orderInfo
.
invoiceStatus
!=
INVOICESTATUS
.
退回
)
throw
new
BizError
(
ERRORENUM
.
不满足重新请求条件
);
let
updateInfo
:
any
=
{
invoiceStatus
:
INVOICESTATUS
.
未开发票
};
if
(
orderInfo
.
state
==
ORDERSTATE
.
已支付
)
{
updateInfo
.
advanceInvoice
=
false
;
}
else
{
updateInfo
.
advanceInvoice
=
true
;
}
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
return
successResult
();
}
\ No newline at end of file
src/config/errorEnum.ts
View file @
8c0ae52f
...
...
@@ -37,7 +37,10 @@ export enum ERRORENUM {
该用户已在宽限期内
,
该订单已支付
,
调起微信支付失败
,
订单不存在
订单不存在
,
发票已开具不可重复提交
,
请求已被退回请重新申请
,
不满足重新请求条件
}
export
enum
ERRORCODEENUM
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment