Commit 8b3ac431 by lixinming
parents 82da08e7 3aa4e59b
import { ERRORENUM } from "../../config/errorEnum";
import { BizError } from "../../util/bizError";
import * as monthData from "../../data/fuHuaQi/monthTable";
/**
* 孵化月度填报 新增报表
* @param occupancyRate 本月出租率
*/
export async function createReport(uscc:string, occupancyRate:number) {
if (typeof uscc != "string" || isNaN(occupancyRate)) throw new BizError(ERRORENUM.参数错误, uscc, occupancyRate);
let name = "1月孵化器月度填报";
let monthInfo = await monthData.addOnceReport(name, uscc, occupancyRate);
return monthInfo;
}
...@@ -12,7 +12,7 @@ const md5 = require("md5"); ...@@ -12,7 +12,7 @@ const md5 = require("md5");
/** /**
* 登录 * 登录
* @param uscc 登录账号 * @param uscc 信用代码
* @param pwd 密码 * @param pwd 密码
* @returns * @returns
*/ */
...@@ -31,7 +31,13 @@ export async function login(uscc:string, pwd:string):Promise<object> { ...@@ -31,7 +31,13 @@ export async function login(uscc:string, pwd:string):Promise<object> {
return fuhuaqiUserInfo; return fuhuaqiUserInfo;
} }
//重置密码 /**
* 重置密码
* @param uscc 信用代码
* @param pwd 原密码
* @param newPwd 修改后的密码
* @returns
*/
export async function changePassword(uscc:string, pwd:string, newPwd:string) { export async function changePassword(uscc:string, pwd:string, newPwd:string) {
if (typeof uscc != "string" || typeof pwd != "string" || typeof newPwd != "string") throw new BizError(ERRORENUM.参数错误, uscc, pwd, newPwd); if (typeof uscc != "string" || typeof pwd != "string" || typeof newPwd != "string") throw new BizError(ERRORENUM.参数错误, uscc, pwd, newPwd);
let reg = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"); let reg = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]");
...@@ -51,7 +57,7 @@ export async function changePassword(uscc:string, pwd:string, newPwd:string) { ...@@ -51,7 +57,7 @@ export async function changePassword(uscc:string, pwd:string, newPwd:string) {
/** /**
* 退出登录 * 退出登录
* @param uscc 登录账号 * @param uscc 信用代码
* @returns * @returns
*/ */
export async function logout(uscc:string):Promise<object> { export async function logout(uscc:string):Promise<object> {
......
...@@ -8,7 +8,6 @@ const financingSchema = new Schema({ ...@@ -8,7 +8,6 @@ const financingSchema = new Schema({
taskId:{type:String, index:true},//任务id taskId:{type:String, index:true},//任务id
logonAdd:String,//注册地址 logonAdd:String,//注册地址
operatingAdd:String,//经营地址 operatingAdd:String,//经营地址
financingTime:Number,//获得融资时间
financingAmount:Number,//融资金额(万元) financingAmount:Number,//融资金额(万元)
investmentInstitutionsName:String,//投资机构名称 investmentInstitutionsName:String,//投资机构名称
timeToObtainInvestment:Number,//获得投资时间 timeToObtainInvestment:Number,//获得投资时间
......
...@@ -5,7 +5,7 @@ const monthTableSchema = new Schema({ ...@@ -5,7 +5,7 @@ const monthTableSchema = new Schema({
taskId:String,//任务id taskId:String,//任务id
name:String,//任务名称 name:String,//任务名称
fuHuaQiUscc:String,//任务所属孵化器id fuHuaQiUscc:String,//任务所属孵化器id
occupancyRate:Number,//出租率 occupancyRate:Number,//出租率(%)
createTime:Number,//创建时间 createTime:Number,//创建时间
draftLock:{type:Boolean, default:false},//草稿锁,true为提交之后,false为草稿 draftLock:{type:Boolean, default:false},//草稿锁,true为提交之后,false为草稿
}); });
...@@ -50,3 +50,15 @@ export async function findmonthTableByTaskId(taskId:string) { ...@@ -50,3 +50,15 @@ export async function findmonthTableByTaskId(taskId:string) {
return monthTableInfo; return monthTableInfo;
} }
/**
* 孵化器月度填报 新增报表
* @param name 任务名称
* @param fuHuaQiUscc 孵化器信用代码
* @param occupancyRate 出租率
* @param createTime 创建时间
* @returns
*/
export async function addOnceReport(name:string, uscc:string, occupancyRate:number) {
let monthInfo = {name, fuHuaQiUscc:uscc, occupancyRate, createTime:new Date().valueOf()}
return await monthTableModel.create(monthInfo);
}
import * as asyncHandler from 'express-async-handler'; import * as asyncHandler from 'express-async-handler';
import * as fuhuaqiBiz from '../biz/fuHuqQi/user'; import * as fuhuaqiBiz from '../biz/fuHuqQi/user';
import * as monthBiz from '../biz/fuHuqQi/month';
export function setRouter(httpServer) { export function setRouter(httpServer) {
httpServer.post('/fuhuaqi/login', asyncHandler(login)); httpServer.post('/fuhuaqi/login', asyncHandler(login));
...@@ -8,6 +9,7 @@ export function setRouter(httpServer) { ...@@ -8,6 +9,7 @@ export function setRouter(httpServer) {
httpServer.post('/fuhuaqi/task/addtask', asyncHandler(addTask)); httpServer.post('/fuhuaqi/task/addtask', asyncHandler(addTask));
httpServer.post('/fuhuaqi/mydata', asyncHandler(myDataInfo)); httpServer.post('/fuhuaqi/mydata', asyncHandler(myDataInfo));
httpServer.post('/fuhuaqi/mydata/update', asyncHandler(updateMyDataInfo)); httpServer.post('/fuhuaqi/mydata/update', asyncHandler(updateMyDataInfo));
httpServer.post('/fuhuaqi/month/addreport', asyncHandler(addReport));
} }
/** /**
...@@ -74,3 +76,13 @@ async function updateMyDataInfo(req, res) { ...@@ -74,3 +76,13 @@ async function updateMyDataInfo(req, res) {
res.success({}); res.success({});
} }
/**
* 孵化月度填报 新增报表
* @param req
* @param res
*/
async function addReport(req, res) {
let {fuHuaQiUscc, occupancyRate} = req.body;
let monthInfo = monthBiz.createReport(fuHuaQiUscc, occupancyRate)
res.success(monthInfo);
}
\ No newline at end of file
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