Commit 086a79fd by lixinming

no message

parent 59feaa59
......@@ -5,7 +5,7 @@
import moment = require("moment");
import { ARTICLEPOSITION, BANNERPOSITION, BRANCHPOSITION, CODPARTICIPANT, DANGJIANVIDEO, DONGTAIZIXUNSUBTYPE, IMGEDITFUNENUM, MEMBERSTATE, MEMBERTYPE, PARTYBUILDSUBTYPEENUM, PARTYBUILDTYPEENUM, STATE, TONGZHIGONGGAO, XUEHUILINGDAOZHIWEI } from "../config/enum";
import { TABLEENUM } from "../data/models/model";
import { find, findCount, findOnce, findToPage, findToSortToPage } from "../data/select";
import { find, findCount, findOnce, findToPage, findToSort, findToSortToPage } from "../data/select";
import { extractData } from "../util/piecemeal";
import { changeEnumValue, eccEnumValue } from "../util/verificationEnum";
import { BizError } from "../util/bizError";
......@@ -52,7 +52,7 @@ export async function homePage() {
});
/**学会动态 每个动态资讯取最新的可见的两个*/
let wenZhangTypeList = [ARTICLEPOSITION.动态资讯_hgh学会动态, ARTICLEPOSITION.动态资讯_hgh政策动向, ARTICLEPOSITION.动态资讯_hgh行业风采];
let dongTaiZiXunData = await find(TABLEENUM.文章管理, {articleType:{"$in":wenZhangTypeList }, display:STATE.});
let dongTaiZiXunData = await findToSort(TABLEENUM.文章管理, {articleType:{"$in":wenZhangTypeList }, display:STATE.}, {articleTime:-1});
dongTaiZiXunData.sort((a, b) => {return a.articleTime - b.articleTime});
let dongTaiZiXunDistinctMap = {};
dongTaiZiXunData.forEach(info => {
......@@ -145,7 +145,7 @@ export async function xueHuiGaiKuang() {
});
/**学会规章 */
let xueHuiGuiZhangData = await find(TABLEENUM.文章管理, {articleType:{"$in":[ARTICLEPOSITION.学会概况_hgh学会规章]}, display:STATE.} );
let xueHuiGuiZhangData = await findToSort(TABLEENUM.文章管理, {articleType:{"$in":[ARTICLEPOSITION.学会概况_hgh学会规章]}, display:STATE.},{articleTime:-1} );
for (let i = 0; i < xueHuiGuiZhangData.length; i++) {
let {id, title, imgUrl, articleTime, desc} = xueHuiGuiZhangData[i];
let articleDate = moment(articleTime);
......@@ -179,7 +179,7 @@ export async function xueHuiGaiKuangXiangQing() {
*/
export async function guiZhangLieBiaoFenYe({pageNumber}) {
let findParam = {articleType:{"$in":[ARTICLEPOSITION.学会概况_hgh学会规章]}, display:STATE.};
let wenZhangGuanLi = await findToPage(TABLEENUM.文章管理, findParam, [], pageNumber);
let wenZhangGuanLi = await findToSortToPage(TABLEENUM.文章管理, findParam, [], {articleTime:-1}, pageNumber);
let dataCount = await findCount(TABLEENUM.文章管理, findParam);
let dataList = [];
......@@ -219,7 +219,7 @@ export async function guiZhangZhiDuXiangQing({id}) {
export async function dongTaiZiXun({type, pageNumber}) {
eccEnumValue("官网", "行业动态类型", type, DONGTAIZIXUNSUBTYPE);
let findParam = {articleType:{"$in":[type]}, display:STATE.};
let dataBaseList = await findToPage(TABLEENUM.文章管理, findParam, [], pageNumber);
let dataBaseList = await findToSortToPage(TABLEENUM.文章管理, findParam, [], {articleTime:-1}, pageNumber);
let dataCount = await findCount(TABLEENUM.文章管理, findParam);
let dataList = [];
......@@ -288,7 +288,7 @@ export async function pinPaiXiangMu() {
};
/**乡村振兴 */
let locationParam = [ARTICLEPOSITION.品牌项目_hgh乡村振兴];
let xiangCunZhenXingData = await find(TABLEENUM.文章管理, {articleType:{"$in":locationParam}, display:STATE.} );
let xiangCunZhenXingData = await findToSort(TABLEENUM.文章管理, {articleType:{"$in":locationParam}, display:STATE.}, {articleTime:-1} );
xiangCunZhenXingData.forEach(info => {
let {id, title, imgUrl, articleTime, desc} = info;
result.xiangCunZhenXing.push({
......@@ -297,7 +297,7 @@ export async function pinPaiXiangMu() {
});
/**芳华杯 */
locationParam = [ARTICLEPOSITION.品牌项目_hgh芳华杯];
let fangHuaBeiData = await find(TABLEENUM.文章管理, {articleType:{"$in":locationParam}, display:STATE.} );
let fangHuaBeiData = await findToSort(TABLEENUM.文章管理, {articleType:{"$in":locationParam}, display:STATE.}, {articleTime:-1} );
fangHuaBeiData.forEach(info => {
let {id, title, imgUrl, articleTime, desc} = info;
result.fangHuaBei.push({
......@@ -306,7 +306,7 @@ export async function pinPaiXiangMu() {
});
/**学术研究 */
locationParam = [ARTICLEPOSITION.品牌项目_hgh学术研究];
let xueShuYanJiuData = await find(TABLEENUM.文章管理, {articleType:{"$in":locationParam}, display:STATE.} );
let xueShuYanJiuData = await findToSort(TABLEENUM.文章管理, {articleType:{"$in":locationParam}, display:STATE.}, {articleTime:-1} );
xueShuYanJiuData.forEach(info => {
let {id, title, imgUrl, articleTime, desc} = info;
result.xueShuYanJiu.push({
......@@ -332,7 +332,7 @@ export async function pinPaiXiangMu() {
*/
export async function xueshuyanjiu({pageNumber}) {
let findParam = {articleType:{"$in":[ARTICLEPOSITION.品牌项目_hgh学术研究]}, display:STATE.};
let dataBaseList = await findToPage(TABLEENUM.文章管理, findParam, [], pageNumber);
let dataBaseList = await findToSortToPage(TABLEENUM.文章管理, findParam, [], {articleTime:-1}, pageNumber);
let dataCount = await findCount(TABLEENUM.文章管理, findParam);
let dataList = [];
......@@ -354,7 +354,7 @@ export async function xueshuyanjiu({pageNumber}) {
*/
export async function xiangCunZhenXing({pageNumber}) {
let findParam = {articleType:{"$in":[ARTICLEPOSITION.品牌项目_hgh乡村振兴]}, display:STATE.};
let dataBaseList = await findToPage(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "imgUrl", "articleTime" ], pageNumber);
let dataBaseList = await findToSortToPage(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "imgUrl", "articleTime" ], {articleTime:-1}, pageNumber);
let dataCount = await findCount(TABLEENUM.文章管理, findParam);
let dataList = [];
......@@ -383,7 +383,7 @@ export async function zhuTiJiaoYu() {
let itemId = info.id;
dataInfo[info.name] = [];
let findParam = {articleType:{"$in":[itemId]}, display:STATE.};
let dataBaseList = await find(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "articleTime", "imgUrl"]);
let dataBaseList = await findToSort(TABLEENUM.文章管理, findParam, {articleTime:-1}, ["id", "title", "desc", "articleTime", "imgUrl"]);
dataBaseList.forEach(item => {
let {id, title, desc, articleTime, imgUrl} = item;
let timeStr = moment(articleTime).format("YYYY-MM-DD")
......@@ -442,7 +442,7 @@ export async function dangJianZiYuan({first, secondary, three, pageNumber}) {
let dataCount = 0;
if (first == PARTYBUILDTYPEENUM.主题教育) {
let findParam = {articleType:{"$in":[secondary]}, display:STATE.};
let dataBaseList = await findToPage(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "articleTime", "imgUrl"], pageNumber);
let dataBaseList = await findToSortToPage(TABLEENUM.文章管理, findParam, ["id", "title", "desc", "articleTime", "imgUrl"], {articleTime:-1}, pageNumber);
dataCount = await findCount(TABLEENUM.文章管理, findParam);
dataBaseList.forEach(item => {
let {title, desc, articleTime, imgUrl, id} = item;
......@@ -581,7 +581,7 @@ export async function tongZhiGongGaoInfo({id, type}) {
export async function reMenPaiHang({type}) {
/**学会动态 每个动态资讯取最新的可见的三个*/
let wenZhangTypeList = [type];
let dongTaiZiXunData = await find(TABLEENUM.文章管理, {articleType:{"$in":wenZhangTypeList }, display:STATE.});
let dongTaiZiXunData = await findToSort(TABLEENUM.文章管理, {articleType:{"$in":wenZhangTypeList }, display:STATE.}, {articleTime:-1});
let dataList = [];
dongTaiZiXunData.forEach(info => {
let {id, title, articleTime, desc } = info;
......
......@@ -8,7 +8,7 @@ import { ERRORENUM } from "../../../config/errorEnum";
import { addOneData } from "../../../data/add";
import { deleteOneData } from "../../../data/delete";
import { TABLEENUM } from "../../../data/models/model";
import { find, findCount, findOnce, findToPage } from "../../../data/select";
import { find, findCount, findOnce, findToPage, findToSortToPage } from "../../../data/select";
import { updateOneData } from "../../../data/update";
import { changeArticleName, generateSystemId, successResult } from "../../../tools/system";
import { BizError } from "../../../util/bizError";
......@@ -64,7 +64,7 @@ export async function list(secureArgs:any) {
let selectParam:any = {};
if (title) selectParam.title = title;
let dbList = await findToPage(TABLEENUM.banner管理, selectParam, [ "id", "location","articleTitle", "position","articleUrl", "display", "desc"], pageNumber);
let dbList = await findToSortToPage(TABLEENUM.banner管理, selectParam, [ "id", "location","articleTitle", "position","articleUrl", "display", "desc"], {ct:-1}, pageNumber);
let dataCount = await findCount(TABLEENUM.banner管理, selectParam);
let dataList = [];
......
......@@ -8,7 +8,7 @@ import { ERRORENUM } from "../../../config/errorEnum";
import { addOneData } from "../../../data/add";
import { deleteOneData } from "../../../data/delete";
import { TABLEENUM } from "../../../data/models/model";
import { find, findCount, findOnce, findToPage } from "../../../data/select";
import { find, findCount, findOnce, findToPage, findToSortToPage } from "../../../data/select";
import { updateOneData } from "../../../data/update";
import { changeArticleName, generateSystemId, successResult } from "../../../tools/system";
import { BizError } from "../../../util/bizError";
......@@ -73,7 +73,7 @@ export async function list(secureArgs:any) {
];
}
let dbList = await findToPage(TABLEENUM.文章管理, selectParam, [ "id", "title", "articleType", "imgUrl", "articleTime", "desc", "display"], pageNumber);
let dbList = await findToSortToPage(TABLEENUM.文章管理, selectParam, [ "id", "title", "articleType", "imgUrl", "articleTime", "desc", "display"], {articleTime:-1}, pageNumber);
let dataCount = await findCount(TABLEENUM.文章管理, selectParam);
let dataList = [];
dbList.forEach(info => {
......
......@@ -11,7 +11,6 @@ import { updateOneData } from "../../../data/update";
import { changeArticleName, generateSystemId, successResult } from "../../../tools/system";
import { BizError } from "../../../util/bizError";
import { extractData } from "../../../util/piecemeal";
import { changeEnumValue } from "../../../util/verificationEnum";
/**
* 列表
......
......@@ -101,7 +101,7 @@ export enum XUEHUILINGDAOZHIWEI {
会长 = 1,
副会长,
秘书长,
监事
监事
}
......@@ -613,7 +613,41 @@ export enum MYORDERLISTPAYSTATE {
缴费失败
}
/**
* 文件上传目录
*/
export enum FILEDIRECTORY {
专题系列 = 'zhuantixilie',
学会概况 = 'xuehuigaikuang',
学会领导 = 'xuehuilingdao',
学术研究 = 'xueshuyanjiu',
文字资料 = 'wenziziliao',
机构管理logo = 'jigouguanlilogo',
机构动态 = 'jigoudongtai',
机构下载专区 = 'jigouxiazaizhuanqu',
banner = 'banner',
文章管理 = 'wenzhangguanli',
视频管理 = 'shipinguanli',
视频管理封面 = 'shipinguanlifengmian',
线下付款转账截图 = 'xianxiazhuanzhangjietu',
会费发票 = 'huifeifapiao'
}
export enum OOSCODE {
专题系列 = 1,
学会概况,
学会领导,
学术研究,
文字资料,
机构管理logo,
机构动态,
机构下载专区,
banner,
文章管理,
视频管理,
视频管理封面,
线下付款转账截图,
会费发票
}
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