Commit 2145bfbb by chenjinjing

no message

parent 2bf63abf
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,6 +20,7 @@
"node-xlsx": "^0.16.1",
"nodemailer": "^6.1.1",
"officegen": "^0.6.5",
"pinyin": "^4.0.0-alpha.2",
"qs": "^6.11.0",
"request": "^2.88.0",
"svg-captcha": "^1.3.12",
......@@ -28,7 +29,6 @@
"ws": "^5.2.2",
"xml2js": "^0.4.23"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
......
......@@ -9,7 +9,7 @@ import { operationalData, selectData, selectManyTableData } from "../data/operat
import { BizError } from "../util/bizError";
import { eccFormParam } from "../util/verificationParam";
import { ERRORENUM } from "../config/enum/errorEnum";
import { getMySqlMs, getToken, md5PwdStr, randomCode, randomId } from "../tools/system";
import { getMySqlMs, getPinyinInitials, getToken, md5PwdStr, randomCode, randomId } from "../tools/system";
import moment = require("moment");
import { changeAdd, extractData } from "../util/piecemeal";
import { EnterpriseApplyForConfig } from "../config/splitResult/enterprise";
......@@ -33,10 +33,12 @@ import { changeEnumValue } from "../util/verificationEnum";
// console.log("查询结果:", enterpriseUserInfo); // 添加日志
if (enterpriseUserInfo && enterpriseUserInfo.eId) throw new BizError(ERRORENUM.企业已存在);
let pinyinName = getPinyinInitials(param.enterpriseName);
let addEInfo = {
eId:randomId(TABLEID.企业基础信息表),
enterpriseName:param.enterpriseName,
pinyinName,
uscc:param.uscc,
logonTime:getMySqlMs(param.logonTime),
logonAddress:JSON.stringify(["", "", "", param.logonAddress]),
......@@ -241,8 +243,11 @@ export async function settleInEnterpriseUpdate(eId:string, param) {
}
if (resInfo.state) throw new BizError(ERRORENUM.该企业已通过审核);
let pinyinName = getPinyinInitials(param.enterpriseName);
let updateInfo = {
enterpriseName:param.enterpriseName,
pinyinName,
uscc:param.uscc,
logonTime:param.logonTime,
logonAddress:JSON.stringify(["", "", "", param.logonAddress]),
......
......@@ -4,7 +4,7 @@
import * as asyncHandler from 'express-async-handler';
import { checkEnterpriseUser, checkInterior, checkUser } from '../middleware/user';
import { getMySqlMs, randomId } from '../tools/system';
import { getMySqlMs, getPinyinInitials, randomId } from '../tools/system';
import { OPERATIONALDATATYPE, TABLEID, TABLENAME } from '../config/enum/dbEnum';
import { changeEnumValue } from '../util/verificationEnum';
import { DEGREE, FUHUASTATE, IPRALLTYPE, ZZMM } from '../config/enum/enum';
......@@ -103,10 +103,11 @@ export async function data1210(req, res) {
let qccInfo = dataMap[enterpriseName];
let eId = randomId(TABLEID.企业基础信息表);
let pinyinName = getPinyinInitials(qccInfo.enterpriseName)
let enterpriseInfo = {//基础信息表
eId,
enterpriseName:qccInfo.enterpriseName,
pinyinName,
RAS:qccInfo.RAS,
zhuceziben:qccInfo.zhuceziben,
shijiaoziben:qccInfo.shijiaoziben,
......@@ -138,6 +139,8 @@ export async function data1210(req, res) {
leaseId:randomId(TABLEID.租赁信息),
eId,
area:subList[4] ? subList[4] : 0,
building:subList[45] || '',
// roomNumber:subList[4] || '',
roomNumber:subList[3] || '',
bankName:subList[18] || '',
};
......
......@@ -5,8 +5,7 @@
*/
import moment = require("moment");
import { TABLEID } from "../config/enum/dbEnum";
import pinyin from 'pinyin';
const md5 = require("md5");
......@@ -77,4 +76,22 @@ export function getMySqlMs(time?) {
export function randomCode() {
return `${Math.ceil(Math.random()*10000)}`
}
\ No newline at end of file
}
/**
* 转换名称为拼音首字母
* @param name
* @returns
*/
export function getPinyinInitials(name) {
const result = pinyin(name, {
style: pinyin.STYLE_FIRST_LETTER, // 只获取首字母
heteronym: false // 不启用多音字模式
});
// 将二维数组转换为一维字符串,如 "阿里巴巴" -> "albb"
return result.map(item => item[0].charAt(0)).join('').toUpperCase();
}
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