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
f1f8e4d0
Commit
f1f8e4d0
authored
Mar 05, 2025
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a0c994c3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
30 deletions
+102
-30
mail.ts
src/biz/mail.ts
+15
-3
cost.ts
src/biz/member/cost.ts
+10
-2
costVerification.ts
src/biz/member/finance/costVerification.ts
+7
-4
invoice.ts
src/biz/member/finance/invoice.ts
+20
-2
order.ts
src/biz/member/order.ts
+44
-16
rightsMgmt.ts
src/biz/member/rightsMgmt.ts
+1
-0
enum.ts
src/config/enum.ts
+4
-3
outPutConfig.ts
src/config/outPutConfig.ts
+1
-0
No files found.
src/biz/mail.ts
View file @
f1f8e4d0
...
...
@@ -10,17 +10,29 @@ import { eccEnumValue } from "../util/verificationEnum";
const
nodemailer
=
require
(
'nodemailer'
);
// 创建发送邮件的传输对象
// let transporter = nodemailer.createTransport({
// host: 'smtp.163.com', // SMTP 服务器地址
// port: 465, // SMTP 服务器端口(通常是 465 或 587)
// secure: true, // 使用 SSL
// auth: {
// user: 'cefa_office@163.com', // 你的邮箱地址
// pass: 'EJRazhkkXK65gnLe' // 你的邮箱密码或应用专用密码
// }
// });
// 测试用邮箱地址
let
transporter
=
nodemailer
.
createTransport
({
host
:
'smtp.
163
.com'
,
// SMTP 服务器地址
host
:
'smtp.
qq
.com'
,
// SMTP 服务器地址
port
:
465
,
// SMTP 服务器端口(通常是 465 或 587)
secure
:
true
,
// 使用 SSL
auth
:
{
user
:
'
cefa_office@163
.com'
,
// 你的邮箱地址
pass
:
'
EJRazhkkXK65gnLe
'
// 你的邮箱密码或应用专用密码
user
:
'
3102438911@qq
.com'
,
// 你的邮箱地址
pass
:
'
erdfcv425860.
'
// 你的邮箱密码或应用专用密码
}
});
async
function
send
(
toMail
,
name
,
type
)
{
let
{
title
,
mailStr
}
=
getModel
(
name
,
type
);
// 设置邮件选项
...
...
src/biz/member/cost.ts
View file @
f1f8e4d0
...
...
@@ -164,11 +164,15 @@ export async function testCallback(weChartPR) {
}
if
(
Object
.
keys
(
updateUserInfo
).
length
)
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
oldInfo
.
userId
},
updateUserInfo
);
let
history
=
await
findOnce
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
oldInfo
.
id
});
let
operationBehavior
=
ORDEREXAMINE
.
用户提交
;
if
(
history
&&
history
.
orderId
)
operationBehavior
=
ORDEREXAMINE
.
用户重新提交
;
//添加审批日志
let
addLogInfo
=
{
orderId
:
oldInfo
.
id
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
用户提交
,
operationBehavior
,
remarks
:
"微信付款"
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
...
...
@@ -228,11 +232,15 @@ export async function payCallback(body) {
}
if
(
Object
.
keys
(
updateUserInfo
).
length
)
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
oldInfo
.
userId
},
updateUserInfo
);
let
history
=
await
findOnce
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
oldInfo
.
id
});
let
operationBehavior
=
ORDEREXAMINE
.
用户提交
;
if
(
history
&&
history
.
orderId
)
operationBehavior
=
ORDEREXAMINE
.
用户重新提交
;
//添加审批日志
let
addLogInfo
=
{
orderId
:
oldInfo
.
id
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
用户提交
,
operationBehavior
,
remarks
:
"微信付款"
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
...
...
src/biz/member/finance/costVerification.ts
View file @
f1f8e4d0
...
...
@@ -121,7 +121,7 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
let
dataList
=
[];
let
itemFile
=
[
"id"
,
"unitName"
,
"money"
,
"paymentNum"
,
"userId"
];
let
itemFile
=
[
"id"
,
"unitName"
,
"money"
,
"paymentNum"
,
"userId"
,
"paymentMethod"
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
itemData
:
any
=
extractData
(
info
,
itemFile
);
...
...
@@ -129,7 +129,7 @@ export async function paidList({name, memberType, documentId, phone, mail, joinS
itemData
.
joinTime
=
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
);
itemData
.
operationTime
=
moment
(
info
.
payTime
).
format
(
"YYYY-MM-DD"
);
itemData
.
memberType
=
changeEnumValue
(
MEMBERTYPE
,
info
.
memberCategory
);
//
itemData.paymentMethod = changeEnumValue(PAYMENTTYPE, info.paymentMethod);
itemData
.
paymentMethod
=
changeEnumValue
(
PAYMENTTYPE
,
info
.
paymentMethod
);
itemData
.
costType
=
info
.
isFirst
==
COSTTYPE
.
首次
?
"首次"
:
"续费"
;
itemData
.
cycle
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY"
)}
`
...
...
@@ -285,14 +285,16 @@ export async function outPutConfirmReceipt({exportColumns, payType, examineState
selectConf
.
push
(
info
.
value
);
})
let
selectFile
=
[
"id"
,
"unitName"
,
"userId"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"paymentNum"
,
"desc"
,
"invoiceMail"
,
"payTime"
,
"confirmReceipt"
];
let
selectFile
=
[
"id"
,
"unitName"
,
"userId"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"paymentMethod"
,
"memberCategory"
,
"paymentNum"
,
"desc"
,
"invoiceMail"
,
"payTime"
,
"confirmReceipt"
,
"invoiceStatus"
];
let
dbList
=
await
find
(
TABLEENUM
.
订单表
,
findParam
,
selectFile
);
let
timeChnageList
=
[
"payTime"
];
//"orderCycleStart", "operationTime"
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"
,
"session"
,
"unitName"
,
"documentId"
,
"uscc"
,
"mail"
,
"unitMail"
,
"memberLevel"
,
"phone"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
info
.
userId
},
[
"memberState"
,
"name"
,
"session"
,
"unitName"
,
"documentId"
,
"uscc"
,
"mail"
,
"unitMail"
,
"memberLevel"
,
"phone"
]);
let
subList
=
[];
for
(
let
i
=
0
;
i
<
selectConf
.
length
;
i
++
)
{
let
key
=
selectConf
[
i
];
...
...
@@ -326,6 +328,7 @@ export async function outPutConfirmReceipt({exportColumns, payType, examineState
else
if
(
key
==
"memberCategory"
)
value
=
changeEnumValue
(
MEMBERTYPE
,
value
);
else
if
(
key
==
"memberLevel"
)
value
=
changeEnumValue
(
MEMBERLEVEL
,
value
);
else
if
(
key
==
"paymentMethod"
)
value
=
changeEnumValue
(
PAYMENTTYPE
,
value
);
else
if
(
key
==
"invoiceStatus"
)
value
=
changeEnumValue
(
INVOICESTATUS
,
value
);
}
subList
.
push
(
value
);
}
...
...
src/biz/member/finance/invoice.ts
View file @
f1f8e4d0
...
...
@@ -196,10 +196,28 @@ export async function confirmReceiptHistory({id}) {
let
dataList
=
[];
dbList
.
sort
((
a
,
b
)
=>
{
return
b
.
operationTime
-
a
.
operationTime
});
dbList
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
[
"operationTime"
,
"operationBehavior"
,
"remarks"
,
"refundImgUrl"
]);
let
item
:
any
=
extractData
(
info
,
[
"operationTime"
,
"operationBehavior"
,
"remarks"
,
"refundImgUrl"
,
"isReceiveMoney"
]);
item
.
operationTime
=
moment
(
item
.
operationTime
).
format
(
"YYYY-MM-DD HH:mm:SS"
);
item
.
operationBehavior
=
changeEnumValue
(
ORDEREXAMINE
,
item
.
operationBehavior
);
// item.operationBehavior = changeEnumValue(ORDEREXAMINE, item.operationBehavior);
item
.
desc
=
""
;
let
operationBehaviorStr
=
changeEnumValue
(
ORDEREXAMINE
,
item
.
operationBehavior
);
if
(
item
.
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
{
item
.
desc
=
"未收到/已收到"
;
//线下付款
}
else
{
if
(
item
.
isReceiveMoney
)
{
//判断是否收到款项
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
-不需退款`
;
item
.
desc
=
"未收到/已收到"
}
else
{
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
-需退款`
;
item
.
desc
=
"已收到"
}
// desc = isReceiveMoney ? changeEnumValue(ISRECEIVE, ISRECEIVE.未收到款项_xg其他) : changeEnumValue(ISRECEIVE, ISRECEIVE.提供账户_zkh需退款_ykh)
}
item
.
operationBehavior
=
operationBehaviorStr
;
dataList
.
push
(
item
);
});
...
...
src/biz/member/order.ts
View file @
f1f8e4d0
...
...
@@ -428,11 +428,15 @@ export async function getInvoiceStatus({id}) {
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
let
history
=
await
findOnce
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
id
});
let
operationBehavior
=
ORDEREXAMINE
.
用户提交
;
if
(
history
&&
history
.
orderId
)
operationBehavior
=
ORDEREXAMINE
.
用户重新提交
;
//添加日志
let
addLogInfo
=
{
orderId
:
id
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
用户提交
,
operationBehavior
,
remarks
:
`
${
desc
}
`
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
...
...
@@ -455,9 +459,21 @@ export async function reasonInfo({id}) {
let
dataList
=
[];
logInfoList
.
forEach
(
info
=>
{
let
isReceiveMoney
=
info
.
isReceiveMoney
?
"已收到"
:
"未收到"
;
let
remarks
=
info
.
remarks
// let isReceiveMoney = info.isReceiveMoney ? "已收到" : "未收到";
let
isReceiveMoney
=
""
;
let
operationBehaviorStr
=
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
);
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
isReceiveMoney
=
"未收到/已收到"
;
//线下付款
else
{
if
(
isReceiveMoney
)
{
//判断是否收到款项
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
-不需退款`
;
isReceiveMoney
=
"未收到/已收到"
}
else
{
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
-需退款`
;
isReceiveMoney
=
"已收到"
}
}
let
remarks
=
info
.
remarks
;
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
退款申请
)
{
isReceiveMoney
=
"-"
;
if
(
info
.
refundName
)
remarks
+=
`-
${
info
.
refundName
}
`
;
...
...
@@ -470,7 +486,8 @@ export async function reasonInfo({id}) {
let
dataInfo
=
{
operationTime
:
moment
(
info
.
operationTime
).
format
(
"YYYY/MM/DD HH:mm:SS"
),
behavior
:
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
),
// behavior:changeEnumValue(ORDEREXAMINE, info.operationBehavior),
behavior
:
operationBehaviorStr
,
isReceiveMoney
,
remarks
};
...
...
@@ -529,6 +546,10 @@ export async function accountInfo({id, form}) {
export
async
function
refundList
({
name
,
memberType
,
joinStartTime
,
joinEndTime
,
pageNumber
})
{
let
findParam
:
any
=
{
isReceive
:{
"$gt"
:
0
}
// "$or":[
// {isReceive:{"$gt":0}, state:ORDERSTATE.未支付},
// {isReceive:{"$gt":1}, state:ORDERSTATE.已支付}
// ]
};
/**用户表查询条件 */
...
...
@@ -567,13 +588,14 @@ 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"
,
"isReceive"
];
let
selectFile
=
[
"id"
,
"unitName"
,
"orderCycleStart"
,
"orderCycleEnd"
,
"money"
,
"memberCategory"
,
"userId"
,
"refundBankCarId"
,
"refundBankName"
,
"refundSuccessful"
,
"isReplenishReturnInfo"
,
"desc"
,
"isReceive"
,
"refundImgUrl"
];
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"
,
"isReceive"
];
let
itemFile
=
[
"id"
,
"name"
,
"unitName"
,
"money"
,
"userId"
,
"memberCategory"
,
"refundBankCarId"
,
"refundBankName"
,
"desc"
,
"isReceive"
,
"refundImgUrl"
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
...
...
@@ -581,6 +603,7 @@ export async function refundList({name, memberType, joinStartTime, joinEndTime,
// itemData.joinTime = moment(info.orderCycleStart).format("YYYY-MM-DD");
itemData
.
memberType
=
changeEnumValue
(
MEMBERTYPE
,
itemData
.
memberCategory
);
itemData
.
cycle
=
`
${
moment
(
info
.
orderCycleStart
).
format
(
"YYYY-MM-DD"
)}
至
${
moment
(
info
.
orderCycleEnd
).
format
(
"YYYY-MM-DD"
)}
`
;
if
(
!
info
.
refundImgUrl
)
itemData
.
refundImgUrl
=
"-"
;
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
:
itemData
.
userId
},
[
"memberState"
,
"name"
,
"individualMemberType"
,
"unitMemberType"
]);
if
(
userInfo
)
{
...
...
@@ -734,22 +757,23 @@ export async function refundOut({id, desc}) {
let
desc
=
""
;
let
operationBehaviorStr
=
changeEnumValue
(
ORDEREXAMINE
,
operationBehavior
);
if
(
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
desc
=
"未收到/已收到"
;
//线下付款
else
{
if
(
operationBehavior
==
ORDEREXAMINE
.
用户提交
)
{
desc
=
"未收到/已收到"
;
//线下付款
}
else
{
if
(
isReceiveMoney
)
{
//判断是否收到款项
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
"-需退款"
`
;
isReceiveMoney
=
"
已收到"
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
-不需退款
`
;
desc
=
"未收到/
已收到"
}
else
{
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
"-不需退款"
`
;
isReceiveMoney
=
"未收到/
已收到"
if
(
info
.
operationBehavior
==
ORDEREXAMINE
.
驳回
)
operationBehaviorStr
=
`
${
changeEnumValue
(
ORDEREXAMINE
,
info
.
operationBehavior
)}
-需退款
`
;
desc
=
"
已收到"
}
// desc = isReceiveMoney ? changeEnumValue(ISRECEIVE, ISRECEIVE.未收到款项_xg其他) : changeEnumValue(ISRECEIVE, ISRECEIVE.提供账户_zkh需退款_ykh)
}
let
addInfo
:
any
=
{
operationTime
,
// operationTime:moment(operationTime).format("YYYY-MM-DD HH:mm:SS"),
//
operationBehavior:operationBehaviorStr,
operationBehavior
:
changeEnumValue
(
ORDEREXAMINE
,
operationBehavior
),
operationBehavior
:
operationBehaviorStr
,
//
operationBehavior:changeEnumValue(ORDEREXAMINE, operationBehavior),
desc
,
other
:
remarks
};
...
...
@@ -816,12 +840,16 @@ export async function reconfirm({id, weChartPR, offlinePaymentUrl, desc}) {
};
await
updateOneData
(
TABLEENUM
.
订单表
,
{
id
},
updateInfo
);
let
history
=
await
findOnce
(
TABLEENUM
.
订单审批历史表
,
{
orderId
:
id
});
let
operationBehavior
=
ORDEREXAMINE
.
用户提交
;
if
(
history
&&
history
.
orderId
)
operationBehavior
=
ORDEREXAMINE
.
用户重新提交
;
//添加日志
let
addLogInfo
=
{
orderId
:
id
,
operationTime
:
new
Date
().
valueOf
(),
operationBehavior
:
ORDEREXAMINE
.
用户提交
,
operationBehavior
,
remarks
:
`
${
desc
}
`
};
await
addOneData
(
TABLEENUM
.
订单审批历史表
,
addLogInfo
);
...
...
src/biz/member/rightsMgmt.ts
View file @
f1f8e4d0
...
...
@@ -133,6 +133,7 @@ export async function info({id}) {
let
firstKey
=
Math
.
floor
(
adminLv
/
100
);
if
(
!
distinctMap
[
firstKey
])
distinctMap
[
firstKey
]
=
[]
if
(
distinctMap
[
firstKey
])
{
if
(
adminLv
==
205
)
adminLv
=
211
;
//2025.2.28 变更管理目录删除,改成会员权限
distinctMap
[
firstKey
].
push
({
key
:
ADMINLV
[
adminLv
],
value
:
adminLv
...
...
src/config/enum.ts
View file @
f1f8e4d0
...
...
@@ -550,7 +550,8 @@ export enum OPERATIONREHAVIOR {
重新提交
,
驳回修改
,
通过
,
用户提交
用户提交
,
用户重新提交
}
...
...
@@ -602,7 +603,6 @@ export enum ADMINLV {
发票管理
,
// 变更管理, 205
管理设置
=
206
,
// 管理权限 = 206,
标签系统
,
通知管理
=
208
,
会员信息修改
=
209
,
...
...
@@ -781,7 +781,8 @@ export enum ORDEREXAMINE {
审核时间
,
//审核时间
已开票
,
//已开票
退款申请
,
//退款申请
已退款
//已退款
已退款
,
//已退款
用户重新提交
,
}
...
...
src/config/outPutConfig.ts
View file @
f1f8e4d0
...
...
@@ -95,6 +95,7 @@ export enum CONFIRMRECEIPTCOLUMNS {
注册手机号
=
"phone"
,
届次
=
"session"
,
支付时间
=
"payTime"
,
//微信支付的时间
发票状态
=
"invoiceStatus"
,
}
...
...
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