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
3aaa27f9
Commit
3aaa27f9
authored
May 24, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.1 经营数据展示接口
parent
31ce8f8b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
6 deletions
+39
-6
fuHuaQiBusiness.ts
src/biz/mobileFuHuaQi/fuHuaQi/fuHuaQiBusiness.ts
+15
-1
eccFormParamConfig.ts
src/config/eccFormParamConfig.ts
+2
-2
businessData.ts
src/data/fuHuaQi/quarterTask/businessData.ts
+1
-2
business.ts
src/routers/mobileClient/business.ts
+17
-0
system.ts
src/tools/system.ts
+4
-1
No files found.
src/biz/mobileFuHuaQi/fuHuaQi/fuHuaQiBusiness.ts
View file @
3aaa27f9
...
...
@@ -2,6 +2,7 @@
* 孵化器经营数据填报
*
*/
import
moment
=
require
(
"moment"
);
import
{
FuHuaQiBusinessDataConfig
}
from
"../../../config/eccFormParamConfig"
;
import
{
ERRORENUM
}
from
"../../../config/errorEnum"
;
import
{
FuHuaQiBusinessDataInfoConfig
}
from
"../../../config/splitResultConfig"
;
...
...
@@ -70,7 +71,7 @@ export async function selectBusiness(uscc:string) {
if
(
!
businessInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
请先填报数据
,
`孵化器
${
uscc
}
调用回显接口时经营数据不存在`
);
if
(
businessInfo
.
draftLock
)
throw
new
BizError
(
ERRORENUM
.
已提交的数据不能进行操作
,
`孵化器
${
uscc
}
尝试 回显 已经提交的经营数据`
);
let
businessData
=
extractData
(
FuHuaQiBusinessDataInfoConfig
,
businessInfo
,
false
)
let
businessData
=
extractData
(
FuHuaQiBusinessDataInfoConfig
,
businessInfo
,
false
)
;
return
{
businessData
};
}
...
...
@@ -95,4 +96,16 @@ export async function updateBusiness(uscc:string, param) {
await
businessInfo
.
save
();
return
{
isSuccess
:
true
};
}
export
async
function
showBusinessData
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
let
taskId
=
sysTools
.
getQuarterTaskIdByYearAndQuarter
(
uscc
,
year
,
quarter
);
let
businessInfo
=
await
findBusinessByTaskId
(
taskId
);
let
businessData
=
extractData
(
FuHuaQiBusinessDataInfoConfig
,
businessInfo
,
false
);
return
{
businessData
};
}
\ No newline at end of file
src/config/eccFormParamConfig.ts
View file @
3aaa27f9
...
...
@@ -20,10 +20,10 @@ export const BaseParamUpdateConfig = {
hatchingGround
:{
type
:
"[Object]"
,
notMustHave
:
true
},
//经备案孵化场地
// isProfessionalTechnology:{type:"Boolean", notMustHave:true},//是否专业技术平台
// professionalTechnologyName:{type:"String", notMustHave:true},//专业技术平台名称
cooperationInstitutions
:{
type
:
"String"
,
notMustHave
:
true
},
//合作机构名称
isCooperation
:{
type
:
"Boolean"
,
notMustHave
:
true
},
//是否与第三方机构合作
// professionalTechnologyCreateTime:{type:"Number", notMustHave:true},//时间 年份 xxxx年01月01日 的时间戳
// professionalTechnologyAmount:{type:"Number", notMustHave:true},//投资金额 万元
cooperationInstitutions
:{
type
:
"String"
,
notMustHave
:
true
},
//合作机构名称
isCooperation
:{
type
:
"Boolean"
,
notMustHave
:
true
},
//是否与第三方机构合作
};
/**
* 使用端: 小程序端【孵化器入口】
...
...
src/data/fuHuaQi/quarterTask/businessData.ts
View file @
3aaa27f9
...
...
@@ -62,4 +62,4 @@ export async function findBusinessByTaskId(taskId:string) {
export
async
function
findBusinessListByTaskIdAndUpdate
(
taskId
:
string
,
isUpdate
:
boolean
)
{
return
await
fuHuaQiBusinessModel
.
find
({
taskId
,
isUpdate
});
}
\ No newline at end of file
}
src/routers/mobileClient/business.ts
View file @
3aaa27f9
...
...
@@ -8,6 +8,9 @@ import { eccReqParamater } from '../../util/verificationParam';
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
export
function
setRouter
(
httpServer
)
{
/**我的数据展示 */
httpServer
.
post
(
'/fuhuaqi/business/show'
,
checkFuHuaQiToken
,
asyncHandler
(
showBusiness
));
/**表单 */
httpServer
.
post
(
'/fuhuaqi/business/addreport'
,
checkFuHuaQiToken
,
asyncHandler
(
addreportBusiness
));
httpServer
.
post
(
'/fuhuaqi/business/updatereport'
,
checkFuHuaQiToken
,
asyncHandler
(
updatereportBusiness
));
httpServer
.
post
(
'/fuhuaqi/business/deletereport'
,
checkFuHuaQiToken
,
asyncHandler
(
deletereportBusiness
));
...
...
@@ -15,6 +18,20 @@ export function setRouter(httpServer) {
}
/**
* 展示孵化器经营数据
* @param req
* @param res
*/
async
function
showBusiness
(
req
,
res
)
{
let
reqConf
=
{
year
:
'Number'
,
quarter
:
'Number'
};
let
{
year
,
quarter
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
monthInfo
=
fuHuaQiBusinessBiz
.
showBusinessData
(
Uscc
,
year
,
quarter
);
res
.
success
(
monthInfo
);
}
/**
* 添加孵化器经营数据
...
...
src/tools/system.ts
View file @
3aaa27f9
...
...
@@ -38,9 +38,12 @@ export function getQuarterTimeKey() {
}
export
function
getQuarterTaskIdByTime
(
uscc
:
string
,
timeMs
:
number
)
{
return
`
${
uscc
}${
new
Date
(
timeMs
).
getFullYear
()}${
moment
(
timeMs
).
quarter
()
}
`
;
return
`
${
uscc
}${
new
Date
(
timeMs
).
getFullYear
()}
0
${
moment
(
timeMs
).
quarter
()
}
`
;
}
export
function
getQuarterTaskIdByYearAndQuarter
(
uscc
:
string
,
year
:
number
,
quarter
:
number
)
{
return
`
${
uscc
}${
year
}
0
${
quarter
}
`
;
}
/**
* 根据时间生成任务id
...
...
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