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
1fa89991
Commit
1fa89991
authored
Aug 02, 2024
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ad6dddee
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
370 additions
and
83 deletions
+370
-83
msgActivity.ts
src/biz/member/msgActivity.ts
+217
-62
public.ts
src/biz/public.ts
+21
-4
enum.ts
src/config/enum.ts
+22
-7
model.ts
src/data/models/model.ts
+13
-1
main.ts
src/main.ts
+2
-0
router.ts
src/routers/msgActivity/router.ts
+59
-4
router.ts
src/routers/public/router.ts
+22
-1
router.ts
src/routers/router.ts
+3
-3
reqResult.ts
src/tools/reqResult.ts
+1
-1
system.ts
src/tools/system.ts
+10
-0
No files found.
src/biz/member/msgActivity.ts
View file @
1fa89991
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
*/
*/
import
moment
=
require
(
"moment"
);
import
moment
=
require
(
"moment"
);
import
{
ACTIVITYSTATE
,
ACTIVITYTYPE
,
CLIENT
MSGLABLE
,
MEMBERLEVEL
,
MEMBERTYP
E
}
from
"../../config/enum"
;
import
{
ACTIVITYSTATE
,
ACTIVITYTYPE
,
CLIENT
ACTIVITYLABLE
,
CLIENTACTIVITYSTATE
,
CLIENTMSGLABLE
,
MEMBERLEVEL
,
MEMBERTYPE
,
STAT
E
}
from
"../../config/enum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
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
,
findToPage
,
findToSort
,
findToSortToPage
}
from
"../../data/select"
;
import
{
find
,
findCount
,
findOnce
,
findToPage
,
findToSort
,
findToSortToPage
}
from
"../../data/select"
;
import
{
generateSystemId
,
getTodayMs
,
successResult
}
from
"../../tools/system"
;
import
{
generateSystemId
,
getTodayMs
,
success
ErrorResult
,
success
Result
}
from
"../../tools/system"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
...
@@ -85,7 +85,6 @@ export async function getMessageList({msgTitle, effectiveStartTime, effectiveEnd
...
@@ -85,7 +85,6 @@ export async function getMessageList({msgTitle, effectiveStartTime, effectiveEnd
export
async
function
addMessage
({
userId
,
lableId
,
msgTitle
,
effectiveTime
,
msgContent
})
{
export
async
function
addMessage
({
userId
,
lableId
,
msgTitle
,
effectiveTime
,
msgContent
})
{
/**消息Id */
/**消息Id */
const
msgId
=
generateSystemId
(
TABLEENUM
.
消息通知表
,
userId
);
const
msgId
=
generateSystemId
(
TABLEENUM
.
消息通知表
,
userId
);
let
addInfo
=
{
let
addInfo
=
{
msgId
,
msgId
,
lableId
,
lableId
,
...
@@ -93,9 +92,37 @@ export async function addMessage({userId, lableId, msgTitle, effectiveTime, msgC
...
@@ -93,9 +92,37 @@ export async function addMessage({userId, lableId, msgTitle, effectiveTime, msgC
effectiveTime
,
effectiveTime
,
msgContent
msgContent
};
};
await
addOneData
(
TABLEENUM
.
消息通知表
,
addInfo
);
await
addOneData
(
TABLEENUM
.
消息通知表
,
addInfo
);
/**消息对象(标签id)对应的用户新建一条消息未读状态 */
let
selectParam
=
{};
if
(
lableId
.
includes
(
CLIENTMSGLABLE
.
所有人
))
{
selectParam
=
{};
}
else
if
(
lableId
.
includes
(
CLIENTMSGLABLE
.
个人会员
))
{
selectParam
=
{
memberType
:{
"$in"
:
parseInt
(
CLIENTMSGLABLE
.
个人会员
)}}
}
else
if
(
lableId
.
includes
(
CLIENTMSGLABLE
.
单位会员
))
{
selectParam
=
{
memberType
:{
"$in"
:
parseInt
(
CLIENTMSGLABLE
.
单位会员
)}}
}
else
if
(
lableId
.
includes
(
CLIENTMSGLABLE
.
理事
))
{
selectParam
=
{
memberLever
:{
"$in"
:
parseInt
(
CLIENTMSGLABLE
.
理事
)}}
}
else
if
(
lableId
.
includes
(
CLIENTMSGLABLE
.
常务理事
))
{
selectParam
=
{
memberLever
:{
"$in"
:
parseInt
(
CLIENTMSGLABLE
.
常务理事
)}}
}
else
{
selectParam
=
{
lableId
:{
"$in"
:
lableId
}}
}
let
userInfo
=
await
find
(
TABLEENUM
.
用户表
,
selectParam
,
[
"userId"
]);
for
(
let
i
=
0
;
i
<
userInfo
.
length
;
i
++
)
{
/**消息已读Id */
const
readId
=
generateSystemId
(
TABLEENUM
.
消息已读状态表
,
userId
);
let
addReadInfo
=
{
readId
,
msgId
,
userId
:
userInfo
[
i
].
userId
,
isRead
:
STATE
.
否
}
await
addOneData
(
TABLEENUM
.
消息已读状态表
,
addReadInfo
);
}
return
successResult
();
return
successResult
();
}
}
...
@@ -151,41 +178,87 @@ export async function delMessage({msgId}) {
...
@@ -151,41 +178,87 @@ export async function delMessage({msgId}) {
/**
/**
* 消息通知
* 消息通知
* @param userId 会员Id
* @param userId 会员Id
(请求头id)
* @returns
* @returns
*/
*/
export
async
function
noticeMessage
({
userId
})
{
export
async
function
noticeMessage
({
userId
})
{
let
selectParam
:
any
=
{
"$or"
:[{
lableId
:{
"$in"
:
CLIENTMSGLABLE
.
所有人
}
}]};
/**非游客用户通知消息条件 */
if
(
userId
)
{
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
]);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
// if (!userInfo || !userInfo.lableId) throw new BizError(ERRORENUM.目标数据不存在);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
return
successErrorResult
(
"该会员暂无消息通知标签分类"
);
let
nowDate
=
new
Date
().
valueOf
();
let
nowDate
=
new
Date
().
valueOf
();
let
memberType
=
userInfo
.
memberType
.
toString
();
let
memberType
=
userInfo
.
memberType
.
toString
();
let
selectParam
=
{
selectParam
[
"$or"
].
push
(
"$or"
:[
{
lableId
:{
"$in"
:
CLIENTMSGLABLE
.
所有人
}
},
{
lableId
:{
"$in"
:
memberType
}
},
{
lableId
:{
"$in"
:
memberType
}
},
{
{
lableId
:{
"$in"
:
userInfo
.
lableId
},
lableId
:{
"$in"
:
userInfo
.
lableId
},
effectiveTime
:{
"$gt"
:
nowDate
}
//有效时间大于当前时间的消息发送通知
effectiveTime
:{
"$gt"
:
nowDate
}
//有效时间大于当前时间的消息发送通知
}
}
]
)
}
;
}
let
dataList
=
[];
const
SelectFiles
=
[
"msgId"
,
"msgTitle"
,
"effectiveTime"
,
"msgContent"
,
"isPop"
];
const
SelectFiles
=
[
"msgId"
,
"msgTitle"
,
"effectiveTime"
,
"msgContent"
,
"isPop"
];
let
msgInfo
=
await
find
(
TABLEENUM
.
消息通知表
,
selectParam
,
SelectFiles
);
let
msgInfo
=
await
find
(
TABLEENUM
.
消息通知表
,
selectParam
,
SelectFiles
);
if
(
!
msgInfo
||
!
msgInfo
.
msgId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
// if (!msgInfo || !msgInfo.msgId) throw new BizError(ERRORENUM.目标数据不存在);
if
(
msgInfo
)
{
let
dataList
=
[];
msgInfo
.
forEach
(
info
=>
{
msgInfo
.
forEach
(
info
=>
{
if
(
!
info
.
msgId
)
return
successErrorResult
(
"暂无消息通知"
);
})
}
for
(
let
i
=
0
;
i
<
msgInfo
.
length
;
i
++
)
{
let
info
=
msgInfo
[
i
];
let
item
:
any
=
extractData
(
info
,
SelectFiles
);
let
item
:
any
=
extractData
(
info
,
SelectFiles
);
//会员的消息已读数据
let
msgReadInfo
=
await
findOnce
(
TABLEENUM
.
消息已读状态表
,
{
userId
,
msgId
:
item
.
msgId
},
[
"readId"
,
"isRead"
]);
// if(!msgReadInfo) {
// }
item
.
readId
=
msgReadInfo
.
readId
;
item
.
isRead
=
msgReadInfo
.
isRead
;
dataList
.
push
(
item
);
dataList
.
push
(
item
);
}
)
}
return
{
dataList
};
return
{
dataList
};
}
}
/**
/**
* 全部已读
* @param msgId 消息Id
*/
export
async
function
allMsgRead
({
userId
,
msgId
})
{
await
updateOneData
(
TABLEENUM
.
消息已读状态表
,
{
userId
,
msgId
},
{
isRead
:
STATE
.
是
});
return
successResult
();
}
/**
* 修改消息为已读
* @param readId
*/
export
async
function
updateMsgRead
({
readId
})
{
let
msgReadInfo
=
await
findOnce
(
TABLEENUM
.
消息已读状态表
,
{
readId
},
[
"readId"
,
"isRead"
]);
if
(
!
msgReadInfo
||
!
msgReadInfo
.
readId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
msgReadInfo
.
isRead
==
STATE
.
是
)
return
;
await
updateOneData
(
TABLEENUM
.
消息已读状态表
,
{
readId
},
{
readTime
:
new
Date
().
valueOf
(),
isRead
:
STATE
.
是
});
return
successResult
();
}
/**
* 活动通知列表
* 活动通知列表
* @param activityName 活动名称
* @param activityName 活动名称
* @param activityStartTime 活动开始时间
* @param activityStartTime 活动开始时间
...
@@ -204,7 +277,7 @@ export async function getActivityList({activityName, activityStartTime, activity
...
@@ -204,7 +277,7 @@ export async function getActivityList({activityName, activityStartTime, activity
selectParam
[
"activityEndTime"
][
"$lt"
]
=
activityEndTime
;
selectParam
[
"activityEndTime"
][
"$lt"
]
=
activityEndTime
;
}
}
const
SelectFiles
=
[
"activityId"
,
"activityType"
,
"activityStartTime"
,
"activityEndTime"
,
"activityAdd"
,
"enrollStartTime"
,
"enrollEndTime"
,
"lableId"
,
"isTopUp"
];
const
SelectFiles
=
[
"activityId"
,
"activity
Name"
,
"activity
Type"
,
"activityStartTime"
,
"activityEndTime"
,
"activityAdd"
,
"enrollStartTime"
,
"enrollEndTime"
,
"lableId"
,
"isTopUp"
];
let
dbList
=
await
findToSortToPage
(
TABLEENUM
.
活动通知表
,
selectParam
,
SelectFiles
,
{
activityStartTime
:
-
1
},
pageNumber
);
let
dbList
=
await
findToSortToPage
(
TABLEENUM
.
活动通知表
,
selectParam
,
SelectFiles
,
{
activityStartTime
:
-
1
},
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
活动通知表
,
selectParam
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
活动通知表
,
selectParam
);
...
@@ -212,12 +285,23 @@ export async function getActivityList({activityName, activityStartTime, activity
...
@@ -212,12 +285,23 @@ export async function getActivityList({activityName, activityStartTime, activity
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
item
:
any
=
extractData
(
info
,
SelectFiles
);
let
item
:
any
=
extractData
(
info
,
SelectFiles
);
/**标签id处理为标签名称 */
if
(
info
.
lableId
==
0
||
info
.
lableId
==
1
||
info
.
lableId
==
2
)
{
item
.
lableId
=
changeEnumValue
(
CLIENTMSGLABLE
,
info
.
lableId
);
}
else
{
item
.
lableId
=
[];
item
.
lableId
=
[];
/**处理固定消息对象 */
for
(
let
lableId
=
0
;
lableId
<
info
.
lableId
.
length
;
lableId
++
)
{
for
(
let
key
in
CLIENTACTIVITYLABLE
)
{
let
anyKey
:
any
=
key
;
if
(
isNaN
(
anyKey
))
{
let
value
=
CLIENTACTIVITYLABLE
[
key
];
if
(
info
.
lableId
[
lableId
]
==
value
)
{
item
.
lableId
.
push
(
anyKey
);
}
}
}
}
/**处理消息对象返回标签名称 */
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{
lableId
:{
"$in"
:
info
.
lableId
}},
[
"lableName"
]);
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{
lableId
:{
"$in"
:
info
.
lableId
}},
[
"lableName"
]);
if
(
lableInfo
)
{
lableInfo
.
forEach
(
lableItem
=>
{
lableInfo
.
forEach
(
lableItem
=>
{
item
.
lableId
.
push
(
lableItem
.
lableName
);
item
.
lableId
.
push
(
lableItem
.
lableName
);
});
});
...
@@ -225,8 +309,8 @@ export async function getActivityList({activityName, activityStartTime, activity
...
@@ -225,8 +309,8 @@ export async function getActivityList({activityName, activityStartTime, activity
/**枚举值、时间格式转换 */
/**枚举值、时间格式转换 */
item
.
activityType
=
changeEnumValue
(
ACTIVITYTYPE
,
info
.
activityType
);
item
.
activityType
=
changeEnumValue
(
ACTIVITYTYPE
,
info
.
activityType
);
item
.
activityStartTime
=
moment
(
item
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
i
f
(
item
.
activityStartTime
)
i
tem
.
activityStartTime
=
moment
(
item
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
item
.
activityEndTime
=
moment
(
item
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
i
f
(
item
.
activityEndTime
)
i
tem
.
activityEndTime
=
moment
(
item
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
item
.
enrollStartTime
=
moment
(
item
.
enrollStartTime
).
format
(
"YYYY-MM-DD"
);
item
.
enrollStartTime
=
moment
(
item
.
enrollStartTime
).
format
(
"YYYY-MM-DD"
);
item
.
enrollEndTime
=
moment
(
item
.
enrollEndTime
).
format
(
"YYYY-MM-DD"
);
item
.
enrollEndTime
=
moment
(
item
.
enrollEndTime
).
format
(
"YYYY-MM-DD"
);
...
@@ -239,7 +323,7 @@ export async function getActivityList({activityName, activityStartTime, activity
...
@@ -239,7 +323,7 @@ export async function getActivityList({activityName, activityStartTime, activity
/**
/**
* 新建活动
* 新建活动
* @param userId 会员id
* @param userId 会员id
(请求头id)
* @param form 新建活动表单 activityType, activityName, enrollForm, activityAdd, activityTime, lableId, enrollTime, activityContent
* @param form 新建活动表单 activityType, activityName, enrollForm, activityAdd, activityTime, lableId, enrollTime, activityContent
* @returns
* @returns
*/
*/
...
@@ -257,9 +341,30 @@ export async function addActivity({userId, form}) {
...
@@ -257,9 +341,30 @@ export async function addActivity({userId, form}) {
/**
/**
* 获取活动详细-修改回显
* @param param0
* @returns
*/
export
async
function
getActivityDetailed
({
activityId
})
{
let
SelectFiles
=
[
"activityId"
,
"activityType"
,
"activityName"
,
"enrollForm"
,
"activityAdd"
,
"activityStartTime"
,
"activityEndTime"
,
"enrollStartTime"
,
"enrollEndTime"
,
"activityContent"
,
"lableId"
];
let
activityInfo
=
await
findOnce
(
TABLEENUM
.
活动通知表
,
{
activityId
},
SelectFiles
);
if
(
!
activityInfo
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
dataList
:
any
=
extractData
(
activityInfo
,
SelectFiles
);
if
(
dataList
.
activityStartTime
)
dataList
.
activityStartTime
=
moment
(
dataList
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
if
(
dataList
.
activityEndTime
)
dataList
.
activityEndTime
=
moment
(
dataList
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
dataList
.
enrollStartTime
=
moment
(
dataList
.
enrollStartTime
).
format
(
"YYYY-MM-DD"
);
dataList
.
enrollEndTime
=
moment
(
dataList
.
enrollEndTime
).
format
(
"YYYY-MM-DD"
);
return
{
dataList
};
}
/**
* 修改活动
* 修改活动
* @param activityId 活动id
* @param activityId 活动id
* @param form 新建活动表单 activityType, activityName, enrollForm, activityAdd, activity
Time, lableId, enroll
Time, activityContent
* @param form 新建活动表单 activityType, activityName, enrollForm, activityAdd, activity
StartTime, activityEndTime, lableId, enrollStartTime, enrollEnd
Time, activityContent
* @returns
* @returns
*/
*/
export
async
function
updateActivity
({
activityId
,
form
})
{
export
async
function
updateActivity
({
activityId
,
form
})
{
...
@@ -333,16 +438,13 @@ export async function enrollList({activityId}) {
...
@@ -333,16 +438,13 @@ export async function enrollList({activityId}) {
/**
/**
* 根据选择的会员下载报名表
* 根据选择的会员下载报名表
* @param
userI
d 会员Id
* @param
i
d 会员Id
*/
*/
export
async
function
getEnrollUrl
({
userId
})
{
export
async
function
getEnrollUrl
({
id
})
{
let
activityInfo
=
await
find
(
TABLEENUM
.
活动通知表
,
{
userId
},
[
"enrollUrl"
]);
let
activityInfo
=
await
find
(
TABLEENUM
.
活动报名表
,
{
userId
:
id
},
[
"userId"
,
"activityId"
,
"enrollUrl"
]);
if
(
!
activityInfo
||
!
activityInfo
.
enrollUrl
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
return
{
activityInfo
};
}
}
...
@@ -363,27 +465,42 @@ export async function activityEnrollForm({activityId}) {
...
@@ -363,27 +465,42 @@ export async function activityEnrollForm({activityId}) {
/**
/**
* 申请报名表
* 申请报名表
* @param userId 会员Id
* @param userId 会员Id
(请求头id)
* @param activityId 活动id
* @param activityId 活动id
* @param enrollUrl 已填报报名表地址
* @param enrollUrl 已填报报名表地址
*/
*/
export
async
function
activityEnroll
({
userId
,
activityId
,
enrollUrl
})
{
export
async
function
activityEnroll
({
userId
,
activityId
,
enrollUrl
})
{
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
,
"memberLevel"
]);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
memberType
=
userInfo
.
memberType
.
toString
();
let
selectParam
=
{
let
selectParam
=
{
activityId
,
activityId
,
"$or"
:[
"$or"
:[
{
lableId
:{
"$in"
:
CLIENTMSGLABLE
.
所有人
}
},
{
lableId
:{
"$in"
:
memberType
}
},
{
{
lableId
:{
"$in"
:
userInfo
.
lableId
},
lableId
:{
"$in"
:
userInfo
.
lableId
},
}
}
]
]
};
};
let
memberType
=
""
;
let
memberLevel
=
""
;
if
(
userInfo
.
memberType
)
{
memberType
=
changeEnumValue
(
MEMBERTYPE
,
userInfo
.
memberType
);
selectParam
[
"$or"
].
push
({
lableId
:{
"$in"
:
memberType
}
});
}
if
(
userInfo
.
memberLevel
)
{
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
userInfo
.
memberLevel
);
selectParam
[
"$or"
].
push
({
lableId
:{
"$in"
:
memberLevel
}
});
}
let
activityInfo
=
await
find
(
TABLEENUM
.
活动通知表
,
selectParam
,
[
"lableId"
]);
let
activityInfo
=
await
find
(
TABLEENUM
.
活动通知表
,
selectParam
,
[
"lableId"
]);
if
(
!
activityInfo
||
!
activityInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
用户没有在此活动对象内
);
if
(
activityInfo
)
{
activityInfo
.
forEach
(
info
=>
{
if
(
!
info
.
lableId
)
{
return
successErrorResult
(
"用户没有在此活动对象范围内"
);
// throw new BizError(ERRORENUM.用户没有在此活动对象内, "用户没有在此活动对象范围内");
}
})
}
/**消息Id */
/**消息Id */
const
enrollId
=
generateSystemId
(
TABLEENUM
.
活动报名表
,
userId
);
const
enrollId
=
generateSystemId
(
TABLEENUM
.
活动报名表
,
userId
);
...
@@ -396,44 +513,51 @@ export async function activityEnroll({userId, activityId, enrollUrl}) {
...
@@ -396,44 +513,51 @@ export async function activityEnroll({userId, activityId, enrollUrl}) {
}
}
await
addOneData
(
TABLEENUM
.
活动报名表
,
addInfo
);
await
addOneData
(
TABLEENUM
.
活动报名表
,
addInfo
);
// await updateOneData(TABLEENUM.活动通知表, {activityId}, {activityState:ACTIVITYSTATE.已参加});
// await updateOneData(TABLEENUM.活动通知表, {activityId}, {activityState:ACTIVITYSTATE.已参加});
return
successResult
();
return
successResult
();
}
}
/**
/**
* 会员个人页-查看活动
* 会员个人页-查看活动
* 根据登录的用户id查询标签id,获取活动通知里对应标签id的所有活动
* 根据登录的用户id查询标签id,获取活动通知里对应标签id的所有活动
* @param userId 会员Id
* @param userId 会员Id
(请求头id)
*/
*/
export
async
function
seeActivity
({
userId
})
{
export
async
function
seeActivity
({
userId
})
{
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
,
"memberLevel"
]);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
memberType
=
userInfo
.
memberType
.
toString
();
let
selectParam
=
{
let
selectParam
=
{
"$or"
:[
"$or"
:[
{
lableId
:{
"$in"
:
CLIENTMSGLABLE
.
所有人
}
},
{
lableId
:{
"$in"
:
memberType
}
},
{
{
lableId
:{
"$in"
:
userInfo
.
lableId
},
lableId
:{
"$in"
:
userInfo
.
lableId
},
}
}
],
],
activityState
:{
"$nin"
:
ACTIVITYSTATE
.
已结束
}
activityState
:{
"$nin"
:
ACTIVITYSTATE
.
已结束
}
};
};
let
memberType
=
""
;
let
memberLevel
=
""
;
if
(
userInfo
.
memberType
)
{
memberType
=
changeEnumValue
(
MEMBERTYPE
,
userInfo
.
memberType
);
selectParam
[
"$or"
].
push
({
lableId
:{
"$in"
:
memberType
}
});
}
if
(
userInfo
.
memberLevel
)
{
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
userInfo
.
memberLevel
);
selectParam
[
"$or"
].
push
({
lableId
:{
"$in"
:
memberLevel
}
});
}
let
SelectFiles
=
[
"activityId"
,
"activityName"
,
"activityStartTime"
,
"activityEndTime"
];
let
SelectFiles
=
[
"activityId"
,
"activityName"
,
"activityStartTime"
,
"activityEndTime"
];
// let activityInfo = await find(TABLEENUM.活动通知表, selectParam, SelectFiles);
// let activityInfo = await find(TABLEENUM.活动通知表, selectParam, SelectFiles);
let
activityInfo
=
await
findToSort
(
TABLEENUM
.
活动通知表
,
selectParam
,
SelectFiles
,
{
activityStartTime
:
-
1
}
);
let
activityInfo
=
await
findToSort
(
TABLEENUM
.
活动通知表
,
selectParam
,
{
activityStartTime
:
-
1
},
SelectFiles
);
if
(
!
activityInfo
||
!
activityInfo
.
length
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
activityInfo
||
!
activityInfo
.
length
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
dataList
=
[];
let
dataList
=
[];
activityInfo
.
forEach
(
info
=>
{
activityInfo
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
SelectFiles
);
let
item
:
any
=
extractData
(
info
,
SelectFiles
);
item
.
activityStartTime
=
moment
(
item
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
// item.activityStartTime = moment(item.activityStartTime).format("YYYY-MM-DD");
item
.
activityEndTime
=
moment
(
item
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
// item.activityEndTime = moment(item.activityEndTime).format("YYYY-MM-DD");
if
(
item
.
activityStartTime
)
item
.
activityStartTime
=
moment
(
item
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
if
(
item
.
activityEndTime
)
item
.
activityEndTime
=
moment
(
item
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
dataList
.
push
(
item
);
dataList
.
push
(
item
);
})
})
...
@@ -443,28 +567,34 @@ export async function seeActivity({userId}) {
...
@@ -443,28 +567,34 @@ export async function seeActivity({userId}) {
/**
/**
* 会员个人页-查看更多活动列表
* 会员个人页-查看更多活动列表
* @param userId 会员Id
* @param userId 会员Id
(请求头id)
* @param param0
* @param param0
*/
*/
export
async
function
homeActivityList
({
userId
,
activityState
})
{
export
async
function
homeActivityList
({
userId
,
activityState
,
pageNumber
})
{
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
,
"memberLevel"
]);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
if
(
!
userInfo
||
!
userInfo
.
lableId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
memberType
=
userInfo
.
memberType
.
toString
();
let
selectParam
:
any
=
{
let
selectParam
:
any
=
{
"$or"
:[
"$or"
:[
{
lableId
:{
"$in"
:
CLIENTMSGLABLE
.
所有人
}
},
{
lableId
:{
"$in"
:
memberType
}
},
{
{
lableId
:{
"$in"
:
userInfo
.
lableId
},
lableId
:{
"$in"
:
userInfo
.
lableId
},
}
}
]
]
};
};
if
(
activityState
)
selectParam
.
activityState
=
activityState
;
let
memberType
=
""
;
let
memberLevel
=
""
;
if
(
userInfo
.
memberType
)
{
memberType
=
changeEnumValue
(
MEMBERTYPE
,
userInfo
.
memberType
);
selectParam
[
"$or"
].
push
({
lableId
:{
"$in"
:
memberType
}
});
}
if
(
userInfo
.
memberLevel
)
{
memberLevel
=
changeEnumValue
(
MEMBERLEVEL
,
userInfo
.
memberLevel
);
selectParam
[
"$or"
].
push
({
lableId
:{
"$in"
:
memberLevel
}
});
}
if
(
activityState
==
ACTIVITYSTATE
.
已结束
)
selectParam
.
activityState
=
activityState
;
if
(
activityState
==
ACTIVITYSTATE
.
已结束
)
selectParam
.
activityState
=
activityState
;
if
(
activityState
==
"已参加"
)
{
if
(
activityState
==
CLIENTACTIVITYSTATE
.
已参加
)
{
let
activityInfo
=
await
find
(
TABLEENUM
.
活动报名表
,
{
userId
},
[
"activityId"
]);
let
activityInfo
=
await
find
(
TABLEENUM
.
活动报名表
,
{
userId
},
[
"activityId"
]);
activityInfo
.
forEach
(
info
=>
{
activityInfo
.
forEach
(
info
=>
{
if
(
selectParam
.
activityId
)
selectParam
=
{
activityId
:[]};
if
(
selectParam
.
activityId
)
selectParam
=
{
activityId
:[]};
...
@@ -474,21 +604,46 @@ export async function homeActivityList({userId, activityState}) {
...
@@ -474,21 +604,46 @@ export async function homeActivityList({userId, activityState}) {
let
SelectFiles
=
[
"activityId"
,
"activityName"
,
"activityStartTime"
,
"activityEndTime"
];
let
SelectFiles
=
[
"activityId"
,
"activityName"
,
"activityStartTime"
,
"activityEndTime"
];
// let activityInfo = await find(TABLEENUM.活动通知表, selectParam, SelectFiles);
// let activityInfo = await find(TABLEENUM.活动通知表, selectParam, SelectFiles);
let
activityInfo
=
await
findToSort
(
TABLEENUM
.
活动通知表
,
selectParam
,
SelectFiles
,
{
activityStartTime
:
-
1
});
if
(
!
activityInfo
||
!
activityInfo
.
length
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
activityInfo
=
await
findToSortToPage
(
TABLEENUM
.
活动通知表
,
selectParam
,
SelectFiles
,
{
activityStartTime
:
-
1
},
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
活动通知表
,
selectParam
);
let
dataList
=
[];
let
dataList
=
[];
if
(
activityInfo
)
{
activityInfo
.
forEach
(
info
=>
{
activityInfo
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
SelectFiles
);
let
item
:
any
=
extractData
(
info
,
SelectFiles
);
item
.
activityStartTime
=
moment
(
item
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
// item.activityStartTime = moment(item.activityStartTime).format("YYYY-MM-DD");
item
.
activityEndTime
=
moment
(
item
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
// item.activityEndTime = moment(item.activityEndTime).format("YYYY-MM-DD");
if
(
item
.
activityStartTime
)
item
.
activityStartTime
=
moment
(
item
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
if
(
item
.
activityEndTime
)
item
.
activityEndTime
=
moment
(
item
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
dataList
.
push
(
item
);
dataList
.
push
(
item
);
});
});
}
return
{
dataList
};
return
{
dataList
,
dataCount
};
}
}
/**
* 会员个人页-查看更多活动详细
* @param activityId
* @returns
*/
export
async
function
homeActivityDetailed
({
activityId
})
{
let
SelectFiles
=
[
"activityId"
,
"activityName"
,
"activityStartTime"
,
"activityEndTime"
,
"enrollStartTime"
,
"enrollEndTime"
,
"activityAdd"
,
"activityContent"
];
let
activityInfo
=
await
findOnce
(
TABLEENUM
.
活动通知表
,
{
activityId
},
SelectFiles
);
if
(
!
activityInfo
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
let
dataList
:
any
=
extractData
(
activityInfo
,
SelectFiles
);
if
(
dataList
.
activityStartTime
)
dataList
.
activityStartTime
=
moment
(
dataList
.
activityStartTime
).
format
(
"YYYY-MM-DD"
);
if
(
dataList
.
activityEndTime
)
dataList
.
activityEndTime
=
moment
(
dataList
.
activityEndTime
).
format
(
"YYYY-MM-DD"
);
dataList
.
enrollStartTime
=
moment
(
dataList
.
enrollStartTime
).
format
(
"YYYY-MM-DD"
);
dataList
.
enrollEndTime
=
moment
(
dataList
.
enrollEndTime
).
format
(
"YYYY-MM-DD"
);
return
{
dataList
};
}
// -------------------------
// -------------------------
...
@@ -496,7 +651,7 @@ export async function homeActivityList({userId, activityState}) {
...
@@ -496,7 +651,7 @@ export async function homeActivityList({userId, activityState}) {
* 活动状态切换
* 活动状态切换
* 设置定时器,每一小时检查一次活动状态
* 设置定时器,每一小时检查一次活动状态
*/
*/
export
function
initActivity
()
{
export
async
function
initActivity
()
{
setInterval
(
async
function
()
{
setInterval
(
async
function
()
{
await
updateActivityState
();
await
updateActivityState
();
},
3600
*
1000
);
},
3600
*
1000
);
...
...
src/biz/public.ts
View file @
1fa89991
import
moment
=
require
(
"moment"
);
import
moment
=
require
(
"moment"
);
import
{
ARTICLEPOSITION
,
CLIENTMSGLABLE
,
DONGTAIZIXUNSUBTYPE
,
PARTYBUILDSUBTYPEENUM
,
PARTYBUILDTYPEENUM
}
from
"../config/enum"
;
import
{
ARTICLEPOSITION
,
CLIENT
ACTIVITYLABLE
,
CLIENT
MSGLABLE
,
DONGTAIZIXUNSUBTYPE
,
PARTYBUILDSUBTYPEENUM
,
PARTYBUILDTYPEENUM
}
from
"../config/enum"
;
import
{
TABLEENUM
}
from
"../data/models/model"
;
import
{
TABLEENUM
}
from
"../data/models/model"
;
import
{
find
}
from
"../data/select"
;
import
{
find
}
from
"../data/select"
;
import
{
getEdition
}
from
"../tools/system"
;
import
{
getEdition
}
from
"../tools/system"
;
...
@@ -115,17 +115,34 @@ export async function getSession() {
...
@@ -115,17 +115,34 @@ export async function getSession() {
/**
/**
* 获取通知对象
* 获取通知对象
*/
*/
export
async
function
getMsgNoticeObject
()
{
let
lableData
=
setEnumInterface
({
defaultParam
:
CLIENTMSGLABLE
});
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{},
[
"lableId"
,
"lableName"
]);
lableInfo
.
forEach
(
info
=>
{
let
item
=
{
key
:
info
.
lableName
,
value
:
info
.
lableId
}
lableData
.
dataList
.
push
(
item
);
})
return
{
lableData
};
}
/**
* 获取通知对象
*/
export
async
function
getNoticeObject
()
{
export
async
function
getNoticeObject
()
{
let
msgLable
=
setEnumInterface
({
defaultParam
:
CLIENTMSG
LABLE
});
let
lableData
=
setEnumInterface
({
defaultParam
:
CLIENTACTIVITY
LABLE
});
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{},
[
"lableId"
,
"lableName"
]);
let
lableInfo
=
await
find
(
TABLEENUM
.
标签表
,
{},
[
"lableId"
,
"lableName"
]);
lableInfo
.
forEach
(
info
=>
{
lableInfo
.
forEach
(
info
=>
{
let
item
=
{
key
:
info
.
lableName
,
value
:
info
.
lableId
}
let
item
=
{
key
:
info
.
lableName
,
value
:
info
.
lableId
}
msgLable
.
dataList
.
push
(
item
);
lableData
.
dataList
.
push
(
item
);
})
})
return
{
msgLable
};
return
{
lableData
};
}
}
src/config/enum.ts
View file @
1fa89991
...
@@ -670,7 +670,8 @@ export enum OOSCODE {
...
@@ -670,7 +670,8 @@ export enum OOSCODE {
会费发票
,
会费发票
,
个人会员详情
=
15
,
个人会员详情
=
15
,
单位会员详情
,
单位会员详情
,
注册信息
注册信息
,
退款凭证
=
18
,
}
}
...
@@ -678,9 +679,23 @@ export enum OOSCODE {
...
@@ -678,9 +679,23 @@ export enum OOSCODE {
* 消息通知-除标签外固定通知类型
* 消息通知-除标签外固定通知类型
*/
*/
export
enum
CLIENTMSGLABLE
{
export
enum
CLIENTMSGLABLE
{
所有人
=
"0"
,
所有人
=
"所有人(包括游客)"
,
//所有人(包括游客)
个人会员
=
"1"
,
个人会员
=
"个人会员"
,
单位会员
=
"2"
单位会员
=
"单位会员"
,
理事
=
"理事会员"
,
常务理事
=
"常务理事会员"
,
}
/**
* 活动通知-除标签外固定通知类型
*/
export
enum
CLIENTACTIVITYLABLE
{
个人会员
=
"个人会员"
,
单位会员
=
"单位会员"
,
理事
=
"理事会员"
,
常务理事
=
"常务理事会员"
,
}
}
...
@@ -707,8 +722,8 @@ export enum ACTIVITYSTATE {
...
@@ -707,8 +722,8 @@ export enum ACTIVITYSTATE {
* 前端参数
* 前端参数
*/
*/
export
enum
CLIENTACTIVITYSTATE
{
export
enum
CLIENTACTIVITYSTATE
{
已开始
=
1
,
全部
=
0
,
已结束
,
已结束
=
2
,
已参加
已参加
,
}
}
src/data/models/model.ts
View file @
1fa89991
...
@@ -91,6 +91,7 @@ enum TABLEENUM {
...
@@ -91,6 +91,7 @@ enum TABLEENUM {
订单审批历史表
=
"orderApprovalHistory"
,
订单审批历史表
=
"orderApprovalHistory"
,
标签表
=
"lable"
,
标签表
=
"lable"
,
消息通知表
=
"massageNotice"
,
消息通知表
=
"massageNotice"
,
消息已读状态表
=
"massageReads"
,
活动通知表
=
"activityNotice"
,
活动通知表
=
"activityNotice"
,
活动报名表
=
"sctivityEnroll"
活动报名表
=
"sctivityEnroll"
}
}
...
@@ -528,7 +529,18 @@ const ModelArray = [
...
@@ -528,7 +529,18 @@ const ModelArray = [
effectiveTime
:
'Number'
,
//有效时间
effectiveTime
:
'Number'
,
//有效时间
msgContent
:
'String'
,
//消息内容
msgContent
:
'String'
,
//消息内容
lableId
:{
type
:
'[String]'
,
default
:[]},
//消息对象 标签id 外键
lableId
:{
type
:
'[String]'
,
default
:[]},
//消息对象 标签id 外键
isPop
:{
type
:
'Number'
,
default
:
STATE
.
否
}
isPop
:{
type
:
'Number'
,
default
:
STATE
.
否
}
//是否弹窗
}
},
{
tableName
:
TABLEENUM
.
消息已读状态表
,
source
:
TABLESOURCEENUM
.
mongo
,
schema
:{
readId
:{
type
:
'String'
,
index
:
true
},
//消息已读id
msgId
:
'String'
,
//消息id
userId
:
'String'
,
//用户id
readTime
:
'Number'
,
//阅读时间
isRead
:{
type
:
'Number'
,
default
:
STATE
.
否
}
//是否已读
}
}
},
},
{
{
...
...
src/main.ts
View file @
1fa89991
import
{
initActivity
}
from
"./biz/member/msgActivity"
;
import
{
initAdmin
}
from
"./biz/member/rightsMgmt"
;
import
{
initAdmin
}
from
"./biz/member/rightsMgmt"
;
import
{
t
}
from
"./biz/provide"
;
import
{
t
}
from
"./biz/provide"
;
import
{
initSMS
}
from
"./biz/sms"
;
import
{
initSMS
}
from
"./biz/sms"
;
...
@@ -18,6 +19,7 @@ async function lanuch() {
...
@@ -18,6 +19,7 @@ async function lanuch() {
await
initSMS
();
await
initSMS
();
await
initAdmin
();
await
initAdmin
();
await
initSystemTask
();
await
initSystemTask
();
await
initActivity
();
// await test1();
// await test1();
// await inputData(); 20240520日导入数据
// await inputData(); 20240520日导入数据
...
...
src/routers/msgActivity/router.ts
View file @
1fa89991
...
@@ -66,7 +66,29 @@ export const Config = {
...
@@ -66,7 +66,29 @@ export const Config = {
{
key
:
"msgId"
,
type
:
"String"
,
desc
:
"消息Id"
},
{
key
:
"msgId"
,
type
:
"String"
,
desc
:
"消息Id"
},
],
],
bindBiz
:
msgActivityBiz
.
delMessage
bindBiz
:
msgActivityBiz
.
delMessage
}
},
{
apiName
:
"消息通知"
,
subUrl
:
'/msgdb/noticemessage'
,
param
:[],
bindBiz
:
msgActivityBiz
.
noticeMessage
},
{
apiName
:
"全部已读"
,
subUrl
:
'/msgdb/allmsgread'
,
param
:[
{
key
:
"msgId"
,
type
:
"String"
,
desc
:
"消息Id"
},
],
bindBiz
:
msgActivityBiz
.
allMsgRead
},
{
apiName
:
"修改消息为已读"
,
subUrl
:
'/msgdb/allmsgread'
,
param
:[
{
key
:
"readId"
,
type
:
"String"
,
desc
:
"消息已读Id"
},
],
bindBiz
:
msgActivityBiz
.
updateMsgRead
},
],
],
"活动通知"
:[
"活动通知"
:[
{
{
...
@@ -93,7 +115,7 @@ export const Config = {
...
@@ -93,7 +115,7 @@ export const Config = {
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
lableId
:{
type
:
'
String
'
,
desc
:
'活动对象(标签Id)'
},
lableId
:{
type
:
'
[String]
'
,
desc
:
'活动对象(标签Id)'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
...
@@ -115,7 +137,7 @@ export const Config = {
...
@@ -115,7 +137,7 @@ export const Config = {
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
},
lableId
:{
type
:
'
String
'
,
desc
:
'活动对象(标签Id)'
},
lableId
:{
type
:
'
[String]
'
,
desc
:
'活动对象(标签Id)'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
...
@@ -125,6 +147,14 @@ export const Config = {
...
@@ -125,6 +147,14 @@ export const Config = {
bindBiz
:
msgActivityBiz
.
addActivity
bindBiz
:
msgActivityBiz
.
addActivity
},
},
{
{
apiName
:
"获取活动详细-修改回显"
,
subUrl
:
'/activitydb/activitydetailed'
,
param
:[
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
bindBiz
:
msgActivityBiz
.
getActivityDetailed
},
{
apiName
:
"修改活动"
,
apiName
:
"修改活动"
,
subUrl
:
'/activitydb/updateactivity'
,
subUrl
:
'/activitydb/updateactivity'
,
param
:[
param
:[
...
@@ -136,7 +166,7 @@ export const Config = {
...
@@ -136,7 +166,7 @@ export const Config = {
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityAdd
:{
type
:
'String'
,
desc
:
'活动地点'
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityStartTime
:{
type
:
'Number'
,
desc
:
'活动开始时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
activityEndTime
:{
type
:
'Number'
,
desc
:
'活动结束时间'
,
notMustHave
:
true
},
lableId
:{
type
:
'
String
'
,
desc
:
'活动对象(标签Id)'
},
lableId
:{
type
:
'
[String]
'
,
desc
:
'活动对象(标签Id)'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollStartTime
:{
type
:
'Number'
,
desc
:
'报名开始时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
enrollEndTime
:{
type
:
'Number'
,
desc
:
'报名结束时间'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
activityContent
:{
type
:
'String'
,
desc
:
'详细内容'
},
...
@@ -172,10 +202,26 @@ export const Config = {
...
@@ -172,10 +202,26 @@ export const Config = {
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
],
bindBiz
:
msgActivityBiz
.
enrollList
bindBiz
:
msgActivityBiz
.
enrollList
},
{
apiName
:
"根据选择的会员下载报名表"
,
subUrl
:
'/activitydb/enrollurl'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"用户id"
}
],
bindBiz
:
msgActivityBiz
.
getEnrollUrl
}
}
],
],
"会员个人页活动通知"
:[
"会员个人页活动通知"
:[
{
{
apiName
:
"下载报名表"
,
subUrl
:
'/homepage/activityenrollform'
,
param
:[
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
bindBiz
:
msgActivityBiz
.
activityEnrollForm
},
{
apiName
:
"申请报名表"
,
apiName
:
"申请报名表"
,
subUrl
:
'/homepage/activityenroll'
,
subUrl
:
'/homepage/activityenroll'
,
param
:[
param
:[
...
@@ -195,9 +241,18 @@ export const Config = {
...
@@ -195,9 +241,18 @@ export const Config = {
subUrl
:
'/homepage/activitylist'
,
subUrl
:
'/homepage/activitylist'
,
param
:[
param
:[
{
key
:
"activityState"
,
type
:
"Number"
,
desc
:
"活动状态"
},
{
key
:
"activityState"
,
type
:
"Number"
,
desc
:
"活动状态"
},
{
key
:
"pageNumber"
,
type
:
"Number"
,
desc
:
"当前页"
}
],
],
bindBiz
:
msgActivityBiz
.
homeActivityList
bindBiz
:
msgActivityBiz
.
homeActivityList
},
},
{
apiName
:
"查看更多活动列表-详情"
,
subUrl
:
'/homepage/activitydetailed'
,
param
:[
{
key
:
"activityId"
,
type
:
"String"
,
desc
:
"活动Id"
},
],
bindBiz
:
msgActivityBiz
.
homeActivityDetailed
},
]
]
}
}
...
...
src/routers/public/router.ts
View file @
1fa89991
...
@@ -258,6 +258,12 @@ export const Config = {
...
@@ -258,6 +258,12 @@ export const Config = {
apiName
:
"消息对象固定类型"
,
apiName
:
"消息对象固定类型"
,
subUrl
:
'/msglabletype'
,
subUrl
:
'/msglabletype'
,
param
:[],
param
:[],
bindBiz
:
publicBiz
.
getMsgNoticeObject
},
{
apiName
:
"活动对象固定类型"
,
subUrl
:
'/activitylabletype'
,
param
:[],
bindBiz
:
publicBiz
.
getNoticeObject
bindBiz
:
publicBiz
.
getNoticeObject
},
},
{
{
...
@@ -273,6 +279,21 @@ export const Config = {
...
@@ -273,6 +279,21 @@ export const Config = {
param
:[],
param
:[],
defaultParam
:
enumConfig
.
STATE
,
defaultParam
:
enumConfig
.
STATE
,
bindBiz
:
publicBiz
.
setEnumInterface
bindBiz
:
publicBiz
.
setEnumInterface
}
},
{
apiName
:
"活动状态"
,
subUrl
:
'/activitystate'
,
param
:[],
defaultParam
:
enumConfig
.
CLIENTACTIVITYSTATE
,
bindBiz
:
publicBiz
.
setEnumInterface
},
{
apiName
:
"活动类型"
,
subUrl
:
'/activitytype'
,
param
:[],
defaultParam
:
enumConfig
.
ACTIVITYTYPE
,
bindBiz
:
publicBiz
.
setEnumInterface
},
],
],
}
}
src/routers/router.ts
View file @
1fa89991
...
@@ -22,15 +22,15 @@ import * as asyncHandler from 'express-async-handler';
...
@@ -22,15 +22,15 @@ import * as asyncHandler from 'express-async-handler';
import
{
payCallback
}
from
"../biz/member/cost"
;
import
{
payCallback
}
from
"../biz/member/cost"
;
import
{
checkUser
}
from
"../middleware/user"
;
import
{
checkUser
}
from
"../middleware/user"
;
const
Look
=
fals
e
;
//true更新文档
const
Look
=
tru
e
;
//true更新文档
export
async
function
setRouter
(
httpServer
){
export
async
function
setRouter
(
httpServer
){
if
(
Look
)
{
if
(
Look
)
{
await
getDoc
();
await
getDoc
();
await
initDoc
(
portalRouter
.
FirstName
,
portalRouter
.
Config
,
portalRouter
.
FirstRouter
);
//网站编辑
//
await initDoc(portalRouter.FirstName, portalRouter.Config, portalRouter.FirstRouter);//网站编辑
await
initDoc
(
publicRouter
.
FirstName
,
publicRouter
.
Config
,
publicRouter
.
FirstRouter
);
//公用组件
await
initDoc
(
publicRouter
.
FirstName
,
publicRouter
.
Config
,
publicRouter
.
FirstRouter
);
//公用组件
// await initDoc(memberRouter.FirstName, memberRouter.Config, memberRouter.FirstRouter);//用户路由
// await initDoc(memberRouter.FirstName, memberRouter.Config, memberRouter.FirstRouter);//用户路由
await
initDoc
(
officalWebsiteRouter
.
FirstName
,
officalWebsiteRouter
.
Config
,
officalWebsiteRouter
.
FirstRouter
);
//官网路由
//
await initDoc(officalWebsiteRouter.FirstName, officalWebsiteRouter.Config, officalWebsiteRouter.FirstRouter);//官网路由
// await initDoc(orderRouter.FirstName, orderRouter.Config, orderRouter.FirstRouter);//会费相关
// await initDoc(orderRouter.FirstName, orderRouter.Config, orderRouter.FirstRouter);//会费相关
// await initDoc(costRouter.FirstName, costRouter.Config, costRouter.FirstRouter);//支付
// await initDoc(costRouter.FirstName, costRouter.Config, costRouter.FirstRouter);//支付
// await initDoc(outPutRouter.FirstName, outPutRouter.Config, outPutRouter.FirstRouter);//导出路由
// await initDoc(outPutRouter.FirstName, outPutRouter.Config, outPutRouter.FirstRouter);//导出路由
...
...
src/tools/reqResult.ts
View file @
1fa89991
...
@@ -143,7 +143,7 @@ export async function initDoc(firstName, apiConfig, apiFirstRouter) {
...
@@ -143,7 +143,7 @@ export async function initDoc(firstName, apiConfig, apiFirstRouter) {
itemStr
+=
`|:---- |:----- |:----- |----- |\n`
;
itemStr
+=
`|:---- |:----- |:----- |----- |\n`
;
itemStr
+=
`|401 |身份验证失败 |headers中的userid错误 |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|401 |身份验证失败 |headers中的userid错误 |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|402 |非法登录 |headers中没有token或者userid |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|402 |非法登录 |headers中没有token或者userid |强制跳转到登陆页面 |\n`
;
itemStr
+=
`|403 |身份验证过期 |token过期 |
+
强制跳转到登陆页面 |\n`
;
itemStr
+=
`|403 |身份验证过期 |token过期 |强制跳转到登陆页面 |\n`
;
itemStr
+=
``
;
itemStr
+=
``
;
...
...
src/tools/system.ts
View file @
1fa89991
...
@@ -17,6 +17,16 @@ export function successResult() {
...
@@ -17,6 +17,16 @@ export function successResult() {
return
{
success
:
true
}
return
{
success
:
true
}
}
}
/**
* 抛出错误信息
* @returns
*/
export
function
successErrorResult
(
msg
)
{
return
{
code
:
500
,
success
:
false
,
msg
};
}
/**
/**
* 生成系统id
* 生成系统id
* @param tableName
* @param tableName
...
...
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