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
07078960
Commit
07078960
authored
May 22, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ff88bc83
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
11 deletions
+16
-11
serverConfig.xml
serverConfig.xml
+3
-0
cost.ts
src/biz/member/cost.ts
+5
-3
examine.ts
src/biz/member/examine.ts
+1
-1
memberFees.ts
src/biz/member/memberFees.ts
+0
-3
serverConfig.ts
src/config/serverConfig.ts
+3
-1
systemClass.ts
src/config/systemClass.ts
+2
-0
main.ts
src/main.ts
+1
-2
router.ts
src/routers/router.ts
+1
-1
No files found.
serverConfig.xml
View file @
07078960
...
...
@@ -28,4 +28,7 @@
<!-- 单位会员注册 -->
<unitMemberRegister>
1729288
</unitMemberRegister>
</sms>
<weChart>
<notifyUrl>
https://yydata.mynatapp.cc/pay/wechart/callback
</notifyUrl>
</weChart>
</config>
src/biz/member/cost.ts
View file @
07078960
...
...
@@ -13,6 +13,7 @@ import { ERRORENUM } from "../../config/errorEnum";
import
{
generateWXOrderId
,
successResult
}
from
"../../tools/system"
;
import
{
updateOneData
}
from
"../../data/update"
;
import
moment
=
require
(
"moment"
);
import
{
systemConfig
}
from
"../../config/serverConfig"
;
const
AppId
=
'wx96c0cf11b3babcf6'
;
const
MchId
=
'1614605859'
;
...
...
@@ -24,7 +25,6 @@ const pay = new WxPay({
privateKey
:
fs
.
readFileSync
(
path
.
join
(
__dirname
.
substring
(
0
,
__dirname
.
indexOf
(
"out"
)),
"keys"
,
'apiclient_key.pem'
)
),
// 秘钥
});
/**
* native下单接口【前端调用】
* @param param0 {id订单列表的id}
...
...
@@ -52,8 +52,9 @@ export async function placeAnOrder({id}) {
out_trade_no
,
//订单号
amount
:{
//金额
total
:
orderInfo
.
money
*
100
//微信支付的单位是分 金额要乘100
// total:1
},
notify_url
:
'https://yydata.mynatapp.cc/pay/wechart/callback'
,
//订单回调
notify_url
:
systemConfig
.
weChartNotifyUrl
,
//订单回调
};
const
result
=
await
pay
.
transactions_native
(
Param
);
if
(
result
.
status
!=
200
)
throw
new
BizError
(
ERRORENUM
.
调起微信支付失败
);
...
...
@@ -72,6 +73,7 @@ async function close(id:string) {
return
{
state
:
WEICHARTPAYSTATE
.
未提交
,
msg
:
"订单已关闭"
};
}
/**
* 订单查询状态【前端调用】
*/
...
...
@@ -144,7 +146,7 @@ export async function payCallback(body) {
/**只有一笔欠费时才更新用户状态 */
let
updateUserInfo
:
any
=
{};
if
(
notPayCount
<
1
)
{
if
(
notPayCount
<
=
1
)
{
let
newOrderInfo
=
await
findOnceToSort
(
TABLEENUM
.
订单表
,
{
userId
:
oldInfo
.
userId
},
{
lifespanEndTime
:
-
1
},
[
"orderCycleStart"
,
"orderCycleEnd"
]);
updateUserInfo
.
lifespanStartTime
=
newOrderInfo
.
orderCycleStart
;
...
...
src/biz/member/examine.ts
View file @
07078960
...
...
@@ -65,7 +65,7 @@ export async function pendingReviewList({name, memberType, documentId, phone, ma
if
(
shi
)
selectParam
.
shi
=
shi
;
const
SelectFiles
=
[
"userId"
,
"userRegisterState"
,
"unitName"
,
"name"
,
"loginId"
,
"phone"
,
"askForTime"
,
"memberLevel"
,
"sheng"
,
"shi"
,
"qu"
,
"individualMemberType"
,
"unitMemberType"
,
"memberType"
,
"mail"
];
let
dbList
=
await
findTo
Page
(
TABLEENUM
.
用户表
,
selectParam
,
SelectFiles
,
pageNumber
);
let
dbList
=
await
findTo
SortToPage
(
TABLEENUM
.
用户表
,
selectParam
,
SelectFiles
,
{
askForTime
:
-
1
}
,
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
用户表
,
selectParam
);
let
dataList
=
[];
...
...
src/biz/member/memberFees.ts
View file @
07078960
...
...
@@ -207,9 +207,6 @@ export async function getRenewalPeriod({name, memberType, documentId, phone, mai
isGracePeriod
:
STATE
.
是
,
lifespanEndTime
:{
"$lt"
:
NowMs
},
gracePeriodEndTime
:{
"$lt"
:
NowMs
}
},
{
isFirstPay
:
true
,
}
],
userRegisterState
:
USERREGISTERSTATE
.
通过
,
...
...
src/config/serverConfig.ts
View file @
07078960
...
...
@@ -16,7 +16,7 @@ export async function initConfig() {
if
(
!
configInfo
||
!
configInfo
.
config
)
throw
new
BizError
(
'xml中无配置'
);
else
{
let
{
port
,
mongodb
,
mysqldb
,
specifyDB
}
=
configInfo
.
config
;
let
{
port
,
mongodb
,
mysqldb
,
specifyDB
,
weChart
}
=
configInfo
.
config
;
systemConfig
.
port
=
parseInt
(
port
[
0
]);
const
MongoPath
=
mongodb
[
0
].
path
[
0
];
...
...
@@ -38,6 +38,8 @@ export async function initConfig() {
}
}
systemConfig
.
weChartNotifyUrl
=
weChart
[
0
].
notifyUrl
[
0
];
if
(
specifyDB
)
{
systemConfig
.
specifyDB
=
specifyDB
[
0
];
}
else
systemConfig
.
specifyDB
=
null
;
...
...
src/config/systemClass.ts
View file @
07078960
...
...
@@ -20,4 +20,5 @@ export class ServerConfig {
smsAppKey
:
string
;
smsSign
:
string
;
smsUnitMemberRegister
:
number
;
weChartNotifyUrl
:
string
;
}
\ No newline at end of file
src/main.ts
View file @
07078960
import
{
inputData
}
from
"./biz/dataInput"
;
import
{
initAdmin
}
from
"./biz/member/rightsMgmt"
;
import
{
initSMS
}
from
"./biz/sms"
;
import
{
initSystemTask
}
from
"./biz/task"
;
import
{
initConfig
,
systemConfig
}
from
"./config/serverConfig"
;
import
{
initDataBaseModel
}
from
"./data/db/db"
;
import
{
test1
}
from
"./dataScript"
;
import
{
httpServer
}
from
"./net/http_server"
;
async
function
lanuch
()
{
...
...
src/routers/router.ts
View file @
07078960
...
...
@@ -94,7 +94,7 @@ function routerFun(apiName, defaultParam, subUrl, param, bindBiz, notMiddleware)
export
async
function
setAdditionalRouter
(
httpServer
)
{
httpServer
.
post
(
'/pay/wechart/callback'
,
asyncHandler
(
async
(
req
,
res
)
=>
{
httpServer
.
post
(
'/
manage/cost/
pay/wechart/callback'
,
asyncHandler
(
async
(
req
,
res
)
=>
{
let
result
=
await
payCallback
(
req
.
body
);
res
.
success
(
result
);
}));
...
...
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