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
9bcd4f99
Commit
9bcd4f99
authored
Oct 24, 2024
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
c186d73c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
7 deletions
+92
-7
apply.ts
src/biz/member/apply.ts
+48
-3
homePage.ts
src/biz/member/homePage.ts
+15
-1
msgActivity.ts
src/biz/member/msgActivity.ts
+3
-2
model.ts
src/data/models/model.ts
+18
-1
router.ts
src/routers/apply/router.ts
+8
-0
No files found.
src/biz/member/apply.ts
View file @
9bcd4f99
...
...
@@ -13,6 +13,7 @@ import { ERRORENUM } from "../../config/errorEnum";
import
{
getMenberNum
,
successResult
}
from
"../../tools/system"
;
import
{
updateOneData
}
from
"../../data/update"
;
import
{
setEnumInterface
}
from
"../public"
;
import
{
addOneData
}
from
"../../data/add"
;
/**
...
...
@@ -30,7 +31,14 @@ export async function applyList({name, joinStartTime, joinEndTime, memberCategor
isBlackUser
:
STATE
.
否
,
changeApplyType
:{
"$gt"
:
CHANGEAPPLYTYPE
.
注册信息补充完成
}
//返回除了补充注册信息之外的所有状态数据
};
if
(
name
)
selectParam
[
"$or"
]
=
[{
name
:
name
},
{
unitName
:
name
}];
if
(
name
)
{
selectParam
[
"$and"
]
=
[{
"$or"
:[
{
unitName
:{
"$regex"
:
`
${
name
}
`
}},
{
name
:{
"$regex"
:
`
${
name
}
`
}}
]
}]
}
if
(
joinStartTime
)
{
selectParam
[
"joinTime"
]
=
{
"$gt"
:
joinStartTime
};
}
...
...
@@ -45,13 +53,13 @@ export async function applyList({name, joinStartTime, joinEndTime, memberCategor
if
(
memberLevel
&&
memberLevel
.
length
)
selectParam
.
applyMemberLevel
=
{
"$in"
:
memberLevel
};
if
(
beforeChange
&&
beforeChange
.
length
)
selectParam
.
beforeChange
=
{
"$in"
:
beforeChange
};
let
selectConf
=
[
"userId"
,
"changeApplyType"
,
"unitName"
,
"name"
,
"beforeChange"
,
"applyMemberLevel"
,
"applyStr"
,
"applyApplicationTime"
,
"applyReviewTime"
,
"individualMemberType"
,
"unitMemberType"
,
"memberType"
];
let
selectConf
=
[
"userId"
,
"
applyId"
,
"
changeApplyType"
,
"unitName"
,
"name"
,
"beforeChange"
,
"applyMemberLevel"
,
"applyStr"
,
"applyApplicationTime"
,
"applyReviewTime"
,
"individualMemberType"
,
"unitMemberType"
,
"memberType"
];
let
dbList
=
await
findToSortToPage
(
TABLEENUM
.
用户表
,
selectParam
,
selectConf
,
{
applyApplicationTime
:
-
1
},
pageNumber
);
let
dataCount
=
await
findCount
(
TABLEENUM
.
用户表
,
selectParam
);
let
dataList
=
[];
let
itemConf
=
[
"userId"
,
"changeApplyType"
,
"unitName"
,
"name"
,
"beforeChange"
,
"applyMemberLevel"
,
"applyStr"
,
"applyApplicationTime"
,
"applyReviewTime"
,
"memberType"
];
let
itemConf
=
[
"userId"
,
"
applyId"
,
"
changeApplyType"
,
"unitName"
,
"name"
,
"beforeChange"
,
"applyMemberLevel"
,
"applyStr"
,
"applyApplicationTime"
,
"applyReviewTime"
,
"memberType"
];
for
(
let
i
=
0
;
i
<
dbList
.
length
;
i
++
)
{
let
info
=
dbList
[
i
];
let
item
:
any
=
extractData
(
info
,
itemConf
);
...
...
@@ -120,6 +128,8 @@ export async function applyList({name, joinStartTime, joinEndTime, memberCategor
lableId
};
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
id
},
updateInfo
);
/**添加审批历史 */
await
updateOneData
(
TABLEENUM
.
理事变更审批历史表
,
{
applyId
:
userInfo
.
applyId
},
updateInfo
);
return
successResult
();
}
...
...
@@ -168,6 +178,8 @@ export async function applyBatchAdopt({idList}) {
lableId
,
};
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
id
},
updateInfo
);
/**添加审批历史 */
await
updateOneData
(
TABLEENUM
.
理事变更审批历史表
,
{
applyId
:
userInfo
.
applyId
},
updateInfo
);
}
...
...
@@ -213,6 +225,16 @@ export async function applyReject({id, remarks}) {
rejectRemarks
:
remarks
};
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
:
id
},
updateInfo
);
/**添加审批历史 */
let
applyInfo
=
{
applyReviewTime
:
NowMs
,
changeApplyType
:
CHANGEAPPLYTYPE
.
驳回修改
,
rejectRemarks
:
remarks
}
await
updateOneData
(
TABLEENUM
.
理事变更审批历史表
,
{
applyId
:
userInfo
.
applyId
},
applyInfo
);
/**重置消息为未读 */
let
msgInfo
=
await
findOnce
(
TABLEENUM
.
消息通知表
,
{
lableId
:{
"$in"
:
CLIENTMSGLABLE
.
驳回申请
}});
await
updateOneData
(
TABLEENUM
.
消息已读状态表
,
{
userId
:
id
,
msgId
:
msgInfo
.
msgId
},
{
isRead
:
STATE
.
否
});
return
successResult
();
}
...
...
@@ -264,6 +286,29 @@ export async function outPutApply() {
}
/**
* 审核历史 success
* @param userId
* @returns
*/
export
async
function
applyHistoryList
({
id
})
{
let
dbList
=
await
find
(
TABLEENUM
.
理事变更审批历史表
,
{
userId
:
id
});
let
dataList
=
[];
dbList
.
forEach
(
info
=>
{
let
item
:
any
=
extractData
(
info
,
[
"changeApplyType"
,
"applyReviewTime"
,
"rejectRemarks"
,
"applyStr"
]);
item
.
changeApplyType
=
changeEnumValue
(
CHANGEAPPLYTYPE
,
item
.
changeApplyType
);
item
.
applyReviewTime
=
moment
(
item
.
applyReviewTime
).
format
(
"YYYY-MM-DD"
);
if
(
!
item
.
applyStr
)
item
.
applyStr
=
"-"
if
(
!
item
.
rejectRemarks
)
item
.
rejectRemarks
=
"-"
dataList
.
push
(
item
);
});
return
{
dataList
};
}
src/biz/member/homePage.ts
View file @
9bcd4f99
...
...
@@ -6,7 +6,7 @@
import
moment
=
require
(
"moment"
);
import
{
CHANGEAPPLYTYPE
,
CLIENTMSGLABLE
,
DOCUMENTTYPE
,
INDIVIDUALMEMBERTYPE
,
MEMBERLEVEL
,
MEMBERLEVELCHANGE
,
MEMBERSTATE
,
MEMBERTYPE
,
NATION
,
PAYMENTSTATUS
,
PROFCATEGORY
,
SEX
,
STATE
,
UNITMEMBERTYPE
,
USERREGISTERSTATE
}
from
"../../config/enum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
addManyData
}
from
"../../data/add"
;
import
{
addManyData
,
addOneData
}
from
"../../data/add"
;
import
{
deleteManyData
}
from
"../../data/delete"
;
import
{
TABLEENUM
}
from
"../../data/models/model"
;
import
{
find
,
findOnce
}
from
"../../data/select"
;
...
...
@@ -503,13 +503,27 @@ export async function applyReason({applyStr, userId}) {
if
(
!
oldInfo
||
!
oldInfo
.
userId
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
const
Now
=
new
Date
().
valueOf
();
let
applyId
=
generateSystemId
(
TABLEENUM
.
理事变更审批历史表
,
userId
);
let
param
=
{
applyStr
,
changeApplyType
:
CHANGEAPPLYTYPE
.
待审批
,
applyApplicationTime
:
Now
,
applyId
,
}
await
updateOneData
(
TABLEENUM
.
用户表
,
{
userId
},
param
);
/**添加审批历史 */
let
applyInfo
:
any
=
{
applyId
,
userId
,
applyMemberLevel
:
oldInfo
.
applyMemberLevel
,
beforeChange
:
oldInfo
.
beforeChange
,
applyStr
,
changeApplyType
:
CHANGEAPPLYTYPE
.
待审批
,
applyApplicationTime
:
Now
,
};
await
addOneData
(
TABLEENUM
.
理事变更审批历史表
,
applyInfo
);
return
successResult
();
}
...
...
src/biz/member/msgActivity.ts
View file @
9bcd4f99
...
...
@@ -218,7 +218,7 @@ export async function noticeMessage({userId}) {
let
selectParam
:
any
=
{
"$or"
:[{
lableId
:{
"$in"
:
CLIENTMSGLABLE
.
所有人
}
}]};
/**非游客用户通知消息条件 */
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
]);
let
userInfo
=
await
findOnce
(
TABLEENUM
.
用户表
,
{
userId
},
[
"lableId"
,
"memberType"
,
"rejectRemarks"
]);
if
(
!
userInfo
)
throw
new
BizError
(
ERRORENUM
.
目标数据不存在
);
// if (!userInfo || !userInfo.lableId) return successErrorResult("该会员暂无消息通知标签分类");
...
...
@@ -233,7 +233,7 @@ export async function noticeMessage({userId}) {
)
let
dataList
=
[];
const
SelectFiles
=
[
"msgId"
,
"msgTitle"
,
"effectiveTime"
,
"msgContent"
,
"isPop"
];
const
SelectFiles
=
[
"msgId"
,
"msgTitle"
,
"effectiveTime"
,
"msgContent"
,
"isPop"
,
"lableId"
];
let
msgInfo
=
await
findToSort
(
TABLEENUM
.
消息通知表
,
selectParam
,
{
createTime
:
-
1
},
SelectFiles
);
// let msgInfo = await find(TABLEENUM.消息通知表, selectParam, SelectFiles);
// if (!msgInfo || !msgInfo.msgId) throw new BizError(ERRORENUM.目标数据不存在);
...
...
@@ -273,6 +273,7 @@ export async function noticeMessage({userId}) {
item
.
readId
=
msgReadInfo
.
readId
;
item
.
isRead
=
msgReadInfo
.
isRead
;
if
(
item
.
lableId
.
includes
(
CLIENTMSGLABLE
.
驳回申请
))
item
.
rejectRemarks
=
userInfo
.
rejectRemarks
dataList
.
push
(
item
);
}
...
...
src/data/models/model.ts
View file @
9bcd4f99
...
...
@@ -93,7 +93,8 @@ enum TABLEENUM {
消息通知表
=
"massageNotice"
,
消息已读状态表
=
"massageReads"
,
活动通知表
=
"activityNotice"
,
活动报名表
=
"activityEnroll"
活动报名表
=
"activityEnroll"
,
理事变更审批历史表
=
"applyHistoryList"
}
...
...
@@ -453,6 +454,7 @@ const ModelArray = [
applyApplicationTime
:
'Number'
,
//变更理事申请时间
applyReviewTime
:
'Number'
,
//变更理事审核时间
rejectRemarks
:
'String'
,
//变更理事驳回理由
applyId
:{
type
:
'String'
,
index
:
true
},
}
},
{
...
...
@@ -612,6 +614,21 @@ const ModelArray = [
refundImgUrl
:
"String"
//退款确认发票地址
}
},
{
tableName
:
TABLEENUM
.
理事变更审批历史表
,
source
:
TABLESOURCEENUM
.
mongo
,
schema
:{
applyId
:{
type
:
'String'
,
index
:
true
},
userId
:{
type
:
'String'
,
index
:
true
},
//用户id 外键
applyMemberLevel
:
'Number'
,
//申请变更的职位
beforeChange
:
'Number'
,
//会员等级、职务 枚举 MEMBERLEVEL 【变更申请前的职位】
applyStr
:
'String'
,
//变更理事申请理由
changeApplyType
:
'Number'
,
//变更审批状态
applyApplicationTime
:
'Number'
,
//变更理事申请时间
applyReviewTime
:
'Number'
,
//变更理事审核时间
rejectRemarks
:
'String'
,
//变更理事驳回理由
}
},
];
...
...
src/routers/apply/router.ts
View file @
9bcd4f99
...
...
@@ -54,6 +54,14 @@ export const Config = {
],
bindBiz
:
applyBiz
.
outPutApply
},
{
apiName
:
"理事审批历史"
,
subUrl
:
'/applydb/applyhistorylist'
,
param
:[
{
key
:
"id"
,
type
:
"String"
,
desc
:
"用户id"
},
],
bindBiz
:
applyBiz
.
applyHistoryList
},
]
}
...
...
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