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
cfd78c1f
Commit
cfd78c1f
authored
Dec 21, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
856a29a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
15 deletions
+46
-15
memberFees.ts
src/biz/member/memberFees.ts
+31
-8
order.ts
src/biz/member/order.ts
+10
-4
verificationEnum.ts
src/util/verificationEnum.ts
+5
-3
No files found.
src/biz/member/memberFees.ts
View file @
cfd78c1f
...
...
@@ -3,9 +3,9 @@
*/
import
moment
=
require
(
"moment"
);
import
{
MEMBERLEVEL
,
MEMBERSTATE
,
MEMBERTYPE
,
MEMBERTYPEECCENUM
,
ORDEREXAMINE
,
ORDERSTATE
,
PAYMENTTYPE
,
RECEIPTCONFIRMATION
,
STATE
,
UNITMEMBERTYPE
,
USERREGISTERSTATE
}
from
"../../config/enum"
;
import
{
INVOICESTATUS
,
MEMBERLEVEL
,
MEMBERSTATE
,
MEMBERTYPE
,
MEMBERTYPEECCENUM
,
ORDEREXAMINE
,
ORDERSTATE
,
PAYMENTSTATUS
,
PAYMENTTYPE
,
RECEIPTCONFIRMATION
,
STATE
,
UNITMEMBERTYPE
,
USERREGISTERSTATE
}
from
"../../config/enum"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
find
,
findCount
,
findOnce
,
findToPage
,
findToSort
,
findToSortToPage
}
from
"../../data/select"
;
import
{
find
,
findCount
,
findOnce
,
find
OnceToSort
,
find
ToPage
,
findToSort
,
findToSortToPage
}
from
"../../data/select"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
import
{
BizError
}
from
"../../util/bizError"
;
...
...
@@ -490,18 +490,41 @@ export async function offlinePayment({orderId, paymentNum, offlinePaymentUrl })
state
:
ORDERSTATE
.
已支付
,
paymentMethod
:
PAYMENTTYPE
.
线下支付
,
payTime
:
new
Date
().
valueOf
(),
confirmReceipt
:
RECEIPTCONFIRMATION
.
待确认
confirmReceipt
:
RECEIPTCONFIRMATION
.
收款确认
,
confirmReceiptMs
:
new
Date
().
valueOf
()
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
:
orderId
},
updateInfo
);
//添加审批日志
//2024年12月21日版本修改 修改成线下付款的用户不需要审核
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
,
orderId
:
orderId
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
用户提交
,
remarks
:
""
operationBehavior
:
ORDEREXAMINE
.
审核时间
,
isReceiveMoney
:
true
,
remarks
:
``
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
...
...
src/biz/member/order.ts
View file @
cfd78c1f
...
...
@@ -536,13 +536,13 @@ export async function refundList({name, memberType, joinStartTime, joinEndTime,
findParam
.
userId
=
{
"$in"
:
checkUserIdList
}
}
let
selectFile
=
[
"id"
,
"unitName"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"memberCategory"
,
"userId"
,
"refundBankCarId"
,
"refundBankName"
,
"refundSuccessful"
,
"isReplenishReturnInfo"
,
"desc"
];
let
selectFile
=
[
"id"
,
"unitName"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"memberCategory"
,
"userId"
,
"refundBankCarId"
,
"refundBankName"
,
"refundSuccessful"
,
"isReplenishReturnInfo"
,
"desc"
,
"isReceive"
];
let
dbList
=
await
findToSortToPage
(
TABLEENUM
.
订单表
,
findParam
,
selectFile
,
{
orderCycleStart
:
-
1
},
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
订单表
,
findParam
);
let
dataList
=
[];
let
itemFile
=
[
"id"
,
"name"
,
"unitName"
,
"money"
,
"userId"
,
"memberCategory"
,
"refundBankCarId"
,
"refundBankName"
,
"desc"
];
let
itemFile
=
[
"id"
,
"name"
,
"unitName"
,
"money"
,
"userId"
,
"memberCategory"
,
"refundBankCarId"
,
"refundBankName"
,
"desc"
,
"isReceive"
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
...
...
@@ -628,7 +628,8 @@ export async function refundApprove({id, refundImgUrl}) {
let
dataList
=
[
selectTitle
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
info
.
userId
},
[
"memberState"
,
"name"
,
"unitName"
,
"memberLevel"
,
"phone"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
info
.
userId
},
[
"userId"
,
"memberState"
,
"name"
,
"unitName"
,
"memberLevel"
,
"phone"
]);
if
(
!
userInfo
||
!
userInfo
.
userId
)
continue
;
let
subList
=
[];
for
(
let
i
=
0
;
i
<
selectConf
.
length
;
i
++
)
{
let
key
=
selectConf
[
i
];
...
...
@@ -670,10 +671,15 @@ export async function approveLog({id}) {
logsList
.
forEach
(
info
=>
{
let
{
operationTime
,
operationBehavior
,
isReceiveMoney
,
remarks
}
=
info
;
let
desc
=
""
;
if
(
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
desc
=
"线下付款"
;
else
{
desc
=
isReceiveMoney
?
changeEnumValue
(
ISRECEIVE
,
ISRECEIVE
.
未收到款项
_xg
其他
)
:
changeEnumValue
(
ISRECEIVE
,
ISRECEIVE
.
提供账户
_zkh
需退款
_ykh
)
}
let
addInfo
:
any
=
{
operationTime
:
moment
(
operationTime
).
format
(
"YYYY-MM-DD HH:mm:SS"
),
operationBehavior
:
changeEnumValue
(
ORDEREXAMINE
,
operationBehavior
),
desc
:
isReceiveMoney
?
changeEnumValue
(
ISRECEIVE
,
ISRECEIVE
.
未收到款项
_xg
其他
)
:
changeEnumValue
(
ISRECEIVE
,
ISRECEIVE
.
提供账户
_zkh
需退款
_ykh
)
,
desc
,
other
:
remarks
};
dataList
.
push
(
addInfo
);
...
...
src/util/verificationEnum.ts
View file @
cfd78c1f
...
...
@@ -47,8 +47,9 @@ export function changeEnumValue(enumConf, value:any) {
if
(
/_ju/
.
test
(
str
))
str
=
str
.
replace
(
/_ju/
,
"。"
);
if
(
/_hgh/
.
test
(
str
))
str
=
str
.
replace
(
/_hgh/
,
"-"
);
if
(
/_kbh/
.
test
(
str
))
str
=
str
.
replace
(
/_kbh/
,
""
);
if
(
/_xg/
.
test
(
str
))
str
=
str
.
replace
(
/_xg/
,
""
);
if
(
/_xg/
.
test
(
str
))
str
=
str
.
replace
(
/_xg/
,
"/"
);
if
(
/_zkh/
.
test
(
str
))
str
=
str
.
replace
(
/_zkh/
,
"("
);
if
(
/_ykh/
.
test
(
str
))
str
=
str
.
replace
(
/_ykh/
,
")"
);
return
str
}
let
str
=
""
;
...
...
@@ -63,7 +64,8 @@ export function changeEnumValue(enumConf, value:any) {
if
(
/_hgh/
.
test
(
str
))
str
=
str
.
replace
(
/_hgh/
,
"-"
);
if
(
/_kbh/
.
test
(
str
))
str
=
str
.
replace
(
/_kbh/
,
""
);
if
(
/_xg/
.
test
(
str
))
str
=
str
.
replace
(
/_xg/
,
"/"
);
if
(
/_xg/
.
test
(
str
))
str
=
str
.
replace
(
/_xg/
,
""
);
if
(
/_zkh/
.
test
(
str
))
str
=
str
.
replace
(
/_zkh/
,
"("
);
if
(
/_ykh/
.
test
(
str
))
str
=
str
.
replace
(
/_ykh/
,
")"
);
str
+=
subStr
;
if
(
index
==
value
.
length
-
1
)
str
+=
""
;
else
str
+=
","
...
...
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