Commit b3f19756 by zhangzhencai

no message

parent 19338dd5
<config>
<port>9098</port>
<sign>xxx90909082fsdahfjosadjfpoiwausjorip2hjklrhn1ioud0u124rx0qwejfokasjfolksaujfoas</sign>
<dbServer>http://192.168.0.105:40012</dbServer>
<dbServer>http://127.0.0.1:9096</dbServer>
<imgUrl>http://127.0.0.1:9098</imgUrl>
<imgFileUrl>http://192.168.0.189:9097</imgFileUrl>
</config>
\ No newline at end of file
......@@ -18,6 +18,8 @@ import moment = require("moment");
import { changeAdd, extractData } from "../util/piecemeal";
import { EnterpriseApplyForConfig } from "../config/splitResult/enterprise";
import { changeEnumValue } from "../util/verificationEnum";
import { on } from "process";
import { systemConfig } from "../config/serverConfig";
export async function allEnterpriseNameList() {
let listList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业基础信息表, {state:1}, ["enterpriseName", "eId"]);
......@@ -34,8 +36,6 @@ export async function allEnterpriseNameList() {
}
//企业申请上传资料
export async function enterpriseApplyFor(eId:string) {
let filesList = ["eId", "uscc", "enterpriseName", "logonAddress", "logonTime"];
......@@ -73,9 +73,10 @@ export async function updateEnterpriseApplyFor(eId:string, param) {
if (!resInfo || !resInfo.eId) {
throw new BizError(ERRORENUM.数据不存在);
}
if (resInfo.state == 1) {
throw new BizError(ERRORENUM.已审核请前往小程序登录)
}
// 去掉审核状态的检查和更新逻辑
// if (resInfo.state == 1) {
// throw new BizError(ERRORENUM.已审核请前往小程序登录)
// }
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.租赁信息, param, {eId});
......@@ -84,7 +85,8 @@ export async function updateEnterpriseApplyFor(eId:string, param) {
export async function enterpriseExamineList(year:number, enterpriseName:string, page:number) {
let selectParam:any = {isSubmit:enumConfig.STATE.};
// let selectParam:any = {isSubmit:enumConfig.STATE.是};
let selectParam:any = {};
if (year) selectParam = {annual:getMySqlMs(year)};
let filesList = [ "mId", "annual", "BI", "TXP", "RD", "state"];
......@@ -119,7 +121,6 @@ export async function enterpriseExamineList(year:number, enterpriseName:string,
}
export async function enterpriseExamineInfo(mId:string) {
let filesList = [ "mId", "annual", "BI", "TXP", "RD"];
let resInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {mId}, filesList);
......@@ -155,51 +156,61 @@ export async function enterpriseExamineUpdate( mId, param) {
return {dataInfo};
}
export async function enterpriseExaminePass(mId) {
let filesList = [ "eId", "annual", "BI", "TXP", "RD"];
let resInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {mId}, filesList);
if (!resInfo || !resInfo.eId) {
throw new BizError(ERRORENUM.数据不存在);
}
//企业审核通过
// export async function enterpriseExaminePass(mId) {
// let filesList = [ "eId", "annual", "BI", "TXP", "RD"];
// let resInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {mId}, filesList);
// if (!resInfo || !resInfo.eId) {
// throw new BizError(ERRORENUM.数据不存在);
// }
let dataInfo = {
state:enumConfig.STATE.
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.企业经营信息, dataInfo, {mId});
return {dataInfo};
}
// let dataInfo = {
// state:enumConfig.STATE.是
// }
// await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.企业经营信息, dataInfo, {mId});
// return {dataInfo};
// }
// --------------------------------------经营数据
export async function enterpriseManageList(enterpriseName:string, year:number, page:number) {
let selectParam:any = {state:1};
// let selectParam:any = {state:1};
let selectParam:any = {};
// if (year) {
// selectParam.annual = getMySqlMs(year);
// }
if (year) {
selectParam.annual = getMySqlMs(year);
selectParam.annual = `${moment(year).format("YYYY")}-01-01 00:00:00`;
}
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc"], where:{} };
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc", "eId"], where:{} };
if (enterpriseName) {
manyTableInfo[TABLENAME.企业基础信息表].where["enterpriseName"] = {"%like%":enterpriseName}
}
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业经营信息, selectParam, ["mId", "BI", "TXP", "RD", "annual", "state"], manyTableInfo, page);
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业经营信息, selectParam, ["mId", "BI", "TXP", "RD", "annual", "quarter"], manyTableInfo, page);
let dataCountList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, selectParam, ["eId"], manyTableInfo);
let dataCount = dataCountList.length;
let dataList = [];
resInfo.forEach(info => {
let {BI, mId, TXP,RD,state,annual, enterprise} = info;
let {BI, mId, TXP, RD, annual, quarter, enterprise} = info;
let quarterStr = "第一季度";
if (quarter ) quarterStr = changeEnumValue(enumConfig.QUARTER, quarter);
let dataInfo = {
eId:enterprise.eId, //企业id
enterpriseName:enterprise.enterpriseName, //企业名称
uscc:enterprise.uscc, //统一信用代码
BI, //营收(万元)
TXP:TXP, //纳税(万元)
RD:RD,//研发投入(万元)
annual:moment(annual).format("YYYY"),//年度
state:state ? "已审核" : "未审核",
annual:`${moment(annual).format("YYYY")}-${quarterStr}`,//年度
// quarter:changeEnumValue(enumConfig.QUARTER, quarter),//新增季度
// state:state ? "已审核" : "未审核",
mId:mId
};
dataList.push(dataInfo);
......@@ -209,28 +220,29 @@ export async function enterpriseManageList(enterpriseName:string, year:number, p
}
export async function outPutEnterpriseManageList(enterpriseName:string, year:number, state:number, type:number, files) {
export async function outPutEnterpriseManageList(enterpriseName:string, year:number, type:number, files) {
let selectParam:any = {};
if (type == 1) {
// if (year) {
// selectParam.annual = getMySqlMs(year);
//
if (year) {
selectParam.annual = getMySqlMs(year);
}
if (state) {
if (state == 1) selectParam.state = 1;
else selectParam.state = 0;
selectParam.annual = `${moment(year).format("YYYY")}-01-01 00:00:00`;
}
// if (state) {
// if (state == 1) selectParam.state = 1;
// else selectParam.state = 0;
// }
}
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc"], where:{} };
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc","eId"], where:{} };
if (enterpriseName && type == 1) {
manyTableInfo[TABLENAME.企业经营信息].where["enterpriseName"] = {"%like%":enterpriseName}
}
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, selectParam, ["mId", "BI", "TXP", "RD", "annual"], manyTableInfo);
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, selectParam, ["mId", "BI", "TXP", "RD", "annual", "quarter"], manyTableInfo);
let dataList = [];
let titleList = []
......@@ -242,17 +254,21 @@ export async function outPutEnterpriseManageList(enterpriseName:string, year:num
dataList.push(titleList);
resInfo.forEach(info => {
let {BI, mId, TXP,RD,state,annual, enterprise} = info;
let {BI, mId, TXP, RD, annual, quarter, enterprise} = info;
let quarterStr = "第一季度";
if (quarter ) quarterStr = changeEnumValue(enumConfig.QUARTER, quarter);
let subList = [];
let stateStr = state ? "已审核" : "未审核";
// let stateStr = state ? "已审核" : "未审核";
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterprise.enterpriseName);
if (subInfo == "uscc") subList.push(enterprise.uscc);
if (subInfo == "BI") subList.push(BI);
if (subInfo == "TXP") subList.push(TXP);
if (subInfo == "RD") subList.push(RD);
if (subInfo == "annual") subList.push(moment(annual).format("YYYY"));
if (subInfo == "state") subList.push(stateStr);
if (subInfo == "annual") subList.push(`${moment(annual).format("YYYY")}-${quarterStr}`);
// if (subInfo == "annual") subList.push(moment(annual).format("YYYY"));
// if (subInfo == "state") subList.push(stateStr);
});
dataList.push(subList);
});
......@@ -260,39 +276,50 @@ export async function outPutEnterpriseManageList(enterpriseName:string, year:num
return {dataList};
}
//企业审核通过
// export async function enterpriseManagePass(mId:string) {
// let info = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {mId}, ["mId"]);
// if (!info || !info.mId) throw new BizError(ERRORENUM.当前数据不存在);
export async function enterpriseManagePass(mId:string) {
let info = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {mId}, ["mId"]);
if (!info || !info.mId) throw new BizError(ERRORENUM.当前数据不存在);
// await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.企业经营信息, {state:1}, {mId} );
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.企业经营信息, {state:1}, {mId} );
return {isSuccess:true};
}
// return {isSuccess:true};
// }
//====融资
export async function enterpriseFinancingList(enterpriseName:string, page:number) {
let selectParam:any = {state:enumConfig.STATE.};
//===融资
export async function enterpriseFinancingList(enterpriseName:string, year:number, page:number) {
// let selectParam:any = {state:enumConfig.STATE.是};
let selectParam:any = {};
if (enterpriseName) {
selectParam.enterpriseName = {"%like%":enterpriseName}
}
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业融资] = {column:["rId", "financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ], where:{} };
manyTableInfo[TABLENAME.企业融资] = {
column:["rId", "financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ],
where:{}
};
let filesList = ["enterpriseName", "uscc", "eId"];
if (year) {
let selectStartTime = getMySqlMs(year);
let selectEndTime = getMySqlMs(moment(year).endOf('year').valueOf());//todo 框架问题不能同时查询一个字段
manyTableInfo[TABLENAME.企业融资].where.investmentDate = {"%gt%":selectStartTime};
}
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业基础信息表, selectParam, filesList, manyTableInfo, page);
let dataCountList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, filesList, manyTableInfo);
let dataCount = dataCountList.length;
let dataList = [];
resInfo.forEach(info => {
let {eId, enterpriseName, uscc, enterprise_financings} = info;
let dataInfo = {
eId,
eId,//企业id
enterpriseName, //企业名称
uscc, //统一信用代码
financingAmount:enterprise_financings[0].financingAmount, //融资金额(万元)
......@@ -313,12 +340,13 @@ export async function enterpriseFinancingList(enterpriseName:string, page:number
* @returns
*/
export async function enterpriseFinancingAllYear(eId:string) {
let filesList = ["rId", "financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ];
let filesList = ["eId","rId", "financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ];
let resInfo = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业融资, {eId}, filesList);
let dataList = [];
resInfo.forEach(info => {
let dataInfo = {
eId,//企业id
investmentDate:moment(info.investmentDate).format("YYYY-MM-DD"),//获得投资时间
financingAmount:info.financingAmount, //融资金额(万元)
financingRounds:changeEnumValue(enumConfig.FINANCINGROUNDS, info.financingRounds), //融资轮次
......@@ -331,18 +359,22 @@ export async function enterpriseFinancingAllYear(eId:string) {
}
export async function outPutEnterpriseFinancingList(enterpriseName:string, type:number, files) {
let selectParam:any = {state:enumConfig.STATE.};
export async function outPutEnterpriseFinancingList(enterpriseName:string,year:number, type:number, files) {
// let selectParam:any = {state:enumConfig.STATE.是};
let selectParam:any = {};
if (type == 1) {
if (enterpriseName) {
selectParam.enterpriseName = {"%like%":enterpriseName}
}
if (year) {
//selectParam.annual = getMySqlMs(year);
selectParam.investmentDate = {">=": `${year}-01-01`, "<=": `${year}-12-31`};
}
}
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业融资] = {column:["financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ], where:{} };
let filesList = ["enterpriseName", "uscc"];
let filesList = ["enterpriseName", "uscc","eId"];
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, filesList, manyTableInfo);
......@@ -375,8 +407,6 @@ export async function outPutEnterpriseFinancingList(enterpriseName:string, type:
}
export async function enterpriseTalentList(entepriseName:string, page:number) {
let selectParam:any = {};
......@@ -449,69 +479,189 @@ export async function outPutEnterpriseTalentList(name:string, type:number, files
// export async function iprList(enterpriseName, page) {
// let selectParam:any = {};
// if (enterpriseName) {
// selectParam.enterpriseName = {"%like%":enterpriseName};
// }
// let manyTableInfo:any = {};
// manyTableInfo[TABLENAME.企业专利表] = {column:["year", "alienPatent", "classIPatent", "secondClassPatent", "thirdPentent"], where:{} };
// manyTableInfo[TABLENAME.知识产权] = {column:["number"], where:{}};
// let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业基础信息表, selectParam, ["enterpriseName", "uscc"], manyTableInfo, page);
// let allDataList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, ["enterpriseName", "uscc"], manyTableInfo);
// let dataList = [];
// resInfo.forEach(info => {
// let {uscc, enterpriseName, enterprise_iprs, enterprise_patents} = info;
// let addItem = {
// uscc,
// enterpriseName,
// alienPatent:undefined,
// classIPatent:undefined,
// secondClassPatent:undefined,
// thirdPentent:undefined,
// count:undefined
// };
// for (let i = 0; i < enterprise_patents.length; i++) {
// let item = enterprise_patents[i];
// if (item.alienPatent) {
// if (addItem.alienPatent == undefined) addItem.alienPatent = 0;
// addItem.alienPatent += item.alienPatent;
// }
// if (item.classIPatent) {
// if (addItem.classIPatent == undefined) addItem.classIPatent = 0;
// addItem.classIPatent += item.classIPatent;
// }
// if (item.secondClassPatent) {
// if (addItem.secondClassPatent == undefined) addItem.secondClassPatent = 0;
// addItem.secondClassPatent += item.secondClassPatent;
// }
// if (item.thirdPentent) {
// if (addItem.thirdPentent == undefined) addItem.thirdPentent = 0;
// addItem.thirdPentent += item.thirdPentent;
// }
// }
// for (let i = 0; i < enterprise_iprs.length; i++) {
// let item = enterprise_iprs[i];
// if (item.number) {
// if (addItem.count == undefined) addItem.count = 0;
// addItem.count += item.number;
// }
// }
// for (let key in addItem) {
// if (addItem[key] == undefined) addItem[key] = "-";
// }
// dataList.push(addItem);
// });
// return {dataList, dataCount:allDataList.length};
// }
/**
* 知识产权及专利列表
* @param enterpriseName
* @param page
* @returns
*/
export async function iprList(enterpriseName, page) {
let selectParam:any = {};
if (enterpriseName) {
selectParam.enterpriseName = {"%like%":enterpriseName};
}
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业专利表] = {column:["year", "alienPatent", "classIPatent", "secondClassPatent", "thirdPentent"], where:{} };
manyTableInfo[TABLENAME.知识产权] = {column:["number"], where:{}};
manyTableInfo[TABLENAME.知识产权] = {column:["eId","number","iprType"], where:{}};
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业基础信息表, selectParam, ["enterpriseName", "uscc"], manyTableInfo, page);
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业基础信息表, selectParam, [], manyTableInfo, page);
let allDataList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, ["enterpriseName", "uscc"], manyTableInfo);
let dataList = [];
resInfo.forEach(info => {
let {uscc, enterpriseName, enterprise_iprs, enterprise_patents} = info;
let {eId,uscc, enterpriseName, enterprise_iprs} = info;
let addItem = {
eId,
uscc,
enterpriseName,
alienPatent:undefined,
classIPatent:undefined,
secondClassPatent:undefined,
thirdPentent:undefined,
count:undefined
count:0,
softwareCopyrightCount: 0,
inventionPatentCount: 0,
overseasPatentCount: 0,
plantVarietyCount: 0,
icLayoutCount: 0
};
for (let i = 0; i < enterprise_patents.length; i++) {
let item = enterprise_patents[i];
if (item.alienPatent) {
if (addItem.alienPatent == undefined) addItem.alienPatent = 0;
addItem.alienPatent += item.alienPatent;
}
if (item.classIPatent) {
if (addItem.classIPatent == undefined) addItem.classIPatent = 0;
addItem.classIPatent += item.classIPatent;
}
if (item.secondClassPatent) {
if (addItem.secondClassPatent == undefined) addItem.secondClassPatent = 0;
addItem.secondClassPatent += item.secondClassPatent;
}
if (item.thirdPentent) {
if (addItem.thirdPentent == undefined) addItem.thirdPentent = 0;
addItem.thirdPentent += item.thirdPentent;
}
}
for (let i = 0; i < enterprise_iprs.length; i++) {
let item = enterprise_iprs[i];
if (item.number) {
if (addItem.count == undefined) addItem.count = 0;
addItem.count += item.number;
}
if (item.iprType === enumConfig.IPROPERTYTYPE.软件著作个数) {
addItem.softwareCopyrightCount += item.number;
} else if (item.iprType === enumConfig.IPROPERTYTYPE.发明专利个数){
addItem.inventionPatentCount += item.number;
} else if (item.iprType === enumConfig.IPROPERTYTYPE.海外专利个数){
addItem.overseasPatentCount += item.number;
} else if (item.iprType === enumConfig.IPROPERTYTYPE.植物新品种个数){
addItem.plantVarietyCount += item.number;
} else if (item.iprType === enumConfig.IPROPERTYTYPE.集成电路布图个数){
addItem.icLayoutCount += item.number;
}
}
// 确保 count 是所有专利类型的总和
addItem.count = addItem.softwareCopyrightCount
+ addItem.inventionPatentCount + addItem.overseasPatentCount
+ addItem.plantVarietyCount + addItem.icLayoutCount;
for (let key in addItem) {
if (addItem[key] == undefined) addItem[key] = "-";
if (key !== 'eId' && addItem[key] == undefined) {
addItem[key] = "-";
}
}
dataList.push(addItem);
});
return {dataList, dataCount:allDataList.length};
}
/**
* 知识产权及专利列表详情
* @param eId
* @returns
*/
export async function getiprDetails(eId: string) {
let selectParam:any = {eId };
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.知识产权] = {column:["eId","iprName","year","iprUrl", "iprType"], where:{}};
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, ["enterpriseName", "uscc"], manyTableInfo);
// 检查 resInfo 是否为空或 undefined
if (!resInfo || resInfo.length === 0) {
return {}; // 或者返回其他合适的默认值
}
let iprTypeInfo = {};
resInfo[0].enterprise_iprs.forEach(info => {
let {iprName, year, iprUrl} = info;
let iprType = changeEnumValue(enumConfig.INTELLECTUALPROPERTYRIGHT, info.iprType);
let yearStr = moment(year).format("YYYY");
if(!iprTypeInfo[iprType]) iprTypeInfo[iprType] = [];
let iprUrlStr = [];
//遍历iprUrl
if (iprUrl) {
let iprUrlArr = JSON.parse(iprUrl);
for (let i = 0; i < iprUrlArr.length; i++) {
iprUrlStr.push(`${systemConfig.imgFileUrl}${iprUrlArr[i]}`);
}
}
iprTypeInfo[iprType].push([
{
key:"著作名称",
value: iprName
},
{
key:"认定时间",
value: `${yearStr}年`,
},
{
key:"证明材料",
// value:iprUrl ? JSON.parse(iprUrl) : []
value:iprUrlStr
}
])
});
return {dataList, dataCount:allDataList.length};
return iprTypeInfo;
}
export async function qiyeRenZheng(enterpriseName, page) {
let selectParam:any = {};
if (enterpriseName) {
......@@ -568,16 +718,21 @@ export async function enterpriseHonor(enterpriseName, page) {
manyTableInfo[TABLENAME.企业基础信息表].where["enterpriseName"] = {"%like%":enterpriseName};
}
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业荣誉, selectParam, ["awardName", "awardingUnit", "awardTime", "awardLevel"], manyTableInfo, page);
let allDataList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业荣誉, selectParam, ["awardName", "awardingUnit", "awardTime", "awardLevel"], manyTableInfo);
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业荣誉, selectParam, ["awardName", "awardingUnit", "awardTime", "awardLevel", "awardImg"], manyTableInfo, page);
let allDataList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业荣誉, selectParam, ["awardName", "awardingUnit", "awardTime", "awardLevel", "awardImg"], manyTableInfo);
let dataList = [];
resInfo.forEach(info => {
let {enterprise, awardName, awardingUnit, awardTime, awardLevel} = info;
let {enterprise, awardName, awardingUnit, awardTime, awardLevel, awardImg} = info;
let addItem = {
uscc:enterprise.uscc,
enterpriseName:enterprise.enterpriseName,
awardName, awardingUnit, awardTime:moment(awardTime).format("YYYY"), awardLevel:changeEnumValue(enumConfig.AWARDLEVEL,awardLevel)
awardName, awardingUnit,
awardTime:moment(awardTime).format("YYYY"),
awardLevel:changeEnumValue(enumConfig.AWARDLEVEL,awardLevel),
// awardImg:JSON.parse(awardImg),
awardImg:JSON.parse(JSON.parse(awardImg)),
};
dataList.push(addItem);
......@@ -585,3 +740,223 @@ export async function enterpriseHonor(enterpriseName, page) {
return {dataList, dataCount:allDataList.length};
}
/**
* 经营数据详情
* @param eId
*/
export async function getDetails(eId:string) {
if (!eId) throw new BizError(ERRORENUM.参数错误, `经营数据详细信息缺失eId`)
let details = {
manage: await enterpriseManageById(eId),
financing: await enterpriseFinancingById(eId),
}
return details;
}
/**
* 详情 经营数据
* @param eId
* @returns
*/
export async function enterpriseManageById(eId:string) {
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc"], where:{eId} };
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, {eId}, ["mId", "BI", "TXP", "RD", "annual", "state"], manyTableInfo);
let resData = [];
resInfo.forEach( info => {
let {BI, mId, TXP,RD,state,annual, enterprise} = info;
resData.push({BI, mId, TXP,RD,state,annual:moment(annual).format("YYYY"), enterprise});
})
resData.sort( (a, b) => {
return b.annual - a.annual;
})
let dataList = [];
resData.forEach(info => {
let {BI, mId, TXP,RD,state,annual, enterprise} = info;
let dataInfo = [
{
key:"企业名称",
value:enterprise.enterpriseName
},
{
key:"统一信用代码",
value:enterprise.uscc
},
{
key:"营收(万元)",
value:BI
},
{
key:"纳税(万元)",
value:TXP
},
{
key:"研发投入(万元)",
value:RD
},
{
key:"年度",
value:annual
},
{
key:"审核状态",
value:state ? "已审核" : "未审核"
}
]
dataList.push(dataInfo);
});
return dataList;
}
/**
* 详情 融资情况
* @param eId
* @returns
*/
export async function enterpriseFinancingById(eId:string) {
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业融资] = {column:["financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ], where:{eId} };
let filesList = ["enterpriseName", "uscc"];
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, {eId}, filesList, manyTableInfo);
let resData = [];
resInfo.forEach( info => {
let {enterpriseName, uscc, enterprise_financings} = info;
resData.push({enterpriseName, uscc, enterprise_financings, investmentDate:new Date(enterprise_financings[0].investmentDate).valueOf()});
})
resData.sort( (a, b) => {
return b.investmentDate - a.investmentDate;
})
let dataList = [];
resData.forEach(info => {
let {enterpriseName, uscc, enterprise_financings} = info;
let dataInfo = [
{
key:"企业名称",
value:enterpriseName
},
{
key:"统一信用代码",
value:uscc
},
{
key:"融资金额(万元)",
value:enterprise_financings[0].financingAmount
},
{
key:"融资轮次",
value:changeEnumValue(enumConfig.FINANCINGROUNDS, enterprise_financings[0].financingRounds)
},
{
key:"获得投资时间",
value:moment(enterprise_financings[0].investmentDate).format("YYYY-MM-DD")
},
{
key:"投资机构名称",
value:enterprise_financings[0].investmentInstitutionsName
},
]
dataList.push(dataInfo);
});
return dataList;
}
//经营数据下载
export async function dwEnterpriseTable(eId: string, entepriseName:string, type:number, files) {
let selectParam:any = {};
if (type ==1) {
if (entepriseName) {
selectParam.enterpriseName = {"%like%":entepriseName}
}
}
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc"], where:{eId} };
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, {eId}, ["mId", "BI", "TXP", "RD", "annual", "state"], manyTableInfo);
let dataList = [];
let titleList = []
let valueList = [];
files.forEach(item => {
titleList.push(item.key);
valueList.push(item.value);
});
dataList.push(titleList);
resInfo.forEach(info => {
let {enterpriseName, uscc, BI, TXP, RD, annual, state} = info;
let subList = [];
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterpriseName);//企业名称
if (subInfo == "uscc") subList.push(uscc); //统一信用代码
if (subInfo == "BI") subList.push(BI);//营收
if (subInfo == "TXP") subList.push(TXP);//纳税
if (subInfo == "RD") subList.push(RD);//研发投入
if (subInfo == "annual") subList.push(annual);//年度
if (subInfo == "state") subList.push(state);//审核状态
});
dataList.push(subList);
})
return {dataList};
}
/**融资情况下载 */
export async function dwFinancingTable(eId: string, entepriseName:string, type:number, files) {
let selectParam:any = {};
if (type ==1) {
if (entepriseName) {
selectParam.enterpriseName = {"%like%":entepriseName}
}
}
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业融资] = {column:["financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ], where:{eId} };
let filesList = ["enterpriseName", "uscc"];
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, {eId}, filesList, manyTableInfo);
let dataList = [];
let titleList = []
let valueList = [];
files.forEach(item => {
titleList.push(item.key);
valueList.push(item.value);
});
dataList.push(titleList);
resInfo.forEach(info => {
let {enterpriseName, uscc, financingAmount, financingRounds, investmentDate, investmentInstitutionsName} = info;
let subList = [];
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterpriseName);//企业名称
if (subInfo == "uscc") subList.push(uscc); //统一信用代码
if (subInfo == "financingAmount") subList.push(financingAmount);//融资金额
if (subInfo == "financingRounds") subList.push(changeEnumValue(enumConfig.FINANCINGROUNDS, financingRounds));//融资轮次
if (subInfo == "investmentDate") subList.push(moment(investmentDate).format("YYYY-MM-DD"));//获得投资时间
if (subInfo == "investmentInstitutionsName") subList.push(investmentInstitutionsName);//投资机构名称
});
dataList.push(subList);
})
return {dataList};
}
\ No newline at end of file
......@@ -338,8 +338,11 @@ export async function getWorthDate() {
if (userInfo && userInfo.uId) throw new BizError(ERRORENUM.手机号码重复);
let filesList = ["eId"];
// let filesList = ["eId"];
let filesList = ["eId", "uscc"];
let enterpriseUserInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {uscc:param.uscc}, filesList);
// console.log("查询结果:", enterpriseUserInfo); // 添加日志
if (enterpriseUserInfo && enterpriseUserInfo.eId) {
throw new BizError(ERRORENUM.企业已存在);
}
......
......@@ -25,7 +25,7 @@ export async function settleInEnterpriseList(page:number, entepriseName:string)
let filesList = ["eId", "enterpriseName", "uscc", "logonTime", "logonAddress"];
let manyTableInfo:any = {}
manyTableInfo[TABLENAME.租赁信息] = {column:["area", "unitPrice", "roomNumber", "rent"], where:{} };
manyTableInfo[TABLENAME.租赁信息] = {column:["area", "unitPrice", "roomNumber", "rent", "totalPrice"], where:{} };
manyTableInfo[TABLENAME.企业孵化信息] = {column:["state", "startTime", "endTime"], where:{} };
manyTableInfo[TABLENAME.企业用户表] = {column:["userName", "pwd", "phone", "uId"], where:{} };
let resList = await selectManyTableData(OPERATIONALDATATYPE.多表分页, TABLENAME.企业基础信息表, selectParam, filesList, manyTableInfo, page );
......@@ -52,6 +52,7 @@ export async function settleInEnterpriseList(page:number, entepriseName:string)
pwd:info.enterprise_users[0].pwd,
phone:info.enterprise_users[0].phone,
uId:info.enterprise_users[0].uId,
totalPrice: info.enterprise_leases[0].totalPrice // 添加年总价字段
});
});
......@@ -107,8 +108,11 @@ export async function settleInEnterpriseUpdate(eId:string, param) {
let leaseInfo = {
area:param.area,
unitPrice:param.unitPrice,
roomNumber:param.roomNumber,
// unitPrice:param.unitPrice,
// unitPrice:param.rent / param.area,// 计算单价
//如果 param.rent 和 param.area 都存在且不为零,则计算 unitPrice 为 param.rent 除以 param.area;否则,直接使用 param.unitPrice。
unitPrice: param.rent && param.area ? param.rent / param.area : param.unitPrice,
rent:param.rent,
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.租赁信息, leaseInfo, {eId});
......@@ -229,7 +233,8 @@ export async function enterpriseRegister(param) {
uscc:param.uscc,
logonTime:getMySqlMs(param.logonTime),
state:0,
register:0
register:0,
rent: param.rent
};
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.企业基础信息表, addEInfo, {});
......@@ -245,6 +250,7 @@ export async function enterpriseRegister(param) {
startTime:getMySqlMs(param.leaseTimeStart),
endTime:getMySqlMs(param.leaseTimeEnd),
area:param.area
}
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.租赁信息, leaseInfo, {});
......
......@@ -71,8 +71,6 @@ export async function getDetails(eId:string) {
}
/**
* 在孵企业详情 基础信息
* @param eId
......@@ -142,11 +140,15 @@ export async function enterpriseById(eId:string) {
export async function enterpriseManageById(eId:string) {
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc"], where:{eId} };
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, {eId}, ["mId", "BI", "TXP", "RD", "annual", "state"], manyTableInfo);
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, {eId}, ["mId", "BI", "TXP", "RD", "annual","quarter"], manyTableInfo);
let resData = [];
resInfo.forEach( info => {
let {BI, mId, TXP,RD,state,annual, enterprise} = info;
resData.push({BI, mId, TXP,RD,state,annual:moment(annual).format("YYYY"), enterprise});
let {BI, mId, TXP,RD,annual,quarter, enterprise} = info;
let quarterStr = "第一季度";
if (quarter ) quarterStr = changeEnumValue(enumConfig.QUARTER, quarter);
resData.push({BI, mId, TXP,RD,annual:moment(annual).format("YYYY"), quarterStr, enterprise});
})
resData.sort( (a, b) => {
......@@ -155,7 +157,8 @@ export async function enterpriseManageById(eId:string) {
let dataList = [];
resData.forEach(info => {
let {BI, mId, TXP,RD,state,annual, enterprise} = info;
let {BI, mId, TXP,RD,annual,quarterStr, enterprise} = info;
info.annual = `${moment(info.annual).format("YYYY")}-${quarterStr}`; // 修改已有的 annual 变量
let dataInfo = [
{
......@@ -179,13 +182,17 @@ export async function enterpriseManageById(eId:string) {
value:RD
},
{
key:"度",
value:annual
key:"度",
value:info.annual
},
{
key:"审核状态",
value:state ? "已审核" : "未审核"
}
// {
// key:"季度",
// value:quarterStr
// },
// {
// key:"审核状态",
// value:state ? "已审核" : "未审核"
// }
]
dataList.push(dataInfo);
});
......@@ -371,7 +378,7 @@ export async function dwEnterpriseTable(entepriseName:string, type:number, files
let filesList = ["enterpriseName", "uscc", "logonTime", "logonAddress", "qiYeGuiMo"];
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.租赁信息] = {column:["area", "startTime", "endTime", "roomNumber"], where:{} };
manyTableInfo[TABLENAME.租赁信息] = {column:["area", "startTime", "endTime", "roomNumber"], where:{}};
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, filesList, manyTableInfo);
......@@ -408,3 +415,285 @@ export async function dwEnterpriseTable(entepriseName:string, type:number, files
return {dataList};
}
export async function getAllDwOutPut(eId:string) {
let details = {
enterprise: await dwBasicInformation(eId),
manage: await dwBusinessData(eId),
financing: await dwFinancingSituatione(eId),
talent: await dwEnterpriseTeam(eId),
service: await dwEnterpriseService(eId),
}
return details;
}
/**
* 下载单企业基础信息
* @param eId
* @returns
*/
export async function dwBasicInformation(eId:string) {
let files = [{key:"企业名称",value:"enterpriseName"},
{key:"统一信用代码",value:"uscc"},
{key:"注册时间",value:"logonTime"},
{key:"注册地址",value:"logonAddress"},
{key:"企业规模",value:"qiYeGuiMo"},
{key:"租赁时间",value: "startTime"},
{key:"租赁面积",value:"area",},
{key:"室号",value:"roomNumber"},
];
let selectParam:any = {eId};
let filesList = ["enterpriseName", "uscc", "logonTime", "logonAddress", "qiYeGuiMo"];
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.租赁信息] = {column:["area", "startTime", "endTime", "roomNumber"], where:{}};
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, selectParam, filesList, manyTableInfo);
let dataList = [];
let titleList = []
let valueList = [];
files.forEach(item => {
titleList.push(item.key);
valueList.push(item.value);
});
dataList.push(titleList);
resInfo.forEach(info => {
let {enterpriseName, uscc, logonTime, logonAddress, qiYeGuiMo, enterprise_leases} = info;
let leasesTime = '-'
if (enterprise_leases[0].startTime){
leasesTime = `${moment(enterprise_leases[0].startTime).format("YYYY-MM-DD")}${moment(enterprise_leases[0].endTime).format("YYYY-MM-DD")}`;
}
let subList = [];
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterpriseName);//企业名称
if (subInfo == "uscc") subList.push(uscc); //统一信用代码
if (subInfo == "logonTime") subList.push(moment(logonTime).format("YYYY-MM-DD"));//注册日期
if (subInfo == "logonAddress") subList.push(changeAdd(JSON.parse(logonAddress)));//注册地址
if (subInfo == "qiYeGuiMo") subList.push(qiYeGuiMo);//企业规模
if (subInfo == "startTime") subList.push(leasesTime);//孵化时间
if (subInfo == "area") subList.push(enterprise_leases[0].area+"㎡");//租赁面积
if (subInfo == "roomNumber") subList.push(enterprise_leases[0].roomNumber);//室号
});
dataList.push(subList);
})
return {dataList};
}
/**
* 下载单企业经营数据
* @param eId
* @returns
*/
export async function dwBusinessData(eId:string) {
let files = [{key:"企业名称",value:"enterpriseName"},
{key:"统一信用代码",value:"uscc"},
{key:"营收(万元)",value:"BI"},
{key:"纳税(万元)",value:"TXP"},
{key:"研发投入(万元)",value:"RD"},
{key:"季度",value:"annual"},
// {key:"审核状态",value:"state"},
// {key:"审核时间",value:"auditTime"}
];
let selectParam:any = {eId};
let filesList = ["enterpriseName", "uscc", "BI", "TXP", "RD", "annual","quarter"];
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column: ["enterpriseName", "uscc"], where:{eId} };
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业经营信息, {eId}, ["mId", "BI", "TXP", "RD", "annual","quarter"], manyTableInfo);
let dataList = [];
let titleList = []
let valueList = [];
files.forEach(item => {
titleList.push(item.key);
valueList.push(item.value);
});
dataList.push(titleList);
resInfo.forEach(info => {
let {enterprise, BI, TXP,RD, annual,quarter} = info;
let quarterStr = "第一季度";
if (quarter ) quarterStr = changeEnumValue(enumConfig.QUARTER, quarter);
let subList = [];
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterprise.enterpriseName);//企业名称
if (subInfo == "uscc") subList.push(enterprise.uscc); //统一信用代码
if (subInfo == "BI") subList.push(BI);//营收
if (subInfo == "TXP") subList.push(TXP);//纳税
if (subInfo == "RD") subList.push(RD);//研发投入
// if (subInfo == "annual") subList.push(annual);//年度
// if (subInfo == "annual") subList.push(new Date(annual).getFullYear()); // 年度,只保留年份
if (subInfo == "annual") subList.push(`${moment(annual).format("YYYY")}-${quarterStr}`);
// if (subInfo == "state") subList.push(state);//审核状态
});
dataList.push(subList);
})
return {dataList};
}
/**
* 单企业融资情况
* @param eId
* @return
*/
export async function dwFinancingSituatione(eId: string) {
let files = [{key:"企业名称",value:"enterpriseName"},
{key:"统一信用代码",value:"uscc"},
{key:"融资金额(万元)",value:"financingAmount"},
{key:"融资轮次",value:"financingRounds"},
{key:"获得投资时间",value:"investmentDate"},
{key:"投资机构名称",value:"investmentInstitutionsName" },
];
let selectParam:any = {eId};
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业融资] = {column:["financingAmount", "financingRounds", "investmentDate", "investmentInstitutionsName" ], where:{eId} };
let filesList = ["enterpriseName","uscc"];
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业基础信息表, {eId}, filesList, manyTableInfo);
let dataList = [];
let titleList = []
let valueList = [];
files.forEach(item => {
titleList.push(item.key);
valueList.push(item.value);
});
dataList.push(titleList);
resInfo.forEach(info => {
let {enterpriseName, uscc, financingAmount, financingRounds, investmentDate, investmentInstitutionsName} = info;
let subList = [];
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterpriseName);//企业名称
if (subInfo == "uscc") subList.push(uscc); //统一信用代码
if (subInfo == "financingAmount") subList.push(financingAmount);//融资金额
if (subInfo == "financingRounds") subList.push(changeEnumValue(enumConfig.FINANCINGROUNDS, financingRounds));//融资轮次
if (subInfo == "investmentDate") subList.push(moment(investmentDate).format("YYYY-MM-DD"));//获得投资时间
if (subInfo == "investmentInstitutionsName") subList.push(investmentInstitutionsName);//投资机构名称
});
dataList.push(subList);
})
return {dataList};
}
/**
* 下载单企业创始团队
* @param name
* @return
*/
export async function dwEnterpriseTeam(eId:string) {
let files = [
{key:"姓名",value:"name"},
{key:"性别",value:"sex"},
{key:"出生年月",value:"birth"},
{key:"最高学历",value:"degree"},
{key:"毕业学校",value:"graduationSchool"},
{key:"企业名称",value:"enterpriseName"},
];
let selectParam:any = {eId};
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column:["enterpriseName" ], where:{eId} };
let filesList = ["name", "sex", "birth", "degree", "graduationSchool"];
let resInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.创业团队, {eId}, filesList, manyTableInfo);
let dataList = [];
let titleList = []
let valueList = [];
files.forEach(item => {
titleList.push(item.key);
valueList.push(item.value);
});
dataList.push(titleList);
resInfo.forEach(info => {
let {name,sex,birth,degree,graduationSchool,enterpriseName} = info;
let subList = [];
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterpriseName);//企业名称
if (subInfo == "name") subList.push(name);//姓名
if (subInfo == "sex") subList.push(changeEnumValue(enumConfig.SEX, sex));//性别
if (subInfo == "birth") subList.push(moment(birth).format("YYYY-MM-DD"));//出生日期
if (subInfo == "degree") subList.push(changeEnumValue(enumConfig.DEGREE, degree));//最高学历
if (subInfo == "graduationSchool") subList.push(graduationSchool);//毕业学校
});
dataList.push(subList);
})
return {dataList};
}
/**
* 下载单企业企业服务
* @param eId
* @return
*/
export async function dwEnterpriseService(eId: string) {
let files = [
{key:"企业名称",value:"enterpriseName"},
{key:"需求类别",value:"needCategory"},
{key:"申请时间",value:"applyTime"},
{key:"跟进状态",value:"followUpStatus"},
{key:"解决时间",value:"resolveTime"},
{key:"需求内容",value:"needContent"},
];
let selectParam:any = {eId};
let filesList = ["esId", "needCategory", "applyTime", "followUpStatus", "resolveTime","needContent"];
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.企业基础信息表] = {column:["eId", "enterpriseName"], where:{eId} };
let resList = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.企业服务表, {eId}, filesList, manyTableInfo );
let dataList = [];
let titleList = []
let valueList = [];
files.forEach(item => {
titleList.push(item.key);
valueList.push(item.value);
});
dataList.push(titleList);
resList.forEach(info => {
let {enterpriseName,needCategory,applyTime,followUpStatus,resolveTime,needContent} = info;
let subList = [];
valueList.forEach(subInfo => {
if (subInfo == "enterpriseName") subList.push(enterpriseName);//公司名称
if(subInfo == "needCategory") subList.push(needCategory);//需求类别
if(subInfo == "applyTime") subList.push(applyTime);//申请时间
if(subInfo == "followUpStatus") subList.push(followUpStatus);//跟进状态
if(subInfo == "resolveTime") subList.push(resolveTime);//解决时间
if(subInfo == "needContent") subList.push(needContent);//需求内容
});
dataList.push(subList);
})
return {dataList};
}
\ No newline at end of file
......@@ -15,19 +15,41 @@ import { PolicyUpdateConfig } from "../config/eccParam/enterprise";
export async function enterprisePolicyList(keywords:string, page:number) {
let selectParam:any = {};
if (keywords) selectParam.desc = {"%like%":keywords};
let filesList = ["poId", "title", "source", "createTimeMs", "closeTimeMs", "isPermanent"];
let filesList = ["poId", "title", "source", "createTimeMs", "closeTimeMs", "isPermanent","coverImg"];
let resList = await selectData(OPERATIONALDATATYPE.分页查询, TABLENAME.政策表, selectParam, filesList, page);
let dataCount = await selectData(OPERATIONALDATATYPE.查询数据量, TABLENAME.政策表, selectParam, null);
let dataList = [];
const now = moment().valueOf(); // 获取当前时间戳
resList.forEach(info => {
let closeTimeMs = info.closeTimeMs;
if (info.isPermanent == 1) closeTimeMs = '永久有效';
if (!info.closeTimeMs) closeTimeMs = "-";
// 格式化日期前检查closeTimeMs是否为'永久有效'或'-'
let formattedCloseTimeMs = closeTimeMs === '永久有效' || closeTimeMs === '-' ? closeTimeMs : moment(closeTimeMs).format("YYYY-MM-DD");
// 判断政策是进行中还是往期
let status = '';
if (info.isPermanent == 1) {
status = '进行中';
} else if (closeTimeMs === '-') {
status = '进行中';
} else {
const policyEndTime = moment(closeTimeMs).valueOf();
status = policyEndTime >= now ? '进行中' : '往期';
}
dataList.push({
poId:info.poId,
title:info.title,
source:info.source,
createTimeMs:info.createTimeMs,
closeTimeMs:info.closeTimeMs ? info.closeTimeMs : "-",
isPermanent:info.isPermanent
closeTimeMs:formattedCloseTimeMs,
isPermanent: info.isPermanent,
//图片
coverImg:JSON.parse(info.coverImg),
//coverImg:info.coverImg ? JSON.parse(info.coverImg) : [],
});
});
......@@ -74,8 +96,8 @@ export async function enterprisePolicyAdd( param) {
eccFormParam(FuncName, PolicyUpdateConfig, param );
if (param.closeTimeMs) param.closeTimeMs = getMySqlMs(param.closeTimeMs);
param.createTimeMs = getMySqlMs();
if (!param.coverImg) param.coverImg = '[]';
// param.createTimeMs = getMySqlMs(); //没有传时间不能调用格式转换方法,会默认时间1970-01-01
if (!param.coverImg.length) param.coverImg = "[\"/yuyi/files/默认图片.png\"]";
else param.coverImg = JSON.stringify(param.coverImg);
param.poId = randomId(TABLEID.政策表);
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.政策表, param, {});
......
......@@ -40,9 +40,10 @@ export const SettleInForUpdateConfig = {
fuHuaTimeStart:{type:"Number"},//孵化开始时间
fuHuaTimeEndTime:{type:"Number"},//孵化结束时间
area:{type:"Number"},//面积
unitPrice:{type:"Number"},//单价
// unitPrice:{type:"Number"},//单价
roomNumber:{type:"String"},//室号
rent:{type:"Number"},//总价
rent:{type:"Number"},//每月租金
// totalPrice:{type:"Number"},//总价
pwd:{type:"String"},
phone:{type:"String"},
userName:{type:"String"},
......@@ -74,9 +75,10 @@ export const AdminRegisterAddConfig = {
fuHuaTimeStart:{type:"Number"},//孵化开始时间
fuHuaTimeEndTime:{type:"Number"},//孵化结束时间
area:{type:"Number"},//面积
unitPrice:{type:"Number"},//单价
// unitPrice:{type:"Number"},//单价
roomNumber:{type:"String"},//室号
rent:{type:"Number"},//总价
rent:{type:"Number"},//每月租金
// totalPrice:{type:"Number"},//总价
pwd:{type:"String"},
phone:{type:"String"},
userName:{type:"String"}
......
......@@ -118,7 +118,9 @@ export enum FOLLOWUPSTATUS {
* 服务类别
*/
export enum NEEDCATEGORY {
物业服务 = 1,
// 物业服务 = 1,
工商税务 = 1,
代理记账,
贷款服务,
法律服务,
知识产权,
......@@ -154,3 +156,50 @@ export enum STATE {
= 0,
}
export enum QUARTER {
第一季度 = 1,
第二季度,
第三季度,
第四季度
}
/**
* 知识产权类型
*/
export enum INTELLECTUALPROPERTYRIGHT {
软件著作 = 1,
发明专利,
海外专利,
植物新品种,
集成电路布图,
}
/**
* 知识产权及专利
*/
export enum IPROPERTYTYPE {
软件著作个数 = 1,
发明专利个数,
海外专利个数,
植物新品种个数,
集成电路布图个数
}
/**
* 前端用
*/
export enum INTELLECTUALPROPERTYRIGHT {
softwareCopyright = 1,
inventionPatent,
overseasPatent,
plantVariety,
icLayout
}
......@@ -18,8 +18,8 @@ export enum ENTERPRISEMANAGE {
"营收(万元)" = "BI",
"纳税(万元)" = "TXP",
"研发投入(万元)" = "RD",
= "annual",
状态 = "state"
= "annual",
// 状态 = "state"
}
export enum ENTERPRISEFINANCING {
......@@ -39,3 +39,15 @@ export enum ENTERPRISETALENT {
毕业学校 = "graduationSchool",
企业名称 = "enterpriseName"
}
/**企业服务 */
export enum ENTERPRISESERVICE {
企业名称="enterpriseName",
需求类别="needCategory",
申请时间="applyTime",
跟进状态="followUpStatus",
解决时间="resolveTime",
需求内容="needContent"
}
......@@ -16,11 +16,14 @@ export async function initConfig() {
if (!configInfo || !configInfo.config) throw new BizError('xml中无配置');
else {
let {port, sign, dbServer } = configInfo.config;
let {port, sign, dbServer, imgUrl, imgFileUrl } = configInfo.config;
systemConfig.port = parseInt(port[0]);
systemConfig.dbSign = sign[0]
systemConfig.dbPath = dbServer[0]
systemConfig.dbSign = sign[0];
systemConfig.dbPath = dbServer[0];
systemConfig.imgUrl = imgUrl[0];
systemConfig.imgFileUrl = imgFileUrl[0];
}
......
......@@ -8,4 +8,6 @@ export class ServerConfig {
port:number;
dbSign:String;
dbPath:String;
imgUrl:String;
imgFileUrl:String;
}
\ No newline at end of file
......@@ -32,6 +32,7 @@ export class httpServer {
httpServer.use(express.static("./static") );
httpServer.use(express.static("./files") );
httpServer.use(express.static("./img") );
const root = path.join(__dirname, "../../public");
httpServer.use(express.static(root));
httpServer.use(fallback('index.html', { root }));
......
......@@ -11,6 +11,8 @@ import * as zhengCeBiz from '../biz/zhengCe';
import * as fuWuBiz from '../biz/fuWu';
import * as ruFuBiz from '../biz/ruFu';
import { checkEnterpriseUser, checkUser } from '../middleware/user';
import { ERRORENUM } from '../config/enum/errorEnum';
import { BizError } from '../util/bizError';
export function setRouter(httpServer) {
//管理员登录登出
......@@ -48,7 +50,11 @@ export function setRouter(httpServer) {
// httpServer.post('/admin/library/financing/details', checkUser, asyncHandler(financingById));
// httpServer.post('/admin/library/talent/details', checkUser, asyncHandler(talentById));
// httpServer.post('/admin/library/service/details', checkUser, asyncHandler(serviceById));
httpServer.post('/admin/library/dw/enterprise/list', checkUser, asyncHandler(dwEnterpriseList));
httpServer.post('/admin/library/dw/enterprise/list', checkUser, asyncHandler(dwEnterpriseList));//下载
httpServer.post('/admin/library/dw/alloutput/list', checkUser, asyncHandler(getAllDwOutPutData));//在孵企业单企业下载
httpServer.post('/admin/library/dw/businessdata/list', checkUser, asyncHandler(dwBusinessDataList));//单企业经营数据下载
httpServer.post('/admin/library/dw/financingsituatione/list', checkUser, asyncHandler(dwFinancingSituationeList));//单企业融资情况下载
httpServer.post('/admin/library/manage/list', checkUser, asyncHandler(manageList));
httpServer.post('/admin/library/dw/manage/list', checkUser, asyncHandler(outPutManageList));
......@@ -86,6 +92,8 @@ export function setRouter(httpServer) {
httpServer.post('/admin/enterprise/register', asyncHandler(enterpriseLogon));
httpServer.post('/admin/library/ipr/list', checkUser, asyncHandler(iprList));
httpServer.post('/admin/library/ipr/details', checkUser, asyncHandler(iprDetails));
httpServer.post('/admin/library/qualification/list', checkUser, asyncHandler(qualificationList));
httpServer.post('/admin/library/honor/list', checkUser, asyncHandler(enterpriseHonor));
......@@ -99,6 +107,17 @@ async function iprList(req, res) {
res.success(result);
}
async function iprDetails(req, res) {
const UserInfo = req.userInfo;
let { eId } = req.body
let result = await enterpriseInfoBiz.getiprDetails(eId);
res.success(result);
}
async function qualificationList(req, res) {
const UserInfo = req.userInfo;
let { entepriseName, page } = req.body
......@@ -378,7 +397,7 @@ async function enterpriseDetails(req, res) {
/**
*
* 下载
* @param req
* @param res
*/
......@@ -391,6 +410,57 @@ async function dwEnterpriseList(req, res) {
/**
* 在孵企业下载
* @param req
* @param res
*/
async function getAllDwOutPutData(req, res) {
let {eId} = req.body
let result = await zaiFuBiz.getAllDwOutPut(eId);
res.success(result);
}
// /**
// * 单企业基本信息下载
// * @param req
// * @param res
// */
// async function dwBasicInformationList(req, res) {
// let {eId} = req.body
// let result = await zaiFuBiz.dwBasicInformation(eId);//基本信息下载
// res.success(result);
// }
/**
* 单企业经营数据下载
* @param req
* @param res
*/
async function dwBusinessDataList(req, res) {
let {eId} = req.body
let result = await zaiFuBiz.dwBusinessData(eId);
res.success(result);
}
/**
* 单企业融资情况下载
* @param req
* @param res
*/
async function dwFinancingSituationeList(req, res) {
let {eId} = req.body
let result = await zaiFuBiz.dwFinancingSituatione(eId);
res.success(result);
}
/**
*
* @param req
* @param res
......@@ -405,8 +475,8 @@ async function manageList(req, res) {
async function outPutManageList(req, res) {
const UserInfo = req.userInfo;
let {entepriseName, year, type, state, files } = req.body
let result = await enterpriseInfoBiz.outPutEnterpriseManageList(entepriseName, year, state, type, files);
let {entepriseName, year, type, files } = req.body
let result = await enterpriseInfoBiz.outPutEnterpriseManageList(entepriseName, year, type, files);
res.success(result);
}
......@@ -417,9 +487,9 @@ async function outPutManageList(req, res) {
async function managePass(req, res) {
const UserInfo = req.userInfo;
let {mId } = req.body
let result = await enterpriseInfoBiz.enterpriseManagePass(mId);
// let result = await enterpriseInfoBiz.enterpriseManagePass(mId);
res.success(result);
// res.success(result);
}
......@@ -430,8 +500,8 @@ async function managePass(req, res) {
*/
async function financingList(req, res) {
const UserInfo = req.userInfo;
let {entepriseName, page } = req.body
let result = await enterpriseInfoBiz.enterpriseFinancingList(entepriseName, page);
let {entepriseName, year, page} = req.body
let result = await enterpriseInfoBiz.enterpriseFinancingList(entepriseName, year, page);
res.success(result);
}
......@@ -457,8 +527,8 @@ async function financingAllYear(req, res) {
*/
async function outPutFinancingList(req, res) {
const UserInfo = req.userInfo;
let {entepriseName, type, files } = req.body
let result = await enterpriseInfoBiz.outPutEnterpriseFinancingList(entepriseName, type, files);
let {entepriseName, year, type, files } = req.body
let result = await enterpriseInfoBiz.outPutEnterpriseFinancingList(entepriseName, year, type, files);
res.success(result);
}
......@@ -485,11 +555,11 @@ async function examineList(req, res) {
* @param res
*/
async function examineSub(req, res) {
const UserInfo = req.userInfo;
let { mId } = req.body
let result = await enterpriseInfoBiz.enterpriseExaminePass(mId);
// const UserInfo = req.userInfo;
// let { mId } = req.body
// let result = await enterpriseInfoBiz.enterpriseExaminePass(mId);
res.success(result);
// res.success(result);
}
......
......@@ -21,6 +21,14 @@ const config = {
"/public/output/enterprisemanage":outputEnumConfig.ENTERPRISEMANAGE,
"/public/output/enterprisefinancing":outputEnumConfig.ENTERPRISEFINANCING,
"/public/output/enterprisetalent":outputEnumConfig.ENTERPRISETALENT,
"/public/output/enterpriseservice":outputEnumConfig.ENTERPRISESERVICE,
"/public/output/ipropertytype":enumConfig.IPROPERTYTYPE,//知识产权及专利类型
// "/public/output/basedata":outputEnumConfig.BASEDATA,
// "/public/output/opreatdata":outputEnumConfig.OPERATIONDATA,
// "/public/output/financingdata":outputEnumConfig.FINANCINGDATA,
}
export function setRouter(httpServer) {
......
......@@ -72,6 +72,7 @@ export function randomId(tableName:string) {
export function getMySqlMs(time?) {
time = time || new Date().valueOf();
return moment(time).format("YYYY-MM-DD HH:mm:ss");
// return moment(time).format("YYYY");
}
export function randomCode() {
......
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