Commit 7bd6fd94 by chenjinjing

no message

parent f91d1d4f
No preview for this file type
No preview for this file type
<config>
<port>7071</port>
<excelModelUrl>http://127.0.0.1:7071/template/</excelModelUrl>
<excelModelUrl>http://192.168.0.71:7071/template/</excelModelUrl>
<!-- <excelModelUrl>http://101.89.111.202:7071/template/</excelModelUrl> -->
<mongodb>
<path>192.168.0.71</path>
......
......@@ -271,7 +271,7 @@ export async function homePage() {
/**较上月变化量 */
"较上月100平方公里范围企业变化": 0,
"较上月3.73平方公里实体租赁变化": 0,
"较上月关联入驻企业变化": 0,
"较上月软信类企业变化": 0,
"较上月小台账企业变化": 0,
"较上月重点稳商变化": 0,
"较上月总入驻企业变化": 0
......@@ -393,7 +393,7 @@ export async function homePage() {
// 计算变化量(本月数据 - 上月数据)
汇总数据.较上月100平方公里范围企业变化 = currentMonthStats["100平方公里范围企业"] - lastMonthStats["100平方公里范围企业"];
汇总数据["较上月3.73平方公里实体租赁变化"] = currentMonthStats["3.73平方公里实体租赁"] - lastMonthStats["3.73平方公里实体租赁"];
汇总数据.较上月关联入驻企业变化 = currentMonthStats["软信类企业"] - lastMonthStats["软信类企业"];
汇总数据.较上月软信类企业变化 = currentMonthStats["软信类企业"] - lastMonthStats["软信类企业"];
汇总数据.较上月小台账企业变化 = currentMonthStats["小台账企业"] - lastMonthStats["小台账企业"];
汇总数据.较上月重点稳商变化 = currentMonthStats["重点稳商"] - lastMonthStats["重点稳商"];
汇总数据.较上月总入驻企业变化 = currentMonthStats["总入驻企业"] - lastMonthStats["总入驻企业"];
......@@ -457,7 +457,7 @@ export async function homePage() {
let selectParam = {
"labels": {
"$elemMatch": {
"labelId": { "$in": [labelEnum.BASELABEL.小台账企业.toString()] }
"labelId": { "$in": [labelEnum.BASELABEL.小台账企业.toString(), labelEnum.BASELABEL.重点稳商企业.toString()] }
}
}
}
......
......@@ -53,6 +53,7 @@ export async function enterpriseCreate(param) {
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'enterpriseNature', labelEnum.ENTERPRISENATURE, param.enterpriseNature);
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'property', labelEnum.PROPERTY, param.property);
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'RAS', configEnum.RAS, param.RAS);
if (param.subDivide) verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'subDivide', industryEnum.SUBDIVIDE, param.subDivide);
/**校验标签 */
if (param.labels && param.labels.length > 0) {
......@@ -89,6 +90,7 @@ export async function enterpriseCreate(param) {
parkEntryTime: param.parkEntryTime,
// industryCategoryGb: param.industryCategoryGb,
industry: param.industry,
subDivide: param.subDivide,
property: param.property,
enterpriseNature: param.enterpriseNature,
leasedArea: param.leasedArea,
......@@ -313,11 +315,11 @@ export async function enterpriseUpdate(uscc:string, param) {
eccFormParam("管理后台修改企业库", EnterpriseUpdateConfig, param);
/**校验枚举 */
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'industry', industryEnum.ALLINDUSTRY, param.industry);
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'subDivide', industryEnum.SUBDIVIDE, param.subDivide);
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'enterpriseNature', labelEnum.ENTERPRISENATURE, param.enterpriseNature);
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'property', labelEnum.PROPERTY, param.property);
verificationEnumTools.eccEnumValue('管理后台新增企业建档', 'RAS', configEnum.RAS, param.RAS);
verificationEnumTools.eccEnumValue('管理后台修改企业建档', 'industry', industryEnum.ALLINDUSTRY, param.industry);
verificationEnumTools.eccEnumValue('管理后台修改企业建档', 'enterpriseNature', labelEnum.ENTERPRISENATURE, param.enterpriseNature);
verificationEnumTools.eccEnumValue('管理后台修改企业建档', 'property', labelEnum.PROPERTY, param.property);
verificationEnumTools.eccEnumValue('管理后台修改企业建档', 'RAS', configEnum.RAS, param.RAS);
if (param.subDivide) verificationEnumTools.eccEnumValue('管理后台修改企业建档', 'subDivide', industryEnum.SUBDIVIDE, param.subDivide);
/**校验标签 */
if (param.labels && param.labels.length > 0) {
......
......@@ -92,6 +92,7 @@ export async function 在谈在跟(buff) {
progressStatus: progressStatus,
primaryContact: rowData[4],
contactDepartment: rowData[5],
progressDetails: rowData[6],
createTime:new Date().valueOf(),
}
......
......@@ -12,6 +12,10 @@ export async function getLabel(labelType?) {
/**需要用到的查询数据 */
let labelDbList = await labelData.selectLabelList(selectParam);
labelDbList.sort( (a, b) => {
return a.id - b.id;
})
/**组合返回结果 */
let dataList = [];
labelDbList.forEach( info => {
......@@ -40,6 +44,10 @@ export async function getNotTypeLabel(labelType) {
/**需要用到的查询数据 */
let labelDbList = await labelData.selectLabelList(selectParam);
labelDbList.sort( (a, b) => {
return a.id - b.id;
})
/**组合返回结果 */
let dataList = [];
labelDbList.forEach( info => {
......
......@@ -64,7 +64,7 @@ export const EnterpriseAddConfig = {
labels:{type:"[String]"}, //企业标签
// industryCategoryGb:{type:"String"}, //国标行业门类
industry:{type:"[Number]"}, //行业领域
subDivide:{type:"[Number]"}, //细分行业领域-用于小台账
subDivide:{type:"[Number]", notMustHave:true}, //细分行业领域-用于小台账
property:{type:"Number"}, //企业所属物业
enterpriseNature:{type:"Number"}, //企业性质
leasedArea:{type:"Number"}, //租赁面积(㎡)
......@@ -89,7 +89,7 @@ export const EnterpriseUpdateConfig = {
parkEntryTime:{type:'Number'}, //入驻园区时间
labels:{type:"[String]"}, //企业标签
industry:{type:"[Number]"}, //行业领域
subDivide:{type:"[Number]"}, //细分行业领域-小台账用
subDivide:{type:"[Number]", notMustHave:true}, //细分行业领域-小台账用
property:{type:"Number"}, //企业所属物业
enterpriseNature:{type:"String"}, //企业性质
leasedArea:{type:"Number"}, //租赁面积(㎡)
......
......@@ -14,6 +14,7 @@ const config = {
"/public/label/labeltype":labelConfig.LABELTYPE, //标签类型
"/public/industrycategorygb":industryConfig.INDUSTRY, //国标行业门类
"/public/industry":industryConfig.ALLINDUSTRY, //行业领域
"/public/subdivied":industryConfig.SUBDIVIDE, //细分行业领域
"/public/ras":enumConfig.RAS, //登记状态
"/public/registrationstatus":enumConfig.REGISTRATIONSTATUS, //推荐/注册情况
"/public/progressstatus":enumConfig.PROGRESSSTATUS, //进展情况
......
......@@ -11,6 +11,9 @@ import { createDataByParam, findEnterpriseByUscc } from "../data/enterprise";
import { formatAddress, getPwdMd5, randomId } from "./system";
import { TABLEID } from "../config/enum/dbEnum";
import moment from "moment";
import { BizError } from "../util/bizError";
import { ERRORENUM } from "../config/errorEnum";
import { changeEnumNameByCode } from "../util/verificationEnum";
let xlsx = require('node-xlsx');
let path = require('path');
let md5 = require("md5");
......@@ -428,6 +431,8 @@ function parseLabels(rowData) {
export async function initBasicData() {
await initLabel();
await initEnterpriseFromExcel();
await udpate小台账细分行业领域();
await udpate重点稳商细分行业领域();
}
......@@ -767,6 +772,152 @@ async function createEnterpriseToList(enterpriseList) {
}
/**
* 初始化小台账企业细分行业领域类型
* @returns
*/
export async function udpate小台账细分行业领域() {
// 读取Excel文件
let {sheetMap} = getExcel(path.join(__dirname.substring(0,__dirname.indexOf("out")), "res", '企业细分行业领域20260128.xlsx' ));
// 获取工作表数据(根据Excel中的工作表名称)
let sheetName = '小台账企业';
let dataList = sheetMap[sheetName];
if (!dataList || dataList.length === 0) {
console.log(`工作表 ${sheetName} 无数据`);
return;
}
console.log(`读取到 ${dataList.length} 行数据`);
// 表头映射
let titleMap = {
"0": "name", //企业名称
"1": "uscc", //统一社会信用代码
"2": "subDivide", //细分行业领域
}
let titleIndexList = Object.keys(titleMap);
// 提取表头行(第0行)
let headerRow = dataList[0] || [];
// 处理每一行数据(从第1行开始)
for (let rowIndex = 1; rowIndex < dataList.length; rowIndex++) {
let subList = dataList[rowIndex];
// 构建行数据对象(用于标签解析)
let rowData:any = {};
titleIndexList.forEach((colIndex, idx) => {
let key = titleMap[colIndex];
let value = subList[parseInt(colIndex)];
rowData[key] = value;
});
/**校验企业 */
let enterpriseDbInfo = await enterpriseData.findEnterpriseByUscc(rowData.uscc);
if (!enterpriseDbInfo || !enterpriseDbInfo.uscc) throw new BizError(ERRORENUM.该企业不存在, `库中不存在uscc=${rowData.uscc}这个企业`);
//处理细分行业领域字段
let subDivide = processSubDivide(rowData.subDivide);
enterpriseDbInfo.subDivide = subDivide;
await enterpriseDbInfo.save();
console.log(`准备修改第 ${rowIndex} 条小台账细分行业领域数据`);
}
}
/**
* 初始化小台账企业细分行业领域类型
* @returns
*/
export async function udpate重点稳商细分行业领域() {
// 读取Excel文件
let {sheetMap} = getExcel(path.join(__dirname.substring(0,__dirname.indexOf("out")), "res", '企业细分行业领域20260128.xlsx' ));
// 获取工作表数据(根据Excel中的工作表名称)
let sheetName = '重点稳商企业';
let dataList = sheetMap[sheetName];
if (!dataList || dataList.length === 0) {
console.log(`工作表 ${sheetName} 无数据`);
return;
}
console.log(`读取到 ${dataList.length} 行数据`);
// 表头映射
let titleMap = {
"0": "name", //企业名称
"1": "uscc", //统一社会信用代码
"2": "subDivide", //细分行业领域
}
let titleIndexList = Object.keys(titleMap);
// 提取表头行(第0行)
let headerRow = dataList[0] || [];
// 处理每一行数据(从第1行开始)
for (let rowIndex = 1; rowIndex < dataList.length; rowIndex++) {
let subList = dataList[rowIndex];
// 构建行数据对象(用于标签解析)
let rowData:any = {};
titleIndexList.forEach((colIndex, idx) => {
let key = titleMap[colIndex];
let value = subList[parseInt(colIndex)];
rowData[key] = value;
});
/**校验企业 */
let enterpriseDbInfo = await enterpriseData.findEnterpriseByUscc(rowData.uscc);
if (!enterpriseDbInfo || !enterpriseDbInfo.uscc) throw new BizError(ERRORENUM.该企业不存在, `库中不存在uscc=${rowData.uscc}这个企业`);
//处理细分行业领域字段
let subDivide = processSubDivide(rowData.subDivide);
enterpriseDbInfo.subDivide = subDivide;
await enterpriseDbInfo.save();
console.log(`准备修改第 ${rowIndex} 条重点稳商细分行业领域数据`);
}
}
/**
* 处理细分行业领域字符串
* @param subDivideStr 细分行业领域字符串
* @returns 枚举值数组
*/
function processSubDivide(subDivideStr: string): number[] {
if (!subDivideStr || !subDivideStr.trim()) {
return [];
}
const values = subDivideStr.trim().split('、').map(v => v.trim()).filter(v => v);
const result: number[] = [];
for (const value of values) {
try {
const enumCode = changeEnumNameByCode(industryEnum.SUBDIVIDE, value);
if (enumCode !== "未知行业" && !isNaN(parseInt(enumCode))) {
result.push(parseInt(enumCode));
} else {
console.warn(`细分行业领域转换失败: "${value}"`);
}
} catch (error) {
console.error(`处理细分行业领域值 "${value}" 时出错:`, error);
}
}
console.log(result + "-" + subDivideStr + "-" + values)
return 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