Commit 90944b9e by lixinming
parents 93d17f3a 21649c8c
......@@ -4,7 +4,7 @@
*/
import moment = require("moment");
import { MEMBERTYPE, STATE, UNITMEMBERTYPE, USERREGISTERSTATE } from "../../config/enum";
import { INDIVIDUALMEMBERTYPE, MEMBERTYPE, PAYMENTSTATUS, STATE, UNITMEMBERTYPE, USERREGISTERSTATE } from "../../config/enum";
import { ERRORENUM } from "../../config/errorEnum";
import { addManyData } from "../../data/add";
import { deleteManyData } from "../../data/delete";
......@@ -233,6 +233,36 @@ export async function getSheng ({userId}) {
}
/**
* 根据会员类别返回对应可下载的证书类型
* @param param0
* @returns
*/
export async function getCertificate({userId}) {
let userInfo = await findOnce(TABLEENUM.用户表, {userId}, ["userId", "memberType", "userRegisterState", "paymentStatus", "individualMemberType", "unitMemberType"]);
if (!userInfo || !userInfo.userId) throw new BizError(ERRORENUM.目标数据不存在);
let certificate = false;
//判断是否审批通过
if (userInfo.userRegisterState == USERREGISTERSTATE.通过) {
if(userInfo.memberType == MEMBERTYPE.个人会员) {
//个人会员已支付可下载
if (userInfo.individualMemberType == INDIVIDUALMEMBERTYPE.个人会员 && userInfo.paymentStatus != PAYMENTSTATUS.未支付) certificate = true;
//个人会员专家无需支付可下载
if (userInfo.individualMemberType == INDIVIDUALMEMBERTYPE.个人会员专家) certificate = true;
} else if(userInfo.memberType == MEMBERTYPE.单位会员) {
//院校无需支付可下载
if (userInfo.unitMemberType == UNITMEMBERTYPE.院校) certificate = true;
//机构和其他已支付可下载
if (userInfo.unitMemberType == UNITMEMBERTYPE.机构 || userInfo.unitMemberType == UNITMEMBERTYPE.其他 && userInfo.paymentStatus != PAYMENTSTATUS.未支付) {
certificate = true;
}
}
}
return {certificate};
}
......
......@@ -387,7 +387,6 @@ export enum USERREGISTERSTATE {
*/
export enum CERTIFICATETYPE {
普通会员证书 = 1,
专家证书,
理事证书,
常务理事证书
}
......
......@@ -389,8 +389,7 @@ export const Config = {
subUrl:'/memberdb/systembase',
param:[],
bindBiz:memberBiz.systemBase
},
}
],
"审批管理":[
{
......@@ -786,6 +785,13 @@ export const Config = {
],
bindBiz:homePageBiz.getHuoDongTongZhi
},
{
apiName:"获取可下载证书模板",
subUrl:'/homepage/getcertificate',
param:[
],
bindBiz:homePageBiz.getCertificate
}
]
}
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