Commit efe8e414 by 孙香冬

no message

parent 87c4b0da
......@@ -7,7 +7,7 @@
import { FinancingParamConfig } from "../../config/checkParamConfig";
import { ERRORENUM } from "../../config/errorEnum";
import { EnterpriseFinancingInfoConfig, EnterpriseInfoConfig } from "../../config/ojbectResultKeyConfig";
import { EnterpriseFinancingInfoConfig } from "../../config/ojbectResultKeyConfig";
import { createFinancing, deleteEnterpriseFinancing, findAddByName, findEnterpriseFinancingByUscc, findFinancingByName, findFinancingCount, findFinancingInfoByTaskIdAndSucc, findFinancingList, groupFindFinancing } from "../../data/enterprise/financing";
import { FinancingListConfig } from "../../config/ojbectResultKeyConfig";
import { BizError } from "../../util/bizError";
......@@ -120,15 +120,17 @@ export async function getAddByName(name:string) {
/**
* 融资企业信息列表
* @param month 数据月份 目前数据库没有该字段
* @param fuHuaQiUscc 孵化器统一信用代码 实际参数是所属孵化器
* @param industry 行业领域 根据孵化器信用代码查找 fuhuaqi表的领域
* @param belongToIncubator 所属孵化器
* @param industry 行业领域
* @param fuHuaQiInvestment 孵化器是否参与投资
* @param page 页数
* @returns
*/
export async function financingList(fuHuaQiUscc:string, fuHuaQiInvestment:boolean, page:number) {
export async function financingList(month:string, belongToIncubator:string, industry:string, fuHuaQiInvestment:boolean, page:number) {
let selectParam:any = {};
if (fuHuaQiUscc) selectParam.fuHuaQiUscc = fuHuaQiUscc;
if (month) selectParam.month = month;
if (belongToIncubator) selectParam.belongToIncubator = belongToIncubator;
if (industry) selectParam.industry = industry;
if (fuHuaQiInvestment) selectParam.fuHuaQiInvestment = fuHuaQiInvestment;
let enterpriseMap = await groupFindFinancing();
......
......@@ -7,13 +7,14 @@
import { TASKTYPEENUM } from "../../config/enum";
import { ERRORENUM } from "../../config/errorEnum";
import { TaskListConfig } from "../../config/ojbectResultKeyConfig";
import { findEnterpriseListByTaskId, updateEnterpriseDraftLock } from "../../data/enterprise/enterprise";
import { findFinancingListByTaskId, updateFinancingDraftLock } from "../../data/enterprise/financing";
import { findAllFuHuaQi } from "../../data/fuHuaQi/fuhuaqi";
import { findmonthTableByTaskId, findmonthTableListByTaskId } from "../../data/fuHuaQi/monthTable";
import { createTaskData, findFuHuaQiTaskByKeyAndUscc } from "../../data/fuHuaQi/task";
import { BizError } from "../../util/bizError";
import { getTaskId, getTimeKey } from "../../util/tools";
import { extractData, getTaskId, getTimeKey } from "../../util/tools";
/**
......@@ -108,3 +109,18 @@ export async function provideTask() {
});
}
/**
* 根据uscc查询任务信息
* @param uscc 企业统一信用代码
*/
export async function getTaskByUscc(uscc:string) {
const TaskId = getTaskId(uscc);
let dataBaseInfo = await findmonthTableByTaskId(TaskId);
if (!dataBaseInfo) throw new BizError(ERRORENUM.未找到数据, `库中不存在${uscc}这个企业`);
let data = extractData(TaskListConfig, dataBaseInfo);
return {data};
}
\ No newline at end of file
......@@ -78,6 +78,9 @@ export const EnterpriseFinancingInfoConfig = {
leasedArea:{key:"租赁面积(平方米)"},
};
/**
* 企业融资信息 参数转换配置
*/
export const FinancingListConfig = {
name:{key:"企业名称"},
logonAdd:{key:"注册地址"},
......@@ -91,6 +94,9 @@ export const FinancingListConfig = {
createTime:{key:"录入时间 不可修改"},
}
/**
* 孵化器账号 参数转换配置
*/
export const FuHuaQiListConfig = {
operationName:{key:"运营机构名称 不可修改"},
uscc:{key:"营业执照"},
......@@ -98,3 +104,15 @@ export const FuHuaQiListConfig = {
liaisonPhone:{key:"负责人"},
personInChargePhone:{key:"负责人联系电话"},
}
/**
* 孵化器任务信息 参数转换配置
*/
export const TaskListConfig = {
name:{key:"任务名称"},
fuHuaQiUscc:{key:"任务所属孵化器id"},
occupancyRate:{key:"出租率"},
liaisonPhone:{key:"负责人"},
createTime:{key:"创建时间"},
}
......@@ -25,7 +25,7 @@ const financingSchema = new Schema({
year:String,//数据年份
month:String,//数据月份
industry:[Number],//领域
belongToIncubator:String, //所属孵化器
});
var financingModel;
......
......@@ -51,3 +51,14 @@ export async function createTaskData(uscc:string, key:string, taskId:string, typ
await fuHuaQiTaskModel.create(addInfo);
}
/**
* 通过任务id获取任务信息
* 支持.save方法保存对象修改
* @param taskId 任务id
* @returns {}
*/
export async function findEnterpriseByUscc(taskId:string) {
return await fuHuaQiTaskModel.selectOnceData({taskId});
}
......@@ -76,11 +76,11 @@ async function fuHuaQiBaseList(req, res) {
* @param res
*/
async function getFinancingList(req, res) {
let reqConf = {fuHuaQiUscc: 'string', fuHuaQiInvestment: 'boolean', page: 'number' };
let { fuHuaQiUscc, fuHuaQiInvestment, page } = checkReqParam(reqConf, req.body);
let reqConf = {month: 'string', belongToIncubator: 'string', industry: 'string', fuHuaQiInvestment: 'boolean', page: 'number' };
let { month, belongToIncubator, industry, fuHuaQiInvestment, page } = checkReqParam(reqConf, req.body);
const Uscc = req.headers.uscc;
let result = await financingBiz.financingList(fuHuaQiUscc, fuHuaQiInvestment, page);
let result = await financingBiz.financingList(month, belongToIncubator, industry, fuHuaQiInvestment, page);
res.success(result);
}
......
......@@ -22,6 +22,7 @@ export function setRouter(httpServer) {
/**任务 */
httpServer.post('/fuhuaqi/task/list', checkFuHuaQiToken, asyncHandler(taskList));
httpServer.post('/fuhuaqi/task/submit', checkFuHuaQiToken, asyncHandler(submitTask));
httpServer.post('/fuhuaqi/task/select', checkFuHuaQiToken, asyncHandler(selectTaskInfo));
/**月度报表 */
httpServer.post('/fuhuaqi/month/addreport', checkFuHuaQiToken, asyncHandler(addReport));
httpServer.post('/fuhuaqi/month/updatereport', checkFuHuaQiToken, asyncHandler(updateReport));
......@@ -318,6 +319,20 @@ async function submitTask(req, res) {
/**
* 查询迁入企业登记信息或新建企业登录信息
* @param req
* @param res
*/
async function selectTaskInfo(req, res) {
let reqConf = {uscc: 'String' };
let { uscc } = checkReqParam(reqConf, req.body);
let result = await taskBiz.getTaskByUscc(uscc);
res.success(result);
}
/**
* 更新基础数据
* @param req
* @param res
......
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