Commit 596d9df1 by chenjinjing

no message

parent 9bcd4f99
...@@ -113,11 +113,21 @@ export async function applyList({name, joinStartTime, joinEndTime, memberCategor ...@@ -113,11 +113,21 @@ export async function applyList({name, joinStartTime, joinEndTime, memberCategor
const NowMs = thisDate.valueOf(); const NowMs = thisDate.valueOf();
let lableInfo = userInfo.lableId.toObject() || []; let lableInfo = userInfo.lableId.toObject() || [];
let newLable = lableInfo.filter( (item) => { let newLable;
return item !== CLIENTMSGLABLE.驳回申请; if (userInfo.applyMemberLevel == MEMBERLEVEL.理事会员) {
newLable = lableInfo.filter( (item) => {
return item !== CLIENTMSGLABLE.驳回理事申请;
}) })
if (!newLable.includes(CLIENTMSGLABLE.通过申请)) { if (!newLable.includes(CLIENTMSGLABLE.通过理事申请)) {
newLable.push(CLIENTMSGLABLE.通过申请); newLable.push(CLIENTMSGLABLE.通过理事申请);
}
} else if (userInfo.applyMemberLevel == MEMBERLEVEL.常务理事会员) {
newLable = lableInfo.filter( (item) => {
return item !== CLIENTMSGLABLE.驳回常务理事申请;
})
if (!newLable.includes(CLIENTMSGLABLE.通过常务理事申请)) {
newLable.push(CLIENTMSGLABLE.通过常务理事申请);
}
} }
let lableId = newLable; let lableId = newLable;
...@@ -163,12 +173,23 @@ export async function applyBatchAdopt({idList}) { ...@@ -163,12 +173,23 @@ export async function applyBatchAdopt({idList}) {
} }
let lableInfo = userInfo.lableId.toObject() || []; let lableInfo = userInfo.lableId.toObject() || [];
let newLable = lableInfo.filter( (item) => { let newLable;
return item !== CLIENTMSGLABLE.驳回申请; if (userInfo.applyMemberLevel == MEMBERLEVEL.理事会员) {
newLable = lableInfo.filter( (item) => {
return item !== CLIENTMSGLABLE.驳回理事申请;
}) })
if (!newLable.includes(CLIENTMSGLABLE.通过申请)) { if (!newLable.includes(CLIENTMSGLABLE.通过理事申请)) {
newLable.push(CLIENTMSGLABLE.通过申请); newLable.push(CLIENTMSGLABLE.通过理事申请);
} }
} else if (userInfo.applyMemberLevel == MEMBERLEVEL.常务理事会员) {
newLable = lableInfo.filter( (item) => {
return item !== CLIENTMSGLABLE.驳回常务理事申请;
})
if (!newLable.includes(CLIENTMSGLABLE.通过常务理事申请)) {
newLable.push(CLIENTMSGLABLE.通过常务理事申请);
}
}
let lableId = newLable; let lableId = newLable;
let updateInfo:any = { let updateInfo:any = {
...@@ -210,12 +231,23 @@ export async function applyReject({id, remarks}) { ...@@ -210,12 +231,23 @@ export async function applyReject({id, remarks}) {
const NowMs = thisDate.valueOf(); const NowMs = thisDate.valueOf();
let lableInfo = userInfo.lableId.toObject() || []; let lableInfo = userInfo.lableId.toObject() || [];
let newLable = lableInfo.filter( (item) => { let newLable;
return item !== CLIENTMSGLABLE.通过申请; if (userInfo.applyMemberLevel == MEMBERLEVEL.理事会员) {
newLable = lableInfo.filter( (item) => {
return item !== CLIENTMSGLABLE.通过理事申请;
}) })
if (!newLable.includes(CLIENTMSGLABLE.驳回申请)) { if (!newLable.includes(CLIENTMSGLABLE.驳回理事申请)) {
newLable.push(CLIENTMSGLABLE.驳回申请); newLable.push(CLIENTMSGLABLE.驳回理事申请);
} }
} else if (userInfo.applyMemberLevel == MEMBERLEVEL.常务理事会员) {
newLable = lableInfo.filter( (item) => {
return item !== CLIENTMSGLABLE.通过常务理事申请;
})
if (!newLable.includes(CLIENTMSGLABLE.驳回常务理事申请)) {
newLable.push(CLIENTMSGLABLE.驳回常务理事申请);
}
}
let lableId = newLable; let lableId = newLable;
let updateInfo:any = { let updateInfo:any = {
...@@ -233,7 +265,13 @@ export async function applyReject({id, remarks}) { ...@@ -233,7 +265,13 @@ export async function applyReject({id, remarks}) {
} }
await updateOneData(TABLEENUM.理事变更审批历史表, {applyId:userInfo.applyId}, applyInfo); await updateOneData(TABLEENUM.理事变更审批历史表, {applyId:userInfo.applyId}, applyInfo);
/**重置消息为未读 */ /**重置消息为未读 */
let msgInfo = await findOnce(TABLEENUM.消息通知表, {lableId:{"$in":CLIENTMSGLABLE.驳回申请}}); let msgInfo;
if (userInfo.applyMemberLevel == MEMBERLEVEL.理事会员) {
msgInfo = await findOnce(TABLEENUM.消息通知表, {lableId:{"$in":CLIENTMSGLABLE.驳回理事申请}});
} else if (userInfo.applyMemberLevel == MEMBERLEVEL.常务理事会员) {
msgInfo = await findOnce(TABLEENUM.消息通知表, {lableId:{"$in":CLIENTMSGLABLE.驳回常务理事申请}});
}
await updateOneData(TABLEENUM.消息已读状态表, {userId:id, msgId:msgInfo.msgId}, {isRead: STATE.}); await updateOneData(TABLEENUM.消息已读状态表, {userId:id, msgId:msgInfo.msgId}, {isRead: STATE.});
return successResult(); return successResult();
......
...@@ -273,7 +273,7 @@ export async function noticeMessage({userId}) { ...@@ -273,7 +273,7 @@ export async function noticeMessage({userId}) {
item.readId = msgReadInfo.readId; item.readId = msgReadInfo.readId;
item.isRead = msgReadInfo.isRead; item.isRead = msgReadInfo.isRead;
if (item.lableId.includes(CLIENTMSGLABLE.驳回申请)) item.rejectRemarks = userInfo.rejectRemarks if (item.lableId.includes(CLIENTMSGLABLE.驳回理事申请) || item.lableId.includes(CLIENTMSGLABLE.驳回常务理事申请)) item.rejectRemarks = userInfo.rejectRemarks
dataList.push(item); dataList.push(item);
} }
......
...@@ -699,8 +699,10 @@ export enum CLIENTMSGLABLE { ...@@ -699,8 +699,10 @@ export enum CLIENTMSGLABLE {
单位会员 = "单位会员", 单位会员 = "单位会员",
理事 = "理事会员", 理事 = "理事会员",
常务理事 = "常务理事会员", 常务理事 = "常务理事会员",
驳回申请 = "驳回理事申请", 驳回理事申请 = "驳回理事申请",
通过申请 = "通过理事申请", 通过理事申请 = "通过理事申请",
驳回常务理事申请 = "驳回常务理事申请",
通过常务理事申请 = "通过常务理事申请",
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment