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
084b98af
Commit
084b98af
authored
Dec 31, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e850b287
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
306 additions
and
68 deletions
+306
-68
apply.ts
src/biz/member/apply.ts
+0
-0
cost.ts
src/biz/member/cost.ts
+57
-2
examine.ts
src/biz/member/examine.ts
+2
-2
costVerification.ts
src/biz/member/finance/costVerification.ts
+74
-8
invoice.ts
src/biz/member/finance/invoice.ts
+32
-11
homePage.ts
src/biz/member/homePage.ts
+26
-14
order.ts
src/biz/member/order.ts
+80
-21
model.ts
src/data/models/model.ts
+12
-3
main.ts
src/main.ts
+2
-6
router.ts
src/routers/member/router.ts
+4
-1
router.ts
src/routers/order/router.ts
+17
-0
No files found.
src/biz/member/apply.ts
View file @
084b98af
This diff is collapsed.
Click to expand it.
src/biz/member/cost.ts
View file @
084b98af
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* 收费
* 收费
*/
*/
import
{
INVOICESTATUS
,
MEMBERSTATE
,
ORDEREXAMINE
,
ORDERSTATE
,
PAYMENTSTATUS
,
PAYMENTTYPE
,
RECEIPTCONFIRMATION
,
STATE
,
WEICHARTPAYSTATE
}
from
"../../config/enum"
;
import
{
INVOICESTATUS
,
MEMBERSTATE
,
MEMBERTYPE
,
ORDEREXAMINE
,
ORDERSTATE
,
PAYMENTSTATUS
,
PAYMENTTYPE
,
RECEIPTCONFIRMATION
,
STATE
,
WEICHARTPAYSTATE
}
from
"../../config/enum"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
findCount
,
findOnce
,
findOnceToSort
}
from
"../../data/select"
;
import
{
findCount
,
findOnce
,
findOnceToSort
}
from
"../../data/select"
;
import
*
as
path
from
"path"
;
import
*
as
path
from
"path"
;
...
@@ -122,6 +122,60 @@ export async function orderClose({id, weChartPR}) {
...
@@ -122,6 +122,60 @@ export async function orderClose({id, weChartPR}) {
}
}
export
async
function
testCallback
(
weChartPR
)
{
let
oldInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
weChartPR
});
if
(
!
oldInfo
||
!
oldInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
oldInfo
.
userId
});
//更新订单状态
let
updateInfo
:
any
=
{
paymentNum
:
"test_____test"
,
state
:
ORDERSTATE
.
已支付
,
paymentMethod
:
PAYMENTTYPE
.
微信支付
,
payTime
:
new
Date
().
valueOf
(),
weChartState
:
WEICHARTPAYSTATE
.
已支付
,
confirmReceipt
:
RECEIPTCONFIRMATION
.
收款确认
,
confirmReceiptMs
:
new
Date
().
valueOf
(),
invoiceStatus
:
INVOICESTATUS
.
未开发票
};
if
(
userInfo
.
memberType
==
MEMBERTYPE
.
单位会员
)
{
updateInfo
.
invoiceStatus
=
INVOICESTATUS
.
不具备开票条件
;
}
//更新用户状态
let
notPayCount
=
await
findCount
(
TABLEENUM
.
订单表
,
{
userId
:
oldInfo
.
userId
,
state
:
ORDERSTATE
.
未支付
}
);
/**只有一笔欠费时才更新用户状态 */
let
updateUserInfo
:
any
=
{};
if
(
notPayCount
<
1
)
{
let
newOrderInfo
=
await
findOnceToSort
(
TABLEENUM
.
订单表
,
{
userId
:
oldInfo
.
userId
},
{
lifespanEndTime
:
-
1
},
[
"orderCycleStart"
,
"orderCycleEnd"
]);
updateUserInfo
.
lifespanStartTime
=
newOrderInfo
.
orderCycleStart
,
updateUserInfo
.
lifespanEndTime
=
newOrderInfo
.
orderCycleEnd
,
updateUserInfo
.
isGracePeriod
=
STATE
.
否
,
updateUserInfo
.
gracePeriodEndTime
=
0
,
updateUserInfo
.
memberState
=
MEMBERSTATE
.
正常
,
updateUserInfo
.
paymentStatus
=
PAYMENTSTATUS
.
已支付
}
else
{
//非一笔订单 要更新会员到期时间 到 用户表
updateUserInfo
.
lifespanStartTime
=
oldInfo
.
orderCycleStart
;
updateUserInfo
.
lifespanEndTime
=
oldInfo
.
orderCycleEnd
;
}
if
(
oldInfo
.
isFirst
)
{
updateUserInfo
.
isFirstPay
=
true
;
}
if
(
Object
.
keys
(
updateUserInfo
).
length
)
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
oldInfo
.
userId
},
updateUserInfo
);
//添加审批日志
let
addLogInfo
=
{
orderId
:
oldInfo
.
id
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
用户提交
,
remarks
:
"微信付款"
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
await
updateOneData
(
TABLEENUM
.
订单表
,
{
weChartPR
},
updateInfo
);
}
/**
/**
* 微信回调函数【微信用】
* 微信回调函数【微信用】
*/
*/
...
@@ -141,11 +195,12 @@ export async function payCallback(body) {
...
@@ -141,11 +195,12 @@ export async function payCallback(body) {
paymentMethod
:
PAYMENTTYPE
.
微信支付
,
paymentMethod
:
PAYMENTTYPE
.
微信支付
,
payTime
:
new
Date
().
valueOf
(),
payTime
:
new
Date
().
valueOf
(),
weChartState
:
WEICHARTPAYSTATE
.
已支付
,
weChartState
:
WEICHARTPAYSTATE
.
已支付
,
confirmReceipt
:
RECEIPTCONFIRMATION
.
待
确认
,
confirmReceipt
:
RECEIPTCONFIRMATION
.
收款
确认
,
confirmReceiptMs
:
new
Date
().
valueOf
(),
confirmReceiptMs
:
new
Date
().
valueOf
(),
invoiceStatus
:
INVOICESTATUS
.
未开发票
invoiceStatus
:
INVOICESTATUS
.
未开发票
};
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
weChartPR
:
wechartCallbackData
.
out_trade_no
},
updateInfo
);
await
updateOneData
(
TABLEENUM
.
订单表
,
{
weChartPR
:
wechartCallbackData
.
out_trade_no
},
updateInfo
);
//更新用户状态
//更新用户状态
...
...
src/biz/member/examine.ts
View file @
084b98af
...
@@ -40,8 +40,8 @@ export async function pendingReviewList({name, memberType, documentId, phone, ma
...
@@ -40,8 +40,8 @@ export async function pendingReviewList({name, memberType, documentId, phone, ma
if
(
!
selectParam
[
"$and"
])
selectParam
[
"$and"
]
=
[];
if
(
!
selectParam
[
"$and"
])
selectParam
[
"$and"
]
=
[];
selectParam
[
"$and"
]
=
[
selectParam
[
"$and"
]
=
[
{
"$or"
:[
{
"$or"
:[
{
unitName
:{
"$regex"
:
`
${
name
}
`
}
,
memberType
:
MEMBERTYPE
.
单位会员
},
{
unitName
:{
"$regex"
:
`
${
name
}
`
}},
{
name
:{
"$regex"
:
`
${
name
}
`
}
,
memberType
:
MEMBERTYPE
.
个人会员
}
{
name
:{
"$regex"
:
`
${
name
}
`
}}
]}
]}
];
];
}
}
...
...
src/biz/member/finance/costVerification.ts
View file @
084b98af
...
@@ -37,13 +37,24 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
...
@@ -37,13 +37,24 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
let
findParam
:
any
=
{
let
findParam
:
any
=
{
state
:
ORDERSTATE
.
已支付
state
:
ORDERSTATE
.
已支付
}
};
if
(
payType
==
1
)
{
if
(
payType
==
1
)
{
findParam
.
paymentMethod
=
PAYMENTTYPE
.
微信支付
;
findParam
.
paymentMethod
=
PAYMENTTYPE
.
微信支付
;
}
else
if
(
payType
==
2
)
{
}
else
if
(
payType
==
2
)
{
findParam
.
paymentMethod
=
{
"$ne"
:
PAYMENTTYPE
.
微信支付
};
findParam
.
paymentMethod
=
{
"$ne"
:
PAYMENTTYPE
.
微信支付
};
}
}
if
(
examineState
)
{
if
(
examineState
==
1
)
{
findParam
.
confirmReceipt
=
RECEIPTCONFIRMATION
.
待确认
;
}
else
{
findParam
.
confirmReceipt
=
RECEIPTCONFIRMATION
.
收款确认
;
}
}
else
findParam
.
confirmReceipt
=
{
"$ne"
:
RECEIPTCONFIRMATION
.
退回
}
/**用户表查询条件 */
/**用户表查询条件 */
let
checkUserIdList
=
[];
let
checkUserIdList
=
[];
let
itemParam
:
any
=
{};
let
itemParam
:
any
=
{};
...
@@ -93,13 +104,7 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
...
@@ -93,13 +104,7 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
}
}
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
phone
)
findParam
.
phone
=
phone
;
if
(
examineState
)
{
if
(
examineState
==
1
)
{
findParam
.
confirmReceipt
=
RECEIPTCONFIRMATION
.
待确认
;
}
else
{
findParam
.
confirmReceipt
=
RECEIPTCONFIRMATION
.
收款确认
;
}
}
else
findParam
.
confirmReceipt
=
{
"$ne"
:
RECEIPTCONFIRMATION
.
退回
}
if
(
costType
)
findParam
.
isFirst
=
costType
==
COSTTYPE
.
首次
;
if
(
costType
)
findParam
.
isFirst
=
costType
==
COSTTYPE
.
首次
;
let
selectFile
=
[
"id"
,
"unitName"
,
"userId"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"isFirst"
,
"paymentNum"
,
"memberState"
,
"operationTime"
,
"confirmReceipt"
,
"invoiceStatus"
];
let
selectFile
=
[
"id"
,
"unitName"
,
"userId"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"isFirst"
,
"paymentNum"
,
"memberState"
,
"operationTime"
,
"confirmReceipt"
,
"invoiceStatus"
];
...
@@ -289,3 +294,64 @@ export async function outPutConfirmReceipt({exportColumns}) {
...
@@ -289,3 +294,64 @@ export async function outPutConfirmReceipt({exportColumns}) {
return
{
dataList
};
return
{
dataList
};
}
}
/**
* 发票管理-财务核对页-批量收款确认 success
* @param id 订单id
*/
export
async
function
confirmReceiptManyPass
({
idList
})
{
//限制长度
if
(
idList
.
length
>
10
)
throw
new
BizError
(
ERRORENUM
.
批量操作超过个数限制
);
let
thisDate
=
new
Date
();
const
NowMs
=
thisDate
.
valueOf
();
for
(
let
i
=
0
;
i
<
idList
.
length
;
i
++
)
{
let
id
=
idList
[
i
];
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
});
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
// if (orderInfo.isFirst && !orderInfo.firstPayExamine ) throw new BizError(ERRORENUM.重复提交, '发票管理-财务核对页-收款确认', `提交通过时订单未通过待支付页的校验`);
if
(
orderInfo
.
confirmReceipt
!=
RECEIPTCONFIRMATION
.
待确认
)
throw
new
BizError
(
ERRORENUM
.
重复提交
,
'发票管理-财务核对页-收款确认'
,
`提交通过时订单已经不是待确认 是
${
orderInfo
.
confirmReceipt
}
`
);
let
updateInfo
:
any
=
{
confirmReceipt
:
RECEIPTCONFIRMATION
.
收款确认
,
confirmReceiptMs
:
new
Date
().
valueOf
()};
if
(
orderInfo
.
invoiceStatus
!=
INVOICESTATUS
.
已开发票
)
updateInfo
.
invoiceStatus
=
INVOICESTATUS
.
未开发票
;
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
let
notPayCount
=
await
findCount
(
TABLEENUM
.
订单表
,
{
userId
:
orderInfo
.
userId
,
state
:
ORDERSTATE
.
未支付
}
);
let
updateUserInfo
:
any
=
{};
/**只有一笔欠费时才更新用户状态 */
if
(
notPayCount
<
1
)
{
let
newOrderInfo
=
await
findOnceToSort
(
TABLEENUM
.
订单表
,
{
userId
:
orderInfo
.
userId
},
{
lifespanEndTime
:
-
1
},
[
"orderCycleStart"
,
"orderCycleEnd"
]);
updateUserInfo
.
lifespanStartTime
=
newOrderInfo
.
orderCycleStart
,
updateUserInfo
.
lifespanEndTime
=
newOrderInfo
.
orderCycleEnd
,
updateUserInfo
.
isGracePeriod
=
STATE
.
否
,
updateUserInfo
.
gracePeriodEndTime
=
0
,
updateUserInfo
.
memberState
=
MEMBERSTATE
.
正常
,
updateUserInfo
.
paymentStatus
=
PAYMENTSTATUS
.
已支付
}
else
{
//非一笔订单 要更新会员到期时间 到 用户表
updateUserInfo
.
lifespanStartTime
=
orderInfo
.
orderCycleStart
;
updateUserInfo
.
lifespanEndTime
=
orderInfo
.
orderCycleEnd
;
}
if
(
orderInfo
.
isFirst
)
{
updateUserInfo
.
isFirstPay
=
true
;
}
if
(
Object
.
keys
(
updateUserInfo
).
length
)
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
updateUserInfo
);
//添加日志
let
addLogInfo
=
{
orderId
:
id
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
审核时间
,
isReceiveMoney
:
true
,
remarks
:
``
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
}
return
successResult
();
}
src/biz/member/finance/invoice.ts
View file @
084b98af
...
@@ -35,18 +35,38 @@ import { successResult } from "../../../tools/system";
...
@@ -35,18 +35,38 @@ import { successResult } from "../../../tools/system";
*/
*/
export
async
function
billStateList
({
name
,
memberType
,
documentId
,
phone
,
mail
,
joinStartTime
,
joinEndTime
,
memberLevel
,
payState
,
paymentType
,
invoiceState
,
weChartPR
,
pageNumber
})
{
export
async
function
billStateList
({
name
,
memberType
,
documentId
,
phone
,
mail
,
joinStartTime
,
joinEndTime
,
memberLevel
,
payState
,
paymentType
,
invoiceState
,
weChartPR
,
pageNumber
})
{
if
(
payState
!=
1
&&
payState
!=
2
&&
payState
!=
3
)
throw
new
BizError
(
ERRORENUM
.
参数错误
);
if
(
payState
!=
1
&&
payState
!=
2
&&
payState
!=
3
)
throw
new
BizError
(
ERRORENUM
.
参数错误
);
let
findParam
:
any
=
{};
let
findParam
:
any
=
{
invoiceStatus
:{
"$ne"
:
INVOICESTATUS
.
已开发票
}};
if
(
invoiceState
)
{
if
(
payState
==
1
)
{
//已支付
findParam
.
state
=
ORDERSTATE
.
已支付
;
if
(
invoiceState
==
1
)
{
//已申请
if
(
invoiceState
==
1
)
{
//已申请
findParam
.
invoiceStatus
=
INVOICESTATUS
.
未开发票
findParam
.
invoiceStatus
=
INVOICESTATUS
.
未开发票
}
else
{
//未申请
}
else
if
(
invoiceState
==
2
)
{
//未申请
findParam
[
"$or"
]
=
[{
invoiceStatus
:
INVOICESTATUS
.
不具备开票条件
},
{
invoiceStatus
:
INVOICESTATUS
.
退回
}];
findParam
[
"$or"
]
=
[{
invoiceStatus
:
INVOICESTATUS
.
不具备开票条件
},
{
invoiceStatus
:
INVOICESTATUS
.
退回
}];
}
else
{
//全部
// findParam.invoiceStatus = {"$ne": INVOICESTATUS.已开发票};
}
}
}
}
else
if
(
payState
==
2
){
//未支付
if
(
payState
==
1
)
{
findParam
.
state
=
ORDERSTATE
.
已支付
;
}
else
if
(
payState
==
2
){
findParam
.
state
=
ORDERSTATE
.
未支付
;
findParam
.
state
=
ORDERSTATE
.
未支付
;
if
(
!
invoiceState
||
invoiceState
==
1
)
{
//已申请 和 全部
findParam
.
invoiceStatus
=
INVOICESTATUS
.
未开发票
}
else
{
//未申请
return
{
dataList
:[],
dataCount
:
0
};
}
}
else
{
//全部
if
(
!
invoiceState
)
{
// 全部
findParam
[
"$or"
]
=
[
{
state
:
ORDERSTATE
.
已支付
,
},
{
state
:
ORDERSTATE
.
未支付
,
invoiceStatus
:
INVOICESTATUS
.
未开发票
},
// { invoiceStatus : INVOICESTATUS.未开发票},
// {"$or":[{invoiceStatus:INVOICESTATUS.不具备开票条件}, {invoiceStatus:INVOICESTATUS.退回}]}
]
}
else
if
(
invoiceState
==
1
)
{
//已申请
findParam
.
invoiceStatus
=
INVOICESTATUS
.
未开发票
;
}
else
{
//未申请
findParam
=
{
state
:
ORDERSTATE
.
未支付
,
invoiceStatus
:
INVOICESTATUS
.
未开发票
};
}
}
}
/**用户表查询条件 */
/**用户表查询条件 */
...
@@ -104,13 +124,13 @@ export async function billStateList({name, memberType, documentId, phone, mail,
...
@@ -104,13 +124,13 @@ export async function billStateList({name, memberType, documentId, phone, mail,
}
}
if
(
weChartPR
)
findParam
.
paymentNum
=
{
"$regex"
:
`
${
weChartPR
}
`
};
if
(
weChartPR
)
findParam
.
paymentNum
=
{
"$regex"
:
`
${
weChartPR
}
`
};
let
selectFile
=
[
"id"
,
"unitName"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"state"
,
"paymentNum"
,
"userId"
,
"desc"
,
"invoiceMail"
,
"weChartCreatePayMs"
];
let
selectFile
=
[
"id"
,
"unitName"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"state"
,
"paymentNum"
,
"userId"
,
"desc"
,
"invoiceMail"
,
"weChartCreatePayMs"
,
"invoiceStatus"
];
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
);
let
dataList
=
[];
let
dataList
=
[];
let
itemFile
=
[
"id"
,
"userId"
,
"unitName"
,
"money"
,
"paymentNum"
,
"memberCategory"
,
"state"
,
"paymentMethod"
,
"desc"
,
"invoiceMail"
,
"weChartCreatePayMs"
];
let
itemFile
=
[
"id"
,
"userId"
,
"unitName"
,
"money"
,
"paymentNum"
,
"memberCategory"
,
"state"
,
"paymentMethod"
,
"desc"
,
"invoiceMail"
,
"weChartCreatePayMs"
,
"invoiceStatus"
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
info
=
dbList
[
i
];
let
itemData
:
any
=
extractData
(
info
,
itemFile
);
let
itemData
:
any
=
extractData
(
info
,
itemFile
);
...
@@ -121,7 +141,6 @@ export async function billStateList({name, memberType, documentId, phone, mail,
...
@@ -121,7 +141,6 @@ export async function billStateList({name, memberType, documentId, phone, mail,
itemData
.
paymentMethod
=
changeEnumValue
(
PAYMENTTYPE
,
itemData
.
paymentMethod
);
itemData
.
paymentMethod
=
changeEnumValue
(
PAYMENTTYPE
,
itemData
.
paymentMethod
);
itemData
.
isPay
=
changeEnumValue
(
ORDERSTATE
,
itemData
.
state
);
itemData
.
isPay
=
changeEnumValue
(
ORDERSTATE
,
itemData
.
state
);
itemData
.
payState
=
info
.
state
==
ORDERSTATE
.
已支付
?
"已支付"
:
"未支付"
;
itemData
.
payState
=
info
.
state
==
ORDERSTATE
.
已支付
?
"已支付"
:
"未支付"
;
let
userInfomation
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
itemData
.
userId
},
[
"userId"
,
"memberState"
,
"name"
,
"memberLevel"
,
"individualMemberType"
,
"unitMemberType"
]);
let
userInfomation
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
itemData
.
userId
},
[
"userId"
,
"memberState"
,
"name"
,
"memberLevel"
,
"individualMemberType"
,
"unitMemberType"
]);
if
(
!
userInfomation
||
!
userInfomation
.
userId
)
continue
;
if
(
!
userInfomation
||
!
userInfomation
.
userId
)
continue
;
...
@@ -133,8 +152,10 @@ export async function billStateList({name, memberType, documentId, phone, mail,
...
@@ -133,8 +152,10 @@ export async function billStateList({name, memberType, documentId, phone, mail,
itemData
.
memberType
=
changeEnumValue
(
MEMBERTYPEECCENUM
,
userInfomation
.
unitMemberType
);
itemData
.
memberType
=
changeEnumValue
(
MEMBERTYPEECCENUM
,
userInfomation
.
unitMemberType
);
}
}
itemData
.
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
userInfomation
.
memberLevel
);
itemData
.
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
userInfomation
.
memberLevel
);
itemData
.
memberState
=
changeEnumValue
(
MEMBERSTATE
,
userInfomation
.
memberState
);
//
itemData.memberState = changeEnumValue(MEMBERSTATE, userInfomation.memberState);
}
}
itemData
.
invoiceStatus
=
itemData
.
invoiceStatus
==
INVOICESTATUS
.
未开发票
?
"已申请"
:
"未申请"
;
// itemData.cycle = `${moment(info.orderCycleStart).format("YYYY-MM-DD")}至${moment(info.orderCycleEnd).format("YYYY-MM-DD")}`;
// itemData.cycle = `${moment(info.orderCycleStart).format("YYYY-MM-DD")}至${moment(info.orderCycleEnd).format("YYYY-MM-DD")}`;
itemData
.
cycle
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY"
)}
`
;
itemData
.
cycle
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY"
)}
`
;
...
...
src/biz/member/homePage.ts
View file @
084b98af
...
@@ -250,7 +250,7 @@ export async function getSheng ({userId}) {
...
@@ -250,7 +250,7 @@ export async function getSheng ({userId}) {
*/
*/
export
async
function
getCertificate
({
userId
})
{
export
async
function
getCertificate
({
userId
})
{
const
Files
=
[
"userId"
,
"memberType"
,
"userRegisterState"
,
"paymentStatus"
,
"individualMemberType"
,
"unitMemberType"
,
const
Files
=
[
"userId"
,
"memberType"
,
"userRegisterState"
,
"paymentStatus"
,
"individualMemberType"
,
"unitMemberType"
,
"sheng"
,
"documentId"
,
"memberNum"
,
"lifespanStartTime"
,
"lifespanEndTime"
,
"shi"
,
"qu"
,
"addres"
,
"unitName"
,
"session"
];
"sheng"
,
"documentId"
,
"memberNum"
,
"lifespanStartTime"
,
"lifespanEndTime"
,
"shi"
,
"qu"
,
"addres"
,
"unitName"
,
"session"
,
"name"
];
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
Files
);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
Files
);
if
(
!
userInfo
||
!
userInfo
.
userId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
userInfo
||
!
userInfo
.
userId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
...
@@ -266,6 +266,7 @@ export async function getSheng ({userId}) {
...
@@ -266,6 +266,7 @@ export async function getSheng ({userId}) {
if
(
userInfo
.
individualMemberType
==
INDIVIDUALMEMBERTYPE
.
专家会员
)
certificate
=
true
;
if
(
userInfo
.
individualMemberType
==
INDIVIDUALMEMBERTYPE
.
专家会员
)
certificate
=
true
;
if
(
certificate
)
{
if
(
certificate
)
{
cefaInfo
=
{
cefaInfo
=
{
name
:
userInfo
.
name
,
area
:
getCityNameByCode
(
userInfo
.
sheng
),
area
:
getCityNameByCode
(
userInfo
.
sheng
),
documentId
:
userInfo
.
documentId
,
documentId
:
userInfo
.
documentId
,
memberNum
:
userInfo
.
memberNum
,
memberNum
:
userInfo
.
memberNum
,
...
@@ -608,26 +609,29 @@ export async function applyReason({applyStr, userId}) {
...
@@ -608,26 +609,29 @@ export async function applyReason({applyStr, userId}) {
export
async
function
infomationChangeUpdate
({
userId
,
unitName
,
uscc
,
legalPerson
,
unitMemberType
,
uusinessLicenseUrl
,
applicationForm
,
desc
})
{
export
async
function
infomationChangeUpdate
({
userId
,
unitName
,
uscc
,
legalPerson
,
unitMemberType
,
uusinessLicenseUrl
,
applicationForm
,
desc
,
yuanXiaoBanXueLeiXing
,
legalPersonMail
,
legalPersonPhone
})
{
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"memberType"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"memberType"
]);
if
(
userInfo
.
memberType
!=
MEMBERTYPE
.
单位会员
)
throw
new
BizError
(
ERRORENUM
.
非单位会员不可操作
);
if
(
userInfo
.
memberType
!=
MEMBERTYPE
.
单位会员
)
throw
new
BizError
(
ERRORENUM
.
非单位会员不可操作
);
//添加日志
//添加日志
/**添加审批历史 */
/**添加审批历史 */
let
applyInfo
:
any
=
{
let
applyInfo
:
any
=
{
applyId
:
generateSystemId
(
TABLEENUM
.
理事
变更审批历史表
,
userId
),
applyId
:
generateSystemId
(
TABLEENUM
.
资料
变更审批历史表
,
userId
),
infoChangeId
:
generateSystemId
(
TABLEENUM
.
理事
变更审批历史表
,
userId
),
infoChangeId
:
generateSystemId
(
TABLEENUM
.
资料
变更审批历史表
,
userId
),
userId
,
userId
,
unitName
,
unitName
,
uscc
,
uscc
,
legalPerson
,
legalPerson
,
unitMemberType
,
unitMemberType
,
uusinessLicenseUrl
,
uusinessLicenseUrl
,
applicationForm
,
applicationForm
,
yuanXiaoBanXueLeiXing
,
desc
,
desc
,
legalPersonMail
,
legalPersonPhone
,
infoChangeOptionType
:
INFOCHANGEAPPLYTYPE
.
待审批
,
infoChangeOptionType
:
INFOCHANGEAPPLYTYPE
.
待审批
,
createTimeMs
:
new
Date
().
valueOf
()
createTimeMs
:
new
Date
().
valueOf
()
};
};
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
},
{
infoChangeId
:
applyInfo
.
infoChangeId
,
infoChangeOptionType
:
INFOCHANGEAPPLYTYPE
.
待审批
});
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
},
{
infoChangeId
:
applyInfo
.
infoChangeId
,
infoChange
Ms
:
new
Date
().
valueOf
(),
infoChange
OptionType
:
INFOCHANGEAPPLYTYPE
.
待审批
});
await
addOneData
(
TABLEENUM
.
资料变更审批历史表
,
applyInfo
);
await
addOneData
(
TABLEENUM
.
资料变更审批历史表
,
applyInfo
);
return
successResult
();
return
successResult
();
...
@@ -638,6 +642,7 @@ export async function infomationChangeInfo({userId}) {
...
@@ -638,6 +642,7 @@ export async function infomationChangeInfo({userId}) {
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
});
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
});
let
dataInfo
:
any
=
{};
let
dataInfo
:
any
=
{};
let
isUpdate
=
true
;
//这里的条件有点乱,因为加班到很晚了
//这里的条件有点乱,因为加班到很晚了
if
(
!
userInfo
.
infoChangeId
||
(
userInfo
.
infoChangeId
&&
userInfo
.
infoChangeOptionType
==
INFOCHANGEAPPLYTYPE
.
通过
))
{
if
(
!
userInfo
.
infoChangeId
||
(
userInfo
.
infoChangeId
&&
userInfo
.
infoChangeOptionType
==
INFOCHANGEAPPLYTYPE
.
通过
))
{
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
});
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
});
...
@@ -650,7 +655,11 @@ export async function infomationChangeInfo({userId}) {
...
@@ -650,7 +655,11 @@ export async function infomationChangeInfo({userId}) {
uusinessLicenseUrl
:
userInfo
.
uusinessLicenseUrl
||
""
,
//营业执照
uusinessLicenseUrl
:
userInfo
.
uusinessLicenseUrl
||
""
,
//营业执照
applicationForm
:
userInfo
.
applicationForm
||
""
,
//盖章申请表
applicationForm
:
userInfo
.
applicationForm
||
""
,
//盖章申请表
desc
:
""
,
desc
:
""
,
yuanXiaoBanXueLeiXing
:
userInfo
.
yuanXiaoBanXueLeiXing
||
""
,
legalPersonMail
:
userInfo
.
legalPersonMail
,
legalPersonPhone
:
userInfo
.
legalPersonPhone
,
};
};
isUpdate
=
true
;
}
else
{
}
else
{
let
infomationChangeHistoryInfo
=
await
findOnceToSort
(
TABLEENUM
.
资料变更审批历史表
,
{
userId
},
{
createTimeMs
:
-
1
});
let
infomationChangeHistoryInfo
=
await
findOnceToSort
(
TABLEENUM
.
资料变更审批历史表
,
{
userId
},
{
createTimeMs
:
-
1
});
dataInfo
=
{
dataInfo
=
{
...
@@ -660,8 +669,15 @@ export async function infomationChangeInfo({userId}) {
...
@@ -660,8 +669,15 @@ export async function infomationChangeInfo({userId}) {
unitMemberType
:
infomationChangeHistoryInfo
.
unitMemberType
,
//单位会员类型
unitMemberType
:
infomationChangeHistoryInfo
.
unitMemberType
,
//单位会员类型
uusinessLicenseUrl
:
infomationChangeHistoryInfo
.
uusinessLicenseUrl
,
//营业执照
uusinessLicenseUrl
:
infomationChangeHistoryInfo
.
uusinessLicenseUrl
,
//营业执照
applicationForm
:
infomationChangeHistoryInfo
.
applicationForm
,
//盖章申请表
applicationForm
:
infomationChangeHistoryInfo
.
applicationForm
,
//盖章申请表
desc
:
infomationChangeHistoryInfo
.
desc
desc
:
infomationChangeHistoryInfo
.
desc
,
yuanXiaoBanXueLeiXing
:
infomationChangeHistoryInfo
.
yuanXiaoBanXueLeiXing
,
legalPersonMail
:
infomationChangeHistoryInfo
.
legalPersonMail
,
legalPersonPhone
:
infomationChangeHistoryInfo
.
legalPersonPhone
,
};
};
if
(
infomationChangeHistoryInfo
.
infoChangeOptionType
==
INFOCHANGEAPPLYTYPE
.
待审批
)
{
isUpdate
=
false
;
}
else
isUpdate
=
true
;
}
}
const
UnitConfig
=
[
"unitMemberType"
,
"yuanXiaoBanXueLeiXing"
,
"yuanXiaoZhuGuanBuMen"
,
"yuanXiaoFuZeRen"
,
"yuanXiaoFuZeRenZhiWu"
,
"yuanXiaoBanGongFuZeRenZhiWu"
,
const
UnitConfig
=
[
"unitMemberType"
,
"yuanXiaoBanXueLeiXing"
,
"yuanXiaoZhuGuanBuMen"
,
"yuanXiaoFuZeRen"
,
"yuanXiaoFuZeRenZhiWu"
,
"yuanXiaoBanGongFuZeRenZhiWu"
,
"yuanXiaoFuZeRenDianHua"
,
"yuanXiaoBanGongFuZeRen"
,
"yuanXiaoBanGongFuZeRenDianHua"
,
"ZhuYaoFuZeRenYouXiang"
,
"yuanXiaoKeYanFuZeRen"
,
"yuanXiaoKeYanFuZeRenDianHua"
,
"yuanXiaoFuZeRenDianHua"
,
"yuanXiaoBanGongFuZeRen"
,
"yuanXiaoBanGongFuZeRenDianHua"
,
"ZhuYaoFuZeRenYouXiang"
,
"yuanXiaoKeYanFuZeRen"
,
"yuanXiaoKeYanFuZeRenDianHua"
,
...
@@ -672,11 +688,6 @@ export async function infomationChangeInfo({userId}) {
...
@@ -672,11 +688,6 @@ export async function infomationChangeInfo({userId}) {
if
(
unitInfo
.
yuanXiaoBanXueLeiXing
)
unitInfo
.
yuanXiaoBanXueLeiXing
=
changeEnumValue
(
BANXUELEIXING
,
unitInfo
.
yuanXiaoBanXueLeiXing
);
if
(
unitInfo
.
yuanXiaoBanXueLeiXing
)
unitInfo
.
yuanXiaoBanXueLeiXing
=
changeEnumValue
(
BANXUELEIXING
,
unitInfo
.
yuanXiaoBanXueLeiXing
);
dataInfo
.
unitInfo
=
unitInfo
;
dataInfo
.
unitInfo
=
unitInfo
;
dataInfo
.
isUpdate
=
isUpdate
;
return
{
dataInfo
};
return
{
dataInfo
};
}
}
\ No newline at end of file
src/biz/member/order.ts
View file @
084b98af
...
@@ -7,7 +7,7 @@ import { generateOrderId, successResult } from "../../tools/system";
...
@@ -7,7 +7,7 @@ import { generateOrderId, successResult } from "../../tools/system";
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
addOneData
}
from
"../../data/add"
;
import
{
addOneData
}
from
"../../data/add"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
find
,
findCount
,
findOnce
,
findOnceToSort
,
findToPage
,
findToSortToPage
}
from
"../../data/select"
;
import
{
find
,
findCount
,
findOnce
,
findOnceToSort
,
findToPage
,
findToSort
,
findToSort
ToPage
}
from
"../../data/select"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
...
@@ -328,7 +328,7 @@ export async function applicationInadvanceInvoiceInfo({id}) {
...
@@ -328,7 +328,7 @@ export async function applicationInadvanceInvoiceInfo({id}) {
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
,
"invoiceMail"
,
"desc"
,
"invoiceStatus"
,
"state"
]);
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
},
[
"id"
,
"userId"
,
"invoiceMail"
,
"desc"
,
"invoiceStatus"
,
"state"
]);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
[
"userId"
,
"memberType"
,
"mail"
,
"unitMemberType"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
orderInfo
.
userId
},
[
"userId"
,
"memberType"
,
"mail"
,
"unitMemberType"
,
"unit"
,
"uscc"
,
"unitName"
]);
if
(
userInfo
.
memberType
!=
MEMBERTYPE
.
单位会员
)
{
if
(
userInfo
.
memberType
!=
MEMBERTYPE
.
单位会员
)
{
throw
new
BizError
(
ERRORENUM
.
发票已发送至邮请注意查看
);
throw
new
BizError
(
ERRORENUM
.
发票已发送至邮请注意查看
);
}
else
if
(
orderInfo
.
state
==
ORDERSTATE
.
未支付
&&
userInfo
.
unitMemberType
!=
UNITMEMBERTYPE
.
院校
)
{
}
else
if
(
orderInfo
.
state
==
ORDERSTATE
.
未支付
&&
userInfo
.
unitMemberType
!=
UNITMEMBERTYPE
.
院校
)
{
...
@@ -336,8 +336,10 @@ export async function applicationInadvanceInvoiceInfo({id}) {
...
@@ -336,8 +336,10 @@ export async function applicationInadvanceInvoiceInfo({id}) {
}
}
let
resultObj
=
{
let
resultObj
=
{
invoiceMail
:
orderInfo
.
invoiceMail
||
userInfo
.
mail
||
""
,
invoiceMail
:
orderInfo
.
invoiceMail
||
""
,
desc
:
orderInfo
.
desc
||
""
desc
:
orderInfo
.
desc
||
""
,
uscc
:
userInfo
.
uscc
,
unitName
:
userInfo
.
unitName
}
}
return
resultObj
;
return
resultObj
;
...
@@ -391,7 +393,7 @@ export async function getInvoiceStatus({id}) {
...
@@ -391,7 +393,7 @@ export async function getInvoiceStatus({id}) {
if
(
oldInfo
.
invoiceStatus
!=
INVOICESTATUS
.
退回
)
dataInfo
.
state
=
AUDITINGCLIENT
.
审核失败
;
if
(
oldInfo
.
invoiceStatus
!=
INVOICESTATUS
.
退回
)
dataInfo
.
state
=
AUDITINGCLIENT
.
审核失败
;
/**获取驳回理由 */
/**获取驳回理由 */
let
userOldInfo
=
await
findOnceToSort
(
TABLEENUM
.
审批历史表
,
{
userId
:
oldInfo
.
userId
,
operationBehavior
:
OPERATIONREHAVIOR
.
驳回修改
},{
operationTime
:
-
1
},
[
"userId"
,
"remarks"
]);
let
userOldInfo
=
await
findOnceToSort
(
TABLEENUM
.
订单
审批历史表
,
{
userId
:
oldInfo
.
userId
,
operationBehavior
:
OPERATIONREHAVIOR
.
驳回修改
},{
operationTime
:
-
1
},
[
"userId"
,
"remarks"
]);
if
(
userOldInfo
&&
userOldInfo
.
userId
)
dataInfo
.
remark
=
userOldInfo
.
remark
;
if
(
userOldInfo
&&
userOldInfo
.
userId
)
dataInfo
.
remark
=
userOldInfo
.
remark
;
return
{
dataInfo
};
return
{
dataInfo
};
...
@@ -416,7 +418,9 @@ export async function getInvoiceStatus({id}) {
...
@@ -416,7 +418,9 @@ export async function getInvoiceStatus({id}) {
payTime
:
new
Date
().
valueOf
(),
payTime
:
new
Date
().
valueOf
(),
confirmReceipt
:
RECEIPTCONFIRMATION
.
待确认
,
confirmReceipt
:
RECEIPTCONFIRMATION
.
待确认
,
invoiceMail
,
invoiceMail
,
desc
desc
,
invoiceStatus
:
INVOICESTATUS
.
未开发票
,
advanceInvoice
:
true
};
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
...
@@ -444,21 +448,40 @@ export async function reasonInfo({id}) {
...
@@ -444,21 +448,40 @@ export async function reasonInfo({id}) {
if
(
orderInfo
.
confirmReceipt
!=
RECEIPTCONFIRMATION
.
退回
)
throw
new
BizError
(
ERRORENUM
.
该订单未被退回
);
if
(
orderInfo
.
confirmReceipt
!=
RECEIPTCONFIRMATION
.
退回
)
throw
new
BizError
(
ERRORENUM
.
该订单未被退回
);
let
logInfo
=
await
findOnceToSort
(
TABLEENUM
.
订单审批历史表
,
{
operationBehavior
:
ORDEREXAMINE
.
用户提交
},
{
operationTime
:
-
1
});
let
logInfo
List
=
await
findToSort
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
id
},
{
operationTime
:
-
1
});
let
dataInfo
=
{
let
dataList
=
[];
operationTime
:
moment
(
logInfo
.
operationTime
).
format
(
"YYYY/MM/DD HH:mm:SS"
),
logInfoList
.
forEach
(
info
=>
{
behavior
:
"退回"
,
let
isReceiveMoney
=
info
.
isReceiveMoney
?
"已到款项"
:
"未到款项"
;
isReceiveMoney
:
logInfo
.
isReceiveMoney
?
"已到款项"
:
"未到款项"
,
remarks
:
logInfo
.
remarks
let
remarks
=
info
.
remarks
};
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
退款申请
)
{
isReceiveMoney
=
"-"
;
if
(
info
.
refundName
)
remarks
+=
`-
${
info
.
refundName
}
`
;
if
(
info
.
refundBankNum
)
remarks
+=
`-
${
info
.
refundBankNum
}
`
;
if
(
info
.
refundBankName
)
remarks
+=
`-
${
info
.
refundBankName
}
`
;
}
else
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
{
isReceiveMoney
=
"-"
;
}
return
{
dataList
:[
dataInfo
]};
let
dataInfo
=
{
operationTime
:
moment
(
info
.
operationTime
).
format
(
"YYYY/MM/DD HH:mm:SS"
),
behavior
:
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
),
isReceiveMoney
,
remarks
};
dataList
.
push
(
dataInfo
);
})
let
isUpdate
=
true
;
if
(
orderInfo
.
isReplenishReturnInfo
&&
orderInfo
.
refundReject
==
false
)
isUpdate
=
false
;
return
{
dataList
:
dataList
,
isUpdate
};
}
}
/**
/**
* 退款信息
* 退款信息
更新
* @param param0
* @param param0
*/
*/
export
async
function
accountInfo
({
id
,
form
})
{
export
async
function
accountInfo
({
id
,
form
})
{
...
@@ -473,7 +496,8 @@ export async function accountInfo({id, form}) {
...
@@ -473,7 +496,8 @@ export async function accountInfo({id, form}) {
refundBankCarId
:
form
.
refundBankCarId
,
refundBankCarId
:
form
.
refundBankCarId
,
refundBankName
:
form
.
refundBankName
,
refundBankName
:
form
.
refundBankName
,
refundDesc
:
form
.
refundDesc
,
refundDesc
:
form
.
refundDesc
,
isReplenishReturnInfo
:
true
isReplenishReturnInfo
:
true
,
refundReject
:
false
};
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
...
@@ -483,7 +507,10 @@ export async function accountInfo({id, form}) {
...
@@ -483,7 +507,10 @@ export async function accountInfo({id, form}) {
orderId
:
id
,
orderId
:
id
,
operationTime
:
new
Date
().
valueOf
(),
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
退款申请
,
operationBehavior
:
ORDEREXAMINE
.
退款申请
,
remarks
:
`
${
form
.
refundDesc
}
`
remarks
:
`
${
form
.
refundDesc
}
`
,
refundName
:
form
.
refundName
,
refundBankNum
:
form
.
refundBankCarId
,
refundBankName
:
form
.
refundBankName
};
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
...
@@ -497,7 +524,7 @@ export async function accountInfo({id, form}) {
...
@@ -497,7 +524,7 @@ export async function accountInfo({id, form}) {
*/
*/
export
async
function
refundList
({
name
,
memberType
,
joinStartTime
,
joinEndTime
,
pageNumber
})
{
export
async
function
refundList
({
name
,
memberType
,
joinStartTime
,
joinEndTime
,
pageNumber
})
{
let
findParam
:
any
=
{
let
findParam
:
any
=
{
isReceive
:{
"$
ne"
:
null
}
isReceive
:{
"$
gt"
:
0
}
};
};
/**用户表查询条件 */
/**用户表查询条件 */
...
@@ -562,7 +589,7 @@ export async function refundList({name, memberType, joinStartTime, joinEndTime,
...
@@ -562,7 +589,7 @@ export async function refundList({name, memberType, joinStartTime, joinEndTime,
}
}
}
}
if
(
!
info
.
isReplenishReturnInfo
)
itemData
.
state
=
"资料补充中"
;
if
(
!
info
.
isReplenishReturnInfo
||
(
info
.
refundReject
==
true
&&
!
info
.
refundSuccessful
)
)
itemData
.
state
=
"资料补充中"
;
else
{
else
{
if
(
info
.
refundSuccessful
)
itemData
.
state
=
"已退款"
;
if
(
info
.
refundSuccessful
)
itemData
.
state
=
"已退款"
;
else
itemData
.
state
=
"待退款"
;
else
itemData
.
state
=
"待退款"
;
...
@@ -659,6 +686,33 @@ export async function refundApprove({id, refundImgUrl}) {
...
@@ -659,6 +686,33 @@ export async function refundApprove({id, refundImgUrl}) {
return
{
dataList
};
return
{
dataList
};
}
}
/**
* 退款驳回
*/
export
async
function
refundOut
({
id
,
desc
})
{
let
orderInfo
=
await
findOnce
(
TABLEENUM
.
订单表
,
{
id
});
if
(
!
orderInfo
||
!
orderInfo
.
id
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
// if (orderInfo.isFirst && !orderInfo.firstPayExamine ) throw new BizError(ERRORENUM.重复提交, '发票管理-财务核对页-收款确认', `提交通过时订单未通过待支付页的校验`);
if
(
orderInfo
.
confirmReceipt
!=
RECEIPTCONFIRMATION
.
退回
)
throw
new
BizError
(
ERRORENUM
.
订单非退回状态
,
'发票管理-退款列表页-退款确认'
,
`退款确认时订单已经不是退款状态 是
${
orderInfo
.
confirmReceipt
}
`
);
if
(
orderInfo
.
paymentMethod
==
PAYMENTTYPE
.
微信支付
)
throw
new
BizError
(
ERRORENUM
.
微信支付无法被退回
);
if
(
orderInfo
.
isReceive
!=
ISRECEIVE
.
提供账户
_zkh
需退款
_ykh
)
throw
new
BizError
(
ERRORENUM
.
该类型退款无需确认
);
let
updateInfo
:
any
=
{
refundSuccessful
:
false
,
isReplenishReturnInfo
:
false
,
refundReject
:
true
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
//添加日志
let
addLogInfo
=
{
orderId
:
id
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
驳回
,
isReceiveMoney
:
true
,
remarks
:
desc
,
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
return
successResult
();
}
/**
/**
...
@@ -674,8 +728,13 @@ export async function approveLog({id}) {
...
@@ -674,8 +728,13 @@ export async function approveLog({id}) {
let
desc
=
""
;
let
desc
=
""
;
if
(
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
desc
=
"线下付款"
;
if
(
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
desc
=
"线下付款"
;
else
{
else
{
desc
=
isReceiveMoney
?
changeEnumValue
(
ISRECEIVE
,
ISRECEIVE
.
未收到款项
_xg
其他
)
:
changeEnumValue
(
ISRECEIVE
,
ISRECEIVE
.
提供账户
_zkh
需退款
_ykh
)
if
(
isReceiveMoney
)
{
}
desc
=
"未收到"
}
else
{
desc
=
"已收到"
}
// desc = isReceiveMoney ? changeEnumValue(ISRECEIVE, ISRECEIVE.未收到款项_xg其他) : changeEnumValue(ISRECEIVE, ISRECEIVE.提供账户_zkh需退款_ykh)
}
let
addInfo
:
any
=
{
let
addInfo
:
any
=
{
operationTime
:
moment
(
operationTime
).
format
(
"YYYY-MM-DD HH:mm:SS"
),
operationTime
:
moment
(
operationTime
).
format
(
"YYYY-MM-DD HH:mm:SS"
),
operationBehavior
:
changeEnumValue
(
ORDEREXAMINE
,
operationBehavior
),
operationBehavior
:
changeEnumValue
(
ORDEREXAMINE
,
operationBehavior
),
...
...
src/data/models/model.ts
View file @
084b98af
...
@@ -86,7 +86,7 @@ enum TABLEENUM {
...
@@ -86,7 +86,7 @@ enum TABLEENUM {
订单表
=
'order'
,
订单表
=
'order'
,
单位所获得科研成果表
=
"scientificResearch"
,
单位所获得科研成果表
=
"scientificResearch"
,
验证码表
=
"code"
,
验证码表
=
"code"
,
审批历史表
=
"approvalHistory"
,
审批历史表
=
"approvalHistory"
,
//审批会员用的
权限表
=
"authority"
,
权限表
=
"authority"
,
订单审批历史表
=
"orderApprovalHistory"
,
订单审批历史表
=
"orderApprovalHistory"
,
标签表
=
"lable"
,
标签表
=
"lable"
,
...
@@ -457,6 +457,7 @@ const ModelArray = [
...
@@ -457,6 +457,7 @@ const ModelArray = [
rejectRemarks
:
'String'
,
//变更理事驳回理由
rejectRemarks
:
'String'
,
//变更理事驳回理由
applyId
:{
type
:
'String'
,
index
:
true
},
applyId
:{
type
:
'String'
,
index
:
true
},
infoChangeId
:{
type
:
"String"
,
index
:
true
},
//资料更新关联id
infoChangeId
:{
type
:
"String"
,
index
:
true
},
//资料更新关联id
infoChangeMs
:{
type
:
"Number"
},
//资料更新申请时间
infoChangeOptionType
:{
type
:
"Number"
}
//INFOCHANGEAPPLYTYPE
infoChangeOptionType
:{
type
:
"Number"
}
//INFOCHANGEAPPLYTYPE
}
}
},
},
...
@@ -517,7 +518,9 @@ const ModelArray = [
...
@@ -517,7 +518,9 @@ const ModelArray = [
refundDesc
:
"String"
,
refundDesc
:
"String"
,
isReplenishReturnInfo
:{
type
:
'Boolean'
,
default
:
false
},
//是否补充退款信息
isReplenishReturnInfo
:{
type
:
'Boolean'
,
default
:
false
},
//是否补充退款信息
//
refundSuccessful
:{
type
:
"Boolean"
,
default
:
false
},
//退款确认
refundSuccessful
:{
type
:
"Boolean"
,
default
:
false
},
//退款确认
refundReject
:{
type
:
"Boolean"
,
default
:
false
},
//退款驳回 true = 被驳回
refundImgUrl
:
"String"
,
refundImgUrl
:
"String"
,
//新加的状态
//新加的状态
isSueInvoicesInAdvance
:{
type
:
"Boolean"
,
default
:
false
},
//提前开票 弃用
isSueInvoicesInAdvance
:{
type
:
"Boolean"
,
default
:
false
},
//提前开票 弃用
...
@@ -627,8 +630,11 @@ const ModelArray = [
...
@@ -627,8 +630,11 @@ const ModelArray = [
operationBehavior
:{
type
:
'Number'
},
//操作行为 枚举 ORDEREXAMINE
operationBehavior
:{
type
:
'Number'
},
//操作行为 枚举 ORDEREXAMINE
isReceiveMoney
:{
type
:
'Boolean'
,
default
:
false
},
//是否收到款项
isReceiveMoney
:{
type
:
'Boolean'
,
default
:
false
},
//是否收到款项
remarks
:{
type
:
'String'
},
//备注
remarks
:{
type
:
'String'
},
//备注
refundImgUrl
:
"String"
//退款确认发票地址
refundImgUrl
:
"String"
,
//退款确认发票地址
//退款信息
refundName
:
"String"
,
//退款姓名
refundBankNum
:
"String"
,
//银行账号
refundBankName
:
"String"
,
//银行开户行
}
}
},
},
{
{
...
@@ -661,6 +667,9 @@ const ModelArray = [
...
@@ -661,6 +667,9 @@ const ModelArray = [
uusinessLicenseUrl
:
"String"
,
//营业执照
uusinessLicenseUrl
:
"String"
,
//营业执照
applicationForm
:
"String"
,
//盖章申请表
applicationForm
:
"String"
,
//盖章申请表
desc
:
"String"
,
//描述
desc
:
"String"
,
//描述
legalPersonMail
:
"String"
,
//法人邮箱
legalPersonPhone
:
"String"
,
//法人电话
yuanXiaoBanXueLeiXing
:
'Number'
,
//办学类型
rejectRemarks
:
'String'
,
//变更驳回理由
rejectRemarks
:
'String'
,
//变更驳回理由
createTimeMs
:
'Number'
,
//日志时间
createTimeMs
:
'Number'
,
//日志时间
}
}
...
...
src/main.ts
View file @
084b98af
import
moment
=
require
(
"moment"
);
import
{
initActivity
}
from
"./biz/member/msgActivity"
;
import
{
initActivity
}
from
"./biz/member/msgActivity"
;
import
{
createOrder
}
from
"./biz/member/order"
;
import
{
initAdmin
}
from
"./biz/member/rightsMgmt"
;
import
{
t
}
from
"./biz/provide"
;
import
{
initSaveUnsubmitted
}
from
"./biz/register"
;
import
{
initSaveUnsubmitted
}
from
"./biz/register"
;
import
{
initSMS
}
from
"./biz/sms"
;
import
{
initSMS
}
from
"./biz/sms"
;
import
{
initSystemTask
}
from
"./biz/task"
;
import
{
initSystemTask
}
from
"./biz/task"
;
import
{
initConfig
,
systemConfig
}
from
"./config/serverConfig"
;
import
{
initConfig
,
systemConfig
}
from
"./config/serverConfig"
;
import
{
initDataBaseModel
}
from
"./data/db/db"
;
import
{
initDataBaseModel
}
from
"./data/db/db"
;
import
{
test
}
from
"./httpTOhttps"
;
import
{
httpServer
}
from
"./net/http_server"
;
import
{
httpServer
}
from
"./net/http_server"
;
async
function
lanuch
()
{
async
function
lanuch
()
{
...
@@ -32,7 +27,8 @@ async function lanuch() {
...
@@ -32,7 +27,8 @@ async function lanuch() {
// await test();
// await test();
// console.log(moment(1498262400000).format("YYYY-MM-DD HH:mm:SS"))
// console.log(moment(1498262400000).format("YYYY-MM-DD HH:mm:SS"))
console
.
log
(
"服务初始化成功"
);
console
.
log
(
"服务初始化成功"
);
// await testCallback("aeaa2492b585abd2bcfe4302a59bccb4")
}
}
lanuch
();
lanuch
();
...
...
src/routers/member/router.ts
View file @
084b98af
...
@@ -1023,9 +1023,12 @@ export const Config = {
...
@@ -1023,9 +1023,12 @@ export const Config = {
{
key
:
"uscc"
,
type
:
"String"
,
desc
:
"统一信用代码"
},
{
key
:
"uscc"
,
type
:
"String"
,
desc
:
"统一信用代码"
},
{
key
:
"legalPerson"
,
type
:
"String"
,
desc
:
"法人代表"
},
{
key
:
"legalPerson"
,
type
:
"String"
,
desc
:
"法人代表"
},
{
key
:
"unitMemberType"
,
type
:
"Number"
,
desc
:
"单位会员类型"
},
{
key
:
"unitMemberType"
,
type
:
"Number"
,
desc
:
"单位会员类型"
},
{
key
:
"yuanXiaoBanXueLeiXing"
,
type
:
"Number"
,
desc
:
"帮学类型"
},
{
key
:
"uusinessLicenseUrl"
,
type
:
"String"
,
desc
:
"营业执照"
},
{
key
:
"uusinessLicenseUrl"
,
type
:
"String"
,
desc
:
"营业执照"
},
{
key
:
"applicationForm"
,
type
:
"String"
,
desc
:
"盖章申请表"
},
{
key
:
"applicationForm"
,
type
:
"String"
,
desc
:
"盖章申请表"
},
{
key
:
"desc"
,
type
:
"String"
,
desc
:
"描述位"
}
{
key
:
"desc"
,
type
:
"String"
,
desc
:
"描述位"
},
{
key
:
"legalPersonMail"
,
type
:
"String"
,
desc
:
"法人邮件"
},
{
key
:
"legalPersonPhone"
,
type
:
"String"
,
desc
:
"法人电话"
},
],
],
bindBiz
:
homePageBiz
.
infomationChangeUpdate
bindBiz
:
homePageBiz
.
infomationChangeUpdate
},
},
...
...
src/routers/order/router.ts
View file @
084b98af
...
@@ -87,6 +87,14 @@ export const Config = {
...
@@ -87,6 +87,14 @@ export const Config = {
bindBiz
:
costVerificationBiz
.
confirmReceiptPass
bindBiz
:
costVerificationBiz
.
confirmReceiptPass
},
},
{
{
apiName
:
"财务核对-批量收款确认"
,
subUrl
:
'/order/invoice/examine/manypass'
,
param
:[
{
key
:
"idList"
,
type
:
"[String]"
,
desc
:
"订单id"
}
],
bindBiz
:
costVerificationBiz
.
confirmReceiptManyPass
},
{
apiName
:
"财务核对-退回"
,
apiName
:
"财务核对-退回"
,
subUrl
:
'/order/invoice/examine/out'
,
subUrl
:
'/order/invoice/examine/out'
,
param
:[
param
:[
...
@@ -226,6 +234,15 @@ export const Config = {
...
@@ -226,6 +234,15 @@ export const Config = {
bindBiz
:
orderBiz
.
refundApprove
bindBiz
:
orderBiz
.
refundApprove
},
},
{
{
apiName
:
"退款驳回"
,
subUrl
:
'/order/refundout'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"订单id"
},
{
key
:
"desc"
,
type
:
"String"
,
desc
:
"备注"
},
],
bindBiz
:
orderBiz
.
refundOut
},
{
apiName
:
"退款列表-数据导出"
,
apiName
:
"退款列表-数据导出"
,
subUrl
:
'/order/invoice/examine/outputrefund'
,
subUrl
:
'/order/invoice/examine/outputrefund'
,
param
:[
param
:[
...
...
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