Commit 61026a17 by chenjinjing

no message

parent 806d4c53
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"pyfl": "^1.1.4", "pyfl": "^1.1.4",
"request": "^2.88.0", "request": "^2.88.0",
"svg-captcha": "^1.3.12", "svg-captcha": "^1.3.12",
"tencentcloud-sdk-nodejs": "^4.1.103",
"xml2js": "^0.4.23" "xml2js": "^0.4.23"
}, },
"scripts": { "scripts": {
......
...@@ -259,7 +259,8 @@ export enum EMIGRATIONTYPE { ...@@ -259,7 +259,8 @@ export enum EMIGRATIONTYPE {
毕业迁出 = 1, 毕业迁出 = 1,
毕业未迁出, //新加状态 毕业未迁出, //新加状态
到期退租, 到期退租,
违约退租 违约退租,
到期未迁出
} }
......
import { INTERFACErEQUESTTYPEENUM } from "./enum"; import { INTERFACErEQUESTTYPEENUM } from "./enum";
// 请把 "INTERFACErEQUESTTYPEENUM.即时更新" 改成 INTERFACErEQUESTTYPEENUM.即时更新 把引号去掉 【定时更新同理 】 // 请把 "INTERFACErEQUESTTYPEENUM.即时更新" 改成 INTERFACErEQUESTTYPEENUM.即时更新 把引号去掉 【定时更新同理 】
export const Config = {"维迈科企业数字画像":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}},"绩效管理驾驶舱":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}},"企业服务":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}},"智慧运营":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}}}; export const Config = {
"维迈科企业数字画像":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}},
"绩效管理驾驶舱":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}},
"企业服务":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}},
"智慧运营":{"type":"INTERFACErEQUESTTYPEENUM.即时更新","time":3600000,"url":"url地址","reqType":"post","header":{},"body":{}}
};
\ No newline at end of file
...@@ -99,19 +99,33 @@ export async function getJxgljsc() { ...@@ -99,19 +99,33 @@ export async function getJxgljsc() {
let qyfhsInfo = await qyfhs(企业资质信息); let qyfhsInfo = await qyfhs(企业资质信息);
jxgljsc.孵化成果.dataList = getKeyValue(qyfhsInfo)//企业孵化数 jxgljsc.孵化成果.dataList = getKeyValue(qyfhsInfo)//企业孵化数
let 毕业Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, { "moveOutType": EMIGRATIONTYPE.毕业迁出 }, []); let 毕业param = {
"%or%":[
{ "moveOutType": EMIGRATIONTYPE.毕业迁出 },
{ "moveOutType": EMIGRATIONTYPE.毕业未迁出 }
]
}
let 毕业Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 毕业param, []);
let 孵化Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, {}, null); let 孵化Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, {}, null);
let currentYear = moment().format("YYYY")+"-01-01"; let currentYear = moment().format("YYYY")+"-01-01";
let 今年Param = { startTime:{"%between%": [currentYear, getMySqlMs()]} }; let 今年Param = { startTime:{"%between%": [currentYear, getMySqlMs()]} };
let 今年毕业Param = {moveOutTime:{"%between%": [currentYear, getMySqlMs()]}, moveOutType:EMIGRATIONTYPE.毕业迁出}; // let 今年毕业Param = {moveOutTime:{"%between%": [currentYear, getMySqlMs()]}, moveOutType:EMIGRATIONTYPE.毕业迁出};
let 今年毕业Param = {moveOutTime:{"%between%": [currentYear, getMySqlMs()]}, "%or%":[
{ "moveOutType": EMIGRATIONTYPE.毕业迁出 },
{ "moveOutType": EMIGRATIONTYPE.毕业未迁出 }
]};
let 今年毕业Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 今年毕业Param, []); let 今年毕业Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 今年毕业Param, []);
let 今年孵化Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 今年Param, null); let 今年孵化Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 今年Param, null);
let lastYearMonthStart = moment().subtract(1, 'years').startOf('year').format('YYYY-MM-DD'); let lastYearMonthStart = moment().subtract(1, 'years').startOf('year').format('YYYY-MM-DD');
let lastYearMonthEnd = moment().subtract(1, 'years').endOf('year').format('YYYY-MM-DD'); let lastYearMonthEnd = moment().subtract(1, 'years').endOf('year').format('YYYY-MM-DD');
let 去年Param = { startTime:{"%between%": [lastYearMonthStart, lastYearMonthEnd]} }; let 去年Param = { startTime:{"%between%": [lastYearMonthStart, lastYearMonthEnd]} };
let 去年毕业Param = {moveOutTime:{"%between%": [lastYearMonthStart, lastYearMonthEnd]}, moveOutType:EMIGRATIONTYPE.毕业迁出}; // let 去年毕业Param = {moveOutTime:{"%between%": [lastYearMonthStart, lastYearMonthEnd]}, moveOutType:EMIGRATIONTYPE.毕业迁出};
let 去年毕业Param = {moveOutTime:{"%between%": [lastYearMonthStart, lastYearMonthEnd]}, "%or%":[
{ "moveOutType": EMIGRATIONTYPE.毕业迁出 },
{ "moveOutType": EMIGRATIONTYPE.毕业未迁出 }
]};
let 去年毕业Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 去年毕业Param, []); let 去年毕业Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 去年毕业Param, []);
let 去年孵化Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 去年Param, null); let 去年孵化Count = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.企业孵化信息, 去年Param, null);
......
...@@ -226,6 +226,17 @@ function getStartAndEndTimeMonthList(startTime, endTime) { ...@@ -226,6 +226,17 @@ function getStartAndEndTimeMonthList(startTime, endTime) {
} }
export function getKeyValueNum(data) {
let result = [];
for (let key in data) {
let value = data[key];
result.push({key, value});
}
return result;
}
export function getKeyValue(data) { export function getKeyValue(data) {
let result = []; let result = [];
for (let key in data) { for (let key in data) {
......
...@@ -2,7 +2,7 @@ import moment = require("moment"); ...@@ -2,7 +2,7 @@ import moment = require("moment");
import { BUILDING, CHANGESTATE, EMIGRATIONTYPE, FOLLOWUPSTATUS, FUHUASTATE, INDUSTRY, NEEDCATEGORY, OFFLINEPROMOTION, ONLINEPROMOTION, OPERATIONALDATATYPE, POLICYTYPE, PROMOTIONTYPE, STATE, TABLENAME } from "../../config/enum"; import { BUILDING, CHANGESTATE, EMIGRATIONTYPE, FOLLOWUPSTATUS, FUHUASTATE, INDUSTRY, NEEDCATEGORY, OFFLINEPROMOTION, ONLINEPROMOTION, OPERATIONALDATATYPE, POLICYTYPE, PROMOTIONTYPE, STATE, TABLENAME } from "../../config/enum";
import { selectData, selectManyTableData } from "./operationalData"; import { selectData, selectManyTableData } from "./operationalData";
import { changeEnumValue } from "../../tools/eccEnum"; import { changeEnumValue } from "../../tools/eccEnum";
import { getAll知识产权, getRecentQuarters, get在孵企业面积, get在孵企业面积变化趋势, get明星企业列表 } from "./out"; import { getAll知识产权, getKeyValueNum, getRecentQuarters, get在孵企业面积, get在孵企业面积变化趋势, get明星企业列表 } from "./out";
import { getMySqlMs } from "../../tools/systemTools"; import { getMySqlMs } from "../../tools/systemTools";
import { getKeyValue } from "./out"; import { getKeyValue } from "./out";
...@@ -169,8 +169,8 @@ export async function getZhyy() { ...@@ -169,8 +169,8 @@ export async function getZhyy() {
zhyy.运营推广.线上推广.count = totalAll ? `${Math.round(线上推广.total / totalAll * 100)}%` : "0%"; zhyy.运营推广.线上推广.count = totalAll ? `${Math.round(线上推广.total / totalAll * 100)}%` : "0%";
zhyy.运营推广.线下推广.count = totalAll ? `${Math.round(线下推广.total / totalAll * 100)}%` : "0%"; zhyy.运营推广.线下推广.count = totalAll ? `${Math.round(线下推广.total / totalAll * 100)}%` : "0%";
zhyy.运营推广.线上推广.dataList = getKeyValue(线上推广.apps); zhyy.运营推广.线上推广.dataList = getKeyValueNum(线上推广.apps);
zhyy.运营推广.线下推广.dataList = getKeyValue(线下推广.apps); zhyy.运营推广.线下推广.dataList = getKeyValueNum(线下推广.apps);
//汇总数据 //汇总数据
let hzsj = { let hzsj = {
......
...@@ -4,15 +4,11 @@ import { initInterfaceData } from "./data/interface/cronJob"; ...@@ -4,15 +4,11 @@ import { initInterfaceData } from "./data/interface/cronJob";
import { httpServer } from "./net/http_server"; import { httpServer } from "./net/http_server";
async function lanuch() { async function lanuch() {
test();
await initConfig(); await initConfig();
// initInterfaceData();
httpServer.createServer( systemConfig.port ); httpServer.createServer( systemConfig.port );
console.log('This indicates that the server is started successfully.'); console.log('This indicates that the server is started successfully.');
} }
function test() {
}
lanuch(); lanuch();
import { bizlive } from "tencentcloud-sdk-nodejs";
import { ERRORCODEENUM } from "../config/errorEnum";
/**
* 中间件 错误返回
* @param err
* @param req
* @param res
* @param next
*/
export function httpErrorHandler(err, req, res, next) {
// console.log("in httpErrorHandler");
console.log(err);
//todo 自定义错误编码
if (err) {
if ( ERRORCODEENUM[err.message] ) {
res.success({success:false, msg:err.message, code:ERRORCODEENUM[err.message]});
next();
}
else {
console.log(req.ip, err.message);
res.send({success:false, msg:err.message, code:500});
// res.success({success:false, msg:err.message, code:500});
next();
}
}
}
...@@ -5,6 +5,7 @@ import routers = require('../routers/router'); ...@@ -5,6 +5,7 @@ import routers = require('../routers/router');
import compression = require('compression'); import compression = require('compression');
import * as fallback from 'express-history-api-fallback'; import * as fallback from 'express-history-api-fallback';
import * as path from "path"; import * as path from "path";
import { httpErrorHandler } from '../middleware/httpErrorHandler';
export class httpServer { export class httpServer {
...@@ -36,6 +37,7 @@ export class httpServer { ...@@ -36,6 +37,7 @@ export class httpServer {
httpServer.use(express.static(path.join(__dirname, "../../img/")) ); httpServer.use(express.static(path.join(__dirname, "../../img/")) );
httpServer.use(express.static(root)) httpServer.use(express.static(root))
httpServer.use(fallback('index.html', { root })) httpServer.use(fallback('index.html', { root }))
httpServer.use(httpErrorHandler);
console.log('web listen on port:'+port); console.log('web listen on port:'+port);
......
/**
* 企业自画像登录
// */
// import * as asyncHandler from 'express-async-handler';
// import * as userInfoBiz from '../biz/user';
// export function setRouter(httpServer) {
// httpServer.post('/yuyi/viewserver/login', asyncHandler(login));
// }
// /**
// * 登录
// * @param req
// * @param res
// */
// async function login(req, res) {
// let {phone, pwd } = req.body
// let result = await userInfoBiz.enterpriseLogin(phone, pwd);
// res.success(result);
// }
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