Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zjxcxServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
zjxcxServer
Commits
3aa4e59b
Commit
3aa4e59b
authored
Feb 07, 2023
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
2a920fb0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
5 deletions
+50
-5
month.ts
src/biz/fuHuqQi/month.ts
+15
-0
user.ts
src/biz/fuHuqQi/user.ts
+9
-3
financing.ts
src/data/enterprise/financing.ts
+0
-1
monthTable.ts
src/data/fuHuaQi/monthTable.ts
+13
-1
fuhuaqi.ts
src/routers/fuhuaqi.ts
+13
-0
No files found.
src/biz/fuHuqQi/month.ts
0 → 100644
View file @
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
;
}
src/biz/fuHuqQi/user.ts
View file @
3aa4e59b
...
...
@@ -12,7 +12,7 @@ const md5 = require("md5");
/**
* 登录
* @param uscc
登录账号
* @param uscc
信用代码
* @param pwd 密码
* @returns
*/
...
...
@@ -31,7 +31,13 @@ export async function login(uscc:string, pwd:string):Promise<object> {
return
fuhuaqiUserInfo
;
}
//重置密码
/**
* 重置密码
* @param uscc 信用代码
* @param pwd 原密码
* @param newPwd 修改后的密码
* @returns
*/
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
);
let
reg
=
new
RegExp
(
"[`~!@#$^&*()=|{}':;',
\\
[
\\
].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"
);
...
...
@@ -51,7 +57,7 @@ export async function changePassword(uscc:string, pwd:string, newPwd:string) {
/**
* 退出登录
* @param uscc
登录账号
* @param uscc
信用代码
* @returns
*/
export
async
function
logout
(
uscc
:
string
):
Promise
<
object
>
{
...
...
src/data/enterprise/financing.ts
View file @
3aa4e59b
...
...
@@ -8,7 +8,6 @@ const financingSchema = new Schema({
// createTime:Number,//入库时间
logonAdd
:
String
,
//注册地址
operatingAdd
:
String
,
//经营地址
financingTime
:
Number
,
//获得融资时间
financingAmount
:
Number
,
//融资金额(万元)
investmentInstitutionsName
:
String
,
//投资机构名称
timeToObtainInvestment
:
Number
,
//获得投资时间
...
...
src/data/fuHuaQi/monthTable.ts
View file @
3aa4e59b
...
...
@@ -5,7 +5,7 @@ const monthTableSchema = new Schema({
taskId
:
String
,
//任务id
name
:
String
,
//任务名称
fuHuaQiUscc
:
String
,
//任务所属孵化器id
occupancyRate
:
Number
,
//出租率
occupancyRate
:
Number
,
//出租率
(%)
createTime
:
Number
,
//创建时间
draftLock
:{
type
:
Boolean
,
default
:
false
},
//草稿锁,true为提交之后,false为草稿
});
...
...
@@ -50,3 +50,15 @@ export async function findmonthTableByTaskId(taskId:string) {
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
);
}
src/routers/fuhuaqi.ts
View file @
3aa4e59b
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
fuhuaqiBiz
from
'../biz/fuHuqQi/user'
;
import
*
as
monthBiz
from
'../biz/fuHuqQi/month'
;
export
function
setRouter
(
httpServer
)
{
httpServer
.
post
(
'/fuhuaqi/login'
,
asyncHandler
(
login
));
...
...
@@ -8,6 +9,7 @@ export function setRouter(httpServer) {
httpServer
.
post
(
'/fuhuaqi/task/addtask'
,
asyncHandler
(
addTask
));
httpServer
.
post
(
'/fuhuaqi/mydata'
,
asyncHandler
(
myDataInfo
));
httpServer
.
post
(
'/fuhuaqi/mydata/update'
,
asyncHandler
(
updateMyDataInfo
));
httpServer
.
post
(
'/fuhuaqi/month/addreport'
,
asyncHandler
(
addReport
));
}
/**
...
...
@@ -74,3 +76,13 @@ async function updateMyDataInfo(req, res) {
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment