Commit 9928eaaf by lixinming

no message

parent 0e546eaa
/**
* admin
*/
import moment = require("moment");
import { OPERATIONALDATATYPE, TABLENAME } from "../config/dbEnum";
import { ERRORENUM } from "../config/errorEnum";
import { operationalData, selectData } from "../middleware/databaseSuccess";
import { getPwdMd5, getTimeKey, getToken } from "../tools/system";
import { BizError } from "../util/bizError";
import { BRANCHNAMESTR, DEGREE, ENTRYTYPE, PARTYPOSITIONS, SEX } from "../config/enum";
import { changeEnumValue } from "../util/verificationEnum";
export async function login(loginId:string, pwd:string) {
let clomun = ["pmId", "loginId", "pwd", "token", "bId", "administrativePositionName", "partyPositionsName", "firstChangeLogin"];
let loginInfo:any = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.党员基础信息表, {loginId}, clomun);
if (!loginInfo) throw new BizError(ERRORENUM.账号不存在, `${loginId}账号非党员账号`);
let check = getPwdMd5(loginId, pwd);
if (loginInfo.pwd != check) throw new BizError(ERRORENUM.密码错误);
const Token = getToken(loginId);
let updateLogin = {
adminToken: Token,
adminTokenMs: moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.党员基础信息表, updateLogin, {loginId});
return {
userid: loginInfo.pmId,
token: Token,
name:loginInfo.name
};
}
export async function logOut(userId) {
let clomun = ["pmId", "loginId", "pwd", "token", "bId", "administrativePositionName", "partyPositionsName", "firstChangeLogin"];
let loginInfo:any = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.党员基础信息表, {pmId:userId}, clomun);
if (!loginInfo) throw new BizError(ERRORENUM.账号不存在, `${userId}账号非党员账号`);
let updateLogin = {
adminToken: "",
adminTokenMs: moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.党员基础信息表, updateLogin, {pmId:userId});
return { isSuccess:true};
}
export async function zzjgList() {
let clomun = ["name", "partyPositionsName", "bId"];
let dbList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.党员基础信息表, {etId:ENTRYTYPE.正式党员}, clomun);
let map = {};
dbList.forEach(info => {
let {name, bId, partyPositionsName} = info;
let partyPositionsNameList = JSON.parse(partyPositionsName);
let isZZB = false;
let zzbStrList = [];
let subStrList = [];
let notParty = false;
partyPositionsNameList.forEach(item => {
if (item < 100 && item >= 10) {
isZZB = true;
zzbStrList.push(changeEnumValue( PARTYPOSITIONS, item));
notParty = true;
}
if (item >= 100) {
subStrList.push(changeEnumValue( PARTYPOSITIONS, item));
notParty = true;
}
})
if (isZZB) {
if (!map[0]) map[0] = {};
zzbStrList.forEach(item => {
map[0][item] = name
});
}
if (!map[bId]) map[bId] = {subList:[]};
subStrList.forEach(item => {
map[bId][item] = name
});
if (!notParty) {
map[bId].sublist.push(name);
}
});
let dataList = [];
for (let key in map) {
if (key == "0") continue;
let item = map[key];
item.name = changeEnumValue(BRANCHNAMESTR, parseInt(key))
dataList.push(item);
}
return {zzbInfo:map[0], }
}
function changePartyPositionsName(partyPositionsName) {
let str = "";
if (!partyPositionsName || partyPositionsName.length) return str;
for (let i= 0; i < partyPositionsName.length; i++) {
let item = partyPositionsName[i];
if (item < 10) continue;
str += changeEnumValue( PARTYPOSITIONS, item);
}
if (!str) {
str = "党员";
}
return str;
}
export async function dyxxList(etId:number, str:string, bId:number, startMs:number, endMs:number, page:number) {
let param:any = {etId};
if (str) param.name = {"%like%":str};getTimeKey
if (bId) param.bId = bId;
if (startMs && endMs) param.birthDate = {"%between%":[ moment(startMs).format("YYYY-MM-DD HH:mm:ss"), moment(endMs).format("YYYY-MM-DD HH:mm:ss")]}
let clomun = ["pmId", "bId", "name", "sex", "birthDate", "phone", "levelOfEducation", "partyJoiningTime", "administrativePositionName", "partyPositionsName", "askForTime", "yubeiTime", "fzdxTime", "listedAsActivistsTime", "talkTime", "desc"];
let dbList = await selectData(OPERATIONALDATATYPE.分页查询, TABLENAME.党员基础信息表, param, clomun, page);
let dataCount = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.党员基础信息表, param, clomun);
let dataList = [];
dbList.forEach(info => {
let item:any = {pmId:info.pmId, name:info.name, phone:info.phone, desc:info.desc };
item.bIdName = changeEnumValue(BRANCHNAMESTR, info.bId);
item.sex = changeEnumValue(SEX, info.sex);
item.levelOfEducation = changeEnumValue(DEGREE, info.levelOfEducation);
if (info.partyPositionsName) item.partyPositionsName = changePartyPositionsName(JSON.parse(info.partyPositionsName) )
if (info.partyJoiningTime) item.partyJoiningTime = moment(info.partyJoiningTime).format("YYYY-MM-DD");
if (info.administrativePositionName) {
item.administrativePositionName = changeEnumValue(DEGREE, info.levelOfEducation);
}
if (info.askForTime) item.askForTime = moment(info.askForTime).format("YYYY-MM-DD");
if (info.yubeiTime) item.yubeiTime = moment(info.yubeiTime).format("YYYY-MM-DD");
if (info.fzdxTime) item.fzdxTime = moment(info.fzdxTime).format("YYYY-MM-DD");
if (info.listedAsActivistsTime) item.listedAsActivistsTime = moment(info.listedAsActivistsTime).format("YYYY-MM-DD");
if (info.talkTime) item.talkTime = moment(info.talkTime).format("YYYY-MM-DD");
dataList.push(item);
});
return {dataCount, dataList}
}
export async function dyxx_change(type, ) {
}
\ No newline at end of file
......@@ -5,8 +5,11 @@
import { OPERATIONALDATATYPE, TABLENAME } from "../config/dbEnum";
import { operationalData, selectData } from "../middleware/databaseSuccess";
import { getPwdMd5, md5PwdStr } from "../tools/system";
export async function dataInit() {
await dataInit2();
return
let list = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.党员基础信息表, {bId:1, etId:1}, ["pmId"]);
for (let i= 0; i < list.length; i++) {
......@@ -28,3 +31,12 @@ export async function dataInit() {
}
}
export async function dataInit2() {
console.log("18234720432 =>", getPwdMd5("18234720432", md5PwdStr("18234720432")));
console.log("15007949519 =>", getPwdMd5("15007949519", md5PwdStr("15007949519")));
console.log("17638538121 =>", getPwdMd5("17638538121", md5PwdStr("17638538121")));
console.log("15201707076 =>", getPwdMd5("15201707076", md5PwdStr("15201707076")));
}
\ No newline at end of file
......@@ -532,7 +532,7 @@ export async function addOrg( param) {
* @param honorName
* @returns
*/
export async function dwPartyVanguardList(bId:number, honorName:string) {
export async function dwPartyVanguardList(honorName:string) {
let param:any = {};
if (honorName) param.honorName = honorName;
......@@ -540,7 +540,7 @@ export async function dwPartyVanguardList(bId:number, honorName:string) {
let partyVanguardData = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.党建先锋表, param, clomun);
let allUserList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.党员基础信息表, {bId}, ["name", "pmId"])
let allUserList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.党员基础信息表, {}, ["name", "pmId"])
let allUserMap = {};
allUserList.forEach(info => {
......@@ -630,3 +630,184 @@ export async function addDWPartyVanguard(bId, param) {
return {isSuccess:true}
}
/**
* 获取党建资讯列表
* @param bId
* @param theme 主题
* @param activityYear 年份
* @param activityMonth 月份
* @returns partyBuildingDynamicList:[{"pbId":1, "theme":"党建动态主题", "dataMonth":"数据月份"}, ......]
*/
export async function partyBuildingDynamicList( activitiesType:Number) {
let param:any = {
activitiesType:{"%like%":activitiesType}
};
let partyInformationList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.专题活动表, param, ["taId", "theme", "activitiesType","activitesTime"]);
let dataList = [];
partyInformationList.forEach(info => {
let activitiesTypeList = [];
JSON.parse(info.activitiesType).forEach(itemKey => {
activitiesTypeList.push({
title:changeEnumValue(configEnum.ACTIVITIESTYPE, itemKey),
color:"red"
});
})
dataList.push({
taId:info.taId,
activitiesType:activitiesTypeList,
theme:info.theme,
activitesTime:moment(info.activitesTime).format("YYYY-MM-DD")
});
});
return {dataList};
}
/**
* 获取党建资讯详情
* @param pbId
* @returns partyBuildingDynamicInfo:{ "theme":"党建动态主题", "dataMonth":"数据月份", "fileName":["党建动态文件名称", ......] }
*/
export async function partyBuildingDynamicDetsils(taId:number) {
let files = ["taId", "activitiesType", "theme", "content", "activitesTime"];
let partyInformation = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.专题活动表, {taId}, files);
let activitiesTypeList = [];
JSON.parse(partyInformation.activitiesType).forEach(itemKey => {
activitiesTypeList.push({
title:changeEnumValue(configEnum.ACTIVITIESTYPE, itemKey),
color:"red"
});
})
let dataInfo:any = {};
dataInfo.taId = partyInformation.taId;
dataInfo.theme = partyInformation.theme;
dataInfo.content = partyInformation.content;
dataInfo.activitesTime = moment(partyInformation.activitesTime).format("YYYY-MM-DD");
dataInfo.source = "牙防所党建";
dataInfo.activitiesType = activitiesTypeList;
return {dataInfo};
}
/**
* 党建质量指数列表
* @param bId 支部id
* @returns [{"dataList":{"key":"一级指标名称","list":{"totalScore":0,"completionProgress":}}}]
*/
export async function partyQualityList() {
let dataYear = moment(new Date().valueOf()).format("YYYY");
let selectParam = {};
let clomun = ["tlId", "primaryIndicators", "secondaryIndicators", "thirdLevelContent", "thirdLevelScore", "currentScore", "completionProgress"];
let partyQualityData = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.党建质量三级指标, selectParam, clomun);
let partyQualityList = [];
for (let key in configEnum.PRIMARYINDICATORS) {
let primaryIndicatorsData = {};
let anyKey:any = key;
if (isNaN(anyKey)) {
const EnumValue = parseInt(configEnum.PRIMARYINDICATORS[key])
primaryIndicatorsData["dataList"] = {key: anyKey, value:EnumValue, list: []};
primaryIndicatorsData["detail"] = {};
partyQualityData.forEach( info => {
let schedule = "进行中";
let {tlId, primaryIndicators, secondaryIndicators, thirdLevelContent, thirdLevelScore, currentScore, completionProgress} = info; //一级指标、总分、三级指标得分、完成进度
if (completionProgress == 100) schedule = "已完成"
if (primaryIndicators == EnumValue) {
primaryIndicatorsData["dataList"]["list"].push({
primaryIndicators,
thirdLevelScore,
currentScore,
completionProgress,
schedule
});
let secondary = verificationEnumTools.changeEnumValue(configEnum.SECONDARYINDICATORS, secondaryIndicators);
if(!primaryIndicatorsData["detail"][secondary]) primaryIndicatorsData["detail"][secondary] = {schedule, dataList: []};
if (thirdLevelScore != currentScore) primaryIndicatorsData["detail"][secondary]["schedule"] = "进行中";
primaryIndicatorsData["detail"][secondary]["dataList"].push({
thirdLevelContent,
thirdLevelScore,
});
}
})
partyQualityList.push(primaryIndicatorsData);
}
}
let partyQuality = [];
partyQualityList.forEach( item => {
let {dataList} = item;
let {key, value, list} = dataList;
let count = list.length;
let changeDataInfo:any = {};
let changeData:any = {totalScore:0, completionProgress:0, currentScore:0};
list.forEach( info => {
let {thirdLevelScore, currentScore, completionProgress, schedule} = info;
changeData.schedule = schedule;
changeData.totalScore += thirdLevelScore;
changeData.completionProgress += completionProgress;
changeData.currentScore += currentScore;
})
let completion = changeData.completionProgress/count;
if (completion == 100) changeData.schedule = "已完成";
changeData.completionProgress = Math.round(completion);
changeDataInfo.key = key;
changeDataInfo.value = value;
changeDataInfo.dataInfo = changeData;
partyQuality.push(changeDataInfo);
})
return {dataList:partyQuality};
}
export async function partyQualityInfo( qualityId:number) {
verificationEnumTools.eccEnumValue("获取详情", "qualityId", configEnum.PRIMARYINDICATORS, qualityId);
let dataYear = moment(new Date().valueOf()).format("YYYY");
let selectParam = {primaryIndicators:qualityId};
let clomun = ["tlId", "primaryIndicators", "secondaryIndicators", "thirdLevelContent", "thirdLevelScore", "currentScore", "completionProgress"];
let partyQualityData = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.党建质量三级指标, selectParam, clomun);
let dataMap = {};
partyQualityData.forEach(info => {
if (!dataMap[info.secondaryIndicators]) dataMap[info.secondaryIndicators] = {state:1, content:info.thirdLevelContent};
else {
dataMap[info.secondaryIndicators].content += "<br>";
dataMap[info.secondaryIndicators].content += info.thirdLevelContent;
}
if (info.completionProgress < 100) dataMap[info.secondaryIndicators].state = 0;
});
let dataList = [];
for (let key in dataMap) {
let title = verificationEnumTools.changeEnumValue(configEnum.SECONDARYINDICATORS, parseInt(key));
dataList.push({
title,
content:dataMap[key].content,
schedule:dataMap[key].state == 1 ? "已完成" : "进行中"
});
}
return {dataList};
}
......@@ -26,11 +26,13 @@ function checkDWLeader(partyPositionsNames) {
}
export async function login(loginId:string, pwd:string) {
let clomun = ["pmId", "loginId", "pwd", "token", "bId", "administrativePositionName", "partyPositionsName"];
let clomun = ["pmId", "loginId", "pwd", "token", "bId", "administrativePositionName", "partyPositionsName", "firstChangeLogin"];
let loginInfo:any = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.党员基础信息表, {loginId}, clomun);
if (!loginInfo) throw new BizError(ERRORENUM.账号不存在, `${loginId}账号非党员账号`);
if (loginInfo.pwd != pwd) throw new BizError(ERRORENUM.密码错误);
let check = sysTools.getPwdMd5(loginId, pwd);
if (loginInfo.pwd != check) throw new BizError(ERRORENUM.密码错误);
const Token = sysTools.getToken(loginId);
......@@ -51,6 +53,7 @@ export async function login(loginId:string, pwd:string) {
name:loginInfo.name,
bId: loginInfo.bId,
userType,
firstChangeLogin:loginInfo.firstChangeLogin != 1
};
}
......@@ -64,28 +67,44 @@ export async function login(loginId:string, pwd:string) {
* @param confirmPwd 确认新密码 未md5
* @returns {isSuccess:true}
*/
export async function changePassword(loginId:string, pwd:string, newPwd:string, confirmPwd:string ) {
export async function changePassword(userId:string, pwd:string, newPwd:string, confirmPwd:string ) {
if (newPwd != confirmPwd) throw new BizError(ERRORENUM.密码不一致);
if (newPwd.search(/^[A-Za-z0-9]{6,18}$/) < 0) throw new BizError(ERRORENUM.密码只能由618位字符和数字组成);
let partyMemberInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.党员基础信息表, {loginId}, ["pmId", "loginId", "pwd"]);
let partyMemberInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.党员基础信息表, {pmId:userId}, ["pmId", "loginId", "pwd"]);
if (!partyMemberInfo) throw new BizError(ERRORENUM.未找到数据);
/**由于pwd是md5之后的 所以这里md5一次即可 */
let checkPwd = sysTools.getPwdMd5(partyMemberInfo.loginId, pwd);
if (partyMemberInfo.pwd != checkPwd) throw new BizError(ERRORENUM.密码错误);
/**由于pwd是md5之后的 所以这里md5一次即可 */
let newCheckPwd = sysTools.getPwdMd5(partyMemberInfo.loginId, newPwd );
/**考虑到如果前端把新密码也md5 就不可以验证是不是符合规则 所以前端传的是明文
* 我们初始化密码的时候 有两次加密 第一次是密码md5 然后再和loginId 进行md5
* 于是这里也要如此操作
*/
partyMemberInfo.pwd = sysTools.getPwdMd5(loginId, sysTools.md5PwdStr(newPwd));
await partyMemberInfo.save();
partyMemberInfo.pwd = checkPwd;
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.党员基础信息表, {pwd:newCheckPwd}, {pmId:userId});
return {isSuccess:true};
}
export async function firstChangePwd(userId, newPwd, confirmation) {
if (newPwd != confirmation) throw new BizError(ERRORENUM.密码不一致);
let partyMemberInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.党员基础信息表, {pmId:userId}, ["pmId", "loginId", "pwd"]);
if (!partyMemberInfo) throw new BizError(ERRORENUM.未找到数据);
let checkPwd = sysTools.getPwdMd5(partyMemberInfo.loginId, newPwd);
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.党员基础信息表, {pwd:checkPwd, firstChangeLogin:1}, {pmId:userId});
return {isSuccess:true};
}
......
......@@ -20,7 +20,7 @@ lanuch();
async function test() {
// await dataInit()
await dataInit()
// let pwd = md5PwdStr("admin");
// console.log();
// let data = await partyQualityList(1);
......
......@@ -57,3 +57,21 @@ export async function checkAppletDWToken(req, res, next) {
next();
}
export async function checkAdminToken(req, res, next) {
if (!req.headers) req.headers = {};
let ReqToken = req.headers.token;
let UserId = req.headers.userid;
if(!UserId || !ReqToken) return next(new BizError(ERRORENUM.非法登录));
let partyMemberInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.党员基础信息表, {pmId: UserId}, ["pmId", "bId", "loginId", "token"]);
if (!partyMemberInfo || !partyMemberInfo.pmId) return next(new BizError(ERRORENUM.身份验证失败));
if (!partyMemberInfo.token || partyMemberInfo.token != ReqToken) return next(new BizError(ERRORENUM.身份验证过期));
req.headers.userid = partyMemberInfo.pmId;
req.headers.bId = partyMemberInfo.bId;
next();
}
\ No newline at end of file
/**
* 小程序端
* 党建首页路由
*/
import * as adminBiz from '../biz/admin';
import * as asyncHandler from 'express-async-handler';
import { eccReqParamater } from '../util/verificationParam';
import { checkAdminToken } from '../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/yfs/admin/login', asyncHandler(login));
httpServer.post('/yfs/admin/logout', asyncHandler(logout));
httpServer.post('/yfs/admin/zzjg', checkAdminToken, asyncHandler(zzjg));//组织机构
httpServer.post('/yfs/admin/dyxx/list', checkAdminToken, asyncHandler(dyxx_list));
httpServer.post('/yfs/admin/dyxx/change', checkAdminToken, asyncHandler(dyxx_change));
// httpServer.post('/yfs/admin/dyxx/add', checkAdminToken, asyncHandler(dyxx_add));
// httpServer.post('/yfs/admin/dfgl/list', checkAdminToken, asyncHandler(dfgl_list));
// httpServer.post('/yfs/admin/dfgl/add', checkAdminToken, asyncHandler(dfgl_add));
// httpServer.post('/yfs/admin/dfgl/del', checkAdminToken, asyncHandler(dfgl_del));
// httpServer.post('/yfs/admin/dfgl/sublist', checkAdminToken, asyncHandler(dfgl_sublist));
}
async function login(req, res) {
let reqConf = {pwd:'String', loginId:'String'};
let {loginId, pwd} = eccReqParamater(reqConf, req.body);
const UserId = req.headers.userid;
let userInfo = await adminBiz.login(loginId, pwd);
res.success(userInfo);
}
async function logout(req, res) {
const UserId = req.headers.userid;
let userInfo = await adminBiz.logOut(UserId);
res.success(userInfo);
}
async function zzjg(req, res) {
let userInfo = await adminBiz.zzjgList();
res.success(userInfo);
}
async function dyxx_list(req, res) {
let reqConf = {etId:"Number", str:"String", bId:"Number", startMs:"Number", endMs:"Number", page:"Number"};
let {etId, str, bId, startMs, endMs, page} = eccReqParamater(reqConf, req.body, ["str", "bId", "startMs", "endMs"]);
let userInfo = await adminBiz.dyxxList(etId, str, bId, startMs, endMs, page);
res.success(userInfo);
}
async function dyxx_change(req, res) {
// let reqConf = {pmId:'String', confirmation:'String'};
// let {confirmation, pwd} = eccReqParamater(reqConf, req.body);
// const UserId = req.headers.userid;
// let userInfo = await adminBiz.firstChangePwd(UserId, pwd, confirmation);
// res.success(userInfo);
}
// async function dyxx_add(req, res) {
// let reqConf = {pwd:'String', confirmation:'String'};
// let {confirmation, pwd} = eccReqParamater(reqConf, req.body);
// const UserId = req.headers.userid;
// let userInfo = await userBiz.firstChangePwd(UserId, pwd, confirmation);
// res.success(userInfo);
// }
// async function dfgl_list(req, res) {
// let reqConf = {pwd:'String', confirmation:'String'};
// let {confirmation, pwd} = eccReqParamater(reqConf, req.body);
// const UserId = req.headers.userid;
// let userInfo = await userBiz.firstChangePwd(UserId, pwd, confirmation);
// res.success(userInfo);
// }
// async function dfgl_add(req, res) {
// let reqConf = {pwd:'String', confirmation:'String'};
// let {confirmation, pwd} = eccReqParamater(reqConf, req.body);
// const UserId = req.headers.userid;
// let userInfo = await userBiz.firstChangePwd(UserId, pwd, confirmation);
// res.success(userInfo);
// }
// async function dfgl_del(req, res) {
// let reqConf = {pwd:'String', confirmation:'String'};
// let {confirmation, pwd} = eccReqParamater(reqConf, req.body);
// const UserId = req.headers.userid;
// let userInfo = await userBiz.firstChangePwd(UserId, pwd, confirmation);
// res.success(userInfo);
// }
// async function dfgl_sublist(req, res) {
// let reqConf = {pwd:'String', confirmation:'String'};
// let {confirmation, pwd} = eccReqParamater(reqConf, req.body);
// const UserId = req.headers.userid;
// let userInfo = await userBiz.firstChangePwd(UserId, pwd, confirmation);
// res.success(userInfo);
// }
\ No newline at end of file
......@@ -32,14 +32,76 @@ export function setRouter(httpServer) {
httpServer.post('/yfs/dw/applet/organizationallife/list', checkAppletDWToken, asyncHandler(organizational_life_list));
httpServer.post('/yfs/dw/applet/organizationallife/add', checkAppletDWToken, asyncHandler(add_details));
httpServer.post('/yfs/dw/applet/partyvanguard/list', checkAppletToken, asyncHandler(get_party_vanguard));
httpServer.post('/yfs/dw/applet/partyvanguard/detsils', checkAppletToken, asyncHandler(get_party_vanguard_detsils));
httpServer.post('/yfs/dw/applet/partyvanguard/add', checkAppletToken, asyncHandler(add_party_vanguard_detsils));
httpServer.post('/yfs/dw/applet/partyvanguard/list', checkAppletDWToken, asyncHandler(get_party_vanguard));
httpServer.post('/yfs/dw/applet/partyvanguard/detsils', checkAppletDWToken, asyncHandler(get_party_vanguard_detsils));
httpServer.post('/yfs/dw/applet/partyvanguard/add', checkAppletDWToken, asyncHandler(add_party_vanguard_detsils));
httpServer.post('/yfs/dw/applet/buildingdynamic/list', checkAppletDWToken, asyncHandler(partyBuildingDynamicList));
httpServer.post('/yfs/dw/applet/buildingdynamic/details', checkAppletDWToken, asyncHandler(detailsList));
httpServer.post('/yfs/dw/applet/partyquality/list', checkAppletToken, asyncHandler(getPartyQuality));
httpServer.post('/yfs/dw/applet/partyquality/detsils',checkAppletToken, asyncHandler(getPartyVanguardDetsils));
}
/**
* 党建指标指数 三级指标列表
* @param req
* @param res
*/
async function getPartyQuality(req, res) {
let result = await dwBiz.partyQualityList();
res.success(result);
}
/**
* 党建先锋 获取荣誉详情
* @param req
* @param res
*/
async function getPartyVanguardDetsils(req, res) {
let reqConf = {qualityId:'Number'};
let {qualityId} = eccReqParamater(reqConf, req.body);
let result = await dwBiz.partyQualityInfo(qualityId);
res.success(result);
}
/**
* 党建资讯列表
* @param req
* @param res
*/
async function partyBuildingDynamicList(req, res) {
let reqConf = {activitiesType:'Number'};
let {activitiesType} = eccReqParamater(reqConf, req.body);
let result = await dwBiz.partyBuildingDynamicList(activitiesType);
res.success(result);
}
/**
* 党建动态详情
* @param req
* @param res
*/
async function detailsList(req, res) {
let reqConf = {taId: 'Number'};
let {taId} = eccReqParamater(reqConf, req.body);
let result = await dwBiz.partyBuildingDynamicDetsils(taId);
res.success(result);
}
/**
*
* @param req
* @param res
......@@ -187,8 +249,7 @@ async function get_party_vanguard(req, res) {
let reqConf = { honorName:'String'};
let {honorName} = eccReqParamater(reqConf, req.body, ["honorName"]);
let bId = req.headers.bId;
let result = await dwBiz.dwPartyVanguardList(bId, honorName);
let result = await dwBiz.dwPartyVanguardList( honorName);
res.success(result);
}
......
......@@ -9,7 +9,17 @@ import { checkAppletToken } from '../../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/yfs/applet/partymember/login', asyncHandler(login));
httpServer.post('/yfs/applet/partymember/changePwd', checkAppletToken, asyncHandler(changePwd));
httpServer.post('/yfs/applet/partymember/changepwd', checkAppletToken, asyncHandler(changePwd));
httpServer.post('/yfs/applet/partymember/first/changepwd', checkAppletToken, asyncHandler(first_change_pwd));
}
async function first_change_pwd(req, res) {
let reqConf = {pwd:'String', confirmation:'String'};
let {confirmation, pwd} = eccReqParamater(reqConf, req.body);
const UserId = req.headers.userid;
let userInfo = await userBiz.firstChangePwd(UserId, pwd, confirmation);
res.success(userInfo);
}
......@@ -35,9 +45,9 @@ async function login(req, res) {
async function changePwd(req, res) {
let reqConf = {confirmPwd:'String', newPwd:'String', pwd:'String' };
let {confirmPwd, newPwd, pwd} = eccReqParamater(reqConf, req.body);
const Uscc = req.headers.uscc;
const UserId = req.headers.userid;
let result = await userBiz.changePassword(Uscc, pwd, newPwd, confirmPwd);
let result = await userBiz.changePassword(UserId, pwd, newPwd, confirmPwd);
res.success(result);
}
\ No newline at end of file
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