Commit 3f4cca13 by lixinming

优化

parent 34a13ae4
/**
* 企业标签
* 企业标签 管理后台
* 6.0功能
*
*/
import { ENTERPRISESYSTEMLABEL, LABELGOAL, LABELTYPE, LABELUPDATEROAD } from "../../../config/enum";
......
/**
* 孵化器标签管理
* 孵化器标签管理 管理后台
* 6.0功能
*/
import moment = require("moment");
......
/**
* 管理后台-标签系统-标签管理
* 6.0功能
*/
import { LABELGOAL, LABELTYPE } from "../../config/enum";
......@@ -11,7 +12,7 @@ import { changeEnumValue, eccEnumValue } from "../../util/verificationEnum";
/**
* 创建标签
* 创建自定义标签
*/
export async function addLabel(name:string, goal:number) {
eccEnumValue("创建标签", "goal", LABELGOAL, goal);
......@@ -24,7 +25,7 @@ export async function addLabel(name:string, goal:number) {
/**
* 修改标签名字
* 修改自定义标签名字
* @param id
* @param name
*/
......@@ -39,7 +40,7 @@ export async function updateLabelName(id:string, name:string) {
/**
* 列表
* 自定义标签列表列表
* @returns
*/
export async function labelList(pageNumber:number) {
......@@ -62,7 +63,7 @@ export async function labelList(pageNumber:number) {
/**
* 删除标签
* 删除自定义标签
* @param id
* @returns
*/
......
/**
* 标签系统
* 标签系统 主要逻辑
*/
import { ENTERPRISESYSTEMLABEL, FHQSYSTEMLABEL, FUHUASTATE, INDUSTRY, LABELGOAL, LABELTYPE, LABELUPDATEROAD, MOVEOUTTYPE, STATEENUM } from "../config/enum";
import { findEnterpriseByUscc, findUsccList } from "../data/enterprise/enterprise";
import * as fuHuaQiLabelLogData from "../data/fuHuaQi/fuHuaQiLabelLog";
import * as enterpriseLabelLogData from "../data/enterprise/enterpriseLabelLog";
import { findFuHuaQiByUSCC, findFuHuaQiOperationNameMapByParam } from "../data/fuHuaQi/fuhuaqi";
import moment = require("moment");
import { selectEnterpriseFinancingAmount } from "../data/enterprise/financingInfo";
import { selectEnterpriseBusinessAmount } from "../data/enterprise/quarterTask/businessdata";
import { addSystemLabel, findOnceLabel } from "../data/label";
import { changeAddToString, getLabelId } from "../tools/system";
import { changeAddresCode, isPointInPolygon } from "../tools/changeAdd";
import moment = require("moment");
/**企业标签操作 */
/**
* 【企业标签】添加单个
......@@ -106,6 +107,8 @@ export async function outLabelToEnterprise(enterpriseInfo, labelId:string, p1?)
}
/**孵化器标签操作 */
/**
* 【孵化器标签】添加单个
* @param uscc
......@@ -200,6 +203,8 @@ export async function outLabelToFuHuaQi(fuHuaQiInfo:any, labelId:string, p1?) {
}
/**防止 百度api接口触发 100/s 接口限制 */
function sleep() {
return new Promise((resolve, reject) => {
setTimeout(()=> {
......@@ -216,7 +221,7 @@ export async function systemLabel() {
let usccList = await findUsccList();
let fuHuaQiNameMap = await findFuHuaQiOperationNameMapByParam({});
let addLogList = [];
let seCount = 0;
let successCount = 0;
let allCount = usccList.length;
for (let i = 0; i < usccList.length; i++) {
let {uscc} = usccList[i];
......@@ -350,11 +355,10 @@ export async function systemLabel() {
await enterpriseInfo.save();
await sleep();
seCount += 1;
successCount += 1;
if (i%100 == 0) {
console.log("进度", Math.ceil((seCount/allCount)*10000)/100,'%');
console.log("进度:", Math.ceil((successCount/allCount)*10000)/100,'%');
}
}
//添加日志
......@@ -421,17 +425,14 @@ async function addIsInZJ(addList) {
/**
* 事件标签
* 企业事件标签
* 事件标签都是系统标签
* 传入的企业对象必须是修改后为保存的
* @param enterpriseInfo
* @param labelId
*/
export function eventLabel(enterpriseInfo, labelId, p1?, p2?, p3?) {
export function enterpriseEventLabel(enterpriseInfo, labelId, p1?, p2?, p3?) {
switch (labelId) {
case ENTERPRISESYSTEMLABEL.上市企业:
if (enterpriseInfo.qualification && enterpriseInfo.qualification.isBeOnTheMarket) {
......
......@@ -12,7 +12,7 @@ import { eccFormParam } from "../../../util/verificationParam";
import * as enterpriseData from "../../../data/enterprise/enterprise";
import { addEnterprisePoint } from "../../point";
import { ENTERPRISENODEENUM } from "../../../config/pointConfig";
import { eventLabel } from "../../label";
import { enterpriseEventLabel } from "../../label";
......@@ -89,16 +89,16 @@ export async function updateQualification(uscc:string, param) {
/**标签 */
if (oldMarketData.isBeOnTheMarket != newMarketData.isBeOnTheMarket) {
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.上市企业, '企业登记' );
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.上市企业, '企业登记' );
}
if (oldIsZjtxData.isZjtx != newIsZjtxData.isZjtx) {
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.专精特新, '企业登记');
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.专精特新, '企业登记');
}
if (oldIsXjrData.isXjr != newIsXjrData.isXjr) {
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.小巨人, '企业登记');
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.小巨人, '企业登记');
}
if (oldHighTechData.isHighTech != newHighTechData.isHighTech) {
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.高新企业, '企业登记');
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.高新企业, '企业登记');
}
/**修改了之后去掉 红框提示 */
......
......@@ -14,7 +14,7 @@ import { BizError } from "../../util/bizError";
import { checkChange, extractData } from "../../util/piecemeal";
import { changeEnumValue, eccEnumValue } from "../../util/verificationEnum";
import { eccFormParam } from "../../util/verificationParam";
import { eventLabel } from "../label";
import { enterpriseEventLabel } from "../label";
/**
......@@ -77,7 +77,7 @@ export async function addEnterpriseFinancing(uscc:string, form) {
//添加标签
let financingRoundsStr = changeEnumValue(FINANCINGROUNDS, form.financingRounds);
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.融资企业, `获得${financingRoundsStr}融资,${form.financingAmount}万元`);
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.融资企业, `获得${financingRoundsStr}融资,${form.financingAmount}万元`);
await enterpriseInfo.save();
return {isSuccess:true};
......
......@@ -16,7 +16,7 @@ import * as configEnum from "../../../config/enum";
import { eccFormParam } from "../../../util/verificationParam";
import * as verificationEnumTools from "../../../util/verificationEnum";
import { checkChange, extractData } from "../../../util/piecemeal";
import { eventLabel } from "../../label";
import { enterpriseEventLabel } from "../../label";
import { findFuHuaQiByUSCC } from "../../../data/fuHuaQi/fuhuaqi";
......@@ -123,7 +123,7 @@ export async function moveInEnterprise(uscc:string, param) {
/**标签 迁入的是别人迁出的企业*/
let fuHuaQiInfo = await findFuHuaQiByUSCC(uscc);
eventLabel(dataBaseInfo, configEnum.ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
enterpriseEventLabel(dataBaseInfo, configEnum.ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
await dataBaseInfo.save();
} else {
......
......@@ -21,7 +21,7 @@ import { findEnterpriseNewTeamData } from "../../../data/enterprise/quarterTask/
import { EnterpriseTeamConfig } from "../../../config/splitResultConfig";
import { findBusinessDataByUsccAndYear } from "../../../data/enterprise/quarterTask/businessdata";
import { selectRepleishData } from "../../../data/enterprise/replenish";
import { eventLabel } from "../../label";
import { enterpriseEventLabel } from "../../label";
import { ENTERPRISESYSTEMLABEL } from "../../../config/enum";
import { findFuHuaQiByUSCC } from "../../../data/fuHuaQi/fuhuaqi";
......@@ -150,9 +150,9 @@ export async function updatePhysicalInfo(fuHuaQiUscc:string, uscc:string, leased
/**标签*/
let fuHuaQiInfo = await findFuHuaQiByUSCC(fuHuaQiUscc);
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.虚拟企业, fuHuaQiInfo.operationName);
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.虚拟企业, fuHuaQiInfo.operationName);
if (oldData.state == configEnum.FUHUASTATE.迁出) {
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
}
}
......@@ -219,9 +219,9 @@ export async function updateVirtualInfo(fuHuaQiUscc:string, uscc:string, virtual
/**标签*/
let fuHuaQiInfo = await findFuHuaQiByUSCC(fuHuaQiUscc);
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.虚拟企业, fuHuaQiInfo.operationName);
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.虚拟企业, fuHuaQiInfo.operationName);
if (oldData.state == configEnum.FUHUASTATE.迁出) {
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
}
......@@ -312,7 +312,7 @@ export async function updateMoveOutInfo(fuHuaQiUscc:string, uscc:string, moveOu
/**标签 */
let fuHuaQiInfo = await findFuHuaQiByUSCC(fuHuaQiUscc);
eventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
enterpriseEventLabel(enterpriseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
await enterpriseInfo.save();
......@@ -420,7 +420,7 @@ export async function replenishMyEnterpriseInPutInfo(fuHuaQiUscc:string, param)
/**标签 迁入的是别人迁出的企业*/
let fuHuaQiInfo = await findFuHuaQiByUSCC(fuHuaQiUscc);
eventLabel(dataBaseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
enterpriseEventLabel(dataBaseInfo, ENTERPRISESYSTEMLABEL.迁出企业, fuHuaQiInfo.operationName);
await dataBaseInfo.save();
} else {
/**添加新注册企业标识 */
......
......@@ -26,7 +26,7 @@ import { getPwdMd5, getThisMonthMs, md5PwdStr } from "../../../../tools/system";
import * as taskTool from "../../../../tools/taskTool";
import * as scoreBiz from "../score";
import { eventLabel } from "../../../label";
import { enterpriseEventLabel } from "../../../label";
import { changeEnumValue } from "../../../../util/verificationEnum";
......@@ -247,7 +247,7 @@ export async function checkTask(uscc:string, taskType:number) {
for (let i= 0; i < finacingDataList.length; i++) {
let itemEnterpriseInfo = await enterpriseData.findEnterpriseByUscc(finacingDataList[i].uscc);
let financingRoundsStr = changeEnumValue(FINANCINGROUNDS, finacingDataList[i].financingRounds);
eventLabel(itemEnterpriseInfo, ENTERPRISESYSTEMLABEL.融资企业, `获得${financingRoundsStr}融资,${finacingDataList[i].financingAmount}万元`);
enterpriseEventLabel(itemEnterpriseInfo, ENTERPRISESYSTEMLABEL.融资企业, `获得${financingRoundsStr}融资,${finacingDataList[i].financingAmount}万元`);
await itemEnterpriseInfo.save();
}
......
/**
* 管委会移动端-企业管理
* 6.0新加功能
*/
import moment = require("moment");
import { ENTERPRISESYSTEMLABEL, FUHUASTATE, GUANWEIHUIMANANGENTERPRISELABEL, INDUSTRY, LABELGOAL, MOVEOUTTYPE } from "../../../config/enum";
import { findEnterpriseByUscc, findEnterpriseCount, findEnterpriseListToPage } from "../../../data/enterprise/enterprise";
......@@ -11,6 +16,11 @@ import { ERRORENUM } from "../../../config/errorEnum";
import { findFuHuaQiByUSCC, findFuHuaQiOperationNameMapByParam } from "../../../data/fuHuaQi/fuhuaqi";
/**
* 企业详情
* @param uscc
* @returns
*/
export async function enterpriseInfomation(uscc:string) {
let dbData = await findEnterpriseByUscc(uscc);
if (!dbData || !dbData.uscc) throw new BizError(ERRORENUM.该企业不存在, uscc);
......
/**
* 管委会移动端-孵化器管理
* 6.0版本更新
*/
import moment = require("moment");
import * as configEnum from "../../../config/enum";
import { findLabelLogByParam } from "../../../data/fuHuaQi/fuHuaQiLabelLog";
......@@ -9,7 +13,6 @@ import { changeEnumManyValue, changeEnumValue, eccEnumValue } from "../../../uti
import { findEnterpriseCount } from "../../../data/enterprise/enterprise";
/**
* 孵化器库-孵化器详情
* @param uscc
......
/**
* 管委会移动端 任务管理
* 6.0功能
*/
import moment = require("moment");
import { TASKTYPEENUM } from "../../../config/enum";
import { ERRORENUM } from "../../../config/errorEnum";
......@@ -8,6 +13,11 @@ import { findMonthTableList } from "../../../data/fuHuaQi/monthTask/monthTable";
import { distinctCycle, findTaskListByParam } from "../../../data/fuHuaQi/monthTask/task";
import { BizError } from "../../../util/bizError";
/**
* 已下发的任务月度集合
* @returns
*/
export async function taskMonthsList() {
let cycleList = await distinctCycle();
......@@ -25,6 +35,15 @@ export async function taskMonthsList() {
}
/**
* 任务列表
* @param submitType
* @param taskYear
* @param taskMonth
* @param name
* @param page
* @returns
*/
export async function taskList(submitType:number, taskYear:number, taskMonth:number, name:string, page:number) {
if (submitType<1 || submitType>3) throw new BizError(ERRORENUM.参数错误);
let fuHuaQiMap = {};
......
/**
* 管委会小程序端主页面
* 6.0功能
*/
import moment = require("moment");
......
/**
* 小程序端 管委会 用户基础功能
* 作者: lxm
* 主要包括有 孵化器账号的登录
* 预留好 重置密码 退出登录 接口
*/
......@@ -9,8 +8,6 @@ import { ERRORENUM } from "../../config/errorEnum";
import { findGuanWeiHuiUserInfoByLoginId } from "../../data/guanWeiHui/guanweihui";
import { BizError } from "../../util/bizError";
import { getPwdMd5, getToken } from "../../tools/system";
import { findFuHuaQiByUSCC } from "../../data/fuHuaQi/fuhuaqi";
const md5 = require("md5");
/**
* 登录
......
......@@ -6,7 +6,7 @@
import * as asyncHandler from 'express-async-handler';
import { checkGuanWeiHuiToken } from '../../middleware/user';
import { eccReqParamater } from '../../util/verificationParam';
import * as labelBiz from '../../biz/admin/label';
import * as labelBiz from '../../biz/admin/labelMGT';
import * as fuHuaQiLabelBiz from '../../biz/admin/fuHuaQi/fuHuaQiLabel';
import * as enterpriseLabelBiz from '../../biz/admin/enterprise/enterpriseLabel';
......
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