Commit debfe4ba by lixinming

no message

parent 04bb7c64
......@@ -14,7 +14,6 @@ import { ERRORENUM } from "../../config/errorEnum";
import { generateWXOrderId, successResult } from "../../tools/system";
import { updateOneData } from "../../data/update";
import moment = require("moment");
import { createOrder } from "./order";
const AppId = 'wx96c0cf11b3babcf6';
const MchId = '1614605859';
......@@ -97,7 +96,6 @@ export async function orderClose({id, weChartPR}) {
}
/**
* 微信回调函数【微信用】
*/
......
......@@ -14,6 +14,7 @@ import { BizError } from "../../util/bizError";
import { extractData } from "../../util/piecemeal";
import { changeEnumValue } from "../../util/verificationEnum";
import { createOrder } from "./order";
import { getCityNameByCode } from "../../config/cityConfig";
/**
* 待审核列表 success
......@@ -47,6 +48,10 @@ export async function pendingReviewList({unitName, joinTime, memberType, sheng,
else item.userRegisterState = changeEnumValue(USERREGISTERSTATE, item.userRegisterState);
if (item.memberType == MEMBERTYPE.个人会员) item.unitName = item.workUnit;
item.memberLevel = changeEnumValue(MEMBERLEVEL, item.memberLevel);
item.sheng = getCityNameByCode(item.sheng);
item.shi = getCityNameByCode(item.shi);
item.qu = getCityNameByCode(item.qu);
dataList.push(item);
});
......@@ -121,7 +126,8 @@ export async function adopt({id, session}) {
* @param remarks 驳回理由
* @returns
*/
export async function reject({userId, remarks}) {
export async function reject({id, remarks}) {
let userId = id;
let userInfo = await findOnce(TABLEENUM.用户表, {userId, isAdmin:STATE.});
if (!userInfo || !userInfo.userId) throw new BizError(ERRORENUM.目标数据不存在);
if (userInfo.memberType == MEMBERTYPE.个人会员 && userInfo.registerFlow != REGISTERFLOW.完成第二步) {
......
......@@ -4,7 +4,7 @@
*/
import moment = require("moment");
import { BANXUELEIXING, DOCUMENTTYPE, INDIVIDUALMEMBERTYPE, INVOICESTATUS, MEMBERLEVEL, MEMBERTYPE, NATION, ORDERSTATE, PROFCATEGORY, SEX, STATE, UNITMEMBERTYPE, USERREGISTERSTATE } from "../../config/enum";
import { MEMBERTYPE, STATE, UNITMEMBERTYPE, USERREGISTERSTATE } from "../../config/enum";
import { ERRORENUM } from "../../config/errorEnum";
import { addManyData } from "../../data/add";
import { deleteManyData } from "../../data/delete";
......@@ -14,7 +14,7 @@ import { updateOneData } from "../../data/update";
import { generateSystemId, successResult } from "../../tools/system";
import { BizError } from "../../util/bizError";
import { extractData } from "../../util/piecemeal";
import { changeEnumValue, eccEnumValue } from "../../util/verificationEnum";
import { eccEnumValue } from "../../util/verificationEnum";
/**
......
......@@ -512,7 +512,7 @@ export async function getInvoiceStatus({id}) {
export async function
// export async function
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -44,7 +44,8 @@ export enum ERRORENUM {
不满足重新请求条件,
该订单正在支付,
微信支付回调错误,
支付失败
支付失败,
地址数据错误
}
export enum ERRORCODEENUM {
......
......@@ -562,9 +562,6 @@ export const Config = {
adminType:{type:'Number', desc:'管理员类别'},
adminLv:{type:'[Number]', desc:'管理员等级'},
}
},
{
key:"userId", type:"String", desc:"登录用户id"
}
],
bindBiz:rightsMgmtBiz.addAdmin
......@@ -591,7 +588,7 @@ export const Config = {
apiName:"修改权限",
subUrl:'/rightsmgmt/updatemgmt',
param:[
{key:"userId", type:"String", desc:"登录用户id"},
{key:"id", type:"String", desc:"登录用户id"},
{key:"adminLv", type:"[Number]", desc:"管理员等级"},
],
bindBiz:rightsMgmtBiz.updateMGMT
......
......@@ -30,62 +30,64 @@ export async function setRouter(httpServer){
await initDoc(orderRouter.FirstName, orderRouter.Config, orderRouter.FirstRouter);//会费相关
await initDoc(costRouter.FirstName, costRouter.Config, costRouter.FirstRouter);//支付
}
await analysisRouter(httpServer, portalRouter.Config, portalRouter.FirstRouter, false);//网站编辑
await analysisRouter(httpServer, publicRouter.Config, publicRouter.FirstRouter, false);//公用组件
await analysisRouter(httpServer, memberRouter.Config, memberRouter.FirstRouter, true);//用户路由
await analysisRouter(httpServer, officalWebsiteRouter.Config, officalWebsiteRouter.FirstRouter, false);//官网路由
await analysisRouter(httpServer, orderRouter.Config, orderRouter.FirstRouter, true);//会费相关
await analysisRouter(httpServer, costRouter.Config, costRouter.FirstRouter, true);//支付
analysisRouter(httpServer, portalRouter.Config, portalRouter.FirstRouter, false);//网站编辑
analysisRouter(httpServer, publicRouter.Config, publicRouter.FirstRouter, false);//公用组件
analysisRouter(httpServer, memberRouter.Config, memberRouter.FirstRouter, true);//用户路由
analysisRouter(httpServer, officalWebsiteRouter.Config, officalWebsiteRouter.FirstRouter, false);//官网路由
analysisRouter(httpServer, orderRouter.Config, orderRouter.FirstRouter, true);//会费相关
analysisRouter(httpServer, costRouter.Config, costRouter.FirstRouter, true);//支付
}
async function analysisRouter(httpServer, config, firstRouter, haveMiddleware) {
function analysisRouter(httpServer, config, firstRouter, haveMiddleware) {
for (let modelKey in config) {
config[modelKey].forEach(info => {
let {apiName, defaultParam, subUrl, param, bindBiz, notMiddleware} = info;
httpServer.post(firstRouter+subUrl, haveMiddleware? checkUser : notCheck, asyncHandler(async function (req, res) {
let chackObjectList = [];
let checkStringMap = {};
let stringNotMustHaveKeys = [];
let funcParam:any = {};
funcParam.userId = req.headers.userId;
for (let i = 0; i < param.length; i++) {
let info:any = param[i];
let {key, type} = param[i];
if (info.isNull) stringNotMustHaveKeys.push(key);
if (type == 'Object') {
chackObjectList.push(param[i]);
checkStringMap[key] = type;
}
else checkStringMap[key] = type;
}
/**校验参数 */
if (chackObjectList.length) {
chackObjectList.forEach(item => {
if (!req.body[item.key]) throw new BizError(ERRORENUM.参数错误, `${apiName}`, `缺少参数${item.key}`);
eccFormParam(apiName, item.sub, req.body[item.key]);
funcParam[item.key] = req.body[item.key];
});
}
if (Object.keys(checkStringMap).length) {
let eccResult = eccReqParamater(apiName, checkStringMap, req.body, stringNotMustHaveKeys);
for (let key in eccResult) {
funcParam[key] = eccResult[key];
}
}
if (defaultParam) funcParam["defaultParam"] = defaultParam;
let result = await bindBiz(funcParam);
res.success(result);
}));
if (haveMiddleware && !notMiddleware) httpServer.post(firstRouter+subUrl, checkUser , asyncHandler(routerFun(apiName, defaultParam, subUrl, param, bindBiz, notMiddleware)));
else httpServer.post(firstRouter+subUrl, asyncHandler(routerFun(apiName, defaultParam, subUrl, param, bindBiz, notMiddleware)));
});
}
}
function routerFun(apiName, defaultParam, subUrl, param, bindBiz, notMiddleware) {
return async function (req, res) {
let chackObjectList = [];
let checkStringMap = {};
let stringNotMustHaveKeys = [];
let funcParam:any = {};
funcParam.userId = req.headers.userId;
for (let i = 0; i < param.length; i++) {
let info:any = param[i];
let {key, type} = param[i];
if (info.isNull) stringNotMustHaveKeys.push(key);
if (type == 'Object') {
chackObjectList.push(param[i]);
checkStringMap[key] = type;
}
else checkStringMap[key] = type;
}
/**校验参数 */
if (chackObjectList.length) {
chackObjectList.forEach(item => {
if (!req.body[item.key]) throw new BizError(ERRORENUM.参数错误, `${apiName}`, `缺少参数${item.key}`);
eccFormParam(apiName, item.sub, req.body[item.key]);
funcParam[item.key] = req.body[item.key];
});
}
if (Object.keys(checkStringMap).length) {
let eccResult = eccReqParamater(apiName, checkStringMap, req.body, stringNotMustHaveKeys);
for (let key in eccResult) {
funcParam[key] = eccResult[key];
}
}
if (defaultParam) funcParam["defaultParam"] = defaultParam;
let result = await bindBiz(funcParam);
res.success(result);
}
}
export async function setAdditionalRouter(httpServer) {
......
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