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
c17f3599
Commit
c17f3599
authored
Dec 21, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
2e672d31
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
201 additions
and
82 deletions
+201
-82
examine.ts
src/biz/member/examine.ts
+6
-1
order.ts
src/biz/member/order.ts
+175
-64
errorEnum.ts
src/config/errorEnum.ts
+3
-1
model.ts
src/data/models/model.ts
+1
-1
router.ts
src/routers/member/router.ts
+2
-2
router.ts
src/routers/order/router.ts
+14
-13
No files found.
src/biz/member/examine.ts
View file @
c17f3599
...
@@ -188,7 +188,12 @@ export async function adopt({id, session}) {
...
@@ -188,7 +188,12 @@ export async function adopt({id, session}) {
}
}
//创建初始订单
//创建初始订单
await
createOrder
(
id
,
userInfo
.
loginId
,
userInfo
.
phone
,
unitName
,
joinTime
+
1000
,
MEMBERLEVEL
.
普通会员
,
userInfo
.
memberType
,
subType
,
true
);
//创建初始订单应该使用
//创建今年的订单
let
thisYear
=
new
Date
().
getFullYear
();
let
orderStartMonthStr
=
moment
(
joinTime
).
format
(
"MM-DD HH:mm:SS"
);
let
orderStartMs
=
new
Date
(
`
${
thisYear
}
-
${
orderStartMonthStr
}
`
).
valueOf
();
await
createOrder
(
id
,
userInfo
.
loginId
,
userInfo
.
phone
,
unitName
,
orderStartMs
,
MEMBERLEVEL
.
普通会员
,
userInfo
.
memberType
,
subType
,
true
);
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
id
},
updateInfo
);
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
id
},
updateInfo
);
...
...
src/biz/member/order.ts
View file @
c17f3599
...
@@ -178,30 +178,56 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
...
@@ -178,30 +178,56 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
confirmReceipt
:
RECEIPTCONFIRMATION
.
待确认
,
confirmReceipt
:
RECEIPTCONFIRMATION
.
待确认
,
state
:
ORDERSTATE
.
已支付
state
:
ORDERSTATE
.
已支付
}
}
/**用户表查询条件 */
let
checkUserIdList
=
[];
let
itemParam
:
any
=
{};
let
isSelectUser
=
false
;
if
(
name
)
{
if
(
name
)
{
findParam
[
"$or"
]
=
[
isSelectUser
=
true
;
{
unitName
:{
"$regex"
:
`
${
name
}
`
},
memberType
:
MEMBERTYPE
.
单位会员
},
itemParam
=
{
{
name
:{
"$regex"
:
`
${
name
}
`
},
memberType
:
MEMBERTYPE
.
个人会员
}
"$or"
:[
{
unitName
:{
"$regex"
:
`
${
name
}
`
}},
{
name
:{
"$regex"
:
`
${
name
}
`
}}
]
]
}
}
if
(
memberType
.
length
)
{
if
(
memberType
<
UNITMEMBERTYPE
.
院校
)
{
findParam
.
individualMemberType
=
{
"$in"
:
memberType
};
}
else
{
findParam
.
unitMemberType
=
{
"$in"
:
memberType
};
}
}
if
(
memberType
&&
memberType
.
length
)
{
isSelectUser
=
true
;
itemParam
[
"$or"
]
=
[
{
unitMemberType
:{
"$in"
:
memberType
}},
{
individualMemberType
:{
"$in"
:
memberType
}}
];
}
if
(
documentId
)
{
isSelectUser
=
true
;
itemParam
.
documentId
=
documentId
;
}
if
(
mail
)
{
isSelectUser
=
true
;
itemParam
.
mail
=
mail
;
}
}
if
(
documentId
)
findParam
.
documentId
=
documentId
;
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
mail
)
findParam
.
mail
=
mail
;
if
(
joinStartTime
)
{
if
(
joinStartTime
)
{
findParam
[
"joinTime"
]
=
{
"$gt"
:
joinStartTime
};
isSelectUser
=
true
;
itemParam
[
"joinTime"
]
=
{
"$gt"
:
joinStartTime
};
}
}
if
(
joinEndTime
)
{
if
(
joinEndTime
)
{
if
(
!
findParam
[
"joinTime"
])
findParam
[
"joinTime"
]
=
{};
isSelectUser
=
true
;
findParam
[
"joinTime"
][
"$lt"
]
=
joinEndTime
;
if
(
!
itemParam
[
"joinTime"
])
itemParam
[
"joinTime"
]
=
{};
itemParam
[
"joinTime"
][
"$lt"
]
=
joinEndTime
;
}
if
(
memberLevel
&&
memberLevel
.
length
)
{
isSelectUser
=
true
;
itemParam
.
memberLevel
=
{
"$in"
:
memberLevel
};
}
if
(
isSelectUser
)
{
let
checkUserIdDataList
=
await
find
(
TABLEENUM
.
用户表
,
itemParam
,
[
"userId"
]);
checkUserIdDataList
.
forEach
(
key
=>
{
checkUserIdList
.
push
(
key
.
userId
);
});
}
if
(
checkUserIdList
.
length
)
{
findParam
.
userId
=
{
"$in"
:
checkUserIdList
}
}
}
if
(
memberLevel
.
length
)
findParam
.
memberLevel
=
{
"$in"
:
memberLevel
};
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
paymentType
)
findParam
.
paymentMethod
=
paymentType
;
if
(
paymentType
)
findParam
.
paymentMethod
=
paymentType
;
if
(
costType
)
findParam
.
isFirst
=
costType
==
COSTTYPE
.
首次
;
if
(
costType
)
findParam
.
isFirst
=
costType
==
COSTTYPE
.
首次
;
...
@@ -368,7 +394,7 @@ export async function outPutConfirmReceipt({exportColumns}) {
...
@@ -368,7 +394,7 @@ export async function outPutConfirmReceipt({exportColumns}) {
}
}
}
}
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
if
(
value
)
{
if
(
value
&&
value
!=
"-"
)
{
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
...
@@ -427,30 +453,55 @@ export async function billStateList({name, memberType, documentId, phone, mail,
...
@@ -427,30 +453,55 @@ export async function billStateList({name, memberType, documentId, phone, mail,
invoiceStatus
:
INVOICESTATUS
.
未开发票
invoiceStatus
:
INVOICESTATUS
.
未开发票
};
};
/**用户表查询条件 */
let
checkUserIdList
=
[]
let
itemParam
:
any
=
{};
let
isSelectUser
=
false
;
if
(
name
)
{
if
(
name
)
{
findParam
[
"$or"
]
=
[
isSelectUser
=
true
;
{
unitName
:{
"$regex"
:
`
${
name
}
`
},
memberType
:
MEMBERTYPE
.
单位会员
},
itemParam
=
{
{
name
:{
"$regex"
:
`
${
name
}
`
},
memberType
:
MEMBERTYPE
.
个人会员
}
"$or"
:[
{
unitName
:{
"$regex"
:
`
${
name
}
`
}},
{
name
:{
"$regex"
:
`
${
name
}
`
}}
]
]
}
}
}
if
(
memberType
&&
memberType
.
length
)
{
if
(
memberType
&&
memberType
.
length
)
{
if
(
memberType
<
UNITMEMBERTYPE
.
院校
)
{
isSelectUser
=
true
;
findParam
.
individualMemberType
=
{
"$in"
:
memberType
};
itemParam
[
"$or"
]
=
[
{
unitMemberType
:{
"$in"
:
memberType
}},
{
individualMemberType
:{
"$in"
:
memberType
}}
];
}
else
{
findParam
.
unitMemberType
=
{
"$in"
:
memberType
};
}
}
if
(
documentId
)
{
isSelectUser
=
true
;
itemParam
.
documentId
=
documentId
;
}
if
(
mail
)
{
isSelectUser
=
true
;
itemParam
.
mail
=
mail
;
}
}
if
(
documentId
)
findParam
.
documentId
=
documentId
;
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
mail
)
findParam
.
mail
=
mail
;
if
(
joinStartTime
)
{
if
(
joinStartTime
)
{
findParam
[
"joinTime"
]
=
{
"$gt"
:
joinStartTime
};
isSelectUser
=
true
;
itemParam
[
"joinTime"
]
=
{
"$gt"
:
joinStartTime
};
}
}
if
(
joinEndTime
)
{
if
(
joinEndTime
)
{
if
(
!
findParam
[
"joinTime"
])
findParam
[
"joinTime"
]
=
{};
isSelectUser
=
true
;
findParam
[
"joinTime"
][
"$lt"
]
=
joinEndTime
;
if
(
!
itemParam
[
"joinTime"
])
itemParam
[
"joinTime"
]
=
{};
itemParam
[
"joinTime"
][
"$lt"
]
=
joinEndTime
;
}
if
(
memberLevel
&&
memberLevel
.
length
)
{
isSelectUser
=
true
;
itemParam
.
memberLevel
=
{
"$in"
:
memberLevel
};
}
if
(
isSelectUser
)
{
let
checkUserIdDataList
=
await
find
(
TABLEENUM
.
用户表
,
itemParam
,
[
"userId"
]);
checkUserIdDataList
.
forEach
(
key
=>
{
checkUserIdList
.
push
(
key
.
userId
);
});
}
}
if
(
memberLevel
.
length
)
findParam
.
memberLevel
=
{
"$in"
:
memberLevel
};
if
(
checkUserIdList
.
length
)
{
findParam
.
userId
=
{
"$in"
:
checkUserIdList
}
}
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
paymentType
)
{
if
(
paymentType
)
{
eccEnumValue
(
"发票列表"
,
"支付类型"
,
PAYMENTTYPE
,
paymentType
);
eccEnumValue
(
"发票列表"
,
"支付类型"
,
PAYMENTTYPE
,
paymentType
);
findParam
.
paymentMethod
=
paymentType
;
findParam
.
paymentMethod
=
paymentType
;
...
@@ -590,7 +641,7 @@ export async function backInvoice({id}) {
...
@@ -590,7 +641,7 @@ export async function backInvoice({id}) {
// if (key == "payTime") {
// if (key == "payTime") {
// if (info.paymentMethod != PAYMENTTYPE.微信支付) value = "-"
// if (info.paymentMethod != PAYMENTTYPE.微信支付) value = "-"
// }
// }
if
(
value
)
{
if
(
value
&&
value
!=
"-"
)
{
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
...
@@ -680,30 +731,56 @@ export async function invoicedList({name, memberType, documentId, phone, mail, j
...
@@ -680,30 +731,56 @@ export async function invoicedList({name, memberType, documentId, phone, mail, j
let
findParam
:
any
=
{
let
findParam
:
any
=
{
invoiceStatus
:
INVOICESTATUS
.
已开发票
invoiceStatus
:
INVOICESTATUS
.
已开发票
};
};
/**用户表查询条件 */
let
checkUserIdList
=
[]
let
itemParam
:
any
=
{};
let
isSelectUser
=
false
;
if
(
name
)
{
if
(
name
)
{
findParam
[
"$or"
]
=
[
isSelectUser
=
true
;
{
unitName
:{
"$regex"
:
`
${
name
}
`
},
memberType
:
MEMBERTYPE
.
单位会员
},
itemParam
=
{
{
name
:{
"$regex"
:
`
${
name
}
`
},
memberType
:
MEMBERTYPE
.
个人会员
}
"$or"
:[
{
unitName
:{
"$regex"
:
`
${
name
}
`
}},
{
name
:{
"$regex"
:
`
${
name
}
`
}}
]
]
}
}
}
if
(
memberType
&&
memberType
.
length
)
{
if
(
memberType
&&
memberType
.
length
)
{
if
(
memberType
<
UNITMEMBERTYPE
.
院校
)
{
isSelectUser
=
true
;
findParam
.
individualMemberType
=
{
"$in"
:
memberType
};
itemParam
[
"$or"
]
=
[
{
unitMemberType
:{
"$in"
:
memberType
}},
{
individualMemberType
:{
"$in"
:
memberType
}}
];
}
else
{
findParam
.
unitMemberType
=
{
"$in"
:
memberType
};
}
}
if
(
documentId
)
{
isSelectUser
=
true
;
itemParam
.
documentId
=
documentId
;
}
if
(
mail
)
{
isSelectUser
=
true
;
itemParam
.
mail
=
mail
;
}
}
if
(
documentId
)
findParam
.
documentId
=
documentId
;
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
mail
)
findParam
.
mail
=
mail
;
if
(
joinStartTime
)
{
if
(
joinStartTime
)
{
findParam
[
"joinTime"
]
=
{
"$gt"
:
joinStartTime
};
isSelectUser
=
true
;
itemParam
[
"joinTime"
]
=
{
"$gt"
:
joinStartTime
};
}
}
if
(
joinEndTime
)
{
if
(
joinEndTime
)
{
if
(
!
findParam
[
"joinTime"
])
findParam
[
"joinTime"
]
=
{};
isSelectUser
=
true
;
findParam
[
"joinTime"
][
"$lt"
]
=
joinEndTime
;
if
(
!
itemParam
[
"joinTime"
])
itemParam
[
"joinTime"
]
=
{};
itemParam
[
"joinTime"
][
"$lt"
]
=
joinEndTime
;
}
if
(
memberLevel
&&
memberLevel
.
length
)
{
isSelectUser
=
true
;
itemParam
.
memberLevel
=
{
"$in"
:
memberLevel
};
}
if
(
isSelectUser
)
{
let
checkUserIdDataList
=
await
find
(
TABLEENUM
.
用户表
,
itemParam
,
[
"userId"
]);
checkUserIdDataList
.
forEach
(
key
=>
{
checkUserIdList
.
push
(
key
.
userId
);
});
}
}
if
(
memberLevel
&&
memberLevel
.
length
)
findParam
.
memberLevel
=
{
"$in"
:
memberLevel
};
if
(
checkUserIdList
.
length
)
{
findParam
.
userId
=
{
"$in"
:
checkUserIdList
}
}
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
paymentType
)
findParam
.
paymentMethod
=
paymentType
;
if
(
paymentType
)
findParam
.
paymentMethod
=
paymentType
;
if
(
isPay
)
findParam
.
state
=
isPay
if
(
isPay
)
findParam
.
state
=
isPay
...
@@ -780,7 +857,7 @@ export async function invoicedList({name, memberType, documentId, phone, mail, j
...
@@ -780,7 +857,7 @@ export async function invoicedList({name, memberType, documentId, phone, mail, j
}
}
}
}
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
if
(
value
)
{
if
(
value
&&
value
!=
"-"
)
{
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
...
@@ -926,17 +1003,20 @@ export async function orderList({userId, type}) {
...
@@ -926,17 +1003,20 @@ export async function orderList({userId, type}) {
/**
/**
* 个人页申请开发票
(提前开票)
* 个人页申请开发票
* @param id 会员缴费列表返回的id
* @param id 会员缴费列表返回的id
* @param newUscc 社会信用代码
* @param newUscc 社会信用代码
* @param newUnitName 发票抬头
* @param newUnitName 发票抬头
*/
*/
export
async
function
applicationInvoice
({
id
,
memberType
,
newUscc
,
newUnitName
})
{
export
async
function
applicationInvoice
({
id
,
memberType
,
newUscc
,
newUnitName
})
{
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"invoiceStatus"
,
"advanceInvoice"
,
"invoiceAdd"
,
"state"
,
"advanceInvoice"
]);
return
successResult
();
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
,
"invoiceStatus"
,
"advanceInvoice"
,
"invoiceAdd"
,
"state"
,
"advanceInvoice"
]);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
已开发票
)
throw
new
BizError
(
ERRORENUM
.
发票已开具不可重复提交
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
已开发票
)
throw
new
BizError
(
ERRORENUM
.
发票已开具不可重复提交
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
退回
)
throw
new
BizError
(
ERRORENUM
.
请求已被退回请重新申请
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
退回
)
throw
new
BizError
(
ERRORENUM
.
请求已被退回请重新申请
);
// let orderInfo = await findOnce(TABLEENUM.订单表, {id}, ["userId", "memberType"]);
let
updateInfo
:
any
=
{};
let
updateInfo
:
any
=
{};
//个人会员申请发票锁定文字,无法修改
//个人会员申请发票锁定文字,无法修改
if
(
memberType
==
MEMBERTYPE
.
单位会员
)
{
if
(
memberType
==
MEMBERTYPE
.
单位会员
)
{
...
@@ -950,15 +1030,26 @@ export async function applicationInvoice({id, memberType, newUscc, newUnitName})
...
@@ -950,15 +1030,26 @@ export async function applicationInvoice({id, memberType, newUscc, newUnitName})
return
successResult
();
return
successResult
();
}
}
/**
* 开发票
* @param param0
* @returns
*/
export
async
function
applicationInadvanceInvoice
({
id
,
mail
,
desc
})
{
export
async
function
applicationInadvanceInvoice
({
id
,
mail
,
desc
})
{
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
]);
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
,
"state"
]);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
已开发票
)
throw
new
BizError
(
ERRORENUM
.
发票已开具不可重复提交
);
if
(
orderInfo
.
invoiceStatus
==
INVOICESTATUS
.
已开发票
)
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
.
院校
)
{
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
[
"userId"
,
"unitMemberType"
,
"memberType"
]);
throw
new
BizError
(
ERRORENUM
.
不可以提前下载发票
);
if
(
userInfo
.
memberType
!=
MEMBERTYPE
.
单位会员
)
{
throw
new
BizError
(
ERRORENUM
.
发票已发送至邮请注意查看
);
}
else
if
(
orderInfo
.
state
==
ORDERSTATE
.
未支付
&&
userInfo
.
unitMemberType
!=
UNITMEMBERTYPE
.
院校
)
{
throw
new
BizError
(
ERRORENUM
.
请先付款后进行发票操作
);
}
}
let
updateInfo
=
{
let
updateInfo
=
{
invoiceMail
:
mail
,
invoiceMail
:
mail
,
desc
:
desc
,
desc
:
desc
,
...
@@ -971,21 +1062,24 @@ export async function applicationInadvanceInvoice({id, mail, desc}) {
...
@@ -971,21 +1062,24 @@ export async function applicationInadvanceInvoice({id, mail, desc}) {
return
successResult
();
return
successResult
();
}
}
export
async
function
applicationInadvanceInvoiceInfo
({
id
})
{
export
async
function
applicationInadvanceInvoiceInfo
({
id
})
{
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
,
"invoiceMail"
,
"desc"
,
"i
sSueInvoicesInAdvance"
,
"invoiceStatus
"
]);
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
,
"invoiceMail"
,
"desc"
,
"i
nvoiceStatus"
,
"state
"
]);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
orderInfo
.
isSueInvoicesInAdvance
)
{
throw
new
BizError
(
ERRORENUM
.
请先提供发票信息
);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
[
"userId"
,
"memberType"
,
"mail"
,
"unitMemberType"
]);
if
(
userInfo
.
memberType
!=
MEMBERTYPE
.
单位会员
)
{
throw
new
BizError
(
ERRORENUM
.
发票已发送至邮请注意查看
);
}
else
if
(
orderInfo
.
state
==
ORDERSTATE
.
未支付
&&
userInfo
.
unitMemberType
!=
UNITMEMBERTYPE
.
院校
)
{
throw
new
BizError
(
ERRORENUM
.
请先付款后进行发票操作
);
}
}
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
[
"userId"
,
"unitMemberType"
]);
if
(
userInfo
.
unitMemberType
!=
UNITMEMBERTYPE
.
院校
)
{
let
resultObj
=
{
throw
new
BizError
(
ERRORENUM
.
不可以提前下载发票
);
invoiceMail
:
orderInfo
.
invoiceMail
||
userInfo
.
mail
||
""
,
desc
:
orderInfo
.
desc
||
""
}
}
return
{
return
resultObj
;
invoiceMail
:
orderInfo
.
invoiceMail
,
desc
:
orderInfo
.
desc
,
};
}
}
...
@@ -1140,11 +1234,28 @@ export async function accountInfo({id, form}) {
...
@@ -1140,11 +1234,28 @@ export async function accountInfo({id, form}) {
* 退款列表
* 退款列表
* @param param0
* @param param0
*/
*/
export
async
function
refundList
({
pageNumber
})
{
export
async
function
refundList
({
name
,
pageNumber
})
{
let
findParam
:
any
=
{
let
findParam
:
any
=
{
isReceive
:
ISRECEIVE
.
提供账户
_zkh
需退款
_ykh
isReceive
:
ISRECEIVE
.
提供账户
_zkh
需退款
_ykh
};
};
let
checkUserIdList
=
[]
if
(
name
)
{
let
itemParam
=
{
"$or"
:[
{
unitName
:{
"$regex"
:
`
${
name
}
`
}},
{
name
:{
"$regex"
:
`
${
name
}
`
}}
]
}
let
checkUserIdDataList
=
await
find
(
TABLEENUM
.
用户表
,
itemParam
,
[
"userId"
]);
checkUserIdDataList
.
forEach
(
key
=>
{
checkUserIdList
.
push
(
key
.
userId
);
});
}
if
(
checkUserIdList
.
length
)
{
findParam
.
userId
=
{
"$in"
:
checkUserIdList
}
}
let
selectFile
=
[
"id"
,
"unitName"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"memberCategory"
,
"userId"
,
"refundBankCarId"
,
"refundBankName"
,
"refundSuccessful"
,
"isReplenishReturnInfo"
];
let
selectFile
=
[
"id"
,
"unitName"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"memberCategory"
,
"userId"
,
"refundBankCarId"
,
"refundBankName"
,
"refundSuccessful"
,
"isReplenishReturnInfo"
];
let
dbList
=
await
findToPage
(
TABLEENUM
.
订单表
,
findParam
,
selectFile
,
pageNumber
);
let
dbList
=
await
findToPage
(
TABLEENUM
.
订单表
,
findParam
,
selectFile
,
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
订单表
,
findParam
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
订单表
,
findParam
);
...
@@ -1245,7 +1356,7 @@ export async function refundApprove({id, refundImgUrl}) {
...
@@ -1245,7 +1356,7 @@ export async function refundApprove({id, refundImgUrl}) {
}
}
}
}
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
if
(
key
==
"orderCycle"
)
value
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
if
(
value
)
{
if
(
value
&&
value
!=
"-"
)
{
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
if
(
timeChnageList
.
indexOf
(
key
)
!=
-
1
)
value
=
moment
(
value
).
format
(
"YYYY-MM-DD"
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
...
...
src/config/errorEnum.ts
View file @
c17f3599
...
@@ -75,7 +75,9 @@ export enum ERRORENUM {
...
@@ -75,7 +75,9 @@ export enum ERRORENUM {
账号不存在
,
账号不存在
,
密码修改错误
,
密码修改错误
,
非单位会员不可操作
,
非单位会员不可操作
,
不存在审批历史
不存在审批历史
,
发票已发送至邮请注意查看
,
请先付款后进行发票操作
}
}
export
enum
ERRORCODEENUM
{
export
enum
ERRORCODEENUM
{
...
...
src/data/models/model.ts
View file @
c17f3599
...
@@ -519,7 +519,7 @@ const ModelArray = [
...
@@ -519,7 +519,7 @@ const ModelArray = [
refundSuccessful
:{
type
:
"Boolean"
,
default
:
false
},
//退款确认
refundSuccessful
:{
type
:
"Boolean"
,
default
:
false
},
//退款确认
refundImgUrl
:
"String"
,
refundImgUrl
:
"String"
,
//新加的状态
//新加的状态
isSueInvoicesInAdvance
:{
type
:
"Boolean"
,
default
:
false
},
//提前开票
isSueInvoicesInAdvance
:{
type
:
"Boolean"
,
default
:
false
},
//提前开票
弃用
}
}
},
},
{
{
...
...
src/routers/member/router.ts
View file @
c17f3599
...
@@ -343,7 +343,7 @@ export const Config = {
...
@@ -343,7 +343,7 @@ export const Config = {
subUrl
:
'/changepwd'
,
subUrl
:
'/changepwd'
,
notMiddleware
:
true
,
notMiddleware
:
true
,
param
:[
param
:[
{
key
:
"userId"
,
type
:
"String"
,
desc
:
"userId"
,
notMustHave
:
true
},
{
key
:
"userId"
,
type
:
"String"
,
desc
:
"userId"
,
isNull
:
true
},
{
key
:
"phone"
,
type
:
"String"
,
desc
:
"绑定手机号"
},
{
key
:
"phone"
,
type
:
"String"
,
desc
:
"绑定手机号"
},
{
key
:
"pwd"
,
type
:
"String"
,
desc
:
"密码"
},
{
key
:
"pwd"
,
type
:
"String"
,
desc
:
"密码"
},
{
key
:
"confirmation"
,
type
:
"String"
,
desc
:
"二次确认密码"
},
{
key
:
"confirmation"
,
type
:
"String"
,
desc
:
"二次确认密码"
},
...
@@ -355,7 +355,7 @@ export const Config = {
...
@@ -355,7 +355,7 @@ export const Config = {
subUrl
:
'/getchangepwdcode'
,
subUrl
:
'/getchangepwdcode'
,
notMiddleware
:
true
,
notMiddleware
:
true
,
param
:[
param
:[
{
key
:
"userId"
,
type
:
"String"
,
desc
:
"userId"
,
notMustHave
:
true
},
{
key
:
"userId"
,
type
:
"String"
,
desc
:
"userId"
,
isNull
:
true
},
{
key
:
"phone"
,
type
:
"String"
,
desc
:
"绑定手机号"
}
{
key
:
"phone"
,
type
:
"String"
,
desc
:
"绑定手机号"
}
],
],
bindBiz
:
userBiz
.
memberChangePwdSendCode
bindBiz
:
userBiz
.
memberChangePwdSendCode
...
...
src/routers/order/router.ts
View file @
c17f3599
...
@@ -202,6 +202,7 @@ export const Config = {
...
@@ -202,6 +202,7 @@ export const Config = {
apiName
:
"退款列表"
,
apiName
:
"退款列表"
,
subUrl
:
'/order/refundlist'
,
subUrl
:
'/order/refundlist'
,
param
:[
param
:[
{
key
:
"name"
,
type
:
"String"
,
desc
:
"名称"
,
isNull
:
true
},
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"当前页"
},
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"当前页"
},
],
],
bindBiz
:
orderBiz
.
refundList
bindBiz
:
orderBiz
.
refundList
...
@@ -260,19 +261,19 @@ export const Config = {
...
@@ -260,19 +261,19 @@ export const Config = {
],
],
bindBiz
:
orderBiz
.
reconfirm
bindBiz
:
orderBiz
.
reconfirm
},
},
// {
// apiName:"申请发票", 弃用统一成下面的
// subUrl:'/order/applicationinvoice',
// param:[
// {key:"id", type:"String", desc:"会员缴费列表返回id"},
// {key:"memberType", type:"Number", desc:"会员类型"},
// {key:"newUscc", type:"String", desc:"新的社会信用代码", isNull:true},
// {key:"newUnitName", type:"String", desc:"新的发票抬头", isNull:true}
// ],
// bindBiz:orderBiz.applicationInvoice
// },
{
{
apiName
:
"申请发票"
,
apiName
:
"开发票"
,
subUrl
:
'/order/applicationinvoice'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"会员缴费列表返回id"
},
{
key
:
"memberType"
,
type
:
"Number"
,
desc
:
"会员类型"
},
{
key
:
"newUscc"
,
type
:
"String"
,
desc
:
"新的社会信用代码"
,
isNull
:
true
},
{
key
:
"newUnitName"
,
type
:
"String"
,
desc
:
"新的发票抬头"
,
isNull
:
true
}
],
bindBiz
:
orderBiz
.
applicationInvoice
},
{
apiName
:
"提前开发票"
,
subUrl
:
'/order/inadvance'
,
subUrl
:
'/order/inadvance'
,
param
:[
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"会员缴费列表返回id"
},
{
key
:
"id"
,
type
:
"String"
,
desc
:
"会员缴费列表返回id"
},
...
@@ -282,7 +283,7 @@ export const Config = {
...
@@ -282,7 +283,7 @@ export const Config = {
bindBiz
:
orderBiz
.
applicationInadvanceInvoice
bindBiz
:
orderBiz
.
applicationInadvanceInvoice
},
},
{
{
apiName
:
"
提前
开发票回显"
,
apiName
:
"开发票回显"
,
subUrl
:
'/order/inadvanceinfo'
,
subUrl
:
'/order/inadvanceinfo'
,
param
:[
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"会员缴费列表返回id"
}
{
key
:
"id"
,
type
:
"String"
,
desc
:
"会员缴费列表返回id"
}
...
...
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