Commit 488d2d17 by chenjinjing

no message

parent 4b6797a8
<config> <config>
<port>9099</port> <port>9099</port>
<sign>xxx90909082fsdahfjosadjfpoiwausjorip2hjklrhn1ioud0u124rx0qwejfokasjfolksaujfoas</sign> <sign>xxx90909082fsdahfjosadjfpoiwausjorip2hjklrhn1ioud0u124rx0qwejfokasjfolksaujfoas</sign>
<dbServer>http://192.168.0.105:40012</dbServer> <dbServer>http://192.168.0.71:40012</dbServer>
</config> </config>
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* */ * */
import { EnterpriseAwardUpdateConfig, EnterpriseCanBaoUpdateConfig, EnterpriseFaRenInfoUpdateConfig, EnterpriseFinancingUpdateConfig, EnterpriseInfomationUpdateConfig, EnterpriseIPRUpdateConfig, EnterprisePatentUpdateConfig, EnterpriseQualificationUpdateConfig, EnterpriseServiceUpdateConfig, EnterpriseTeamUpdateConfig } from "../config/eccParam/enterprise"; import { EnterpriseAwardUpdateConfig, EnterpriseCanBaoUpdateConfig, EnterpriseFaRenInfoUpdateConfig, EnterpriseFinancingUpdateConfig, EnterpriseInfomationUpdateConfig, EnterpriseIPRUpdateConfig, EnterpriseManageInfoAddConfig, EnterpriseManageInfoUpdateConfig, EnterprisePatentUpdateConfig, EnterpriseQualificationUpdateConfig, EnterpriseServiceUpdateConfig, EnterpriseTeamUpdateConfig } from "../config/eccParam/enterprise";
import { OPERATIONALDATATYPE, TABLEID, TABLENAME } from "../config/enum/dbEnum"; import { OPERATIONALDATATYPE, TABLEID, TABLENAME } from "../config/enum/dbEnum";
import * as enumConfig from "../config/enum/enum"; import * as enumConfig from "../config/enum/enum";
import { EnterpriseBaseResConfig, EnterpriseFaRenInfoResConfig, EnterpriseInfomationResConfig, EnterpriseLeaseInfoResConfig, EnterpriseQualificationInfoResConfig } from "../config/splitResult/enterprise"; import { EnterpriseBaseResConfig, EnterpriseFaRenInfoResConfig, EnterpriseInfomationResConfig, EnterpriseLeaseInfoResConfig, EnterpriseQualificationInfoResConfig } from "../config/splitResult/enterprise";
...@@ -1022,7 +1022,7 @@ export async function enterpriseServiceList(eId) { ...@@ -1022,7 +1022,7 @@ export async function enterpriseServiceList(eId) {
*/ */
export async function enterpriseServiceInfo(eId, esId) { export async function enterpriseServiceInfo(eId, esId) {
let filesList = [ "esId", "needCategory", "applyTime", "followUpStatus", "needContent"]; let filesList = [ "esId", "needCategory", "applyTime", "followUpStatus", "needContent", "fangKui"];
let resInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业服务表, {esId, eId}, filesList) let resInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业服务表, {esId, eId}, filesList)
if (!resInfo || !resInfo.esId) throw new BizError(ERRORENUM.当前数据不存在); if (!resInfo || !resInfo.esId) throw new BizError(ERRORENUM.当前数据不存在);
...@@ -1031,7 +1031,8 @@ export async function enterpriseServiceInfo(eId, esId) { ...@@ -1031,7 +1031,8 @@ export async function enterpriseServiceInfo(eId, esId) {
needCategory:resInfo.needCategory, needCategory:resInfo.needCategory,
applyTime:moment(resInfo.applyTime).format("YYYY-MM-DD"), applyTime:moment(resInfo.applyTime).format("YYYY-MM-DD"),
followUpStatus:changeEnumValue(enumConfig.FOLLOWUPSTATUS, resInfo.followUpStatus), followUpStatus:changeEnumValue(enumConfig.FOLLOWUPSTATUS, resInfo.followUpStatus),
needContent:resInfo.needContent needContent:resInfo.needContent,
dealResult:resInfo.fangKui,
} }
return {dataInfo}; return {dataInfo};
...@@ -1156,13 +1157,11 @@ export async function enterpriseManageInfo(eId, mId) { ...@@ -1156,13 +1157,11 @@ export async function enterpriseManageInfo(eId, mId) {
} }
export async function updateEnterpriseManageInfo(eId, mId, param) { export async function updateEnterpriseManageInfo(eId, mId, param) {
let filesList = [ "eId", "annual", "BI", "TXP", "RD"]; const FuncName = "企业修改企业营收记录"
let resInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {eId, mId}, filesList); eccFormParam(FuncName, EnterpriseManageInfoUpdateConfig, param );
if (!resInfo || !resInfo.eId) { let resInfo = await selectData(OPERATIONALDATATYPE.查询单个, TABLENAME.企业经营信息, {eId, mId}, []);
throw new BizError(ERRORENUM.数据不存在); if (!resInfo || !resInfo.mId) throw new BizError(ERRORENUM.数据不存在);
}
let dataInfo = { let dataInfo = {
createTime:getMySqlMs(), createTime:getMySqlMs(),
...@@ -1177,3 +1176,60 @@ export async function updateEnterpriseManageInfo(eId, mId, param) { ...@@ -1177,3 +1176,60 @@ export async function updateEnterpriseManageInfo(eId, mId, param) {
} }
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};
}
...@@ -110,3 +110,16 @@ export const EnterpriseServiceUpdateConfig = { ...@@ -110,3 +110,16 @@ export const EnterpriseServiceUpdateConfig = {
} }
export const EnterpriseManageInfoUpdateConfig = {
BI:{type:"Number"},//营业收入
TXP:{type:"Number"},//纳税
RD:{type:"Number"},//研发投入
}
export const EnterpriseManageInfoAddConfig = {
year:{type:"Number"}, //年度
BI:{type:"Number"},//营业收入
TXP:{type:"Number"},//纳税
RD:{type:"Number"},//研发投入
}
...@@ -40,6 +40,7 @@ export enum TABLENAME { ...@@ -40,6 +40,7 @@ export enum TABLENAME {
} }
export enum TABLEID { export enum TABLEID {
雨艺孵化器='yy',
企业孵化信息='fh', 企业孵化信息='fh',
租赁信息='le', 租赁信息='le',
企业用户表='ur', 企业用户表='ur',
......
import { TABLEID } from "./config/enum/dbEnum";
import { initConfig, systemConfig } from "./config/serverConfig"; import { initConfig, systemConfig } from "./config/serverConfig";
import { httpServer } from "./net/http_server"; import { httpServer } from "./net/http_server";
import { randomId } from "./tools/system";
async function lanuch() { async function lanuch() {
await initConfig(); await initConfig();
httpServer.createServer(systemConfig.port); httpServer.createServer(systemConfig.port);
let yid = randomId(TABLEID.雨艺孵化器)
console.log('This indicates that the server is started successfully.'); console.log('This indicates that the server is started successfully.');
} }
......
...@@ -72,6 +72,9 @@ export function setRouter(httpServer) { ...@@ -72,6 +72,9 @@ export function setRouter(httpServer) {
/**企业营收 */ /**企业营收 */
httpServer.post('/xcx/finance/revenue/info', checkUser, asyncHandler(revenueInfo)); httpServer.post('/xcx/finance/revenue/info', checkUser, asyncHandler(revenueInfo));
httpServer.post('/xcx/finance/revenue/update', checkUser, asyncHandler(revenueUpdate)); httpServer.post('/xcx/finance/revenue/update', checkUser, asyncHandler(revenueUpdate));
httpServer.post('/xcx/finance/revenue/add', checkUser, asyncHandler(revenueAdd));
httpServer.post('/xcx/finance/revenue/del', checkUser, asyncHandler(revenueDel));
httpServer.post('/xcx/finance/revenue/list', checkUser, asyncHandler(revenueList));
//=============政策速递 //=============政策速递
...@@ -99,6 +102,8 @@ async function revenueInfo(req, res) { ...@@ -99,6 +102,8 @@ async function revenueInfo(req, res) {
res.success(result); res.success(result);
} }
/** /**
* *
* @param req * @param req
...@@ -112,6 +117,47 @@ async function revenueUpdate(req, res) { ...@@ -112,6 +117,47 @@ async function revenueUpdate(req, res) {
res.success(result); res.success(result);
} }
/**
*
* @param req
* @param res
*/
async function revenueAdd(req, res) {
const UserInfo = req.userInfo;
let { param } = req.body;
let result = await enterpriseInfoBiz.createEnterpriseManageInfo(UserInfo.eId, param);
res.success(result);
}
/**
*
* @param req
* @param res
*/
async function revenueDel(req, res) {
const UserInfo = req.userInfo;
let {mId} = req.body
let result = await enterpriseInfoBiz.deleteEnterpriseManageInfo(UserInfo.eId, mId);
res.success(result);
}
/**
*
* @param req
* @param res
*/
async function revenueList(req, res) {
const UserInfo = req.userInfo;
let result = await enterpriseInfoBiz.enterpriseManageList(UserInfo.eId);
res.success(result);
}
//====================================政策速递 //====================================政策速递
......
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