Commit 903b4863 by lixinming

修改引用

parent ebd69d4f
......@@ -7,7 +7,7 @@
import { ERRORENUM } from "../../config/errorEnum";
import { BizError } from "../../util/bizError";
import * as monthData from "../../data/fuHuaQi/monthTable";
import { changeEnumValue, extractData, getTaskId } from "../../util/tools";
import { extractData, getTaskId } from "../../util/tools";
import { findAllFuHuaQiOperationNameMap } from "../../data/fuHuaQi/fuhuaqi";
import { MonthConfig } from "../../config/ojbectResultKeyConfig";
import { OUTPUTTYPE } from "../../config/enum";
......
......@@ -11,8 +11,8 @@ import { ERRORENUM } from "../../config/errorEnum";
import { findEnterpriseListByTaskId, updateEnterpriseDraftLock } from "../../data/enterprise/enterprise";
import { findFinancingListByTaskId, updateFinancingDraftLock } from "../../data/enterprise/financing";
import { findAllFuHuaQi } from "../../data/fuHuaQi/fuhuaqi";
import { createMonthTableToList, findMonthTableByTaskId, findmonthTableListByTaskId } from "../../data/fuHuaQi/monthTable";
import { findEnterpriseByTaskIdAndType, createTaskToList, findFuHuaQiTaskByTaskId, findTaskCountByKey } from "../../data/fuHuaQi/task";
import * as monthTableData from "../../data/fuHuaQi/monthTable";
import * as taskData from "../../data/fuHuaQi/task";
import { BizError } from "../../util/bizError";
import { logHandle } from "../../util/log";
import { getTaskId, getTimeKey } from "../../util/tools";
......@@ -28,7 +28,7 @@ export async function fuHuaQiTaskList(uscc:string) {
let result = [];
const TaskId = getTaskId(uscc);
let taskMap = await findFuHuaQiTaskByTaskId(TaskId);
let taskMap = await taskData.findFuHuaQiTaskByTaskId(TaskId);
// let taskTypeMapConf = {};
for (let key in TASKTYPEENUM) {
......@@ -45,7 +45,7 @@ export async function fuHuaQiTaskList(uscc:string) {
let dataList = [];
switch(keyNumber) {
case TASKTYPEENUM.孵化器月度填报: dataList = await findmonthTableListByTaskId(TaskId); break;
case TASKTYPEENUM.孵化器月度填报: dataList = await monthTableData.findmonthTableListByTaskId(TaskId); break;
case TASKTYPEENUM.新注册或迁入企业登记:
dataList = await findEnterpriseListByTaskId(TaskId);
dataList.forEach(item => {
......@@ -77,14 +77,14 @@ export async function fuHuaQiTaskList(uscc:string) {
*/
export async function checkTask(uscc:string, taskType:number) {
const TaskId = getTaskId(uscc);
let taskInfo = await findEnterpriseByTaskIdAndType(TaskId, taskType);
let taskInfo = await taskData.findEnterpriseByTaskIdAndType(TaskId, taskType);
if (!taskInfo) throw new BizError(ERRORENUM.任务不存在, uscc, TaskId);
if ( taskInfo.isSubmit ) throw new BizError(ERRORENUM.不能重复提交任务, uscc, taskType);
switch (taskType) {
case TASKTYPEENUM.孵化器月度填报:
let monthTableInfo = await findMonthTableByTaskId(TaskId);
let monthTableInfo = await monthTableData.findMonthTableByTaskId(TaskId);
if (!monthTableInfo.isUpdate) throw new BizError(ERRORENUM.该报表需要填写本月内容后提交, uscc, taskType);
if ( monthTableInfo.draftLock ) throw new BizError(ERRORENUM.不能重复提交任务, uscc, taskType, '月度表lock = true');
......@@ -118,7 +118,7 @@ export async function checkTask(uscc:string, taskType:number) {
*/
export async function provideTask() {
const TimeKey = getTimeKey();
let taskCount = await findTaskCountByKey(TimeKey);
let taskCount = await taskData.findTaskCountByKey(TimeKey);
if (taskCount) {}//todo 重复创建了任务
let fuHuaQiList = await findAllFuHuaQi();
......@@ -166,10 +166,10 @@ export async function provideTask() {
try {
await createTaskToList(addList);
await taskData.createTaskToList(addList);
/**添加月度填报表 */
await createMonthTableToList(monthList);
await monthTableData.createMonthTableToList(monthList);
logHandle(`添加了${addList.length}`);
} catch (err) {
//todo添加异常了
......
......@@ -9,7 +9,7 @@ import { ERRORENUM } from "../../config/errorEnum";
import { FuHuaQiListConfig } from "../../config/ojbectResultKeyConfig";
import * as fuhuaqiData from "../../data/fuHuaQi/fuhuaqi"
import { BizError } from "../../util/bizError";
import { checkChange, checkParamater, extractData, getPwdMd5, getToken } from "../../util/tools";
import * as tools from "../../util/tools";
/**
......@@ -23,10 +23,10 @@ export async function login(uscc:string, pwd:string) {
let fuhuaqiInfo = await fuhuaqiData.findFuHuaQiByUSCC(uscc);
if(!fuhuaqiInfo) throw new BizError(ERRORENUM.账号不存在);
let checkPwd = getPwdMd5(fuhuaqiInfo.uscc, pwd);
let checkPwd = tools.getPwdMd5(fuhuaqiInfo.uscc, pwd);
if (fuhuaqiInfo.pwd != checkPwd) throw new BizError(ERRORENUM.密码错误);
const Token = getToken(uscc);
const Token = tools.getToken(uscc);
let fuhuaqiUserInfo = {
uscc: fuhuaqiInfo.uscc,
......@@ -56,7 +56,7 @@ export async function firstLoginChangePwd(uscc:string, pwd:string, confirmPwd:st
let dataBaseInfo = await fuhuaqiData.findFuHuaQiByUSCC(uscc);
if (dataBaseInfo.firstLoginIsChangePwd) throw new BizError(ERRORENUM.不能重复修改密码, `重复调用了首次登录之后的修改密码接口${uscc}`);
//todo 校验密码
dataBaseInfo.pwd = getPwdMd5(uscc, pwd);
dataBaseInfo.pwd = tools.getPwdMd5(uscc, pwd);
dataBaseInfo.firstLoginIsChangePwd = true;
await dataBaseInfo.save();
......@@ -82,9 +82,9 @@ export async function changePassword(uscc:string, pwd:string, newPwd:string) {
}
let fuhuaqiInfo = await fuhuaqiData.findFuHuaQiByUSCC(uscc);
if (!fuhuaqiInfo) throw new BizError(ERRORENUM.未找到数据);
let checkPwd = getPwdMd5(fuhuaqiInfo.uscc, pwd);
let checkPwd = tools.getPwdMd5(fuhuaqiInfo.uscc, pwd);
if (fuhuaqiInfo.pwd != checkPwd) throw new BizError(ERRORENUM.密码错误);
fuhuaqiInfo.pwd = getPwdMd5(uscc, newPwd);
fuhuaqiInfo.pwd = tools.getPwdMd5(uscc, newPwd);
await fuhuaqiInfo.save();
return {isSuccess:true};
......@@ -127,7 +127,7 @@ export async function logout(uscc:string){
let count = await fuhuaqiData.findFuHuaQiUserCount(selectParam);
let dataList = [];
dataBaseList.forEach( info => {
let changeData = extractData(FuHuaQiListConfig, info, true);
let changeData = tools.extractData(FuHuaQiListConfig, info, true);
const Count = enterpriseMap[info.uscc] || 0;
dataList.push(changeData);
});
......@@ -161,7 +161,7 @@ export async function updateState(uscc:string, userState:boolean) {
* @returns
*/
export async function addUser(param) {
checkParamater("新增孵化器账号信息", FuHuaQiUserConfig, param);//校验表单参数
tools.checkParamater("新增孵化器账号信息", FuHuaQiUserConfig, param);//校验表单参数
let fuhuaqiInfo = await fuhuaqiData.findFuHuaQiByUSCC(param.uscc);
......
......@@ -190,7 +190,11 @@ export async function findEnterpriseListByFuHuaQiUsccName(fuHuaQiUscc:string) {
}
export async function 查询所有已绑定过的孵化器id() {
/**
* 查询所有已绑定过的孵化器id
* @returns [孵化器id]
*/
export async function findAllBindFuHuaQi() {
return await enterpriseModel.distinct('fuHuaQiUscc');
}
......
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