Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yuyixcx
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
yuyixcx
Commits
b133fba0
Commit
b133fba0
authored
Mar 12, 2025
by
zhangzhencai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
537b6516
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1916 additions
and
1367 deletions
+1916
-1367
serverConfig.xml
serverConfig.xml
+2
-1
enterpriseInfo.ts
src/biz/enterpriseInfo.ts
+203
-863
finance.ts
src/biz/finance.ts
+298
-0
qualification.ts
src/biz/qualification.ts
+543
-0
teams.ts
src/biz/teams.ts
+228
-0
enterprise.ts
src/config/eccParam/enterprise.ts
+27
-3
enum.ts
src/config/enum/enum.ts
+45
-2
errorEnum.ts
src/config/enum/errorEnum.ts
+1
-1
enterprise.ts
src/config/splitResult/enterprise.ts
+5
-0
enterpriseInfo.ts
src/routers/enterpriseInfo.ts
+34
-496
finance.ts
src/routers/finance.ts
+149
-0
public.ts
src/routers/public.ts
+4
-0
qualification.ts
src/routers/qualification.ts
+238
-0
router.ts
src/routers/router.ts
+7
-0
teams.ts
src/routers/teams.ts
+131
-0
system.ts
src/tools/system.ts
+1
-1
No files found.
serverConfig.xml
View file @
b133fba0
<config>
<port>
9099
</port>
<sign>
xxx90909082fsdahfjosadjfpoiwausjorip2hjklrhn1ioud0u124rx0qwejfokasjfolksaujfoas
</sign>
<dbServer>
http://1
92.168.0.105:40012
</dbServer>
<dbServer>
http://1
27.0.0.1:9096
</dbServer>
</config>
\ No newline at end of file
src/biz/enterpriseInfo.ts
View file @
b133fba0
/**
* 企业信息
* 汇总
*
*
* 企业信息汇总
* */
import
{
EnterpriseAwardUpdateConfig
,
EnterpriseCanBaoUpdateConfig
,
EnterpriseFaRenInfoUpdateConfig
,
EnterpriseFinancingUpdateConfig
,
EnterpriseInfomationUpdateConfig
,
EnterpriseIPRUpdateConfig
,
EnterpriseManageInfoAddConfig
,
EnterpriseManageInfoUpdateConfig
,
EnterprisePatentUpdateConfig
,
EnterpriseQualificationUpdateConfig
,
EnterpriseServiceUpdateConfig
,
EnterpriseTeamUpdateConfig
}
from
"../config/eccParam/enterprise"
;
import
{
EnterpriseFaRenInfoUpdateConfig
,
EnterpriseInfomationUpdateConfig
,
EnterpriseServiceUpdateConfig
}
from
"../config/eccParam/enterprise"
;
import
{
OPERATIONALDATATYPE
,
TABLEID
,
TABLENAME
}
from
"../config/enum/dbEnum"
;
import
*
as
enumConfig
from
"../config/enum/enum"
;
import
{
EnterpriseBaseResConfig
,
EnterpriseFaRenInfoResConfig
,
EnterpriseInfomationResConfig
,
EnterpriseLeaseInfoResConfig
,
EnterpriseQualificationInfoResConfig
}
from
"../config/splitResult/enterprise"
;
...
...
@@ -22,11 +18,11 @@ import moment = require("moment");
//==登录登出
//企业用户表没有存uscc字段,先查询到企业eId,然后到用户表查询密码判断是否登录成功
export
async
function
enterpriseLogin
(
uscc
:
string
,
pwd
:
string
)
{
let
dbInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业基础信息表
,
{
uscc
},
[
"eId"
]);
export
async
function
enterpriseLogin
(
phone
:
string
,
pwd
:
string
)
{
//
let dbInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业基础信息表, {uscc}, ["eId"]);
let
filesList
=
[
"userName"
,
"eId"
,
"pwd"
,
"uId"
];
let
enterpriseInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业用户表
,
{
eId
:
dbInfo
.
eId
},
filesList
);
let
filesList
=
[
"userName"
,
"eId"
,
"pwd"
,
"uId"
,
"phone"
];
let
enterpriseInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业用户表
,
{
phone
},
filesList
);
if
(
!
enterpriseInfo
||
!
enterpriseInfo
.
eId
)
{
throw
new
BizError
(
ERRORENUM
.
账号或密码错误
);
...
...
@@ -45,6 +41,7 @@ export async function enterpriseLogin(uscc:string, pwd:string) {
let
userInfo
=
{
userId
:
enterpriseInfo
.
uId
,
userName
:
enterpriseInfo
.
userName
,
phone
:
enterpriseInfo
.
phone
,
token
:
updateUserInfo
.
token
,
};
...
...
@@ -66,12 +63,40 @@ export async function enterpriseLogout(uId) {
}
/**
* 登录手机号绑定的其他企业列表
* @param phone
* @returns
*/
export
async
function
enterpriseByPhone
(
phone
:
string
)
{
let
manyTableInfo
:
any
=
{};
manyTableInfo
[
TABLENAME
.
企业基础信息表
]
=
{
column
:
[
"enterpriseName"
,
"uscc"
],
where
:{}
};
let
filesList
=
[
"userName"
,
"eId"
];
let
enterpriseInfo
=
await
selectManyTableData
(
OPERATIONALDATATYPE
.
多表联查
,
TABLENAME
.
企业用户表
,
{
phone
},
filesList
,
manyTableInfo
);
let
dataList
=
[];
enterpriseInfo
.
forEach
(
info
=>
{
let
{
enterprise
}
=
info
;
dataList
.
push
({
enterpriseName
:
enterprise
.
enterpriseName
,
eId
:
info
.
eId
,
uscc
:
enterprise
.
uscc
});
})
return
dataList
;
}
//===首页
export
async
function
homePage
(
eId
:
string
)
{
let
filesList
=
[
"enterpriseName"
,
"eId"
];
let
enterpriseInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业基础信息表
,
{
eId
},
filesList
);
let
canBaoFileList
=
[
"annual"
,
"zhuanKe"
,
"benKe"
,
"
yanJiuSheng
"
,
"boShi"
,
"qiTa"
];
let
canBaoFileList
=
[
"annual"
,
"zhuanKe"
,
"benKe"
,
"
shuoshi
"
,
"boShi"
,
"qiTa"
];
let
canBaoInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
参保记录
,
{
eId
},
canBaoFileList
);
canBaoInfo
.
sort
(
(
a
,
b
)
=>
{
return
new
Date
(
b
.
annual
).
valueOf
()
-
new
Date
(
a
.
annual
).
valueOf
()});
...
...
@@ -80,20 +105,31 @@ export async function homePage(eId:string) {
if
(
canBaoInfo
[
0
])
{
if
(
canBaoInfo
[
0
].
zhuanKe
)
chongYeRenYuan
+=
canBaoInfo
[
0
].
zhuanKe
;
if
(
canBaoInfo
[
0
].
benKe
)
chongYeRenYuan
+=
canBaoInfo
[
0
].
benKe
;
if
(
canBaoInfo
[
0
].
yanJiuSheng
)
chongYeRenYuan
+=
canBaoInfo
[
0
].
yanJiuSheng
;
if
(
canBaoInfo
[
0
].
shuoshi
)
chongYeRenYuan
+=
canBaoInfo
[
0
].
shuoshi
;
if
(
canBaoInfo
[
0
].
boShi
)
chongYeRenYuan
+=
canBaoInfo
[
0
].
boShi
;
if
(
canBaoInfo
[
0
].
qiTa
)
chongYeRenYuan
+=
canBaoInfo
[
0
].
qiTa
;
}
canBaoInfo
.
sort
(
(
a
,
b
)
=>
{
return
new
Date
(
b
.
annual
).
valueOf
()
-
new
Date
(
a
.
annual
).
valueOf
()});
//只返回前五条
let
zhengCeInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
政策表
,
{
isPermanent
:
1
},
{},
1
,
5
);
//只返回前五条改为3条
let
zhengCeInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
政策表
,
{
isPermanent
:
1
},
{},
1
,
3
);
let
zhengCeList
=
[];
zhengCeInfo
.
forEach
(
info
=>
{
let
{
poId
,
title
,
source
,
createTimeMs
,
coverImg
}
=
info
;
zhengCeList
.
push
(
{
poId
,
title
,
source
,
createTimeMs
:
moment
(
createTimeMs
).
format
(
"YYYY-MM-DD"
),
coverImg
:
coverImg
?
JSON
.
parse
(
coverImg
)[
0
]
:
''
let
{
poId
,
title
,
source
,
createTimeMs
,
closeTimeMs
,
coverImg
,
isPermanent
}
=
info
;
let
coverImgDefault
=
JSON
.
parse
(
coverImg
)[
0
];
if
(
!
coverImgDefault
)
coverImgDefault
=
"/yuyi/files/默认图片.png"
;
// 判断是否为永久有效政策
let
formattedCloseTime
=
isPermanent
?
"永久有效"
:
moment
(
closeTimeMs
).
format
(
"YYYY-MM-DD"
);
zhengCeList
.
push
(
{
poId
,
title
,
source
,
createTimeMs
,
closeTimeMs
:
formattedCloseTime
,
coverImg
:
coverImgDefault
});
})
let
dataInfo
=
{
...
...
@@ -107,13 +143,16 @@ export async function homePage(eId:string) {
}
let
thisYear
=
new
Date
().
getFullYear
();
let
jysjFile
=
[
"BI"
,
"TXP"
,
"RD"
,
"mId"
];
let
thisYearjJysjInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
state
:
1
,
annual
:
getMySqlMs
(
`
${
thisYear
}
-01-01 00:00:00`
)},
jysjFile
);
let
jysjFile
=
[
"BI"
,
"TXP"
,
"RD"
,
"mId"
,
"annual"
,
"quarter"
];
let
thisYearjJysjInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
state
:
1
,
annual
:
getMySqlMs
(
`
${
thisYear
}
-01-01 00:00:00`
)},
jysjFile
);
if
(
thisYearjJysjInfo
&&
thisYearjJysjInfo
.
mId
)
{
dataInfo
.
manage
.
thisYear
.
BI
=
!
isNaN
(
thisYearjJysjInfo
.
BI
)
?
thisYearjJysjInfo
.
BI
:
"未填报"
;
dataInfo
.
manage
.
thisYear
.
TXP
=
!
isNaN
(
thisYearjJysjInfo
.
TXP
)
?
thisYearjJysjInfo
.
TXP
:
"未填报"
;
dataInfo
.
manage
.
thisYear
.
RD
=
!
isNaN
(
thisYearjJysjInfo
.
RD
)
?
thisYearjJysjInfo
.
RD
:
"未填报"
;
}
let
lastYearjJysjInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
state
:
1
,
annual
:
getMySqlMs
(
`
${
thisYear
-
1
}
-01-01 00:00:00`
)},
jysjFile
);
if
(
lastYearjJysjInfo
&&
lastYearjJysjInfo
.
mId
)
{
dataInfo
.
manage
.
lastYear
.
BI
=
!
isNaN
(
lastYearjJysjInfo
.
BI
)
?
lastYearjJysjInfo
.
BI
:
"未填报"
;
...
...
@@ -127,55 +166,59 @@ export async function homePage(eId:string) {
}
export
async
function
taskList
(
eId
:
string
,
year
,
state
)
{
export
async
function
taskList
(
eId
:
string
,
annual
,
state
)
{
let
quarterConf
=
[
"第一季度"
,
"第二季度"
,
"第三季度"
,
"第四季度"
];
let
year
=
annual
.
slice
(
0
,
4
);
let
annualquarter
=
annual
.
slice
(
4
)
let
quarter
=
0
;
quarterConf
.
forEach
(
(
item
,
index
)
=>
{
if
(
annualquarter
==
item
)
{
quarter
=
index
+
1
;
}
})
let
dataList
:
any
[]
=
[];
let
thisYear
=
new
Date
().
getFullYear
();
let
jysjFile
=
[
"BI"
,
"TXP"
,
"RD"
,
"mId"
,
"state"
,
"isSubmit"
];
let
thisYearjJysjInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
annual
:
getMySqlMs
(
`
${
thisYear
}
-01-01 00:00:00`
)},
jysjFile
);
if
(
!
thisYearjJysjInfo
||
!
thisYearjJysjInfo
.
mId
)
{
//创建新的填报任务
let
itemInfo
=
{
eId
,
mId
:
randomId
(
TABLEID
.
企业经营信息
),
annual
:
getMySqlMs
(
`
${
thisYear
}
-01-01 00:00:00`
),
BI
:
0
,
TXP
:
0
,
RD
:
0
,
createTime
:
getMySqlMs
(),
state
:
0
,
isSubmit
:
0
,
isUpdate
:
0
}
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业经营信息
,
itemInfo
,
{});
}
let
lastYearjJysjInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
annual
:
getMySqlMs
(
`
${
thisYear
-
1
}
-01-01 00:00:00`
)},
jysjFile
);
if
(
!
lastYearjJysjInfo
||
!
lastYearjJysjInfo
.
mId
)
{
//创建新的填报任务
let
itemInfo
=
{
eId
,
mId
:
randomId
(
TABLEID
.
企业经营信息
),
annual
:
getMySqlMs
(
`
${
thisYear
-
1
}
-01-01 00:00:00`
),
BI
:
0
,
TXP
:
0
,
RD
:
0
,
createTime
:
getMySqlMs
(),
state
:
0
,
isSubmit
:
0
,
isUpdate
:
0
}
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业经营信息
,
itemInfo
,
{});
}
let
selectParam
:
any
=
{
eId
,
annual
:
getMySqlMs
(
`
${
year
}
-01-01 00:00:00`
)};
let
selectParam
:
any
=
{
eId
,
annual
:
getMySqlMs
(
`
${
year
}
-01-01 00:00:00`
),
quarter
};
if
(
state
==
1
)
selectParam
.
isSubmit
=
0
;
else
selectParam
.
isSubmit
=
1
;
let
lastYearjJysjInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
annual
:
getMySqlMs
(
`
${
year
}
-01-01 00:00:00`
),
quarter
},
jysjFile
);
if
(
!
lastYearjJysjInfo
||
!
lastYearjJysjInfo
.
mId
)
{
//创建新的填报任务
let
itemInfo
=
{
eId
,
mId
:
randomId
(
TABLEID
.
企业经营信息
),
annual
:
getMySqlMs
(
`
${
year
}
-01-01 00:00:00`
),
quarter
,
BI
:
0
,
TXP
:
0
,
RD
:
0
,
createTime
:
getMySqlMs
(),
state
:
0
,
isSubmit
:
0
,
isUpdate
:
0
}
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业经营信息
,
itemInfo
,
{});
}
let
manageList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业经营信息
,
selectParam
,
jysjFile
);
// 按年度和季度倒序排列
manageList
.
sort
((
a
,
b
)
=>
{
if
(
a
.
annual
===
b
.
annual
)
{
return
b
.
quarter
-
a
.
quarter
;
}
return
new
Date
(
b
.
annual
).
valueOf
()
-
new
Date
(
a
.
annual
).
valueOf
();
});
manageList
.
forEach
(
info
=>
{
dataList
.
push
({
mId
:
info
.
mId
,
annual
:
moment
(
info
.
annual
).
format
(
"YYYY"
),
quarter
:
info
.
quarter
,
//新增季度
state
:
info
.
isSubmit
,
remaining
:
!
info
.
isSubmit
?
100
:
0
,
isSubmit
:
info
.
isSubmit
==
1
...
...
@@ -187,6 +230,72 @@ export async function taskList(eId:string, year, state) {
}
}
// export async function taskList(eId:string, annual, state) {
// let dataList:any[] = [];
// let thisYear = new Date().getFullYear();
// let jysjFile = ["BI", "TXP", "RD", "mId", "state", "isSubmit"];
// let thisYearjJysjInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {eId, annual:getMySqlMs(`${thisYear}-01-01 00:00:00`)}, jysjFile);
// if (!thisYearjJysjInfo || !thisYearjJysjInfo.mId) {
// //创建新的填报任务
// let itemInfo = {
// eId,
// mId:randomId(TABLEID.企业经营信息),
// annual:getMySqlMs(`${thisYear}-01-01 00:00:00`),
// BI:0,
// TXP:0,
// RD:0,
// createTime:getMySqlMs(),
// state:0,
// isSubmit:0,
// isUpdate:0
// }
// await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.企业经营信息, itemInfo, {});
// }
// let lastYearjJysjInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, { eId, annual:getMySqlMs(`${thisYear-1}-01-01 00:00:00`)}, jysjFile);
// if (!lastYearjJysjInfo || !lastYearjJysjInfo.mId) {
// //创建新的填报任务
// let itemInfo = {
// eId,
// mId:randomId(TABLEID.企业经营信息),
// annual:getMySqlMs(`${thisYear-1}-01-01 00:00:00`),
// BI:0,
// TXP:0,
// RD:0,
// createTime:getMySqlMs(),
// state:0,
// isSubmit:0,
// isUpdate:0
// }
// await operationalData(OPERATIONALDATATYPE.增加, TABLENAME.企业经营信息, itemInfo, {});
// }
// let selectParam:any = {eId, annual:getMySqlMs(`${thisYear}-01-01 00:00:00`)};
// if (state == 1 ) selectParam.isSubmit = 0;
// else selectParam.isSubmit = 1;
// let manageList = await selectData(OPERATIONALDATATYPE.查询多个, TABLENAME.企业经营信息, selectParam, jysjFile);
// manageList.forEach(info => {
// dataList.push({
// mId:info.mId,
// annual:moment(info.annual).format("YYYY"),
// state:info.isSubmit,
// remaining:!info.isSubmit ? 100:0,
// isSubmit:info.isSubmit == 1
// });
// });
// return {
// dataList
// }
// }
/**
* 获取企业基本信息
* 回显
...
...
@@ -333,707 +442,26 @@ export async function enterpriseLeaseInfo(eId) {
dataInfo
.
enterpriseName
=
enterpriseInfo
.
enterpriseName
;
dataInfo
.
state
=
changeEnumValue
(
enumConfig
.
FUHUASTATE
,
enterpriseInfo
.
enterprise_fuhuas
[
0
].
state
);
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"
)}
`
;
return
{
dataInfo
};
}
//=====================================================知识产权
/**
* 知识产权信息-列表
* 回显
* @param uscc
*/
export
async
function
enterpriseIPRInfo
(
eId
:
string
)
{
let
filesList
=
[
"iprId"
,
"year"
,
"number"
];
let
iprList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
知识产权
,
{
eId
},
filesList
);
let
dataList
:
any
[]
=
[];
iprList
.
forEach
(
item
=>
{
let
{
iprId
,
year
,
number
}
=
item
;
dataList
.
push
({
iprId
,
year
,
yearStr
:
moment
(
year
).
format
(
"YYYY"
),
number
});
});
return
{
dataList
};
}
/**
* 知识产权信息-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseIPRInfo
(
eId
,
iprId
,
param
)
{
const
FuncName
=
"企业修改知识产权"
eccFormParam
(
FuncName
,
EnterpriseIPRUpdateConfig
,
param
);
let
filesList
=
[
"year"
,
"number"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
知识产权
,
{
iprId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
year
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
let
disIprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
知识产权
,
{
year
:
getMySqlMs
(
param
.
year
),
eId
},
[
"eId"
,
"iprId"
])
if
(
disIprInfo
&&
disIprInfo
.
eId
&&
disIprInfo
.
iprId
!=
iprId
)
throw
new
BizError
(
ERRORENUM
.
存在重复的年份数据
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
iprInfo
);
if
(
!
changeList
.
length
)
return
{
isSuccess
:
true
};
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
知识产权
,
param
,
{
iprId
});
return
{
isSuccess
:
true
};
}
/**
* 知识产权信息-添加
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
createEnterpriseIPRInfo
(
eId
,
param
)
{
const
FuncName
=
"企业创建知识产权"
eccFormParam
(
FuncName
,
EnterpriseIPRUpdateConfig
,
param
);
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
知识产权
,
{
year
:
getMySqlMs
(
param
.
year
),
eId
},
[
"eId"
])
if
(
iprInfo
&&
iprInfo
.
eId
)
throw
new
BizError
(
ERRORENUM
.
存在重复的年份数据
);
let
addInfo
=
{
eId
,
year
:
getMySqlMs
(
param
.
year
),
number
:
param
.
number
,
iprId
:
randomId
(
TABLEID
.
知识产权
)
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
知识产权
,
addInfo
,
{});
return
{
isSuccess
:
true
};
}
export
async
function
deleteEnterpriseIPRInfo
(
eId
,
iprId
)
{
let
filesList
=
[
"year"
,
"number"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
知识产权
,
{
iprId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
year
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
知识产权
,
{},
{
iprId
,
eId
});
return
{
isSuccess
:
true
};
}
//====================================专利
/**
* 专利信息-列表
* 回显
* @param uscc
*/
export
async
function
enterprisePatentInfo
(
eId
:
string
)
{
let
filesList
=
[
"pId"
,
"year"
,
"alienPatent"
,
"classIPatent"
,
"secondClassPatent"
,
"thirdPentent"
];
let
iprList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业专利表
,
{
eId
},
filesList
);
let
dataList
:
any
[]
=
[];
iprList
.
forEach
(
item
=>
{
let
{
pId
,
year
,
number
,
alienPatent
,
classIPatent
,
secondClassPatent
,
thirdPentent
}
=
item
;
dataList
.
push
({
pId
,
year
,
yearStr
:
moment
(
year
).
format
(
"YYYY"
),
number
,
alienPatent
,
classIPatent
,
secondClassPatent
,
thirdPentent
});
});
return
{
dataList
};
}
/**
* 专利信息-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterprisePatentInfo
(
eId
,
pId
,
param
)
{
const
FuncName
=
"企业修改知识产权"
eccFormParam
(
FuncName
,
EnterprisePatentUpdateConfig
,
param
);
let
filesList
=
[
"pId"
,
"year"
,
"alienPatent"
,
"classIPatent"
,
"secondClassPatent"
,
"thirdPentent"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业专利表
,
{
pId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
year
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
let
disInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业专利表
,
{
year
:
getMySqlMs
(
param
.
year
),
eId
},
[
"eId"
,
"pId"
])
if
(
disInfo
&&
disInfo
.
eId
&&
disInfo
.
pId
!=
pId
)
throw
new
BizError
(
ERRORENUM
.
存在重复的年份数据
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
iprInfo
);
if
(
!
changeList
.
length
)
return
{
isSuccess
:
true
};
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
企业专利表
,
param
,
{
pId
,
eId
});
return
{
isSuccess
:
true
};
}
/**
* 专利信息-添加
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
createEnterprisePatentInfo
(
eId
,
param
)
{
const
FuncName
=
"企业创建知识产权"
eccFormParam
(
FuncName
,
EnterprisePatentUpdateConfig
,
param
);
let
disInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业专利表
,
{
year
:
getMySqlMs
(
param
.
year
),
eId
},
[
"eId"
])
if
(
disInfo
&&
disInfo
.
eId
)
throw
new
BizError
(
ERRORENUM
.
存在重复的年份数据
);
let
addInfo
=
{
eId
,
year
:
getMySqlMs
(
param
.
year
),
alienPatent
:
param
.
alienPatent
,
classIPatent
:
param
.
classIPatent
,
secondClassPatent
:
param
.
secondClassPatent
,
thirdPentent
:
param
.
thirdPentent
,
pId
:
randomId
(
TABLEID
.
企业专利表
)
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业专利表
,
addInfo
,
{});
return
{
isSuccess
:
true
};
}
/**
* 专利信息-删除
* @param param0
* @returns
*/
export
async
function
deleteEnterprisePatentInfo
(
eId
,
pId
)
{
let
filesList
=
[
"pId"
,
"year"
,
"alienPatent"
,
"classIPatent"
,
"secondClassPatent"
,
"thirdPentent"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业专利表
,
{
pId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
year
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
企业专利表
,
{},
{
pId
,
eId
});
return
{
isSuccess
:
true
};
}
//====================================资质
/**
* 资质信息-回显
* 回显
* @param uscc
*/
export
async
function
enterpriseQualificationInfo
(
eId
)
{
let
filesList
=
[
"eId"
,
"kxTime"
,
"zjtxTime"
,
"xjrTime"
,
"xjrPyTime"
,
"goPublicTime"
,
"goPublicSector"
];
let
qualificationInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业资质
,
{
eId
},
filesList
);
if
(
!
qualificationInfo
||
!
qualificationInfo
.
eId
)
{
//创建新的
let
addInfo
=
{
eId
,
qId
:
randomId
(
TABLEID
.
企业资质
),
kxTime
:
0
,
zjtxTime
:
0
,
xjrTime
:
0
,
xjrPyTime
:
0
,
goPublicTime
:
0
,
goPublicSector
:
'[]'
,
}
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业资质
,
addInfo
,
{});
addInfo
.
goPublicSector
=
JSON
.
parse
(
addInfo
.
goPublicSector
);
return
{
dataInfo
:
addInfo
};
}
if
(
qualificationInfo
.
goPublicSector
)
qualificationInfo
.
goPublicSector
=
JSON
.
parse
(
qualificationInfo
.
goPublicSector
);
let
resultInfo
:
any
=
extractData
(
EnterpriseQualificationInfoResConfig
,
qualificationInfo
);
resultInfo
.
kxTime
=
new
Date
(
resultInfo
.
kxTime
).
valueOf
();
resultInfo
.
zjtxTime
=
new
Date
(
resultInfo
.
zjtxTime
).
valueOf
();
resultInfo
.
xjrTime
=
new
Date
(
resultInfo
.
xjrTime
).
valueOf
();
resultInfo
.
xjrPyTime
=
new
Date
(
resultInfo
.
xjrPyTime
).
valueOf
();
resultInfo
.
goPublicTime
=
new
Date
(
resultInfo
.
goPublicTime
).
valueOf
();
return
{
dataInfo
:
resultInfo
};
}
/**
* 资质信息-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
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"
,
"kxTime"
,
"zjtxTime"
,
"xjrTime"
,
"xjrPyTime"
,
"goPublicTime"
,
"goPublicSector"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业资质
,
{
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
eId
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
/**修改字段 */
filesList
.
forEach
(
keyStr
=>
{
if
(
keyStr
==
"goPublicSector"
)
return
;
if
(
!
param
[
keyStr
])
delete
param
[
keyStr
]
});
param
.
goPublicSector
=
JSON
.
stringify
(
param
.
goPublicSector
);
let
addInfo
:
any
=
{};
if
(
param
.
kxTime
)
addInfo
.
kxTime
=
param
.
kxTime
;
if
(
param
.
zjtxTime
)
addInfo
.
zjtxTime
=
param
.
zjtxTime
;
if
(
param
.
xjrTime
)
addInfo
.
xjrTime
=
param
.
xjrTime
;
if
(
param
.
xjrPyTime
)
addInfo
.
xjrPyTime
=
param
.
xjrPyTime
;
if
(
param
.
goPublicTime
)
addInfo
.
goPublicTime
=
param
.
goPublicTime
;
if
(
param
.
goPublicSector
)
addInfo
.
goPublicSector
=
param
.
goPublicSector
;
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
企业资质
,
param
,
{
eId
});
return
{
isSuccess
:
true
};
}
//=====================================================================荣誉奖项
/**
* 荣誉奖项-列表
* 回显
* @param uscc
*/
export
async
function
enterpriseHonorInfo
(
eId
)
{
let
filesList
=
[
"hId"
,
"awardName"
,
"awardingUnit"
,
"awardTime"
,
"awardLevel"
,
"awardImg"
];
let
iprList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业荣誉
,
{
eId
},
filesList
);
let
dataList
:
any
[]
=
[];
iprList
.
forEach
(
item
=>
{
let
{
hId
,
awardName
,
awardingUnit
,
awardTime
,
awardLevel
,
awardImg
}
=
item
;
dataList
.
push
({
hId
,
awardName
,
awardingUnit
,
awardTime
:
moment
(
awardTime
).
format
(
"YYYY"
),
awardLevel
:
awardLevel
,
awardImg
:
JSON
.
parse
(
awardImg
),
});
});
return
{
dataList
};
}
/**
* 荣誉奖项-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseHonorInfo
(
eId
,
hId
,
param
)
{
const
FuncName
=
"企业修改荣誉奖项"
eccFormParam
(
FuncName
,
EnterpriseAwardUpdateConfig
,
param
);
param
.
awardTime
=
getMySqlMs
(
param
.
awardTime
);
param
.
awardImg
=
JSON
.
stringify
(
param
.
awardImg
);
let
filesList
=
[
"awardName"
,
"awardingUnit"
,
"awardTime"
,
"awardLevel"
,
"awardImg"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业荣誉
,
{
hId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
awardName
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
企业荣誉
,
param
,
{
hId
,
eId
});
return
{
isSuccess
:
true
};
}
/**
* 荣誉奖项-添加
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
createEnterpriseHonorInfo
(
eId
,
param
)
{
const
FuncName
=
"企业创建荣誉奖项"
eccFormParam
(
FuncName
,
EnterpriseAwardUpdateConfig
,
param
);
let
addInfo
=
{
eId
,
hId
:
randomId
(
TABLEID
.
企业荣誉
),
awardName
:
param
.
awardName
,
awardingUnit
:
param
.
awardingUnit
,
awardTime
:
getMySqlMs
(
param
.
awardTime
),
awardLevel
:
param
.
awardLevel
,
awardImg
:
JSON
.
stringify
(
param
.
awardImg
),
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业荣誉
,
addInfo
,
{});
return
{
isSuccess
:
true
};
}
/**
* 荣誉奖项-删除
* @param param0
* @returns
*/
export
async
function
deleteEnterpriseHonorInfo
(
eId
,
hId
)
{
let
filesList
=
[
"awardName"
,
"awardingUnit"
,
"awardTime"
,
"awardLevel"
,
"awardImg"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业荣誉
,
{
hId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
awardName
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
企业荣誉
,
{},
{
hId
,
eId
});
return
{
isSuccess
:
true
};
}
//=======================================团队
/**
* 创业团队-列表
* 回显
* @param uscc
*/
export
async
function
enterpriseTeamInfo
(
eId
)
{
let
filesList
=
[
"tId"
,
"name"
,
"sex"
,
"birth"
,
"degree"
,
"graduationSchool"
,
"talentType"
,
"des"
];
let
iprList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
创业团队
,
{
eId
},
filesList
);
let
dataList
:
any
[]
=
[];
iprList
.
forEach
(
item
=>
{
let
{
tId
,
name
,
sex
,
birth
,
degree
,
graduationSchool
,
talentType
,
des
}
=
item
;
dataList
.
push
({
tId
,
name
,
sex
:
changeEnumValue
(
enumConfig
.
SEX
,
sex
),
birth
:
moment
(
birth
).
format
(
"YYYY-MM-DD"
),
degree
:
changeEnumValue
(
enumConfig
.
DEGREE
,
degree
),
graduationSchool
,
talentType
:
changeEnumValue
(
enumConfig
.
ENTERPRISETEAM
,
talentType
),
des
,
});
});
return
{
dataList
};
}
/**
* 创业团队-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseTeamInfo
(
eId
,
tId
,
param
)
{
const
FuncName
=
"企业修改创业团队"
eccFormParam
(
FuncName
,
EnterpriseTeamUpdateConfig
,
param
);
let
filesList
=
[
"name"
,
"sex"
,
"birth"
,
"degree"
,
"graduationSchool"
,
"talentType"
,
"des"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
创业团队
,
{
tId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
name
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
iprInfo
);
if
(
!
changeList
.
length
)
return
{
isSuccess
:
true
};
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
创业团队
,
param
,
{
tId
,
eId
});
return
{
isSuccess
:
true
};
}
/**
* 创业团队-添加
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
createEnterpriseTeamInfo
(
eId
,
param
)
{
const
FuncName
=
"企业修改创业团队"
eccFormParam
(
FuncName
,
EnterpriseTeamUpdateConfig
,
param
);
eccEnumValue
(
FuncName
,
'sex'
,
enumConfig
.
SEX
,
param
.
sex
);
eccEnumValue
(
FuncName
,
'talentType'
,
enumConfig
.
ENTERPRISETEAM
,
param
.
talentType
);
let
addInfo
=
{
tId
:
randomId
(
TABLEID
.
创业团队
),
eId
,
name
:
param
.
name
,
sex
:
param
.
sex
,
birth
:
getMySqlMs
(
param
.
birth
),
degree
:
param
.
degree
,
graduationSchool
:
param
.
graduationSchool
,
talentType
:
param
.
talentType
,
des
:
param
.
des
,
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
创业团队
,
addInfo
,
{});
return
{
isSuccess
:
true
};
}
/**
* 创业团队-删除
* @param param0
* @returns
*/
export
async
function
deleteEnterpriseTeamInfo
(
eId
,
tId
)
{
let
filesList
=
[
"name"
,
"sex"
,
"birth"
,
"degree"
,
"graduationSchool"
,
"talentType"
,
"des"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
创业团队
,
{
tId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
name
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
创业团队
,
{},
{
tId
,
eId
});
return
{
isSuccess
:
true
};
}
//==================================================参保人数
/**
* 参保信息-列表
* 回显
* @param uscc
*/
export
async
function
enterpriseCanBaoInfo
(
eId
)
{
let
filesList
=
[
"cId"
,
"annual"
,
"zhuanKe"
,
"benKe"
,
"yanJiuSheng"
,
"boShi"
,
"qiTa"
];
let
iprList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
参保记录
,
{
eId
},
filesList
);
let
dataList
:
any
[]
=
[];
iprList
.
forEach
(
item
=>
{
let
{
cId
,
annual
,
zhuanKe
,
benKe
,
yanJiuSheng
,
boShi
,
qiTa
}
=
item
;
dataList
.
push
({
cId
,
annual
:
new
Date
(
annual
).
valueOf
(),
zhuanKe
,
benKe
,
yanJiuSheng
,
boShi
,
qiTa
});
});
return
{
dataList
};
}
/**
* 参保信息-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseCanBaoInfo
(
eId
,
cId
,
param
)
{
const
FuncName
=
"企业修改参保信息"
eccFormParam
(
FuncName
,
EnterpriseCanBaoUpdateConfig
,
param
);
let
filesList
=
[
"annual"
,
"zhuanKe"
,
"benKe"
,
"yanJiuSheng"
,
"boShi"
,
"qiTa"
,
"cId"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
参保记录
,
{
cId
,
eId
},
filesList
);
if
(
!
iprInfo
||
!
iprInfo
.
annual
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
参保记录
,
{
eId
,
annual
:
getMySqlMs
(
param
.
annual
)},
filesList
);
if
(
resInfo
&&
resInfo
.
annual
&&
resInfo
.
cId
!=
cId
)
throw
new
BizError
(
ERRORENUM
.
不可重复添加同一年度数据
);
/**修改字段 */
param
.
annual
=
getMySqlMs
(
param
.
annual
);
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
参保记录
,
param
,
{
cId
,
eId
});
return
{
isSuccess
:
true
};
}
/**
* 参保信息-添加
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
createEnterpriseCanBaoInfo
(
eId
,
param
)
{
const
FuncName
=
"企业修改参保信息"
eccFormParam
(
FuncName
,
EnterpriseCanBaoUpdateConfig
,
param
);
let
annual
=
getMySqlMs
(
param
.
annual
);
let
filesList
=
[
"annual"
,
"zhuanKe"
,
"benKe"
,
"yanJiuSheng"
,
"boShi"
,
"qiTa"
];
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
参保记录
,
{
eId
,
annual
},
filesList
);
if
(
resInfo
&&
resInfo
.
annual
)
throw
new
BizError
(
ERRORENUM
.
不可重复添加同一年度数据
);
let
addInfo
=
{
cId
:
randomId
(
TABLEID
.
参保记录
),
eId
,
annual
,
zhuanKe
:
param
.
zhuanKe
,
benKe
:
param
.
benKe
,
yanJiuSheng
:
param
.
yanJiuSheng
,
boShi
:
param
.
boShi
,
qiTa
:
param
.
qiTa
,
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
参保记录
,
addInfo
,
{});
return
{
isSuccess
:
true
};
}
/**
* 参保信息-删除
* @param param0
* @returns
*/
export
async
function
deleteEnterpriseCanBaoInfo
(
eId
,
cId
)
{
let
filesList
=
[
"annual"
,
"zhuanKe"
,
"benKe"
,
"yanJiuSheng"
,
"boShi"
,
"qiTa"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
参保记录
,
{
cId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
annual
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
参保记录
,
{},
{
cId
,
eId
});
//如果 startTime 或 endTime 为空或无效,可以设置默认值或提示信息:
if
(
enterpriseInfo
.
enterprise_leases
)
{
const
startTime
=
moment
(
enterpriseInfo
.
enterprise_leases
[
0
].
startTime
);
const
endTime
=
moment
(
enterpriseInfo
.
enterprise_leases
[
0
].
endTime
);
return
{
isSuccess
:
true
};
}
//===============================================企业融资
/**
* 企业融资-列表
* 回显
* @param uscc
*/
export
async
function
enterpriseFinancingInfo
(
eId
)
{
let
filesList
=
[
"rId"
,
"financingAmount"
,
"financingRounds"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentStyle"
,
"fuHuaQiInvestmentAmount"
,
"investmentDate"
,
"investmentInstitutionsName"
,
"valuation"
];
let
iprList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业融资
,
{
eId
},
filesList
);
let
dataList
:
any
[]
=
[];
iprList
.
forEach
(
item
=>
{
let
{
rId
,
financingAmount
,
financingRounds
,
fuHuaQiInvestment
,
fuHuaQiInvestmentStyle
,
fuHuaQiInvestmentAmount
,
investmentDate
,
investmentInstitutionsName
,
valuation
}
=
item
;
let
info
:
any
=
{
rId
,
financingAmount
,
financingRounds
,
fuHuaQiInvestment
,
investmentDate
:
new
Date
(
investmentDate
).
valueOf
(),
investmentInstitutionsName
,
valuation
};
if
(
fuHuaQiInvestment
==
enumConfig
.
STATE
.
是
)
{
info
.
fuHuaQiInvestmentStyle
=
fuHuaQiInvestmentStyle
;
info
.
fuHuaQiInvestmentAmount
=
fuHuaQiInvestmentAmount
;
if
(
startTime
.
isValid
()
&&
endTime
.
isValid
())
{
dataInfo
.
leaseTime
=
`
${
startTime
.
format
(
"YYYY-MM-DD"
)}
至
${
endTime
.
format
(
"YYYY-MM-DD"
)}
`
;
}
else
{
dataInfo
.
leaseTime
=
'未设置租赁日期'
;
}
dataList
.
push
(
info
);
});
return
{
dataList
};
}
/**
* 企业融资-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseFinancingInfo
(
eId
,
rId
,
param
)
{
const
FuncName
=
"企业修改融资信息"
eccFormParam
(
FuncName
,
EnterpriseFinancingUpdateConfig
,
param
);
if
(
param
.
fuHuaQiInvestment
==
enumConfig
.
STATE
.
是
)
{
if
(
!
param
.
fuHuaQiInvestmentStyle
||
!
param
.
fuHuaQiInvestmentAmount
)
throw
new
BizError
(
ERRORENUM
.
参数错误
);
}
else
{
param
.
fuHuaQiInvestmentStyle
=
0
;
param
.
fuHuaQiInvestmentAmount
=
0
;
}
let
filesList
=
[
"rId"
,
"financingAmount"
,
"financingRounds"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentStyle"
,
"fuHuaQiInvestmentAmount"
,
"investmentDate"
,
"investmentInstitutionsName"
,
"valuation"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业融资
,
{
rId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
rId
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
企业融资
,
param
,
{
rId
,
eId
});
return
{
isSuccess
:
true
};
}
/**
* 企业融资-添加
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
createEnterpriseFinancingInfo
(
eId
,
param
)
{
const
FuncName
=
"企业修改参保信息"
eccFormParam
(
FuncName
,
EnterpriseFinancingUpdateConfig
,
param
);
let
addInfo
:
any
=
{
rId
:
randomId
(
TABLEID
.
企业融资
),
eId
,
financingAmount
:
param
.
financingAmount
,
financingRounds
:
param
.
financingRounds
,
investmentDate
:
getMySqlMs
(
param
.
investmentDate
),
investmentInstitutionsName
:
param
.
investmentInstitutionsName
,
valuation
:
param
.
valuation
,
};
addInfo
.
fuHuaQiInvestment
=
param
.
fuHuaQiInvestment
;
if
(
param
.
fuHuaQiInvestment
==
enumConfig
.
STATE
.
是
)
{
if
(
!
param
.
fuHuaQiInvestmentStyle
||
!
param
.
fuHuaQiInvestmentAmount
)
throw
new
BizError
(
ERRORENUM
.
参数错误
);
addInfo
.
fuHuaQiInvestmentStyle
=
param
.
fuHuaQiInvestmentStyle
;
addInfo
.
fuHuaQiInvestmentAmount
=
param
.
fuHuaQiInvestmentAmount
;
}
else
{
param
.
fuHuaQiInvestmentStyle
=
"[]"
;
param
.
fuHuaQiInvestmentAmount
=
0
;
dataInfo
.
leaseTime
=
'无租赁信息'
;
}
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业融资
,
addInfo
,
{});
// 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"
)}
`
;
return
{
isSuccess
:
true
};
}
/**
* 企业融资-删除
* @param param0
* @returns
*/
export
async
function
deleteEnterpriseFinancingInfo
(
eId
,
rId
)
{
let
filesList
=
[
"rId"
,
"financingAmount"
,
"financingRounds"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentStyle"
,
"fuHuaQiInvestmentAmount"
,
"investmentDate"
,
"investmentInstitutionsName"
,
"valuation"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业融资
,
{
rId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
rId
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
企业融资
,
{},
{
rId
,
eId
});
return
{
isSuccess
:
true
};
return
{
dataInfo
};
}
//===============================================企业服务
...
...
@@ -1143,43 +571,55 @@ export async function deleteEnterpriseServiceInfo(eId, esId) {
export
async
function
enterprisePolicyList
(
state
)
{
let
selectParam
:
any
=
{};
if
(
state
==
1
)
{
selectParam
.
closeTimeMs
=
{
"%gt%"
:
getMySqlMs
()}
}
else
if
(
state
==
2
)
{
selectParam
.
closeTimeMs
=
{
"%lt%"
:
getMySqlMs
()}
}
else
if
(
state
==
2
)
{
selectParam
.
closeTimeMs
=
{
"%gt%"
:
getMySqlMs
()}
}
let
filesList
=
[
"poId"
,
"title"
,
"source"
,
"createTimeMs"
,
"c
overImg
"
];
let
resList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
政策表
,
{}
,
filesList
);
let
filesList
=
[
"poId"
,
"title"
,
"source"
,
"createTimeMs"
,
"c
loseTimeMs"
,
"coverImg"
,
"isPermanent
"
];
let
resList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
政策表
,
selectParam
,
filesList
);
let
dataList
=
[];
resList
.
forEach
(
info
=>
{
let
{
poId
,
title
,
source
,
createTimeMs
,
coverImg
}
=
info
;
dataList
.
push
(
{
poId
,
title
,
source
,
createTimeMs
:
moment
(
createTimeMs
).
format
(
"YYYY-MM-DD"
),
coverImg
:
coverImg
?
JSON
.
parse
(
coverImg
)[
0
]
:
''
let
{
poId
,
title
,
source
,
createTimeMs
,
closeTimeMs
,
coverImg
,
isPermanent
}
=
info
;
// 判断是否为永久有效政策
let
formattedCreateTime
=
isPermanent
?
"永久有效"
:
moment
(
closeTimeMs
).
format
(
"YYYY-MM-DD"
);
dataList
.
push
(
{
poId
,
title
,
source
,
createTimeMs
,
closeTimeMs
:
formattedCreateTime
,
coverImg
:
coverImg
?
JSON
.
parse
(
coverImg
)[
0
]
:
''
,
isPermanent
}
);
});
return
{
dataList
};
}
export
async
function
enterprisePolicyInfo
(
poId
)
{
let
filesList
=
[
"poId"
,
"desc"
,
"title"
,
"source"
,
"c
reateTimeMs"
,
"coverImg
"
];
let
filesList
=
[
"poId"
,
"desc"
,
"title"
,
"source"
,
"c
loseTimeMs"
,
"coverImg"
,
"isPermanent
"
];
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
政策表
,
{
poId
},
filesList
);
if
(
!
resInfo
||
!
resInfo
.
poId
)
{
throw
new
BizError
(
ERRORENUM
.
数据不存在
);
}
let
{
closeTimeMs
,
isPermanent
}
=
resInfo
;
// 判断是否为永久有效政策
let
formattedCreateTime
=
isPermanent
?
"永久有效"
:
moment
(
closeTimeMs
).
format
(
"YYYY-MM-DD"
);
let
dataInfo
=
{
poId
:
resInfo
.
poId
,
desc
:
resInfo
.
desc
,
title
:
resInfo
.
title
,
source
:
resInfo
.
source
,
c
reateTimeMs
:
moment
(
resInfo
.
createTimeMs
).
format
(
"YYYY-MM-DD"
)
,
c
loseTimeMs
:
formattedCreateTime
,
coverImg
:
JSON
.
parse
(
resInfo
.
coverImg
)
}
...
...
@@ -1189,103 +629,3 @@ export async function enterprisePolicyInfo(poId) {
//========================================================企业经营
export
async
function
enterpriseManageInfo
(
eId
,
mId
)
{
let
filesList
=
[
"mId"
,
"annual"
,
"BI"
,
"TXP"
,
"RD"
];
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
mId
},
filesList
);
if
(
!
resInfo
||
!
resInfo
.
mId
)
{
throw
new
BizError
(
ERRORENUM
.
数据不存在
);
}
let
dataInfo
=
{
mId
:
resInfo
.
mId
,
annual
:
moment
(
resInfo
.
annual
).
format
(
"YYYY"
),
BI
:
parseFloat
(
resInfo
.
BI
),
TXP
:
parseFloat
(
resInfo
.
TXP
),
RD
:
parseFloat
(
resInfo
.
RD
)
}
return
{
dataInfo
};
}
export
async
function
updateEnterpriseManageInfo
(
eId
,
mId
,
param
)
{
const
FuncName
=
"企业修改企业营收记录"
eccFormParam
(
FuncName
,
EnterpriseManageInfoUpdateConfig
,
param
);
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
mId
},
[
"annual"
,
"mId"
]);
if
(
!
resInfo
||
!
resInfo
.
mId
)
throw
new
BizError
(
ERRORENUM
.
数据不存在
);
let
disInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
annual
:
resInfo
.
annual
},
[
"eId"
,
"mId"
]);
if
(
disInfo
&&
disInfo
.
eId
&&
disInfo
.
mId
!=
mId
)
throw
new
BizError
(
ERRORENUM
.
不可重复添加同一年度数据
);
let
dataInfo
=
{
createTime
:
getMySqlMs
(),
BI
:
param
.
BI
,
TXP
:
param
.
TXP
,
RD
:
param
.
RD
,
isUpdate
:
enumConfig
.
STATE
.
是
}
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
企业经营信息
,
dataInfo
,
{
eId
,
mId
});
return
{
dataInfo
};
}
export
async
function
createEnterpriseManageInfo
(
eId
,
param
)
{
const
FuncName
=
"企业添加企业营收记录"
eccFormParam
(
FuncName
,
EnterpriseManageInfoAddConfig
,
param
);
let
annual
=
getMySqlMs
(
param
.
year
);
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
eId
,
annual
},
[]);
if
(
resInfo
.
annual
)
throw
new
BizError
(
ERRORENUM
.
不可重复添加同一年度数据
);
let
addInfo
=
{
mId
:
randomId
(
TABLEID
.
企业经营信息
),
eId
,
createTime
:
getMySqlMs
(),
annual
:
getMySqlMs
(
param
.
year
),
BI
:
param
.
BI
,
TXP
:
param
.
TXP
,
RD
:
param
.
RD
,
state
:
0
};
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业经营信息
,
addInfo
,
{});
return
{
isSuccess
:
true
};
}
export
async
function
deleteEnterpriseManageInfo
(
eId
,
mId
)
{
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业经营信息
,
{
mId
,
eId
},
[])
if
(
!
resInfo
||
!
resInfo
.
mId
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
企业经营信息
,
{},
{
mId
,
eId
});
return
{
isSuccess
:
true
};
}
export
async
function
enterpriseManageList
(
eId
)
{
let
filesList
=
[
"mId"
,
"annual"
,
"BI"
,
"TXP"
,
"RD"
];
let
resInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业经营信息
,
{
eId
},
filesList
);
if
(
!
resInfo
)
{
throw
new
BizError
(
ERRORENUM
.
数据不存在
);
}
let
dataInfo
=
[];
resInfo
.
forEach
(
info
=>
{
dataInfo
.
push
(
{
mId
:
info
.
mId
,
annual
:
moment
(
info
.
annual
).
format
(
"YYYY"
),
BI
:
info
.
BI
||
"0.00"
,
TXP
:
info
.
TXP
||
"0.00"
,
RD
:
info
.
RD
||
"0.00"
}
)
})
return
{
dataInfo
};
}
src/biz/finance.ts
0 → 100644
View file @
b133fba0
/**
* 企业融资
*/
import
moment
=
require
(
"moment"
);
import
{
OPERATIONALDATATYPE
,
TABLEID
,
TABLENAME
}
from
"../config/enum/dbEnum"
;
import
{
operationalData
,
selectData
}
from
"../data/operationalData"
;
import
{
EnterpriseAwardUpdateConfig
,
EnterpriseFinancingUpdateConfig
,
EnterpriseManageInfoAddConfig
,
EnterpriseManageInfoUpdateConfig
}
from
"../config/eccParam/enterprise"
;
import
{
eccFormParam
}
from
"../util/verificationParam"
;
import
{
getMySqlMs
,
randomId
}
from
"../tools/system"
;
import
{
BizError
}
from
"../util/bizError"
;
import
{
ERRORENUM
}
from
"../config/enum/errorEnum"
;
import
*
as
enumConfig
from
"../config/enum/enum"
;
import
{
changeEnumValue
}
from
"../util/verificationEnum"
;
//===============================================企业融资
/**
* 企业融资-列表
* 回显
* @param uscc
*/
export
async
function
enterpriseFinancingInfo
(
eId
)
{
let
filesList
=
[
"rId"
,
"financingAmount"
,
"financingRounds"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentStyle"
,
"fuHuaQiInvestmentAmount"
,
"investmentDate"
,
"investmentInstitutionsName"
,
"valuation"
];
let
iprList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业融资
,
{
eId
},
filesList
);
let
dataList
:
any
[]
=
[];
iprList
.
forEach
(
item
=>
{
let
{
rId
,
financingAmount
,
financingRounds
,
fuHuaQiInvestment
,
fuHuaQiInvestmentStyle
,
fuHuaQiInvestmentAmount
,
investmentDate
,
investmentInstitutionsName
,
valuation
}
=
item
;
let
info
:
any
=
{
rId
,
financingAmount
,
financingRounds
,
fuHuaQiInvestment
,
investmentDate
:
new
Date
(
investmentDate
).
valueOf
(),
investmentInstitutionsName
,
valuation
};
if
(
fuHuaQiInvestment
==
enumConfig
.
STATE
.
是
)
{
info
.
fuHuaQiInvestmentStyle
=
fuHuaQiInvestmentStyle
;
info
.
fuHuaQiInvestmentAmount
=
fuHuaQiInvestmentAmount
;
}
dataList
.
push
(
info
);
});
return
{
dataList
};
}
/**
* 企业融资-修改
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseFinancingInfo
(
eId
,
rId
,
param
)
{
const
FuncName
=
"企业修改融资信息"
eccFormParam
(
FuncName
,
EnterpriseFinancingUpdateConfig
,
param
);
if
(
param
.
fuHuaQiInvestment
==
enumConfig
.
STATE
.
是
)
{
if
(
!
param
.
fuHuaQiInvestmentStyle
||
!
param
.
fuHuaQiInvestmentAmount
)
throw
new
BizError
(
ERRORENUM
.
参数错误
);
}
else
{
param
.
fuHuaQiInvestmentStyle
=
0
;
param
.
fuHuaQiInvestmentAmount
=
0
;
}
let
filesList
=
[
"rId"
,
"financingAmount"
,
"financingRounds"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentStyle"
,
"fuHuaQiInvestmentAmount"
,
"investmentDate"
,
"investmentInstitutionsName"
,
"valuation"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业融资
,
{
rId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
rId
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
修改
,
TABLENAME
.
企业融资
,
param
,
{
rId
,
eId
});
return
{
isSuccess
:
true
};
}
/**
* 企业融资-添加
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
createEnterpriseFinancingInfo
(
eId
,
param
)
{
const
FuncName
=
"企业修改参保信息"
eccFormParam
(
FuncName
,
EnterpriseFinancingUpdateConfig
,
param
);
let
addInfo
:
any
=
{
rId
:
randomId
(
TABLEID
.
企业融资
),
eId
,
financingAmount
:
param
.
financingAmount
,
financingRounds
:
param
.
financingRounds
,
investmentDate
:
getMySqlMs
(
param
.
investmentDate
),
investmentInstitutionsName
:
param
.
investmentInstitutionsName
,
valuation
:
param
.
valuation
,
};
addInfo
.
fuHuaQiInvestment
=
param
.
fuHuaQiInvestment
;
if
(
param
.
fuHuaQiInvestment
==
enumConfig
.
STATE
.
是
)
{
if
(
!
param
.
fuHuaQiInvestmentStyle
||
!
param
.
fuHuaQiInvestmentAmount
)
throw
new
BizError
(
ERRORENUM
.
参数错误
);
addInfo
.
fuHuaQiInvestmentStyle
=
param
.
fuHuaQiInvestmentStyle
;
addInfo
.
fuHuaQiInvestmentAmount
=
param
.
fuHuaQiInvestmentAmount
;
}
else
{
param
.
fuHuaQiInvestmentStyle
=
"[]"
;
param
.
fuHuaQiInvestmentAmount
=
0
;
}
await
operationalData
(
OPERATIONALDATATYPE
.
增加
,
TABLENAME
.
企业融资
,
addInfo
,
{});
return
{
isSuccess
:
true
};
}
/**
* 企业融资-删除
* @param param0
* @returns
*/
export
async
function
deleteEnterpriseFinancingInfo
(
eId
,
rId
)
{
let
filesList
=
[
"rId"
,
"financingAmount"
,
"financingRounds"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentStyle"
,
"fuHuaQiInvestmentAmount"
,
"investmentDate"
,
"investmentInstitutionsName"
,
"valuation"
];
let
iprInfo
=
await
selectData
(
OPERATIONALDATATYPE
.
查询单个
,
TABLENAME
.
企业融资
,
{
rId
,
eId
},
filesList
)
if
(
!
iprInfo
||
!
iprInfo
.
rId
)
throw
new
BizError
(
ERRORENUM
.
当前数据不存在
);
await
operationalData
(
OPERATIONALDATATYPE
.
删除
,
TABLENAME
.
企业融资
,
{},
{
rId
,
eId
});
return
{
isSuccess
:
true
};
}