Commit cebf2675 by lixinming

no message

parent db6ddac6
......@@ -13,6 +13,7 @@ import moment = require("moment");
import { createEnterprise, deleteEnterprise,findEnterpriseCount, findEnterpriseByUscc, findEnterpriseListToPage, findEnterpriseListByFuHuaQiUsccName, 查询所有已绑定过的孵化器id, findEnterpriseList } from "../../data/enterprise/enterprise";
import { EnterpriseListConfig } from "../../config/ojbectResultKeyConfig";
import { findAllFuHuaQi, findFuHuaQiByUSCC } from "../../data/fuHuaQi/fuhuaqi";
import { OUTPUTTYPE } from "../../config/enum";
/**
......@@ -194,8 +195,9 @@ export async function enterpriseList(time:string, fuHuaQiUscc:string, industry,
* @param isNaturalPersonHolding 自然人控股
* @returns dataList
*/
export async function outPutEnterpriseData(time:string, fuHuaQiUscc:string, industry, isNaturalPersonHolding:number) {
export async function outPutEnterpriseData(time:string, fuHuaQiUscc:string, industry, isNaturalPersonHolding:number, type:Number) {
let selectParam:any = {};
if (type == OUTPUTTYPE.当前数据) {
if ( time.length > 0 ) {
let startT = moment(time).startOf('month').valueOf();
let endT = moment(time).endOf('month').valueOf();
......@@ -212,6 +214,8 @@ export async function outPutEnterpriseData(time:string, fuHuaQiUscc:string, indu
selectParam.isNaturalPersonHolding = isNaturalPersonHolding == 2 ? true : false;
}
}
let dataBaseList = await findEnterpriseList(selectParam );
let dataList = [];
dataBaseList.forEach( info => {
......
......@@ -14,6 +14,7 @@ import { checkChange, checkParamater, extractData, getTaskId } from "../../util/
import { findEnterpriseInfoByName, findEnterpriseListByFuHuaQiUsccName } from "../../data/enterprise/enterprise";
import { findFuHuaQiByName } from "../../data/fuHuaQi/fuhuaqi";
import moment = require("moment");
import { OUTPUTTYPE } from "../../config/enum";
/**
......@@ -187,15 +188,17 @@ export async function financingList(monthData:string, fuHuaQiName:string, indust
* @param page 页数
* @returns
*/
export async function outPutFinancingList(monthData:string, fuHuaQiName:string, industry, fuHuaQiInvestment:number) {
export async function outPutFinancingList(monthData:string, fuHuaQiName:string, industry, fuHuaQiInvestment:number, type:number) {
let selectParam:any = {};
if (type == OUTPUTTYPE.当前数据 ) {
let fuHuaQiUscc = "";
if (fuHuaQiName.length > 0) {
let fuHuaQiInfo = await findFuHuaQiByName(fuHuaQiName);
if(fuHuaQiInfo) fuHuaQiUscc = fuHuaQiInfo.uscc;
}
let selectParam:any = {};
if ( monthData.length > 0 ) {
let startT = moment(monthData).startOf('month').valueOf();
let endT = moment(monthData).endOf('month').valueOf();
......@@ -207,6 +210,7 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
selectParam.fuHuaQiInvestment = fuHuaQiInvestment == 2 ? true : false;
}
}
let dataBaseList = await findFinancingList(selectParam );
let dataList = [];
......
......@@ -9,7 +9,7 @@ import { findEnterpriseCount, findEnterpriseCountByFuHuaQiUscc, groupFindEnterpr
import { findFuHuaQiByUSCC, findFuHuaQiCount, findFuHuaQiList, findFuHuaQiListByPage } from "../../data/fuHuaQi/fuhuaqi";
import * as tools from "../../util/tools";
import { FuHuaQiHomeDataConfig, FuHuaQiBaseListConfig, FuHuaQiBaseDataConfig } from "../../config/ojbectResultKeyConfig";
import { FUHUAINDUSTRY, FUHUAQILNVESTMENTSTYLE, FUHUAQILV, INSTITUTIONALNATURE } from "../../config/enum";
import { FUHUAINDUSTRY, FUHUAQILNVESTMENTSTYLE, FUHUAQILV, INSTITUTIONALNATURE, OUTPUTTYPE } from "../../config/enum";
import { extractData } from "../../util/tools";
import { BizError } from "../../util/bizError";
import { ERRORENUM } from "../../config/errorEnum";
......@@ -147,11 +147,14 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
* @param industry
* @returns
*/
export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:number, industry:number) {
export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:number, industry:number, type:Number) {
let selectParam:any = {};
if (type == OUTPUTTYPE.当前数据) {
if (lv) selectParam.lv = lv;
if (institutionalNature) selectParam.institutionalNature = institutionalNature;
if (industry) selectParam.industry = industry;
}
let enterpriseMap = await groupFindEnterprise();//企业总数
......
......@@ -10,6 +10,7 @@ import * as monthData from "../../data/fuHuaQi/monthTable";
import { changeEnumValue, extractData, getTaskId } from "../../util/tools";
import { findAllFuHuaQiOperationNameMap } from "../../data/fuHuaQi/fuhuaqi";
import { MonthConfig } from "../../config/ojbectResultKeyConfig";
import { OUTPUTTYPE } from "../../config/enum";
/**
......@@ -136,14 +137,17 @@ export async function monthTableList(state:number, year:number, month:number, pa
* @param month 数据月份
* @param page 页面
*/
export async function outPutMonthTableList(state:number, year:number, month:number) {
export async function outPutMonthTableList(state:number, year:number, month:number, type:number) {
let selectParam:any = {};
// if (state) selectParam.state = state;
if (type == OUTPUTTYPE.当前数据 ) {
if (state == 2 || state == 3) {
selectParam.draftLock = state == 2 ? true : false;
}
if (year) selectParam.year = year;
if (month) selectParam.month = month;
}
let dataBaseList = await monthData.findMonthTableList(selectParam);
......
......@@ -4,31 +4,32 @@ import * as baseBiz from '../biz/fuHuqQi/base';
import * as enterpriseBiz from '../biz/enterprise/enterprise';
import * as financingBiz from '../biz/enterprise/financing';
import * as guanWeiHuiBiz from '../biz/guanWeiHui/user';
import { checkParamaterType, checkReqParam } from '../util/tools';
import { checkParamaterType, checkReqParam, getTimeKey } from '../util/tools';
import { BizError } from '../util/bizError';
import { ERRORENUM } from '../config/errorEnum';
import { monthTableList, outPutMonthTableList } from '../biz/fuHuqQi/month';
import { OUTPUTDATATYPE, OUTPUTTYPE } from '../config/enum';
import { checkGuanWeiHuiToken } from '../middleware/user';
export function setRouter(httpServer) {
// /**登录 */
httpServer.post('/admin/login', asyncHandler(login));
// /** 孵化器*/
httpServer.post('/admin/fuhuaqi/baselist', asyncHandler(fuHuaQiBaseList));
httpServer.post('/admin/fuhuaqi/monthoccupancyrate', asyncHandler(getMonthList));
httpServer.post('/admin/fuhuaqi/userlist', asyncHandler(getFuHuaQiUserList));
httpServer.post('/admin/fuhuaqi/updatestate', asyncHandler(updateState));
httpServer.post('/admin/fuhuaqi/adduser',asyncHandler(addUser));
httpServer.post('/admin/fuhuaqi/baselist',checkGuanWeiHuiToken, asyncHandler(fuHuaQiBaseList));
httpServer.post('/admin/fuhuaqi/monthoccupancyrate',checkGuanWeiHuiToken, asyncHandler(getMonthList));
httpServer.post('/admin/fuhuaqi/userlist',checkGuanWeiHuiToken, asyncHandler(getFuHuaQiUserList));
httpServer.post('/admin/fuhuaqi/updatestate',checkGuanWeiHuiToken, asyncHandler(updateState));
httpServer.post('/admin/fuhuaqi/adduser',checkGuanWeiHuiToken,asyncHandler(addUser));
/**企业 */
httpServer.post('/admin/enterprise/list', asyncHandler(getEnterpriseList));
httpServer.post('/admin/enterprise/financinglist', asyncHandler(getFinancingList));
httpServer.post('/admin/enterprise/affiliationfuhuaqi',asyncHandler(affiliationFuHuaQi));
httpServer.post('/admin/enterprise/list',checkGuanWeiHuiToken, asyncHandler(getEnterpriseList));
httpServer.post('/admin/enterprise/financinglist',checkGuanWeiHuiToken, asyncHandler(getFinancingList));
httpServer.post('/admin/enterprise/affiliationfuhuaqi',checkGuanWeiHuiToken,asyncHandler(affiliationFuHuaQi));
/**导出数据 */
httpServer.post('/admin/data/output/fuhuaqi', asyncHandler(outPutFuHuaQiData));
httpServer.post('/admin/data/output/enterprise', asyncHandler(outPutEnterpriseData));
httpServer.post('/admin/data/output/financing', asyncHandler(outPutFinancingData));
httpServer.post('/admin/data/output/month', asyncHandler(outPutMonthData));
httpServer.post('/admin/data/output/fuhuaqi',checkGuanWeiHuiToken, asyncHandler(outPutFuHuaQiData));
httpServer.post('/admin/data/output/enterprise',checkGuanWeiHuiToken, asyncHandler(outPutEnterpriseData));
httpServer.post('/admin/data/output/financing',checkGuanWeiHuiToken, asyncHandler(outPutFinancingData));
httpServer.post('/admin/data/output/month',checkGuanWeiHuiToken, asyncHandler(outPutMonthData));
}
......@@ -156,15 +157,10 @@ async function affiliationFuHuaQi(req, res) {
async function outPutFuHuaQiData(req, res) {
let reqConf = {lv: 'Number', institutionalNature: 'Number', industry: 'Number', dataType:'Number', type:'Number', page:'Number' };
let { lv, institutionalNature, industry, type, page } = checkParamaterType(reqConf, req.body);
let reqConf = {lv: 'Number', institutionalNature: 'Number', industry: 'Number', dataType:'Number', type:'Number'};
let { lv, institutionalNature, industry, type } = checkParamaterType(reqConf, req.body);
let dataList = [];
if (type == OUTPUTTYPE.全部数据) dataList = await baseBiz.outPutFuHuaQiBaseData(lv, institutionalNature, industry);
else {
let baseData = await baseBiz.fuHuaQiBaseList(lv, institutionalNature, industry, page);
dataList = baseData.dataList;
}
let dataList = await baseBiz.outPutFuHuaQiBaseData(lv, institutionalNature, industry, type);
let keyList = [
"name","operationName","uscc","virtualEnterpriseNum","logonTime",
......@@ -186,22 +182,18 @@ async function outPutFuHuaQiData(req, res) {
});
result.push(subList);
});
let name = `孵化器列表${getTimeKey()}.xlsx`;
res.success({data:result});
res.success({name, data:result});
}
async function outPutEnterpriseData(req, res) {
let reqConf = {time: 'Number', fuHuaQiUscc: 'String', industry: '[Number]', isNaturalPersonHolding: 'Number', page: 'Number', type:'Number' };
let reqConf = {time: 'Number', fuHuaQiUscc: 'String', industry: '[Number]', isNaturalPersonHolding: 'Number', type:'Number' };
let { time, fuHuaQiUscc, industry, isNaturalPersonHolding, page, type } = checkParamaterType(reqConf, req.body);
let dataList = [];
if (type == OUTPUTTYPE.全部数据) dataList = await enterpriseBiz.outPutEnterpriseData(time, fuHuaQiUscc, industry, isNaturalPersonHolding);
else {
let baseData = await enterpriseBiz.enterpriseList(time, fuHuaQiUscc, industry, isNaturalPersonHolding, page);
dataList = baseData.dataList;
}
let dataList = await enterpriseBiz.outPutEnterpriseData(time, fuHuaQiUscc, industry, isNaturalPersonHolding, type);
let keyList = [
"name", "createTime", "fuhuaqiUscc", "uscc", "industry", "logonTime",
......@@ -222,19 +214,16 @@ async function outPutEnterpriseData(req, res) {
result.push(subList);
});
res.success({data:result});
let name = `在孵企业${getTimeKey()}.xlsx`;
res.success({name, data:result});
}
async function outPutFinancingData(req, res) {
let reqConf = {monthData: 'String', fuHuaQiName: 'String', fuHuaQiInvestment: 'Number', industry: '[Number]', page: 'Number', type:'Number' };
let {monthData, fuHuaQiName, industry, fuHuaQiInvestment, page, type} = checkParamaterType(reqConf, req.body);
let reqConf = {monthData: 'String', fuHuaQiName: 'String', fuHuaQiInvestment: 'Number', industry: '[Number]', type:'Number' };
let {monthData, fuHuaQiName, industry, fuHuaQiInvestment, type} = checkParamaterType(reqConf, req.body);
let dataList = [];
if (type == OUTPUTTYPE.全部数据) dataList = await financingBiz.outPutFinancingList(monthData, fuHuaQiName, industry, fuHuaQiInvestment);
else {
let baseData = await financingBiz.financingList(monthData, fuHuaQiName, industry, fuHuaQiInvestment, page);
dataList = baseData.dataList;
}
let dataList = await financingBiz.outPutFinancingList(monthData, fuHuaQiName, industry, fuHuaQiInvestment, type);
let keyList = [
"name", "logonAdd", "operatingAdd", "financingAmount","investmentInstitutionsName",
......@@ -253,20 +242,17 @@ async function outPutFinancingData(req, res) {
result.push(subList);
});
res.success({data:result});
let name = `融资企业${getTimeKey()}.xlsx`;
res.success({name, data:result});
}
async function outPutMonthData(req, res) {
let reqConf = {state: 'Number', year: 'Number', month: 'Number', page: 'Number', type:'Number'};
let { state, year, month, page, type } = checkParamaterType(reqConf, req.body);
let reqConf = {state: 'Number', year: 'Number', month: 'Number', type:'Number'};
let { state, year, month, type } = checkParamaterType(reqConf, req.body);
let dataList = [];
if (type == OUTPUTTYPE.全部数据) dataList = await outPutMonthTableList(state, year, month);
else {
let baseData = await await monthTableList(state, year, month, page);
dataList = baseData.dataList;
}
let dataList = await outPutMonthTableList(state, year, month, type);
let keyList = [
"operationName",
......@@ -286,5 +272,7 @@ async function outPutMonthData(req, res) {
result.push(subList);
});
res.success({data:result});
let name = `月度任务${getTimeKey()}.xlsx`;
res.success({name, data:result});
}
\ No newline at end of file
......@@ -104,11 +104,12 @@ async function initFuHuaQiData() {
};
for (let i = 0; i < 12; i++) {
if (i == 10) continue;
let item = subList[i];
let item =subList[i];
let key = titleMap[i];
let value = item;
if (i ==2) {
addDataInfo.pwd = getPwdMd5(item, item.slice(item.length-6));
let itemStr = `${item}`;
addDataInfo.pwd = getPwdMd5(itemStr, itemStr.slice(itemStr.length-6));
}
if (i == 3) {
value = FUHUAQILV[item] || 0;
......
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