Commit b5509757 by chenjinjing

no message

parent 982934a3
<config> <config>
<port>9099</port> <port>9099</port>
<sign>xxx90909082fsdahfjosadjfpoiwausjorip2hjklrhn1ioud0u124rx0qwejfokasjfolksaujfoas</sign> <sign>xxx90909082fsdahfjosadjfpoiwausjorip2hjklrhn1ioud0u124rx0qwejfokasjfolksaujfoas</sign>
<dbServer>http://192.168.0.105:9096</dbServer> <dbServer>http://192.168.0.71:9096</dbServer>
</config> </config>
\ No newline at end of file
/**
* 答题自评
*/
import moment = require("moment");
import { OPERATIONALDATATYPE, TABLEID, TABLENAME } from "../config/enum/dbEnum";
import { changeEnumValue } from "../util/verificationEnum";
import { operationalData, selectData, selectManyTableData } from "../data/operationalData";
import { INDUSTRY, STATE } from "../config/enum/enum";
import { getMySqlMs, randomId } from "../tools/system";
import { BizError } from "../util/bizError";
import { ERRORENUM } from "../config/enum/errorEnum";
/**
* ----------------------------------租房补贴评价答题
*/
/**
* 题目
*/
export async function zuFangAnswerOption() {
let answerInfo = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.租房补贴企业自评, {}, []);
//按照顺序返回题目
answerInfo.sort( (a, b) => {
return a.sort - b.sort;
})
let answerOption = []
answerInfo.forEach( info => {
answerOption.push(info);
})
return answerOption;
}
/**
* 存储答题明细
* @param eId 提交企业
* @param zaId 关联题目id
* @param options 选择的选项(1表示是,0表示否)
* @returns
*/
export async function addZuFangAnswerrecord(eId, zaId, options) {
// 1.检查/创建答题记录
let record:any = await checkOrCreateRecord(eId, "租房补贴答题记录");
// 2.检查是否已答过本题
let existingDetail = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.租房补贴答题记录明细, {zaId, zarId:record.zarId}, []);
// 3:更新或创建明细记录
if (Object.keys(existingDetail).length) { //如果本题记录已存在,修改已答题过的记录
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.租房补贴答题记录明细, { options }, {zadId:existingDetail.zadId});
} else {
let addInfo = {
zadId: randomId(TABLEID.租房补贴答题记录明细),
zarId: record.zarId,
zaId,
options,
}
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.租房补贴答题记录明细, addInfo, {});
}
//4:完成全部答题
let answerInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.租房补贴企业自评, {zaId}, []);
if (answerInfo.answerType == "是否认定科小或创新型中小企业") {
let updateInfo = {
answerStatus: STATE.
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.租房补贴答题记录, updateInfo, {zarId:record.zarId});
}
return {zarId:record.zarId};
}
/**
* 企业租房自评结果
*/
export async function enterpriseZuFangResults(zarId) {
console.log(zarId);
//获取企业租房自评答题记录
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.租房补贴答题记录] = {column:["totalScore", "answerTime", "answerStatus"], where:{} };
manyTableInfo[TABLENAME.租房补贴企业自评] = {column:["zaId", "answerType", "sort", "subject"], where:{} };
let answerInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.租房补贴答题记录明细, {zarId}, ["zadId", "zarId", "zaId", "options"], manyTableInfo);
if (!answerInfo) throw new BizError(ERRORENUM.答题记录不存在);
//scores:0 = 否
let scores = {
是否有研发费用:STATE.,
是否有缴纳社保:STATE.,
是否有软著等知识产权:STATE.,
是否认定科小或创新型中小企业:STATE.
}
answerInfo.forEach( detail => {
let type = detail.zufang_answer.answerType;
scores[type] = detail.options;
})
//计算各个类型得分 0 = 否
let totalScore = STATE.;
for (let key in scores) {
if (scores[key] == STATE.) totalScore = STATE.;
}
//更新是否符合租房补贴条件
let updateAddInfo = {
totalScore
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.租房补贴答题记录, updateAddInfo, {zarId});
return {totalScore};
}
/**
* ----------------------------------高新企业创新能力评价答题
*/
/**
* 高新技术企业自评
* @param eId
*/
export async function gaoxinAnswerList(eId) {
let filesList = ["eId", "logonTime", "industry"];
let iprInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {eId}, filesList);
let islogonTime = false;
let isindustry = false;
// let islogonTime = true;
// let isindustry = true;
if (iprInfo.logonTime) {
let regDate = moment(iprInfo.logonTime, 'YYYY-MM-DD');
// 创建加一年后的日期(自动处理闰年)
let anniversary = regDate.clone().add(1, 'years');
//判断当前时间是否晚于加一年后的日期
let sameAfter = moment().isSameOrAfter(anniversary);
if (sameAfter) islogonTime = true;
}
// todo 行业领域范围还没给到我
let industry = [];
if (iprInfo.industry) {
let industryList = JSON.parse(iprInfo.industry || '[]');
industryList.forEach( item => {
if (item == INDUSTRY["信息传输、软件和信息技术服务业"] || item == INDUSTRY.科学研究和技术服务业 || item == INDUSTRY.制造业) {
isindustry = true;
}
industry.push(changeEnumValue(INDUSTRY, item))
})
}
let dataList = [
{
key:"1.注册时间:企业注册成立≥一年",
value:moment(iprInfo.logonTime).format("YYYY-MM-DD") || "",
isOk:islogonTime
},
{
key:"2.业务领域范围",
value:industry.join(',') || "",
isOk:isindustry
},
];
return {dataList};
}
/**
* 题目
*/
export async function gaoxinAnswerOption() {
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.高新企业创新能力评价选项] = {column:["goId", "gaId", "sort", "answer", "option", "notes", "score"], where:{} };
let answerFile = ["gaId", "answerType", "sort", "subject", "isMultipleChoice", "questionType"];
let answerInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.高新企业创新能力评价答题, {}, answerFile, manyTableInfo);
//按照顺序返回题目
answerInfo.sort( (a, b) => {
return a.sort - b.sort;
})
let answerOption = {
知识产权:[],
科技成果:[],
研发管理:[],
企业成长:[]
}
answerInfo.forEach( info => {
info.gaoxin_options.sort( (a, b) => {
return a.sort - b.sort;
})
info.subject = `${info.subject}${info.questionType})`;
/**除了知识产权、科技成果、研发管理、企业成长剩余题目类型不返回 */
if (answerOption[info.answerType]) answerOption[info.answerType].push(info);
})
return answerOption;
}
/**
* 完成全部答题
* @param garId 答题记录id
*/
async function changeAnswerStatu(garId) {
console.log("完成全部答题:", garId)
let updateInfo = {
answerStatus: STATE.
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.答题记录, updateInfo, {garId});
return {isSuccess:true};
}
/**
* 存储答题明细
* @param eId 提交企业
* @param gaId 关联题目id
* @param options 选择的选项ID数组 ["", ""]
* @param assetGrowth 净资产增长率(0-1小数形式)
* @param revenueGrowth 销售收入增长率(0-1小数形式)
* @returns
*/
export async function addAnswerrecord(eId, gaId, options, assetGrowth, revenueGrowth) {
// 1.检查/创建答题记录
let record:any = await checkOrCreateRecord(eId, "答题记录");
// 2.检查是否已答过本题
let existingDetail = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.答题记录明细, {gaId, garId:record.garId}, []);
// 3.计算本题得分 选项得分计算
let answerInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.高新企业创新能力评价答题, {gaId}, []);
let gaoxinOption = [];
console.log(answerInfo.answerType)
if (answerInfo.answerType == "企业成长") {
gaoxinOption = await calculateGrowthScore(assetGrowth, revenueGrowth);
} else {
gaoxinOption = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.高新企业创新能力评价选项, {gaId, goId:{"%in%":options}}, ["goId", "score"]);
}
/**
* gaoxinOption = [
{id:1, score:5},
{id:2}, // 无score属性
{id:3, score:3}
];
options 计算结果:5 + 0 + 3 = 8
*/
let score = gaoxinOption.reduce((sum, opt) => sum + (opt.score || 0), 0)
// 4:更新或创建明细记录
if (Object.keys(existingDetail).length) { //如果本题记录已存在,修改已答题过的记录
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.答题记录明细, { options:JSON.stringify(options), questionScore:score }, {gadId:existingDetail.gadId});
} else {
let addInfo = {
gadId: randomId(TABLEID.答题记录明细),
garId: record.garId,
gaId,
options:JSON.stringify(options),
questionScore: score
}
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.答题记录明细, addInfo, {});
}
// 步骤5:更新总分
await updateTotalScore(record.garId);
//完成全部答题
if (answerInfo.answerType == "企业成长") {
await changeAnswerStatu(record.garId);
}
return {garId:record.garId};
}
/**
* 查找未完成的记录
* @param eId
*/
export async function checkOrCreateRecord(eId, tableName) {
let addInfo = {};
if (tableName == "租房补贴答题记录") {
let existingRecord = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.租房补贴答题记录, {eId, answerStatus:STATE.}, []);
addInfo = existingRecord;
/**如果没有未完成答题记录,创建一条新的 */
if (!Object.keys(existingRecord).length) {
addInfo = {
zarId:randomId(TABLEID.租房补贴答题记录),
eId,
answerTime: getMySqlMs(),
totalScore: 0,
answerStatus: STATE.
};
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.租房补贴答题记录, addInfo, {});
}
} else if (tableName == "答题记录") {
let existingRecord = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.答题记录, {eId, answerStatus:STATE.}, []);
addInfo = existingRecord;
/**如果没有未完成答题记录,创建一条新的 */
if (!Object.keys(existingRecord).length) {
addInfo = {
garId:randomId(TABLEID.答题记录),
eId,
answerTime: getMySqlMs(),
totalScore: 0,
answerStatus: STATE.
};
await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.答题记录, addInfo, {});
}
}
return addInfo;
}
/**
* 更新总分函数
* @param garId 答题记录
*/
async function updateTotalScore(garId) {
let existingDetail = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.答题记录明细, {garId}, ["questionScore"]);
let sumScore = 0;
existingDetail.forEach( info => {
sumScore += parseInt(info.questionScore);
})
let updateInfo = {
totalScore: sumScore || 0
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.答题记录, updateInfo, {garId});
}
/**
* 企业成长性评分计算
* @param assetGrowth 净资产增长率(0-1小数形式)
* @param revenueGrowth 销售收入增长率(0-1小数形式)
* @returns number 综合得分 0/6/8/10
* >35%:10分
25%-35% 8分
15%-24% 6分
<15%:0分
*/
async function calculateGrowthScore(assetGrowth, revenueGrowth) {
// 处理负增长情况
let validAsset = Math.max(0, assetGrowth);
let validRevenue = Math.max(0, revenueGrowth);
let assetGrowthScore = 0;
// 净资产增长率阶梯式评分
if (validAsset > 35) assetGrowthScore = 10;
else if (validAsset >= 25) assetGrowthScore = 8;
else if (validAsset >= 15) assetGrowthScore = 6;
let revenueGrowthScore = 0;
// 销售收入增长率阶梯式评分
if (validRevenue > 35) revenueGrowthScore = 10;
else if (validRevenue >= 25) revenueGrowthScore = 8;
else if (validRevenue >= 15) revenueGrowthScore = 6;
let result = [
{id:"jzczzl1", score:assetGrowthScore},
{id:"xssrzzl2", score:revenueGrowthScore},
];
return result;
}
/**
* 企业自评结果
*/
export async function enterpriseResults(garId) {
console.log(garId);
//获取企业自评答题记录
let manyTableInfo:any = {};
manyTableInfo[TABLENAME.答题记录] = {column:["totalScore", "answerTime", "answerStatus"], where:{} };
manyTableInfo[TABLENAME.高新企业创新能力评价答题] = {column:["gaId", "answerType", "sort", "subject", "isMultipleChoice", "questionType"], where:{} };
let answerInfo = await selectManyTableData(OPERATIONALDATATYPE.多表联查, TABLENAME.答题记录明细, {garId}, ["gadId", "garId", "gaId", "options", "questionScore"], manyTableInfo);
if (!answerInfo) throw new BizError(ERRORENUM.答题记录不存在);
let scores = {
知识产权:0,
科技成果:0,
研发管理:0,
企业成长:0
}
//计算各个类型得分
let totalScore = 0;
answerInfo.forEach( detail => {
totalScore = parseInt(detail.gaoxin_answerrecord.totalScore);
let type = detail.gaoxin_answer.answerType;
scores[type] += parseInt(detail.questionScore);
})
//是否达标
let isReach = "未达标";
if (totalScore >= 71) isReach = "已达标";
let lowestType = getLowestScoreRateType(scores);
return {isReach, totalScore, scores, lowestType};
}
//计算最低得分率类型
function getLowestScoreRateType(scores) {
// 定义各类型权重
let weights = {
'知识产权': 0.3,
'科技成果': 0.3,
'研发管理': 0.2,
'企业成长': 0.2
};
// 计算加权得分率并找出最小值
let results = [];
let minRate = Infinity;
for (let type in scores) {
let rate = scores[type] * weights[type];
if (rate < minRate) {
minRate = rate;
results.length = 0; // 清空之前的结果
results.push(type);
} else if (rate === minRate) {
results.push(type);
}
}
return results;
}
/**
* 企业基础信息
*/
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* 企业信息汇总 * 企业信息汇总
* */ * */
import { EnterpriseFaRenInfoUpdateConfig, EnterpriseInfomationUpdateConfig, EnterpriseServiceUpdateConfig} from "../config/eccParam/enterprise"; import { EnterpriseFaRenInfoUpdateConfig, EnterpriseInfomationUpdateConfig, enterpriseLeaseUpdateConfig, EnterpriseServiceUpdateConfig} from "../config/eccParam/enterprise";
import { OPERATIONALDATATYPE, TABLEID, TABLENAME } from "../config/enum/dbEnum"; import { OPERATIONALDATATYPE, TABLEID, TABLENAME } from "../config/enum/dbEnum";
import * as enumConfig from "../config/enum/enum"; import * as enumConfig from "../config/enum/enum";
import { EnterpriseBaseResConfig, EnterpriseFaRenInfoResConfig, EnterpriseInfomationResConfig, EnterpriseLeaseInfoResConfig, EnterpriseQualificationInfoResConfig } from "../config/splitResult/enterprise"; import { EnterpriseBaseResConfig, EnterpriseFaRenInfoResConfig, EnterpriseInfomationResConfig, EnterpriseLeaseInfoResConfig, EnterpriseQualificationInfoResConfig } from "../config/splitResult/enterprise";
...@@ -12,7 +12,7 @@ import { checkChange, extractData } from "../util/piecemeal"; ...@@ -12,7 +12,7 @@ import { checkChange, extractData } from "../util/piecemeal";
import { changeEnumValue, eccEnumValue } from "../util/verificationEnum"; import { changeEnumValue, eccEnumValue } from "../util/verificationEnum";
import { eccFormParam } from "../util/verificationParam"; import { eccFormParam } from "../util/verificationParam";
import { ERRORENUM } from "../config/enum/errorEnum"; import { ERRORENUM } from "../config/enum/errorEnum";
import { getDeclarationTime, getLastDeclarationTime, getMySqlMs, getToken, randomId } from "../tools/system"; import { getAddresList, getDeclarationTime, getLastDeclarationTime, getMySqlMs, getToken, randomId } from "../tools/system";
import moment = require("moment"); import moment = require("moment");
import { sendVerificationCode } from "./mail"; import { sendVerificationCode } from "./mail";
...@@ -21,16 +21,30 @@ import { sendVerificationCode } from "./mail"; ...@@ -21,16 +21,30 @@ import { sendVerificationCode } from "./mail";
//企业用户表没有存uscc字段,先查询到企业eId,然后到用户表查询密码判断是否登录成功 //企业用户表没有存uscc字段,先查询到企业eId,然后到用户表查询密码判断是否登录成功
export async function enterpriseLogin(phone:string, pwd:string) { export async function enterpriseLogin(phone:string, pwd:string) {
let filesList = ["userName", "eId", "pwd", "uId", "phone"]; let filesList = ["userName", "eId", "pwd", "uId", "phone"];
let userDbData = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业用户表, { phone }, filesList);
let eId = userDbData[0].eId;
let enterpriseUserInfo = userDbData[0];
// if (userDbData.length > 1) {
// if (phone == "13601665163") {
// eId = userDbData[1].eId;
// enterpriseUserInfo = userDbData[1];
// }
// }
if (!eId) throw new BizError(ERRORENUM.账号或密码错误);
let includeConf = {}; let includeConf = {};
includeConf[TABLENAME.企业孵化信息] = {colum:["state", "startTime", "endTime"], where:{state:{"%ne%":enumConfig.FUHUASTATE.迁出}} }; includeConf[TABLENAME.企业孵化信息] = {colum:["state", "startTime", "endTime"], where:{state:{"%ne%":enumConfig.FUHUASTATE.迁出}} };
includeConf[TABLENAME.企业用户表] = {colum:filesList, where:{phone} }; let enterpriseInfo = await selectManyTableData(OPERATIONALDATATYPE.多表单个, TABLENAME.企业基础信息表, {state:enumConfig.CHANGESTATE.已通过, eId}, ["enterpriseName"], includeConf);
let enterpriseInfo = await selectManyTableData(OPERATIONALDATATYPE.多表单个, TABLENAME.企业基础信息表, {state:enumConfig.CHANGESTATE.已通过}, ["enterpriseName"], includeConf);
// includeConf[TABLENAME.企业孵化信息] = {colum:["state", "startTime", "endTime"], where:{state:{"%ne%":enumConfig.FUHUASTATE.迁出}} };
// includeConf[TABLENAME.企业用户表] = {colum:filesList, where:{phone} };
// let enterpriseInfo = await selectManyTableData(OPERATIONALDATATYPE.多表单个, TABLENAME.企业基础信息表, {state:enumConfig.CHANGESTATE.已通过}, ["enterpriseName"], includeConf);
if (!enterpriseInfo || !enterpriseInfo.enterpriseName) { if (!enterpriseInfo || !enterpriseInfo.enterpriseName) {
throw new BizError(ERRORENUM.账号或密码错误); throw new BizError(ERRORENUM.账号或密码错误);
} }
let {enterprise_users} = enterpriseInfo; // let {enterprise_users} = enterpriseInfo;
let enterpriseUserInfo = enterprise_users[0]; // let enterpriseUserInfo = enterprise_users[0];
if (!enterpriseUserInfo || !enterpriseUserInfo.phone) { if (!enterpriseUserInfo || !enterpriseUserInfo.phone) {
throw new BizError(ERRORENUM.账号或密码错误); throw new BizError(ERRORENUM.账号或密码错误);
} }
...@@ -56,6 +70,30 @@ export async function enterpriseLogin(phone:string, pwd:string) { ...@@ -56,6 +70,30 @@ export async function enterpriseLogin(phone:string, pwd:string) {
/** /**
* 修改密码
* @param uId
* @param pwd 原密码
* @param newPwd 新密码
* @param confirmPwd 再次确认密码
* @returns
*/
export async function changePassword(uId:string, pwd:string, newPwd:string, confirmPwd:string) {
let enterpriseInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业用户表, { uId }, ["userName", "uId", "pwd"]);
if (!enterpriseInfo.uId) throw new BizError(ERRORENUM.数据不存在);
/**验证当前密码 */
if (pwd != enterpriseInfo.pwd) throw new BizError(ERRORENUM.原密码错误);
// if (newPwd != confirmPwd) throw new BizError(ERRORENUM.密码不一致);
if (newPwd.search(/^[A-Za-z0-9]{6,18}$/) < 0) throw new BizError(ERRORENUM.密码只能由618位字符和数字组成);
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.企业用户表, {pwd:newPwd}, { uId });
return {isSuccess:true};
}
/**
* 小程序登录改为邮箱认证--todo * 小程序登录改为邮箱认证--todo
* @param email 邮箱 * @param email 邮箱
* @param code 验证码 * @param code 验证码
...@@ -166,6 +204,30 @@ export async function enterpriseByPhone(phone:string) { ...@@ -166,6 +204,30 @@ export async function enterpriseByPhone(phone:string) {
//===首页 //===首页
/**
* 首页获取企业基本信息
* @param uscc
*/
export async function homePageBaseInfo(eId) {
let enterpriseInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {eId}, ["uscc", "enterpriseName", "logonAddress"]);
let fuhuaInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业孵化信息, {eId}, ["startTime", "endTime"]);
let logonAddress = [];
if (enterpriseInfo.logonAddress) {
logonAddress = getAddresList(enterpriseInfo.logonAddress);
}
let dataInfo = {
uscc: enterpriseInfo.uscc,
logonAddress: logonAddress,
fuhuaTime: `${moment(fuhuaInfo.startTime).format("YYYY/MM/DD")}-${moment(fuhuaInfo.endTime).format("YYYY/MM/DD")}`,
};
return {dataInfo};
}
export async function homePage(eId:string) { export async function homePage(eId:string) {
let filesList = ["enterpriseName", "eId"]; let filesList = ["enterpriseName", "eId"];
let enterpriseInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {eId}, filesList); let enterpriseInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {eId}, filesList);
...@@ -319,7 +381,12 @@ export async function enterpriseBaseInfo(eId) { ...@@ -319,7 +381,12 @@ export async function enterpriseBaseInfo(eId) {
let filesList = ["uscc", "enterpriseName", "logonTime", "logonAddress", "operatingAddress", "oldLogonAddress", "zhuCeHao", "zuZhiJiGouDaiMa", "dengJiJiGuan"]; let filesList = ["uscc", "enterpriseName", "logonTime", "logonAddress", "operatingAddress", "oldLogonAddress", "zhuCeHao", "zuZhiJiGouDaiMa", "dengJiJiGuan"];
let enterpriseInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {eId}, filesList); let enterpriseInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {eId}, filesList);
enterpriseInfo.logonAddress = JSON.parse(enterpriseInfo.logonAddress); let logonAddress = [];
if (enterpriseInfo.logonAddress) {
logonAddress = getAddresList(enterpriseInfo.logonAddress);
}
enterpriseInfo.logonAddress = logonAddress;
enterpriseInfo.operatingAddress = enterpriseInfo.operatingAddress || "-"; enterpriseInfo.operatingAddress = enterpriseInfo.operatingAddress || "-";
enterpriseInfo.oldLogonAddress = JSON.parse(enterpriseInfo.oldLogonAddress||'[]'); enterpriseInfo.oldLogonAddress = JSON.parse(enterpriseInfo.oldLogonAddress||'[]');
enterpriseInfo.logonTime = moment(enterpriseInfo.logonTime).format("YYYY-MM-DD"); enterpriseInfo.logonTime = moment(enterpriseInfo.logonTime).format("YYYY-MM-DD");
...@@ -463,20 +530,71 @@ export async function enterpriseLeaseInfo(eId) { ...@@ -463,20 +530,71 @@ export async function enterpriseLeaseInfo(eId) {
const endTime = moment(enterpriseInfo.enterprise_leases[0].endTime); const endTime = moment(enterpriseInfo.enterprise_leases[0].endTime);
if (startTime.isValid() && endTime.isValid()) { if (startTime.isValid() && endTime.isValid()) {
dataInfo.leaseTime = `${startTime.format("YYYY-MM-DD")}${endTime.format("YYYY-MM-DD")}`; // dataInfo.leaseTime = `${startTime.format("YYYY-MM-DD")}至${endTime.format("YYYY-MM-DD")}`;
dataInfo.leaseStartTime = startTime.format("YYYY-MM-DD");
dataInfo.leaseEndTime = endTime.format("YYYY-MM-DD");
} else { } else {
dataInfo.leaseTime = '未设置租赁日期'; // dataInfo.leaseTime = '未设置租赁日期';
dataInfo.leaseStartTime = '-';
dataInfo.leaseEndTime = '-';
} }
} else { } else {
dataInfo.leaseTime = '无租赁信息'; dataInfo.leaseStartTime = '-';
dataInfo.leaseEndTime = '-';
} }
// if (enterpriseInfo.enterprise_leases) dataInfo.leaseTime = `${moment(enterpriseInfo.enterprise_leases[0].startTime).format("YYYY-MM-DD")}至${moment(enterpriseInfo.enterprise_leases[0].endTime).format("YYYY-MM-DD")}`; // if (enterpriseInfo.enterprise_leases) dataInfo.leaseTime = `${moment(enterpriseInfo.enterprise_leases[0].startTime).format("YYYY-MM-DD")}至${moment(enterpriseInfo.enterprise_leases[0].endTime).format("YYYY-MM-DD")}`;
if (enterpriseInfo.enterprise_fuhuas) dataInfo.fuHuaTime = `${moment(enterpriseInfo.enterprise_fuhuas[0].startTime).format("YYYY-MM-DD")}${moment(enterpriseInfo.enterprise_fuhuas[0].endTime).format("YYYY-MM-DD")}`; if (enterpriseInfo.enterprise_fuhuas) {
const startTime = moment(enterpriseInfo.enterprise_fuhuas[0].startTime);
const endTime = moment(enterpriseInfo.enterprise_fuhuas[0].endTime);
if (startTime.isValid() && endTime.isValid()) {
// dataInfo.leaseTime = `${startTime.format("YYYY-MM-DD")}至${endTime.format("YYYY-MM-DD")}`;
dataInfo.fuHuaStartTime = startTime.format("YYYY-MM-DD");
dataInfo.fuHuaEndTime = endTime.format("YYYY-MM-DD");
} else {
dataInfo.fuHuaStartTime = '-';
dataInfo.fuHuaEndTime = '-';
}
// dataInfo.fuHuaTime = `${moment(enterpriseInfo.enterprise_fuhuas[0].startTime).format("YYYY-MM-DD")}至${moment(enterpriseInfo.enterprise_fuhuas[0].endTime).format("YYYY-MM-DD")}`;
} else {
dataInfo.fuHuaStartTime = '-';
dataInfo.fuHuaEndTime = '-';
}
return {dataInfo}; return {dataInfo};
} }
/**
* 修改企业入驻信息
* @param eId
*/
export async function enterpriseLeaseUpdate(eId, param) {
const FuncName = "修改企业入驻信息"
eccFormParam(FuncName, enterpriseLeaseUpdateConfig, param );
eccEnumValue(FuncName, 'building', enumConfig.BUILDING, param.building);
let leaseParam = {
area:param.area,
building:param.building,
roomNumber:param.roomNumber,
rent:param.rent,
startTime:param.leaseStartTime,
endTime:param.leaseEndTime
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.租赁信息, leaseParam, {eId});
let fuhuaParam = {
startTime:param.startTime,
endTime:param.endTime
}
await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.企业孵化信息, fuhuaParam, {eId});
return {isSuccess:true};
}
//===============================================企业服务 //===============================================企业服务
...@@ -486,19 +604,20 @@ export async function enterpriseLeaseInfo(eId) { ...@@ -486,19 +604,20 @@ export async function enterpriseLeaseInfo(eId) {
* @param uscc * @param uscc
*/ */
export async function enterpriseServiceList(eId) { export async function enterpriseServiceList(eId) {
let filesList = ["esId", "needCategory", "applyTime", "followUpStatus"]; let filesList = ["esId", "needCategory", "applyTime", "followUpStatus", "needContent"];
let iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业服务表, {eId}, filesList); let iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业服务表, {eId}, filesList);
let dataList:any[] = []; let dataList:any[] = [];
iprList.forEach(item => { iprList.forEach(item => {
let {esId, needCategory, applyTime, followUpStatus} = item; let {esId, needCategory, applyTime, followUpStatus, needContent} = item;
dataList.push({ dataList.push({
esId, esId,
needCategory, needCategory,
applyTime:moment(applyTime).format("YYYY-MM-DD"), applyTime:moment(applyTime).format("YYYY-MM-DD"),
followUpStatus:changeEnumValue(enumConfig.FOLLOWUPSTATUS, followUpStatus) followUpStatus:changeEnumValue(enumConfig.FOLLOWUPSTATUS, followUpStatus),
needContent
}); });
}); });
......
...@@ -190,39 +190,39 @@ export async function enterpriseIPRList(eId, iprType) { ...@@ -190,39 +190,39 @@ export async function enterpriseIPRList(eId, iprType) {
let iprColumn = []; let iprColumn = [];
let iprConf = []; let iprConf = [];
if (iprType == enumConfig.IPRALLTYPE.商标信息) { if (iprType == enumConfig.IPRALLTYPE.商标信息) {
iprColumn = ["tmId", "name", "RegDate"]; iprColumn = ["tmId", "name", "RegDate", "imageUrl"];
iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.商标, {eId}, iprColumn); iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.商标, {eId}, iprColumn);
iprConf = ["tmId", "name", "RegDate"] iprConf = ["tmId", "name", "RegDate", "imageUrl"]
} }
if (iprType == enumConfig.IPRALLTYPE.作品著作权) { if (iprType == enumConfig.IPRALLTYPE.作品著作权) {
iprColumn = ["crId", "name", "registerDate"]; iprColumn = ["crId", "name", "registerDate", "iprUrl"];
iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.作品著作权, {eId}, iprColumn); iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.作品著作权, {eId}, iprColumn);
iprConf = ["crId", "name", "registerDate"] iprConf = ["crId", "name", "registerDate", "iprUrl"]
} }
if (iprType == enumConfig.IPRALLTYPE.软件著作权) { if (iprType == enumConfig.IPRALLTYPE.软件著作权) {
iprColumn = ["scId", "registerAperDate", "name"]; iprColumn = ["scId", "registerAperDate", "name", "iprUrl"];
iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.软件著作权, {eId}, iprColumn); iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.软件著作权, {eId}, iprColumn);
iprConf = ["scId", "name", "registerAperDate"] iprConf = ["scId", "name", "registerAperDate", "iprUrl"]
} }
if (iprType == enumConfig.IPRALLTYPE.外观设计专利) { if (iprType == enumConfig.IPRALLTYPE.外观设计专利) {
iprColumn = ["patentId", "publicationDate", "title"]; iprColumn = ["patentId", "publicationDate", "title", "iprUrl"];
iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.专利, {eId, kindcode:enumConfig.KUNDCODE.外观设计}, iprColumn); iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.专利, {eId, kindcode:enumConfig.KUNDCODE.外观设计}, iprColumn);
iprConf = ["patentId", "title", "publicationDate"] iprConf = ["patentId", "title", "publicationDate", "iprUrl"]
} }
if (iprType == enumConfig.IPRALLTYPE.实用新型专利) { if (iprType == enumConfig.IPRALLTYPE.实用新型专利) {
iprColumn = ["patentId", "eId", "category", "kindcode", "applicationNumber", "applicationDate", "publicationNumber", "publicationDate", "legalStatusDesc", "title", "agency", "kindCodeDesc", "IPCDesc", "inventorStringList", "assigneestringList"]; iprColumn = ["patentId", "eId", "category", "kindcode", "applicationNumber", "applicationDate", "publicationNumber", "publicationDate", "legalStatusDesc", "title", "agency", "kindCodeDesc", "IPCDesc", "inventorStringList", "assigneestringList", "iprUrl"];
iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.专利, {eId, kindcode:enumConfig.KUNDCODE.实用新型}, iprColumn); iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.专利, {eId, kindcode:enumConfig.KUNDCODE.实用新型}, iprColumn);
iprConf = ["patentId", "title", "publicationDate"] iprConf = ["patentId", "title", "publicationDate", "iprUrl"]
} }
if (iprType == enumConfig.IPRALLTYPE.发明专利) { if (iprType == enumConfig.IPRALLTYPE.发明专利) {
iprColumn = ["patentId", "eId", "category", "kindcode", "applicationNumber", "applicationDate", "publicationNumber", "publicationDate", "legalStatusDesc", "title", "agency", "kindCodeDesc", "IPCDesc", "inventorStringList", "assigneestringList"]; iprColumn = ["patentId", "eId", "category", "kindcode", "applicationNumber", "applicationDate", "publicationNumber", "publicationDate", "legalStatusDesc", "title", "agency", "kindCodeDesc", "IPCDesc", "inventorStringList", "assigneestringList", "iprUrl"];
iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.专利, {eId, kindcode:{"%between%":[enumConfig.KUNDCODE.发明公布, enumConfig.KUNDCODE.发明授权]}}, iprColumn); iprList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.专利, {eId, kindcode:{"%between%":[enumConfig.KUNDCODE.发明公布, enumConfig.KUNDCODE.发明授权]}}, iprColumn);
iprConf = ["patentId", "title", "publicationDate"] iprConf = ["patentId", "title", "publicationDate", "iprUrl"]
} }
let dataList:any = []; let dataList:any = [];
...@@ -234,7 +234,8 @@ export async function enterpriseIPRList(eId, iprType) { ...@@ -234,7 +234,8 @@ export async function enterpriseIPRList(eId, iprType) {
iprId:info[iprConf[0]], iprId:info[iprConf[0]],
iprName:info[iprConf[1]], iprName:info[iprConf[1]],
iprTime, iprTime,
timeNumber:new Date(info[iprConf[2]]).valueOf() timeNumber:new Date(info[iprConf[2]]).valueOf(),
iprUrl:JSON.parse(info[iprConf[3]]),
}) })
}) })
} }
...@@ -669,22 +670,31 @@ export async function enterpriseQualificationInfo(eId) { ...@@ -669,22 +670,31 @@ export async function enterpriseQualificationInfo(eId) {
kxTime: "", kxTime: "",
kxNumber: "", kxNumber: "",
kxImg: [], kxImg: [],
zjtxState: 0, zjtxState: 0,
zjtxTime: "", zjtxTime: "",
zjtxImg: [], zjtxImg: [],
xjrState: 0,
xjrTime: "", // xjrState: 0,
xjrImg: [], // xjrTime: "",
// xjrImg: [],
xjrPyState: 0, xjrPyState: 0,
xjrPyTime: "", xjrPyTime: "",
xjrPyImg: [], xjrPyImg: [],
gxjsState: 0, gxjsState: 0,
gaoXinJiShuTime: "", gaoXinJiShuTime: "",
gaoXinJiShuImg: [], gaoXinJiShuImg: [],
listedState: 0,
goPublicSector: [], cxState: 0,
goPublicTime: "", cxTime: "",
other: "", cxImg: [],
// listedState: 0,
// goPublicSector: [],
// goPublicTime: "",
// other: "",
}; };
if (qualificationData.qId) { if (qualificationData.qId) {
result = { result = {
...@@ -695,20 +705,22 @@ export async function enterpriseQualificationInfo(eId) { ...@@ -695,20 +705,22 @@ export async function enterpriseQualificationInfo(eId) {
zjtxState: qualificationData.zjtxState || 0, zjtxState: qualificationData.zjtxState || 0,
zjtxTime: qualificationData.zjtxTime, zjtxTime: qualificationData.zjtxTime,
zjtxImg: qualificationData.zjtxImg ? JSON.parse(qualificationData.zjtxImg) : [],//新增专精特新证书 zjtxImg: qualificationData.zjtxImg ? JSON.parse(qualificationData.zjtxImg) : [],//新增专精特新证书
xjrState: qualificationData.xjrState || 0, // xjrState: qualificationData.xjrState || 0,
xjrTime: qualificationData.xjrTime, // xjrTime: qualificationData.xjrTime,
xjrImg: qualificationData.xjrImg ? JSON.parse(qualificationData.xjrImg) : [],//新增小巨人证书 // xjrImg: qualificationData.xjrImg ? JSON.parse(qualificationData.xjrImg) : [],//新增小巨人证书
xjrPyState: qualificationData.xjrPyState || 0, xjrPyState: qualificationData.xjrPyState || 0,
xjrPyTime: qualificationData.xjrPyTime, xjrPyTime: qualificationData.xjrPyTime,
xjrPyImg: qualificationData.zjtxImg ? JSON.parse(qualificationData.xjrPyImg) : [],//新增小巨人培育证书 xjrPyImg: qualificationData.zjtxImg ? JSON.parse(qualificationData.xjrPyImg) : [],//新增小巨人培育证书
gxjsState: qualificationData.gxjsState || 0, gxjsState: qualificationData.gxjsState || 0,
gaoXinJiShuTime: qualificationData.gaoXinJiShuTime, gaoXinJiShuTime: qualificationData.gaoXinJiShuTime,
gaoXinJiShuImg: qualificationData.gaoXinJiShuImg ? JSON.parse(qualificationData.gaoXinJiShuImg) : [],//新增高新技术证书 gaoXinJiShuImg: qualificationData.gaoXinJiShuImg ? JSON.parse(qualificationData.gaoXinJiShuImg) : [],//新增高新技术证书
listedState: qualificationData.listedState || 0, cxState: qualificationData.cxState || 0,//新增创新状态
goPublicSector: JSON.parse(qualificationData.goPublicSector) || [], cxTime: qualificationData.cxTime,
goPublicTime: qualificationData.goPublicTime, cxImg: qualificationData.cxImg ? JSON.parse(qualificationData.cxImg) :[],//新增科编图片
// goPublicTime: qualificationData.goPublicTime ? moment(qualificationData.goPublicTime).valueOf() : "", // listedState: qualificationData.listedState || 0,
other: qualificationData.other || '',//新增其他 // goPublicSector: JSON.parse(qualificationData.goPublicSector) || [],
// goPublicTime: qualificationData.goPublicTime,
// other: qualificationData.other || '',//新增其他
}; };
} }
...@@ -730,32 +742,26 @@ export async function updateEnterpriseQualificationInfo(eId, param) { ...@@ -730,32 +742,26 @@ export async function updateEnterpriseQualificationInfo(eId, param) {
if (param.goPublicSector) eccEnumValue(FuncName, 'goPublicSector', enumConfig.LISTINGSITUATION, param.goPublicSector); if (param.goPublicSector) eccEnumValue(FuncName, 'goPublicSector', enumConfig.LISTINGSITUATION, param.goPublicSector);
let filesList = ["eId", "kxState","kxTime","kxNumber","kxImg", "zjtxState","zjtxTime","zjtxImg", let filesList = ["eId", "kxState","kxTime","kxNumber","kxImg", "zjtxState","zjtxTime","zjtxImg",
"xjrState", "xjrTime","xjrImg","xjrPyState", "xjrPyTime","xjrPyImg", "xjrPyState", "xjrPyTime","xjrPyImg",
"gxjsState","gaoXinJiShuTime","gaoXinJiShuImg","listedState", "goPublicTime", "goPublicSector","other"]; "gxjsState","gaoXinJiShuTime","gaoXinJiShuImg","cxState", "cxTime","cxImg"];
let iprInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业资质, {eId}, filesList) let iprInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业资质, {eId}, filesList)
/**修改字段 */
// filesList.forEach(keyStr => {
// if (keyStr == "goPublicSector" || keyStr == "kxState" || keyStr == "zjtxState"
// || keyStr == "xjrState" || keyStr == "xjrPyState" || keyStr == "gxjsState" || keyStr == "listedState"
// ) return;
// if (!param[keyStr]) delete param[keyStr]
// });
param.kxNumber = param.kxNumber ? param.kxNumber : null; param.kxNumber = param.kxNumber ? param.kxNumber : null;
param.goPublicSector = param.goPublicSector ? JSON.stringify(param.goPublicSector) : "[]"; // param.goPublicSector = param.goPublicSector ? JSON.stringify(param.goPublicSector) : "[]";
param.kxImg = param.kxImg ? JSON.stringify(param.kxImg) : "[]"; param.kxImg = param.kxImg ? JSON.stringify(param.kxImg) : "[]";
param.zjtxImg = param.zjtxImg ? JSON.stringify(param.zjtxImg) : "[]"; param.zjtxImg = param.zjtxImg ? JSON.stringify(param.zjtxImg) : "[]";
param.xjrImg = param.xjrImg ? JSON.stringify(param.xjrImg) : "[]"; param.xjrImg = param.xjrImg ? JSON.stringify(param.xjrImg) : "[]";
param.xjrPyImg = param.xjrPyImg ? JSON.stringify(param.xjrPyImg) : "[]"; param.xjrPyImg = param.xjrPyImg ? JSON.stringify(param.xjrPyImg) : "[]";
param.gaoXinJiShuImg = param.gaoXinJiShuImg ? JSON.stringify(param.gaoXinJiShuImg) : "[]"; param.gaoXinJiShuImg = param.gaoXinJiShuImg ? JSON.stringify(param.gaoXinJiShuImg) : "[]";
param.cxImg = param.cxImg ? JSON.stringify(param.cxImg) : "[]";
param.kxTime = param.kxTime ? getMySqlMs(param.kxTime) : null; param.kxTime = param.kxTime ? getMySqlMs(param.kxTime) : null;
param.zjtxTime = param.zjtxTime ? getMySqlMs(param.zjtxTime) : null; param.zjtxTime = param.zjtxTime ? getMySqlMs(param.zjtxTime) : null;
param.xjrTime = param.xjrTime ? getMySqlMs(param.xjrTime) : null; param.xjrTime = param.xjrTime ? getMySqlMs(param.xjrTime) : null;
param.xjrPyTime = param.xjrPyTime ? getMySqlMs(param.xjrPyTime) : null; param.xjrPyTime = param.xjrPyTime ? getMySqlMs(param.xjrPyTime) : null;
param.gaoXinJiShuTime = param.gaoXinJiShuTime ? getMySqlMs(param.gaoXinJiShuTime) : null; param.gaoXinJiShuTime = param.gaoXinJiShuTime ? getMySqlMs(param.gaoXinJiShuTime) : null;
param.goPublicTime = param.goPublicTime ? getMySqlMs(param.goPublicTime) : null; param.cxTime = param.cxTime ? getMySqlMs(param.cxTime) : null;
// param.goPublicTime = param.goPublicTime ? getMySqlMs(param.goPublicTime) : null;
if (!iprInfo || !iprInfo.eId) { if (!iprInfo || !iprInfo.eId) {
param.qId = randomId(TABLEID.企业资质); param.qId = randomId(TABLEID.企业资质);
...@@ -771,67 +777,6 @@ export async function updateEnterpriseQualificationInfo(eId, param) { ...@@ -771,67 +777,6 @@ export async function updateEnterpriseQualificationInfo(eId, param) {
} }
// export async function updateEnterpriseQualificationInfo(eId, param) {
// const FuncName = "企业修改资质信息";
// // 验证参数
// eccFormParam(FuncName, EnterpriseQualificationUpdateConfig, param);
// // 处理上市板块枚举值
// if (param.goPublicSector) {
// eccEnumValue(FuncName, 'goPublicSector', enumConfig.LISTINGSITUATION, param.goPublicSector);
// }
// // 查询现有数据
// let filesList = [
// "eId", "kxState", "kxTime", "kxNumber", "kxImg",
// "zjtxState", "zjtxTime", "zjtxImg",
// "xjrState", "xjrTime", "xjrImg", "xjrPyState", "xjrPyTime", "xjrPyImg",
// "gxjsState", "gaoXinJiShuTime", "gaoXinJiShuImg", "listedState", "goPublicTime", "goPublicSector", "other"
// ];
// let iprInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业资质, { eId }, filesList);
// if (!iprInfo || !iprInfo.eId) throw new BizError(ERRORENUM.当前数据不存在);
// // 构建需要更新的字段
// let addInfo: any = {};
// // 处理图片字段
// const imageFields = ["kxImg", "zjtxImg", "xjrImg", "xjrPyImg", "gaoXinJiShuImg"];
// imageFields.forEach(field => {
// if (param[field] && param[field].length > 0) {
// addInfo[field] = JSON.stringify(param[field]);
// }
// });
// // 处理其他字段
// const otherFields = [
// "kxState", "kxTime", "kxNumber",
// "zjtxState", "zjtxTime",
// "xjrState", "xjrTime", "xjrPyTime",
// "gxjsState", "gaoXinJiShuTime",
// "listedState", "goPublicTime", "goPublicSector", "other"
// ];
// otherFields.forEach(field => {
// if (param[field] !== undefined) {
// addInfo[field] = param[field];
// }
// });
// // 特殊处理 goPublicSector
// if (param.goPublicSector && Array.isArray(param.goPublicSector)) {
// addInfo.goPublicSector = JSON.stringify(param.goPublicSector);
// }
// // 更新数据库
// if (Object.keys(addInfo).length > 0) {
// await operationalData(OPERATIONALDATATYPE.修改, TABLENAME.企业资质, addInfo, { eId });
// }
// return { isSuccess: true };
// }
...@@ -62,19 +62,22 @@ export const EnterpriseQualificationUpdateConfig = { ...@@ -62,19 +62,22 @@ export const EnterpriseQualificationUpdateConfig = {
zjtxState:{key:"Number", notMustHave:true},//专精特新认定状态 zjtxState:{key:"Number", notMustHave:true},//专精特新认定状态
zjtxImg:{key:"[String]", notMustHave:true},//新增专精特新图片 zjtxImg:{key:"[String]", notMustHave:true},//新增专精特新图片
zjtxTime:{key:"Number", notMustHave:true},//专精特新认定时间 zjtxTime:{key:"Number", notMustHave:true},//专精特新认定时间
xjrImg:{key:"[String]", notMustHave:true},//新增小巨人证书 // xjrImg:{key:"[String]", notMustHave:true},//新增小巨人证书
xjrState:{key:"Number", notMustHave:true},//小巨人认定状态 // xjrState:{key:"Number", notMustHave:true},//小巨人认定状态
xjrTime:{key:"Number", notMustHave:true},//小巨人认定时间 // xjrTime:{key:"Number", notMustHave:true},//小巨人认定时间
xjrPyTime:{key:"Number", notMustHave:true},//小巨人培育认定时间 xjrPyTime:{key:"Number", notMustHave:true},//小巨人培育认定时间
xjrPyState:{key:"Number", notMustHave:true},//小巨人培育认定状态 xjrPyState:{key:"Number", notMustHave:true},//小巨人培育认定状态
xjrPyImg:{key:"[String]", notMustHave:true},//新增小巨人培育证书 xjrPyImg:{key:"[String]", notMustHave:true},//新增小巨人培育证书
gaoXinJiShuTime:{key:"Number", notMustHave:true},// 新增高新技术认定时间 gaoXinJiShuTime:{key:"Number", notMustHave:true},// 新增高新技术认定时间
gaoXinJiShuImg:{key:"[String]", notMustHave:true},//新增高新技术图片 gaoXinJiShuImg:{key:"[String]", notMustHave:true},//新增高新技术图片
gxjsState:{key:"Number", notMustHave:true},//高新技术状态 gxjsState:{key:"Number", notMustHave:true},//高新技术状态
listedState:{key:"Number", notMustHave:true},//上市状态 cxState:{key:"Number", notMustHave:true},//创新认定状态
goPublicTime:{key:"Number", notMustHave:true},//上市时间 cxTime:{key:"Number", notMustHave:true},//创新认定时间
goPublicSector:{key:"[Number]", notMustHave:true},//上市板块 cxImg:{key:"[String]", notMustHave:true},//新增创新图片
other:{key:"Number", notMustHave:true},//新增其他 // listedState:{key:"Number", notMustHave:true},//上市状态
// goPublicTime:{key:"Number", notMustHave:true},//上市时间
// goPublicSector:{key:"[Number]", notMustHave:true},//上市板块
// other:{key:"Number", notMustHave:true},//新增其他
} }
...@@ -154,3 +157,18 @@ export const EnterpriseManageInfoAddConfig = { ...@@ -154,3 +157,18 @@ export const EnterpriseManageInfoAddConfig = {
TXP:{type:"Number"},//纳税 TXP:{type:"Number"},//纳税
RD:{type:"Number"},//研发投入 RD:{type:"Number"},//研发投入
} }
export const enterpriseLeaseUpdateConfig = {
area:{key:"String"},//租赁面积
building:{key:"Number"},//楼号
roomNumber:{key:"String"},//室号
rent:{key:"String"},//每月租金
leaseStartTime:{key:"Number"},//租赁开始时间
leaseEndTime:{key:"Number"},//租赁结束时间
startTime:{key:"Number"},//孵化开始时间
endTime:{key:"Number"},//孵化结束时间
}
...@@ -41,6 +41,13 @@ export enum TABLENAME { ...@@ -41,6 +41,13 @@ export enum TABLENAME {
作品著作权 = "copy_right", 作品著作权 = "copy_right",
软件著作权 = "software_copyright", 软件著作权 = "software_copyright",
专利 = "patent", 专利 = "patent",
高新企业创新能力评价答题="gaoxin_answer",
高新企业创新能力评价选项="gaoxin_option",
答题记录="gaoxin_answerrecord",
答题记录明细="gaoxin_answerdetail",
租房补贴企业自评="zufang_answer",
租房补贴答题记录="zufang_answerrecord",
租房补贴答题记录明细="zufang_answerdetail",
} }
...@@ -68,4 +75,11 @@ export enum TABLEID { ...@@ -68,4 +75,11 @@ export enum TABLEID {
软件著作权 = "sc", 软件著作权 = "sc",
专利 = "ipr", 专利 = "ipr",
图片存储='img', 图片存储='img',
高新企业创新能力评价答题="ga",
高新企业创新能力评价选项="go",
答题记录="gar",
答题记录明细="gad",
租房补贴企业自评="zaId",
租房补贴答题记录="zarId",
租房补贴答题记录明细="zadId",
} }
\ No newline at end of file
...@@ -2,15 +2,22 @@ ...@@ -2,15 +2,22 @@
* 行业领域 * 行业领域
*/ */
export enum INDUSTRY{ export enum INDUSTRY{
集成电路 = 1, "信息传输、软件和信息技术服务业" = 1,
生物医药, 科学研究和技术服务业,
人工智能及智能制造, 制造业,
航空航天, 建筑业,
汽车产业, 租赁和商务服务业,
软件和信息服务业, 批发和零售业
低碳环保及新材料,
综合, // 集成电路 = 1,
文化创意 // 生物医药,
// 人工智能及智能制造,
// 航空航天,
// 汽车产业,
// 软件和信息服务业,
// 低碳环保及新材料,
// 综合,
// 文化创意
} }
...@@ -71,6 +78,7 @@ export enum FUHUASTATE { ...@@ -71,6 +78,7 @@ export enum FUHUASTATE {
*/ */
export enum EMIGRATIONTYPE { export enum EMIGRATIONTYPE {
毕业迁出 = 1, 毕业迁出 = 1,
毕业未迁出, //新加状态
到期退租, 到期退租,
违约退租 违约退租
} }
...@@ -221,6 +229,17 @@ export enum IPRALLTYPE { ...@@ -221,6 +229,17 @@ export enum IPRALLTYPE {
} }
/**
* 租房补贴题目
*/
export enum ANSWERTYPE {
是否有研发费用 = 1,
是否有缴纳社保,
是否有软著等知识产权,
是否认定科小或创新型中小企业
}
export enum IPRTYPE { export enum IPRTYPE {
软件著作权 = 1, 软件著作权 = 1,
专利 = 100, 专利 = 100,
......
...@@ -30,6 +30,11 @@ export enum ERRORENUM { ...@@ -30,6 +30,11 @@ export enum ERRORENUM {
验证码过期, 验证码过期,
验证码发送失败, 验证码发送失败,
验证码不存在, 验证码不存在,
答题记录不存在,
账号密码错误,
密码不一致,
密码只能由618位字符和数字组成,
原密码错误,
} }
export enum ERRORCODEENUM { export enum ERRORCODEENUM {
......
...@@ -11,12 +11,15 @@ export function setRouter(httpServer) { ...@@ -11,12 +11,15 @@ export function setRouter(httpServer) {
httpServer.post('/xcx/enterprise/login', asyncHandler(login)); httpServer.post('/xcx/enterprise/login', asyncHandler(login));
httpServer.post('/xcx/enterprise/email/login', asyncHandler(emailLogin));// 邮箱验证码登录 httpServer.post('/xcx/enterprise/email/login', asyncHandler(emailLogin));// 邮箱验证码登录
httpServer.post('/xcx/enterprise/request/verification/code', asyncHandler(requestVerificationCode));// 发送验证码 httpServer.post('/xcx/enterprise/request/verification/code', asyncHandler(requestVerificationCode));// 发送验证码
httpServer.post('/xcx/enterprise/changepwd', checkUser, asyncHandler(changePassword));
/**登出 */ /**登出 */
httpServer.post('/xcx/enterprise/logout', checkUser, asyncHandler(logout)); httpServer.post('/xcx/enterprise/logout', checkUser, asyncHandler(logout));
/**首页 */ /**首页 */
httpServer.post('/xcx/enterprise/home/enterpriselist', checkUser, asyncHandler(enterpriseByPhoneList)); httpServer.post('/xcx/enterprise/home/enterpriselist', checkUser, asyncHandler(enterpriseByPhoneList));
httpServer.post('/xcx/enterprise/home/top', checkUser, asyncHandler(homePageTop)); httpServer.post('/xcx/enterprise/home/top', checkUser, asyncHandler(homePageTop));
httpServer.post('/xcx/enterprise/home/baseinfo', checkUser, asyncHandler(homePageBaseInfo));
httpServer.post('/xcx/enterprise/home/task', checkUser, asyncHandler(homePageTask)); httpServer.post('/xcx/enterprise/home/task', checkUser, asyncHandler(homePageTask));
httpServer.post('/xcx/enterprise/home/tasksubmit', checkUser, asyncHandler(homePageTaskSubmit)); httpServer.post('/xcx/enterprise/home/tasksubmit', checkUser, asyncHandler(homePageTaskSubmit));
...@@ -31,6 +34,7 @@ export function setRouter(httpServer) { ...@@ -31,6 +34,7 @@ export function setRouter(httpServer) {
httpServer.post('/xcx/enterprise/faren/update', checkUser, asyncHandler(updateFaRenInfo)); httpServer.post('/xcx/enterprise/faren/update', checkUser, asyncHandler(updateFaRenInfo));
/**入驻信息 */ /**入驻信息 */
httpServer.post('/xcx/enterprise/ruzhu/info', checkUser, asyncHandler(ruZhuInfo)); httpServer.post('/xcx/enterprise/ruzhu/info', checkUser, asyncHandler(ruZhuInfo));
httpServer.post('/xcx/enterprise/ruzhu/update', checkUser, asyncHandler(ruZhuUpdate));
//=============政策速递 //=============政策速递
httpServer.post('/xcx/policy/list', checkUser, asyncHandler(policyList)); httpServer.post('/xcx/policy/list', checkUser, asyncHandler(policyList));
...@@ -174,6 +178,22 @@ async function login(req, res) { ...@@ -174,6 +178,22 @@ async function login(req, res) {
res.success(result); res.success(result);
} }
/**
*
* @param req
* @param res
*/
async function changePassword(req, res) {
const UserInfo = req.userInfo;
let {pwd, newPwd, confirmPwd } = req.body
let result = await enterpriseInfoBiz.changePassword(UserInfo.uId, pwd, newPwd, confirmPwd );
res.success(result);
}
/** /**
* 邮箱验证码登录 * 邮箱验证码登录
* @param req * @param req
...@@ -225,6 +245,15 @@ async function ruZhuInfo(req, res) { ...@@ -225,6 +245,15 @@ async function ruZhuInfo(req, res) {
} }
async function ruZhuUpdate(req, res) {
const UserInfo = req.userInfo;
let {param } = req.body;
let result = await enterpriseInfoBiz.enterpriseLeaseUpdate(UserInfo.eId, param);
res.success(result);
}
//===============================法人信息 //===============================法人信息
/** /**
* *
...@@ -317,6 +346,19 @@ async function enterpriseByPhoneList(req, res) { ...@@ -317,6 +346,19 @@ async function enterpriseByPhoneList(req, res) {
* @param req * @param req
* @param res * @param res
*/ */
async function homePageBaseInfo(req, res) {
const UserInfo = req.userInfo;
let result = await enterpriseInfoBiz.homePageBaseInfo(UserInfo.eId);
res.success(result);
}
/**
* 首页
* @param req
* @param res
*/
async function homePageTop(req, res) { async function homePageTop(req, res) {
const UserInfo = req.userInfo; const UserInfo = req.userInfo;
let result = await enterpriseInfoBiz.homePage(UserInfo.eId); let result = await enterpriseInfoBiz.homePage(UserInfo.eId);
...@@ -324,6 +366,7 @@ async function homePageTop(req, res) { ...@@ -324,6 +366,7 @@ async function homePageTop(req, res) {
res.success(result); res.success(result);
} }
/** /**
* 首页-任务 * 首页-任务
* @param req * @param req
......
/**
* 高新企业创新能力评价答题
*/
import * as asyncHandler from 'express-async-handler';
import * as gaoxinBiz from '../biz/answer';
import { checkUser } from '../middleware/user';
export function setRouter(httpServer) {
httpServer.post('/xcx/gaoxin/answer/list', checkUser, asyncHandler(gaoxinAnswerList));
httpServer.post('/xcx/gaoxin/answer/option', checkUser, asyncHandler(gaoxinAnswerOption));
httpServer.post('/xcx/gaoxin/answer/addanswerrecord', checkUser, asyncHandler(addAnswerrecord));
httpServer.post('/xcx/gaoxin/answer/enterpriseresults', checkUser, asyncHandler(enterpriseResults));
httpServer.post('/xcx/gaoxin/answer/zufangoption', checkUser, asyncHandler(zuFangAnswerOption));
httpServer.post('/xcx/gaoxin/answer/addzufanganswerrecord', checkUser, asyncHandler(addZuFangAnswerrecord));
httpServer.post('/xcx/gaoxin/answer/enterprisezufangresults', checkUser, asyncHandler(enterpriseZuFangResults));
// httpServer.post('/xcx/gaoxin/answer/changeanswerstatu', checkUser, asyncHandler(changeAnswerStatu));
// httpServer.post('/xcx/gaoxin/answer/calculategrowthscore', checkUser, asyncHandler(calculateGrowthScore));
}
/**
* 是否有资格开始测评
* @param req
* @param res
*/
async function gaoxinAnswerList(req, res) {
const UserInfo = req.userInfo;
let result = await gaoxinBiz.gaoxinAnswerList(UserInfo.eId);
res.success(result);
}
/**
* 题目
* @param req
* @param res
*/
async function gaoxinAnswerOption(req, res) {
const UserInfo = req.userInfo;
let result = await gaoxinBiz.gaoxinAnswerOption();
res.success(result);
}
/**
* 获取高新技术企业自评结果
* @param req
* @param res
*/
async function enterpriseResults(req, res) {
const UserInfo = req.userInfo;
let {garId} = req.body;
let result = await gaoxinBiz.enterpriseResults(garId);
res.success(result);
}
/**
* 存储答题明细
* @param req
* @param res
*/
async function addAnswerrecord(req, res) {
const UserInfo = req.userInfo;
let {gaId, options, assetGrowth, revenueGrowth} = req.body;
let result = await gaoxinBiz.addAnswerrecord(UserInfo.eId, gaId, options, assetGrowth, revenueGrowth);
res.success(result);
}
/**
* 租房题目
* @param req
* @param res
*/
async function zuFangAnswerOption(req, res) {
const UserInfo = req.userInfo;
let result = await gaoxinBiz.zuFangAnswerOption();
res.success(result);
}
/**
* 租房存储答题明细
* @param req
* @param res
*/
async function addZuFangAnswerrecord(req, res) {
const UserInfo = req.userInfo;
let {zaId, options} = req.body;
let result = await gaoxinBiz.addZuFangAnswerrecord(UserInfo.eId, zaId, options);
res.success(result);
}
/**
* 获取高新技术企业自评结果
* @param req
* @param res
*/
async function enterpriseZuFangResults(req, res) {
const UserInfo = req.userInfo;
let {zarId} = req.body;
let result = await gaoxinBiz.enterpriseZuFangResults(zarId);
res.success(result);
}
/**
* 完成全部答题
* @param req
* @param res
*/
// async function changeAnswerStatu(req, res) {
// const UserInfo = req.userInfo;
// let {garId} = req.body;
// let result = await gaoxinBiz.changeAnswerStatu(garId);
// res.success(result);
// }
/**
* 企业成长性评分
* @param req
* @param res
*/
// async function calculateGrowthScore(req, res) {
// const UserInfo = req.userInfo;
// let {assetGrowth, revenueGrowth} = req.body;
// let result = await gaoxinBiz.calculateGrowthScore(assetGrowth, revenueGrowth);
// res.success(result);
// }
...@@ -7,7 +7,9 @@ import * as enterpriseInfoRouters from './enterpriseInfo'; ...@@ -7,7 +7,9 @@ import * as enterpriseInfoRouters from './enterpriseInfo';
import * as teamsRouters from './teams'; import * as teamsRouters from './teams';
import * as qualificationRouters from './qualification'; import * as qualificationRouters from './qualification';
import * as financeRouters from './finance'; import * as financeRouters from './finance';
import * as gaoxinRouters from './gaoxin';
import * as filesInfoRouters from './files'; import * as filesInfoRouters from './files';
export function setRouter(httpServer){ export function setRouter(httpServer){
/**下拉框等公用 路由 */ /**下拉框等公用 路由 */
publicRouters.setRouter(httpServer); publicRouters.setRouter(httpServer);
...@@ -17,6 +19,7 @@ export function setRouter(httpServer){ ...@@ -17,6 +19,7 @@ export function setRouter(httpServer){
teamsRouters.setRouter(httpServer); teamsRouters.setRouter(httpServer);
qualificationRouters.setRouter(httpServer); qualificationRouters.setRouter(httpServer);
financeRouters.setRouter(httpServer); financeRouters.setRouter(httpServer);
gaoxinRouters.setRouter(httpServer);
filesInfoRouters.setRouter(httpServer); filesInfoRouters.setRouter(httpServer);
} }
\ No newline at end of file
...@@ -96,5 +96,21 @@ export function getDeclarationTime() { ...@@ -96,5 +96,21 @@ export function getDeclarationTime() {
return {declarationYear:getMySqlMs(`${thisYear}-01-01 00:00:00`), declarationQuarter:thisQuarter}; return {declarationYear:getMySqlMs(`${thisYear}-01-01 00:00:00`), declarationQuarter:thisQuarter};
} }
/**
* 去除地址包含相同上海市上海市问题
* @param address
*/
export function getAddresList(address) {
let logonAddress = [];
if (address) {
let logonAddressList = JSON.parse(address || '[]')
for (let i = 0; i < logonAddressList.length; i++) {
if (logonAddressList[i] != logonAddressList[i+1]) logonAddress.push(logonAddressList[i]);
}
}
return logonAddress;
}
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