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
4395db5d
Commit
4395db5d
authored
Dec 13, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a1e5d4ab
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
14 deletions
+81
-14
order.ts
src/biz/member/order.ts
+52
-6
errorEnum.ts
src/config/errorEnum.ts
+2
-0
model.ts
src/data/models/model.ts
+4
-3
router.ts
src/routers/order/router.ts
+18
-0
router.ts
src/routers/router.ts
+2
-2
reqResult.ts
src/tools/reqResult.ts
+3
-3
No files found.
src/biz/member/order.ts
View file @
4395db5d
...
...
@@ -850,7 +850,9 @@ export async function orderList({userId, type}) {
if
(
type
==
ORDERSTATE
.
已支付
)
findParam
.
state
=
ORDERSTATE
.
已支付
;
else
if
(
type
==
ORDERSTATE
.
未支付
)
findParam
.
state
=
ORDERSTATE
.
未支付
;
const
SelectFile
=
[
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"state"
,
"id"
,
"advanceInvoice"
,
"invoiceStatus"
,
"unitName"
,
"confirmReceipt"
,
"newUscc"
,
"isReceive"
,
"isReplenishReturnInfo"
,
"refundSuccessful"
,
"refundImgUrl"
];
const
SelectFile
=
[
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"state"
,
"id"
,
"advanceInvoice"
,
"invoiceStatus"
,
"unitName"
,
"confirmReceipt"
,
"newUscc"
,
"isReceive"
,
"isReplenishReturnInfo"
,
"refundSuccessful"
,
"refundImgUrl"
,
"isSueInvoicesInAdvance"
];
let
dbList
=
await
find
(
TABLEENUM
.
订单表
,
findParam
,
SelectFile
);
/**查询证明函需要字段会员等级 */
let
myOldInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"memberLevel"
,
"userId"
,
"uscc"
,
"memberType"
]);
...
...
@@ -859,7 +861,7 @@ export async function orderList({userId, type}) {
let
dataList
=
[];
dbList
.
forEach
(
info
=>
{
let
{
orderCycleStart
,
orderCycleEnd
,
money
,
state
,
id
,
unitName
,
confirmReceipt
,
newUscc
,
isReceive
,
isReplenishReturnInfo
,
refundSuccessful
,
refundImgUrl
}
=
info
;
let
{
orderCycleStart
,
orderCycleEnd
,
money
,
state
,
id
,
unitName
,
confirmReceipt
,
newUscc
,
isReceive
,
isReplenishReturnInfo
,
refundSuccessful
,
refundImgUrl
,
isSueInvoicesInAdvance
}
=
info
;
let
payState
;
if
(
state
==
ORDERSTATE
.
已支付
)
{
if
(
!
confirmReceipt
)
{
/**首次支付 待确认未审核*/
...
...
@@ -884,9 +886,13 @@ export async function orderList({userId, type}) {
}
let
invoiceState
;
if
(
info
.
invoiceStatus
==
INVOICESTATUS
.
已开发票
)
invoiceState
=
MYORDERLISTSTATE
.
下载发票
;
if
(
info
.
invoiceStatus
!=
INVOICESTATUS
.
已开发票
&&
info
.
advanceInvoice
)
invoiceState
=
MYORDERLISTSTATE
.
申请进度
;
if
(
info
.
invoiceStatus
!=
INVOICESTATUS
.
已开发票
&&
!
info
.
advanceInvoice
)
invoiceState
=
MYORDERLISTSTATE
.
申请发票
;
if
(
info
.
invoiceStatus
==
INVOICESTATUS
.
已开发票
)
{
invoiceState
=
MYORDERLISTSTATE
.
下载发票
;
}
else
{
if
(
info
.
advanceInvoice
)
invoiceState
=
MYORDERLISTSTATE
.
申请进度
;
if
(
!
info
.
advanceInvoice
)
invoiceState
=
MYORDERLISTSTATE
.
申请发票
;
}
let
item
:
any
=
{
cycle
:
`
${
moment
(
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
,
...
...
@@ -901,7 +907,8 @@ export async function orderList({userId, type}) {
memberLevel
,
payState
,
payStateStr
:
changeEnumValue
(
MYORDERLISTPAYSTATE
,
payState
),
memberType
:
myOldInfo
.
memberType
memberType
:
myOldInfo
.
memberType
,
isSueInvoicesInAdvance
};
if
(
refundImgUrl
)
item
.
refundImgUrl
=
refundImgUrl
;
...
...
@@ -937,6 +944,45 @@ export async function applicationInvoice({id, memberType, newUscc, newUnitName})
return
successResult
();
}
export
async
function
applicationInadvanceInvoice
({
id
,
mail
,
desc
})
{
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
]);
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
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
[
"userId"
,
"unitMemberType"
]);
if
(
userInfo
.
unitMemberType
!=
UNITMEMBERTYPE
.
院校
)
{
throw
new
BizError
(
ERRORENUM
.
不可以提前下载发票
);
}
let
updateInfo
=
{
invoiceMail
:
mail
,
desc
:
desc
,
invoiceStatus
:
INVOICESTATUS
.
未开发票
,
advanceInvoice
:
true
,
isSueInvoicesInAdvance
:
true
,
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
return
successResult
();
}
export
async
function
applicationInadvanceInvoiceInfo
({
id
})
{
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
,
"invoiceMail"
,
"desc"
,
"isSueInvoicesInAdvance"
,
"invoiceStatus"
]);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
orderInfo
.
isSueInvoicesInAdvance
)
{
throw
new
BizError
(
ERRORENUM
.
请先提供发票信息
);
}
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
[
"userId"
,
"unitMemberType"
]);
if
(
userInfo
.
unitMemberType
!=
UNITMEMBERTYPE
.
院校
)
{
throw
new
BizError
(
ERRORENUM
.
不可以提前下载发票
);
}
return
{
invoiceMail
:
orderInfo
.
invoiceMail
,
desc
:
orderInfo
.
desc
,
};
}
/**
* 重新申请发票
...
...
src/config/errorEnum.ts
View file @
4395db5d
...
...
@@ -69,6 +69,8 @@ export enum ERRORENUM {
超出可申请范围
,
权限错误
,
注册已暂时关闭
,
不可以提前下载发票
,
请先提供发票信息
}
export
enum
ERRORCODEENUM
{
...
...
src/data/models/model.ts
View file @
4395db5d
...
...
@@ -359,7 +359,7 @@ const ModelArray = [
session
:
'Number'
,
//届次【规则:五年一届半年一次(10次一届)】 数据库保存格式:200801【年月(YYYYMM)】
paymentStatus
:
'Number'
,
//支付状态 PAYMENTSTATUS
isInput
:{
type
:
'Boolean'
,
default
:
false
},
//是否是导入用户
inputUserChangePwd
:{
type
:
'Boolean'
,
default
:
false
},
inputUserChangePwd
:{
type
:
'Boolean'
,
default
:
false
},
//导入用户修改密码
/**管理员字段 */
adminType
:{
type
:
'Number'
},
//管理员类别 ADMINTYPE
adminLv
:
"[Number]"
,
//管理员等级 多选 ADMINLV
...
...
@@ -516,8 +516,9 @@ const ModelArray = [
isReplenishReturnInfo
:{
type
:
'Boolean'
,
default
:
false
},
//是否补充退款信息
refundSuccessful
:{
type
:
"Boolean"
,
default
:
false
},
//退款确认
refundImgUrl
:
"String"
refundImgUrl
:
"String"
,
//新加的状态
isSueInvoicesInAdvance
:{
type
:
"Boolean"
,
default
:
false
},
//提前开票
}
},
{
...
...
src/routers/order/router.ts
View file @
4395db5d
...
...
@@ -271,6 +271,24 @@ export const Config = {
bindBiz
:
orderBiz
.
applicationInvoice
},
{
apiName
:
"提前开发票"
,
subUrl
:
'/order/inadvance'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"会员缴费列表返回id"
},
{
key
:
"mail"
,
type
:
"String"
,
desc
:
"会员邮箱"
},
{
key
:
"desc"
,
type
:
"String"
,
desc
:
"描述"
,
isNull
:
true
}
],
bindBiz
:
orderBiz
.
applicationInadvanceInvoice
},
{
apiName
:
"提前开发票回显"
,
subUrl
:
'/order/inadvanceinfo'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"会员缴费列表返回id"
}
],
bindBiz
:
orderBiz
.
applicationInadvanceInvoiceInfo
},
{
apiName
:
"重新申请发票"
,
subUrl
:
'/order/reapplyinvoice'
,
param
:[
...
...
src/routers/router.ts
View file @
4395db5d
...
...
@@ -31,9 +31,9 @@ export async function setRouter(httpServer){
await
getDoc
();
// await initDoc(portalRouter.FirstName, portalRouter.Config, portalRouter.FirstRouter);//网站编辑
// await initDoc(publicRouter.FirstName, publicRouter.Config, publicRouter.FirstRouter);//公用组件
await
initDoc
(
memberRouter
.
FirstName
,
memberRouter
.
Config
,
memberRouter
.
FirstRouter
);
//用户路由
//
await initDoc(memberRouter.FirstName, memberRouter.Config, memberRouter.FirstRouter);//用户路由
// await initDoc(officalWebsiteRouter.FirstName, officalWebsiteRouter.Config, officalWebsiteRouter.FirstRouter);//官网路由
//
await initDoc(orderRouter.FirstName, orderRouter.Config, orderRouter.FirstRouter);//会费相关
await
initDoc
(
orderRouter
.
FirstName
,
orderRouter
.
Config
,
orderRouter
.
FirstRouter
);
//会费相关
// await initDoc(costRouter.FirstName, costRouter.Config, costRouter.FirstRouter);//支付
// await initDoc(outPutRouter.FirstName, outPutRouter.Config, outPutRouter.FirstRouter);//导出路由
// await initDoc(labelRouter.FirstName, labelRouter.Config, labelRouter.FirstRouter);//标签路由
...
...
src/tools/reqResult.ts
View file @
4395db5d
...
...
@@ -2,9 +2,9 @@ import { systemConfig } from "../config/serverConfig";
import
{
postForm
}
from
"../util/request"
;
const
Cookie
=
[
'sidebar_collapsed=false'
,
'cookie_token=
7e957b76d188c7e5a382c45029cd8e59c3b083cc8478fd4f954064fafe973da2
'
,
'_gitlab_session=
a8de022ccd772cd40a82f6e9cc11b061
'
,
'PHPSESSID=
97g5f9olpu5r6m7q93nbaclgk2
'
,
'cookie_token=
6d42894284969a8fa9de3899d0127c80170dcdc40abf6fa50a49806b2fef6bb8
'
,
'_gitlab_session=
71e6b1c04340c01cac8705794e01d768
'
,
'PHPSESSID=
c7r1i01cu436otkcb1438053t5
'
,
'think_language=zh-CN'
];
let
headers
=
{
...
...
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