Commit 5446414b by 蒋勇

d

parent 668ba7b9
......@@ -18,6 +18,7 @@ class APIBase extends DocBase {
"rpt.queryStatus2",
"rpt.queryReport",
"rpt.buildWordReport",
"rpt.resultJson",
"rpt.queryPosMap",
"rpt.updateTaskRptUrl"
];
......
......@@ -94,6 +94,15 @@ class RptAPI extends APIBase{
return system.getResult(null);
}
}
async resultJson(pobj,query){
if(pobj){
var x=await this.rptService.resultJson(pobj.batchid);
return system.getResult(x);
}else{
return system.getResult(null);
}
}
async buildWordReport(pobj,query){
if(pobj){
var x=await this.rptService.buildWordReport(pobj.batchid);
......
......@@ -185,6 +185,33 @@ class RptTypeService extends ServiceBase{
await this.db.models.uploadbatch.update({"wordrpturl":upinfo.rptUrl},{ where: { id: upinfo.batchid }});
return {};
}
//返回
async resultJson(batchid){
var batch=await this.db.models.uploadbatch.findById(batchid);
var rs=await this.db.models.result.findAll({where:{"BatchNo":batchid},attributes:["indexName","status"],raw:true});
var tmp={};
var arrayfi=[];
rs.forEach((item=>{
if(item.biztype=="ri"){
tmp[item.indexName]=Number(item.status);
}else{
var tmp2={};
tmp2[item.indexName]=item.status;
arrayfi.push(tmp2);
}
}));
var paramto={
"Detection_zone":batch.batchdate,
"CreatTime":batch.updated_at,
"company_name":batch.companyname,
"Task_Num":batch.id,
"fi":arrayfi,
"ri":tmp,
}
//修改
return paramto;
}
//让黄静调用一下
async buildWordReport(batchid){
var batch=await this.db.models.uploadbatch.findById(batchid);
......
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