Commit 027abf0f by 蒋勇

d

parent db48f873
......@@ -66,9 +66,10 @@ class RptAPI extends APIBase{
return system.getResult(x);
}
async saveRptHistory(pobj,query){
console.log(JSON.stringify(pobj));
var x=await this.rptService.saveRptHistory(pobj);
return system.getResult(x);
pobj.forEach(async (hs)=>{
await this.rptService.saveRptHistory(hs);
});
return system.getResult({});
}
async queryStatus(pobj,query){
console.log(JSON.stringify(pobj));
......
......@@ -5,6 +5,7 @@ class RptTypeService extends ServiceBase{
constructor(){
super("rpt",ServiceBase.getDaoName(RptTypeService));
this.redisClient=system.getObject("util.redisClient");
this.cacheBatchId={};
}
async saveRptHistory(hs){
var self=this;
......@@ -12,7 +13,13 @@ class RptTypeService extends ServiceBase{
var hisarray=[];
var rptid=hs.rptid;
var batchid=hs.batchid;
var batch=await this.db.models.uploadbatch.findById(batchid);
var batch=null;
if(!this.cacheBatchId[batchid]){
batch=await this.db.models.uploadbatch.findOne({where:{id:batchid},transaction:t});
this.cacheBatchId[batchid]=batch;
}else{
batch=this.cacheBatchId[batchid];
}
var hisdata=hs.hisdata;
var rptdate=hs.rptdate;
var rptcode=hs.rptcode;
......@@ -51,7 +58,7 @@ class RptTypeService extends ServiceBase{
self.redisClient.delete("batch"+batchid);
//改变批的状态为解析完毕
batch.batchstatuscode="calc";
batch.save();
await batch.save({transaction:t});
}
return {};
});
......
......@@ -3,7 +3,7 @@ var settings={
host: "43.247.184.32",
port: 8967,
password: "Gongsibao2018",
db: 2,
db: 15,
},
database: {
dbname: "fktaxctl",
......@@ -21,10 +21,8 @@ var settings={
idle: 1000000
},
debug: false,
dialectOptions: {
requestTimeout: 999999,
// instanceName:'DEV'
} //设置MSSQL超时时间
logging:false
}
},
reqEsDevUrl:"http://192.168.4.249:9200/",
......
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