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
e8c82b1d
Commit
e8c82b1d
authored
Mar 06, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
22cf1b0a
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
162 additions
and
71 deletions
+162
-71
cost.ts
src/biz/member/cost.ts
+9
-7
order.ts
src/biz/member/order.ts
+73
-0
officialWebsite.ts
src/biz/officialWebsite.ts
+19
-19
xueHuiJiaGou.ts
src/biz/portal/xueHui/xueHuiJiaGou.ts
+15
-17
enum.ts
src/config/enum.ts
+8
-3
model.ts
src/data/models/model.ts
+8
-5
modelInit.ts
src/data/models/modelInit.ts
+1
-1
select.ts
src/data/select.ts
+1
-1
router.ts
src/routers/officalWebsite/router.ts
+3
-2
router.ts
src/routers/portal/router.ts
+14
-14
router.ts
src/routers/router.ts
+1
-1
system.ts
src/tools/system.ts
+10
-1
No files found.
src/biz/member/cost.ts
View file @
e8c82b1d
/**
/**
*
会费管理
*
收费
*/
*/
import
moment
=
require
(
"moment"
);
import
{
MEMBERLEVEL
,
MEMBERTYPE
,
ORDERSTATE
}
from
"../../config/enum"
;
import
{
generateOrderId
}
from
"../../tools/system"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
addOneData
}
from
"../../data/add"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
/**
*
*/
export
async
function
costList
({
unit
,
joinTime
})
{
}
\ No newline at end of file
src/biz/member/order.ts
0 → 100644
View file @
e8c82b1d
/**
* 订单相关
*/
import
moment
=
require
(
"moment"
);
import
{
MEMBERLEVEL
,
MEMBERTYPE
,
ORDERSTATE
}
from
"../../config/enum"
;
import
{
generateOrderId
}
from
"../../tools/system"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
addOneData
}
from
"../../data/add"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
findToPage
}
from
"../../data/select"
;
/**
* 对内使用 创建一条订单
* @param userId 会员id
* @param unitName 单位名称
* @param orderStartMs 订单开始时间
* @param memberLv 会员等级 MEMBERLEVEL
* @param memberType 会员类型 MEMBERTYPE
* @param isFirst 是否首次缴费
* @returns
*/
export
async
function
createOrder
(
userId
:
string
,
unitName
:
string
,
orderStartMs
:
number
,
memberLv
:
number
,
memberType
:
number
,
isFirst
:
boolean
)
{
/**计算订单周期 */
const
EndMs
=
moment
(
orderStartMs
).
add
(
1
,
'years'
).
valueOf
();
/**订单id */
const
OrderId
=
generateOrderId
(
userId
);
/**计算会费 */
let
money
=
0
;
if
(
memberLv
==
MEMBERLEVEL
.
专家会员
)
{
}
else
{
}
let
addInfo
=
{
id
:
OrderId
,
orderCycleStart
:
orderStartMs
,
orderCycleEnd
:
EndMs
,
unitName
,
money
,
paymentMethod
:
0
,
memberId
:
userId
,
memberCategory
:
memberType
,
paymentNum
:
0
,
invoiceAdd
:
''
,
state
:
ORDERSTATE
.
未支付
,
isFirst
};
// await addOneData(TABLEENUM.订单表, addInfo);
return
true
;
}
/**
* 初始订单
*/
export
async
function
firstOrderList
({
unitName
,
joinTime
,
memberType
,
orderState
})
{
let
findParam
:
any
=
{
isFirst
:
true
};
if
(
unitName
)
findParam
.
unitName
=
{
"$regex"
:
unitName
};
if
(
memberType
)
findParam
.
memberCategory
=
memberType
;
if
(
orderState
)
findParam
.
state
=
orderState
;
// await findToPage(TABLEENUM.订单表, findParam, ["unitName", ""])
}
/**
* 已缴费名单
*/
export
async
function
paidList
({
unit
,
joinTime
,
memberType
})
{
eccEnumValue
(
"已缴费名单"
,
"会员类型"
,
MEMBERTYPE
,
memberType
);
}
src/biz/officialWebsite.ts
View file @
e8c82b1d
...
@@ -18,8 +18,8 @@ export async function banner() {
...
@@ -18,8 +18,8 @@ export async function banner() {
let
localBanners
=
[
BANNERPOSITION
.
首页
_hghbanner01
,
BANNERPOSITION
.
首页
_hghbanner02
,
BANNERPOSITION
.
首页
_hghbanner03
];
let
localBanners
=
[
BANNERPOSITION
.
首页
_hghbanner01
,
BANNERPOSITION
.
首页
_hghbanner02
,
BANNERPOSITION
.
首页
_hghbanner03
];
let
bannerData
=
await
find
(
TABLEENUM
.
banner
管理
,
{
location
:{
"$in"
:
localBanners
},
display
:
STATE
.
是
}
);
let
bannerData
=
await
find
(
TABLEENUM
.
banner
管理
,
{
location
:{
"$in"
:
localBanners
},
display
:
STATE
.
是
}
);
bannerData
.
forEach
(
info
=>
{
bannerData
.
forEach
(
info
=>
{
let
{
imgUrl
,
t
itle
,
desc
,
articleUrl
}
=
info
;
let
{
imgUrl
,
articleT
itle
,
desc
,
articleUrl
}
=
info
;
result
.
bannerList
.
push
({
imgUrl
,
title
,
desc
,
articleUrl
});
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitle
,
desc
,
articleUrl
});
});
});
return
result
;
return
result
;
}
}
...
@@ -47,7 +47,7 @@ export async function homePage() {
...
@@ -47,7 +47,7 @@ export async function homePage() {
});
});
/**学会动态 每个动态资讯取最新的可见的两个*/
/**学会动态 每个动态资讯取最新的可见的两个*/
let
wenZhangTypeList
=
[
ARTICLEPOSITION
.
动态资讯
_hgh
学会动态
,
ARTICLEPOSITION
.
动态资讯
_hgh
政策动向
,
ARTICLEPOSITION
.
动态资讯
_hgh
行业风采
];
let
wenZhangTypeList
=
[
ARTICLEPOSITION
.
动态资讯
_hgh
学会动态
,
ARTICLEPOSITION
.
动态资讯
_hgh
政策动向
,
ARTICLEPOSITION
.
动态资讯
_hgh
行业风采
];
let
dongTaiZiXunData
=
await
find
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$
or
"
:
wenZhangTypeList
},
display
:
STATE
.
是
});
let
dongTaiZiXunData
=
await
find
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$
in
"
:
wenZhangTypeList
},
display
:
STATE
.
是
});
dongTaiZiXunData
.
sort
((
a
,
b
)
=>
{
return
a
.
articleTime
-
b
.
articleTime
});
dongTaiZiXunData
.
sort
((
a
,
b
)
=>
{
return
a
.
articleTime
-
b
.
articleTime
});
let
dongTaiZiXunDistinctMap
=
{};
let
dongTaiZiXunDistinctMap
=
{};
dongTaiZiXunData
.
forEach
(
info
=>
{
dongTaiZiXunData
.
forEach
(
info
=>
{
...
@@ -55,7 +55,7 @@ export async function homePage() {
...
@@ -55,7 +55,7 @@ export async function homePage() {
if
(
!
dongTaiZiXunDistinctMap
[
articleType
])
dongTaiZiXunDistinctMap
[
articleType
]
=
[];
if
(
!
dongTaiZiXunDistinctMap
[
articleType
])
dongTaiZiXunDistinctMap
[
articleType
]
=
[];
if
(
dongTaiZiXunDistinctMap
[
articleType
].
length
<
2
)
{
if
(
dongTaiZiXunDistinctMap
[
articleType
].
length
<
2
)
{
dongTaiZiXunDistinctMap
[
articleType
].
push
({
dongTaiZiXunDistinctMap
[
articleType
].
push
({
id
,
title
,
imgUrl
,
articleTime
,
desc
id
,
title
,
imgUrl
,
articleTime
:
moment
(
articleTime
).
format
(
"YYYY-MM-DD"
)
,
desc
});
});
}
}
});
});
...
@@ -103,25 +103,25 @@ export async function xueHuiGaiKuang() {
...
@@ -103,25 +103,25 @@ export async function xueHuiGaiKuang() {
result
.
xueHuiGaiKuang
=
extractData
(
xueHuiGaiKuangData
,
[
"title"
,
"desc"
,
"imgList"
]);
result
.
xueHuiGaiKuang
=
extractData
(
xueHuiGaiKuangData
,
[
"title"
,
"desc"
,
"imgList"
]);
/**学会领导 */
/**学会领导 */
let
xueHuiLingDaoData
=
await
find
Once
(
TABLEENUM
.
学会领导
,
{}
);
let
xueHuiLingDaoData
=
await
find
(
TABLEENUM
.
学会领导
,
{}
);
xueHuiLingDaoData
.
sort
((
a
,
b
)
=>
{
return
a
.
rank
-
b
.
rank
});
xueHuiLingDaoData
.
sort
((
a
,
b
)
=>
{
return
a
.
rank
-
b
.
rank
});
xueHuiLingDaoData
.
forEach
(
info
=>
{
xueHuiLingDaoData
.
forEach
(
info
=>
{
result
.
xueHuiLingDao
.
push
(
extractData
(
info
,
[
"name"
,
"position"
,
"imgUrl"
,
"miniImgUrl"
,
"desc"
]));
result
.
xueHuiLingDao
.
push
(
extractData
(
info
,
[
"name"
,
"position"
,
"imgUrl"
,
"miniImgUrl"
,
"desc"
]));
});
});
/**组织架构 */
/**组织架构 */
let
zuZhiJiaGouData
=
await
find
Once
(
TABLEENUM
.
学会架构
,
{
display
:
1
}
);
let
zuZhiJiaGouData
=
await
find
(
TABLEENUM
.
学会架构
,
{
display
:
1
}
);
zuZhiJiaGouData
.
forEach
(
info
=>
{
zuZhiJiaGouData
.
forEach
(
info
=>
{
result
.
xueHuiLingDao
.
push
(
extractData
(
info
,
[
"departmentName"
,
"desc"
]));
result
.
zuZhiJiaGou
.
push
(
extractData
(
info
,
[
"departmentName"
,
"desc"
]));
});
});
/**学会规章 */
/**学会规章 */
let
xueHuiGuiZhangData
=
await
find
Once
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
学会概况
_hgh
学会规章
]},
display
:
STATE
.
是
}
);
let
xueHuiGuiZhangData
=
await
find
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
学会概况
_hgh
学会规章
]},
display
:
STATE
.
是
}
);
for
(
let
i
=
0
;
i
<
xueHuiGuiZhangData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
xueHuiGuiZhangData
.
length
;
i
++
)
{
let
{
id
,
title
,
imgUrl
,
articleTime
}
=
xueHuiGuiZhangData
[
i
];
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
xueHuiGuiZhangData
[
i
];
let
articleDate
=
moment
(
articleTime
)
let
articleDate
=
moment
(
articleTime
)
;
result
.
xueHuiGuiZhang
.
push
({
result
.
xueHuiGuiZhang
.
push
({
id
,
title
,
imgUrl
,
yearAndMonth
:
articleDate
.
format
(
"YYYY-MM"
),
day
:
articleDate
.
format
(
"DD"
)
id
,
title
,
yearAndMonth
:
articleDate
.
format
(
"YYYY-MM"
),
day
:
articleDate
.
format
(
"DD"
),
desc
});
});
}
}
...
@@ -231,8 +231,8 @@ export async function pinPaiXiangMuBanner() {
...
@@ -231,8 +231,8 @@ export async function pinPaiXiangMuBanner() {
let
localBanners
=
[
BANNERPOSITION
.
品牌项目
_hghbanner01
,
BANNERPOSITION
.
品牌项目
_hghbanner02
,
BANNERPOSITION
.
品牌项目
_hghbanner03
];
let
localBanners
=
[
BANNERPOSITION
.
品牌项目
_hghbanner01
,
BANNERPOSITION
.
品牌项目
_hghbanner02
,
BANNERPOSITION
.
品牌项目
_hghbanner03
];
let
bannerData
=
await
find
(
TABLEENUM
.
banner
管理
,
{
location
:{
"$in"
:
localBanners
},
display
:
STATE
.
是
}
);
let
bannerData
=
await
find
(
TABLEENUM
.
banner
管理
,
{
location
:{
"$in"
:
localBanners
},
display
:
STATE
.
是
}
);
bannerData
.
forEach
(
info
=>
{
bannerData
.
forEach
(
info
=>
{
let
{
imgUrl
,
t
itle
,
desc
,
articleUrl
}
=
info
;
let
{
imgUrl
,
articleT
itle
,
desc
,
articleUrl
}
=
info
;
result
.
bannerList
.
push
({
imgUrl
,
title
,
desc
,
articleUrl
});
result
.
bannerList
.
push
({
imgUrl
,
title
:
articleTitle
,
desc
,
articleUrl
});
});
});
return
result
;
return
result
;
}
}
...
@@ -251,7 +251,7 @@ export async function pinPaiXiangMu() {
...
@@ -251,7 +251,7 @@ export async function pinPaiXiangMu() {
};
};
/**乡村振兴 */
/**乡村振兴 */
let
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
乡村振兴
];
let
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
乡村振兴
];
let
xiangCunZhenXingData
=
await
find
(
TABLEENUM
.
文章管理
,
{
location
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
}
);
let
xiangCunZhenXingData
=
await
find
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
}
);
xiangCunZhenXingData
.
forEach
(
info
=>
{
xiangCunZhenXingData
.
forEach
(
info
=>
{
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
result
.
xiangCunZhenXing
.
push
({
result
.
xiangCunZhenXing
.
push
({
...
@@ -260,19 +260,19 @@ export async function pinPaiXiangMu() {
...
@@ -260,19 +260,19 @@ export async function pinPaiXiangMu() {
});
});
/**芳华杯 */
/**芳华杯 */
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
芳华杯
];
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
芳华杯
];
let
fangHuaBeiData
=
await
find
(
TABLEENUM
.
文章管理
,
{
location
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
}
);
let
fangHuaBeiData
=
await
find
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
}
);
fangHuaBeiData
.
forEach
(
info
=>
{
fangHuaBeiData
.
forEach
(
info
=>
{
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
result
.
xiangCunZhenXing
.
push
({
result
.
fangHuaBei
.
push
({
id
,
title
,
imgUrl
,
articleTime
:
moment
(
articleTime
).
format
(
"YYYY-MM-DD"
),
desc
id
,
title
,
imgUrl
,
articleTime
:
moment
(
articleTime
).
format
(
"YYYY-MM-DD"
),
desc
});
});
});
});
/**学术研究 */
/**学术研究 */
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
学术研究
];
locationParam
=
[
ARTICLEPOSITION
.
品牌项目
_hgh
学术研究
];
let
xueShuYanJiuData
=
await
find
(
TABLEENUM
.
文章管理
,
{
location
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
}
);
let
xueShuYanJiuData
=
await
find
(
TABLEENUM
.
文章管理
,
{
articleType
:{
"$in"
:
locationParam
},
display
:
STATE
.
是
}
);
xueShuYanJiuData
.
forEach
(
info
=>
{
xueShuYanJiuData
.
forEach
(
info
=>
{
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
let
{
id
,
title
,
imgUrl
,
articleTime
,
desc
}
=
info
;
result
.
x
iangCunZhenXing
.
push
({
result
.
x
ueShuYanJiu
.
push
({
id
,
title
,
imgUrl
,
articleTime
:
moment
(
articleTime
).
format
(
"YYYY-MM-DD"
),
desc
id
,
title
,
imgUrl
,
articleTime
:
moment
(
articleTime
).
format
(
"YYYY-MM-DD"
),
desc
});
});
});
});
...
@@ -317,7 +317,7 @@ export async function xueshuyanjiu({pageNumber}) {
...
@@ -317,7 +317,7 @@ export async function xueshuyanjiu({pageNumber}) {
*/
*/
export
async
function
xiangCunZhenXing
({
pageNumber
})
{
export
async
function
xiangCunZhenXing
({
pageNumber
})
{
let
findParam
=
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
品牌项目
_hgh
乡村振兴
]},
display
:
STATE
.
是
};
let
findParam
=
{
articleType
:{
"$in"
:[
ARTICLEPOSITION
.
品牌项目
_hgh
乡村振兴
]},
display
:
STATE
.
是
};
let
dataBaseList
=
await
findToPage
(
TABLEENUM
.
文章管理
,
findParam
,
[],
pageNumber
);
let
dataBaseList
=
await
findToPage
(
TABLEENUM
.
文章管理
,
findParam
,
[
"id"
,
"title"
,
"desc"
,
"imgUrl"
,
"articleTime"
],
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
文章管理
,
findParam
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
文章管理
,
findParam
);
let
dataList
=
[];
let
dataList
=
[];
...
...
src/biz/portal/xueHui/xueHuiJiaGou.ts
View file @
e8c82b1d
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
{
ERRORENUM
}
from
"../../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../../config/errorEnum"
;
import
{
addOneData
}
from
"../../../data/add"
;
import
{
add
ManyData
,
add
OneData
}
from
"../../../data/add"
;
import
{
deleteOneData
}
from
"../../../data/delete"
;
import
{
deleteOneData
}
from
"../../../data/delete"
;
import
{
TABLEENUM
}
from
"../../../data/models/model"
;
import
{
TABLEENUM
}
from
"../../../data/models/model"
;
import
{
find
,
findOnce
}
from
"../../../data/select"
;
import
{
find
,
findOnce
}
from
"../../../data/select"
;
...
@@ -14,21 +14,6 @@ import { BizError } from "../../../util/bizError";
...
@@ -14,21 +14,6 @@ import { BizError } from "../../../util/bizError";
import
{
extractData
}
from
"../../../util/piecemeal"
;
import
{
extractData
}
from
"../../../util/piecemeal"
;
/**
* 创建学会架构
* @param userId
* @param param
* @returns
*/
export
async
function
create
({
userId
,
form
})
{
form
.
id
=
generateSystemId
(
TABLEENUM
.
学会架构
,
userId
);
await
addOneData
(
TABLEENUM
.
学会架构
,
form
);
return
successResult
();
}
/**
/**
* 修改
* 修改
...
@@ -80,7 +65,20 @@ export async function del( {userId, id}) {
...
@@ -80,7 +65,20 @@ export async function del( {userId, id}) {
*/
*/
export
async
function
list
()
{
export
async
function
list
()
{
let
dbList
=
await
find
(
TABLEENUM
.
学会架构
,
{});
let
dbList
=
await
find
(
TABLEENUM
.
学会架构
,
{});
let
ct
=
new
Date
().
valueOf
();
if
(
!
dbList
||
!
dbList
.
length
)
{
dbList
=
[];
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
dbList
.
push
({
id
:
`
${
i
}
`
,
departmentName
:
''
,
desc
:
''
,
display
:
1
,
ct
});
};
await
addManyData
(
TABLEENUM
.
学会架构
,
dbList
);
}
let
dataList
=
[];
let
dataList
=
[];
dbList
.
forEach
(
info
=>
{
dbList
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
[
"id"
,
"departmentName"
,
"desc"
,
"display"
]);
let
item
:
any
=
extractData
(
info
,
[
"id"
,
"departmentName"
,
"desc"
,
"display"
]);
...
...
src/config/enum.ts
View file @
e8c82b1d
...
@@ -123,9 +123,8 @@ export enum BANNERPOSITION {
...
@@ -123,9 +123,8 @@ export enum BANNERPOSITION {
* 内容管理文章位置
* 内容管理文章位置
*/
*/
export
enum
ARTICLEPOSITION
{
export
enum
ARTICLEPOSITION
{
首页
_hgh
学会动态
=
1
,
学会概况
_hgh
学会规章
=
1
,
学会概况
_hgh
学会规章
,
动态资讯
_hgh
政策动向
,
动态资讯
_hgh
政策动向
=
3
,
动态资讯
_hgh
学会动态
,
动态资讯
_hgh
学会动态
,
动态资讯
_hgh
行业风采
,
动态资讯
_hgh
行业风采
,
品牌项目
_hgh
乡村振兴
,
品牌项目
_hgh
乡村振兴
,
...
@@ -353,4 +352,10 @@ export enum CERTIFICATETYPE {
...
@@ -353,4 +352,10 @@ export enum CERTIFICATETYPE {
}
}
/**
* 订单状态
*/
export
enum
ORDERSTATE
{
未支付
=
1
,
}
src/data/models/model.ts
View file @
e8c82b1d
...
@@ -83,7 +83,7 @@ enum TABLEENUM {
...
@@ -83,7 +83,7 @@ enum TABLEENUM {
用户表
=
'users'
,
用户表
=
'users'
,
文字资料
=
'wenZiZiLiao'
,
文字资料
=
'wenZiZiLiao'
,
订单表
=
'order'
,
订单表
=
'order'
,
单位所获得科研成果表
=
"
scientificResearch"
,
单位所获得科研成果表
=
"scientificResearch"
,
}
}
const
ModelArray
=
[
const
ModelArray
=
[
...
@@ -427,15 +427,18 @@ const ModelArray = [
...
@@ -427,15 +427,18 @@ const ModelArray = [
id
:{
type
:
'String'
,
index
:
true
},
id
:{
type
:
'String'
,
index
:
true
},
orderYear
:
'String'
,
//订单年度
orderYear
:
'String'
,
//订单年度
unitName
:
'String'
,
//单位名称
unitName
:
'String'
,
//单位名称
orderCycle
:
'String'
,
//订单周期
orderCycleStart
:
'Number'
,
//订单周期开始时间
orderCycleEnd
:
'Number'
,
//订单周期结束时间
money
:
'String'
,
//金额
money
:
'String'
,
//金额
paymentMethod
:
'Number'
,
//付款方式 枚举
paymentMethod
:
'Number'
,
//付款方式 枚举
memberId
:
'String'
,
//会员id
memberId
:
'String'
,
//会员id
loginId
:
'String'
,
//登陆名
memberCategory
:
'Number'
,
//会员类别 枚举
memberCategory
:
'Number'
,
//会员类别 枚举
paymentNum
:
'String'
,
//支付单号
paymentNum
:
'String'
,
//支付单号
(与订单号不一样)
membershipFeesType
:
'Number'
,
//会费类别 枚举
//
membershipFeesType:'Number',//会费类别 枚举
invoiceAdd
:
'String'
,
//发票地址
invoiceAdd
:
'String'
,
//发票
图片
地址
state
:
'Number'
,
//状态 枚举
state
:
'Number'
,
//状态 枚举
isFirst
:{
type
:
'Boolean'
,
default
:
true
},
//首次订单
}
}
},
},
...
...
src/data/models/modelInit.ts
View file @
e8c82b1d
...
@@ -124,7 +124,7 @@ async function initMongoModel(myMongoDB:any) {
...
@@ -124,7 +124,7 @@ async function initMongoModel(myMongoDB:any) {
return
await
dataModels
[
tableName
].
insertMany
(
dataList
);
return
await
dataModels
[
tableName
].
insertMany
(
dataList
);
}
}
dataModels
[
tableName
].
findCount
=
async
function
(
param
)
{
dataModels
[
tableName
].
findCount
=
async
function
(
param
)
{
return
await
dataModels
[
tableName
].
find
(
param
).
count
();
return
await
dataModels
[
tableName
].
find
(
param
).
count
Documents
();
}
}
dataModels
[
tableName
].
updateManyData
=
async
function
(
param
,
updateInfo
)
{
dataModels
[
tableName
].
updateManyData
=
async
function
(
param
,
updateInfo
)
{
return
await
dataModels
[
tableName
].
updateMany
(
param
,
{
$set
:
updateInfo
});
return
await
dataModels
[
tableName
].
updateMany
(
param
,
{
$set
:
updateInfo
});
...
...
src/data/select.ts
View file @
e8c82b1d
...
@@ -5,7 +5,7 @@ import { dataModels } from "./models/modelInit";
...
@@ -5,7 +5,7 @@ import { dataModels } from "./models/modelInit";
export
async
function
findToPage
(
tableEnumValue
:
string
,
param
:
object
,
files
:
object
,
pageNumber
:
number
,
pageSize
?)
{
export
async
function
findToPage
(
tableEnumValue
:
string
,
param
:
object
,
files
:
object
,
pageNumber
:
number
,
pageSize
?)
{
pageSize
=
pageSize
||
10
;
//默认每页10个
pageSize
=
pageSize
||
10
;
//默认每页10个
let
data
=
await
dataModels
[
tableEnumValue
].
find
(
param
,
files
,
pageNumber
,
pageSize
);
let
data
=
await
dataModels
[
tableEnumValue
].
find
(
param
,
files
).
skip
((
pageNumber
-
1
)
*
pageSize
).
limit
(
pageSize
);
return
data
;
return
data
;
}
}
...
...
src/routers/officalWebsite/router.ts
View file @
e8c82b1d
...
@@ -52,7 +52,7 @@ export const Config = {
...
@@ -52,7 +52,7 @@ export const Config = {
"动态资讯"
:[
"动态资讯"
:[
{
{
apiName
:
"动态资讯列表"
,
apiName
:
"动态资讯列表"
,
subUrl
:
'/
xuehuiguizhangxiangqing
'
,
subUrl
:
'/
dongtaizixun
'
,
param
:[
param
:[
{
key
:
"type"
,
type
:
"Number"
,
desc
:
"政策动向学会动态行业风采,参考公用接口"
},
{
key
:
"type"
,
type
:
"Number"
,
desc
:
"政策动向学会动态行业风采,参考公用接口"
},
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"当前页"
},
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"当前页"
},
...
@@ -135,5 +135,5 @@ export const Config = {
...
@@ -135,5 +135,5 @@ export const Config = {
],
],
bindBiz
:
officialWebsiteBiz
.
tongZhiGongGao
bindBiz
:
officialWebsiteBiz
.
tongZhiGongGao
},
},
]
]
,
}
}
\ No newline at end of file
src/routers/portal/router.ts
View file @
e8c82b1d
...
@@ -131,20 +131,20 @@ export const Config = {
...
@@ -131,20 +131,20 @@ export const Config = {
}
}
],
],
"学会概况_学会架构"
:[
"学会概况_学会架构"
:[
{
//
{
apiName
:
"新建"
,
//
apiName:"新建",
subUrl
:
'/xuehui/xuehuijiagou/create'
,
//
subUrl:'/xuehui/xuehuijiagou/create',
param
:[
//
param:[
{
key
:
"form"
,
type
:
"Object"
,
sub
:
//
{key:"form", type:"Object", sub:
{
//
{
departmentName
:{
type
:
"String"
,
desc
:
"组织名称"
},
//
departmentName:{type:"String", desc:"组织名称"},
desc
:{
typs
:
"String"
,
desc
:
"组织介绍"
}
//
desc:{typs:"String", desc:"组织介绍"}
},
//
},
desc
:
"表单"
//
desc:"表单"
}
//
}
],
//
],
bindBiz
:
xueHuiJiaGouBiz
.
create
//
bindBiz:xueHuiJiaGouBiz.create
},
//
},
{
{
apiName
:
"删除"
,
apiName
:
"删除"
,
subUrl
:
'/xuehui/xuehuijiagou/delete'
,
subUrl
:
'/xuehui/xuehuijiagou/delete'
,
...
...
src/routers/router.ts
View file @
e8c82b1d
...
@@ -14,7 +14,7 @@ import * as memberRouter from "./member/router";
...
@@ -14,7 +14,7 @@ import * as memberRouter from "./member/router";
import
*
as
officalWebsiteRouter
from
"./officalWebsite/router"
;
import
*
as
officalWebsiteRouter
from
"./officalWebsite/router"
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
const
Look
=
tru
e
;
//true更新文档
const
Look
=
fals
e
;
//true更新文档
export
async
function
setRouter
(
httpServer
){
export
async
function
setRouter
(
httpServer
){
if
(
Look
)
{
if
(
Look
)
{
...
...
src/tools/system.ts
View file @
e8c82b1d
...
@@ -38,5 +38,13 @@ export function generateToken(userId:string) {
...
@@ -38,5 +38,13 @@ export function generateToken(userId:string) {
* 生成userid
* 生成userid
*/
*/
export
function
generateUserId
()
{
export
function
generateUserId
()
{
return
md5
(
`
${
Math
.
random
()
*
100
}${
new
Date
().
valueOf
()}${
Math
.
random
()
*
10000
}
`
);
return
md5
(
`
${
Math
.
random
()
*
100
}${
new
Date
().
valueOf
()}${
Math
.
floor
(
Math
.
random
()
*
10000
)}
`
);
}
/**
* 生成唯一订单id
*/
export
function
generateOrderId
(
userId
:
string
)
{
return
md5
(
`
${
userId
}${
Math
.
random
()
*
100
}${
new
Date
().
valueOf
()}${
Math
.
floor
(
Math
.
random
()
*
1000
)}
`
);
}
}
\ No newline at end of file
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