Commit 6786ebc6 by lixinming

修bug

parent 23b1b9f7
......@@ -4,9 +4,9 @@
*/
import moment = require("moment");
import { ENTERPRISETEAM, FUHUASTATE, INDUSTRY, MOVEOUTTYPE, STATEENUM } from "../../../../config/enum";
import { FUHUASTATE, INDUSTRY, MOVEOUTTYPE } from "../../../../config/enum";
import { ENTERPRISENODEENUM, FUHUAQINODEENUM, POINTTYPEENUM } from "../../../../config/pointConfig";
import { findEnterpriseCount, findEnterpriseCountByFuHuaQiUscc, findEnterpriseList } from "../../../../data/enterprise/enterprise";
import { findEnterpriseCount, findEnterpriseList } from "../../../../data/enterprise/enterprise";
import { findMonthTableList } from "../../../../data/fuHuaQi/monthTask/monthTable";
import { getPointDataByParam } from "../../../point";
import { findBusinessDataByParam } from "../../../../data/fuHuaQi/quarterTask/businessData";
......@@ -21,7 +21,7 @@ export async function fuHuaQiOperateStats(uscc:string, year:number) {
let selectParam = {
state : {"$ne":FUHUASTATE.迁出},
fuHuaQiUscc : uscc,
fuHuaQiUscc: uscc,
"$or":[{"$and":[{"draftLock":true}, {"taskId":{"$ne":null}}]}, {"$and":[{"draftLock":false}, {"taskId":null}]}]//未提交的企业不能查看
};
let enterpriseTotal = await findEnterpriseCount(selectParam); //非迁出企业总数
......
......@@ -48,8 +48,8 @@ export async function bussinessAnomaly(page:number) {
warnList.push({name:info._id, bcos:"多次填报为0"});
});
let dataList = warnList.splice((page-1)*5, page*5);
let count = warnList.length;
let dataList = warnList.splice((page-1)*5, page*5);
let pageCount = Math.ceil(count/5);
return {count, pageCount, dataList};
......@@ -108,8 +108,8 @@ export async function enterpriseTXPAnomaly(page:number) {
warnList.push({name:info._id, bcos:"多次填报为0"});
});
let dataList = warnList.splice((page-1)*5, page*5);
let count = warnList.length;
let dataList = warnList.splice((page-1)*5, page*5);
let pageCount = Math.ceil(count/5);
return {count, pageCount, dataList};
......@@ -151,8 +151,8 @@ export async function teamAnomaly(page:number) {
rankList.push({name:info.name, count:0, bcos:"填报为0" });
});
let dataList = rankList.splice((page-1)*5, page*5);
let count = rankList.length;
let dataList = rankList.splice((page-1)*5, page*5);
let pageCount = Math.ceil(count/5);
return {count, pageCount, dataList};
......
......@@ -60,7 +60,7 @@ export async function fuHuaQiWarningOverView() {
let lowReportingRate = rankList.slice(0,5)//低填报率
let revenueAnomalyCount = await getRevenueAnomalyCount(fuHuaQiNameMap); //营收异常
let revenueAnomalyCount = await getRevenueAnomalyCount(); //营收异常
let fuHuaQiTPAnomalyCount = await getFuHuaQiTPAnomalyCount(fuHuaQiNameMap);
let teamAnomalyCount = await getTeamAnomalyCount(fuHuaQiNameMap);
......@@ -111,14 +111,14 @@ export async function revenueAnomaly(page:number) {
}
});
let dataList = checkList.splice((page-1)*5, 5);
let count = checkList.length;
let dataList = checkList.splice((page-1)*5, 5);
let pageCount = Math.ceil(count/5);
return {dataList, count, pageCount};
}
async function getRevenueAnomalyCount(fuHuaQiNameMap) {
async function getRevenueAnomalyCount() {
let fuHuaQiAcreList = await findFuHuaQiFilesDataByParam({}, {hatchingGround:1, incubatedAcreage:1, uscc:1});
let expMap = {};//目标值
......@@ -144,10 +144,8 @@ async function getRevenueAnomalyCount(fuHuaQiNameMap) {
let max = Math.round( expCount + (expCount * 0.3) );
let min = Math.round( expCount - (expCount * 0.3) );
let name = fuHuaQiNameMap[fuHuaQiUscc];
if (RR > max || RR < min) {
count += 1;
count = count+ 1;
}
});
......@@ -194,8 +192,8 @@ export async function fuHuaQiTPAnomaly(page:number) {
let checkList = Object.values(dataMap);
let dataList = checkList.splice((page-1)*5, 5);
let count = checkList.length;
let dataList = checkList.splice((page-1)*5, 5);
let pageCount = Math.ceil(count/5);
return {dataList, count, pageCount};
......@@ -253,8 +251,8 @@ export async function teamAnomaly(page:number) {
if (memberCount < enterpriseCount) checkList.push({uscc, name, enterpriseCount, memberCount});
}
let dataList = checkList.splice((page-1)*5, 5);
let count = checkList.length;
let dataList = checkList.splice((page-1)*5, 5);
let pageCount = Math.ceil(count/5);
return {count, pageCount, dataList};
......
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