Commit 12e1881e by 蒋勇

d

parent 3a5f8ff1
...@@ -15,7 +15,8 @@ class APIBase extends DocBase { ...@@ -15,7 +15,8 @@ class APIBase extends DocBase {
"rpt.saveRptHistory", "rpt.saveRptHistory",
"rpt.saveRpt", "rpt.saveRpt",
"rpt.queryStatus", "rpt.queryStatus",
"rpt.queryReport" "rpt.queryReport",
"rpt.queryPosMap"
]; ];
var x = lst.indexOf(fullname); var x = lst.indexOf(fullname);
return x >= 0; return x >= 0;
......
...@@ -80,18 +80,19 @@ class RptAPI extends APIBase{ ...@@ -80,18 +80,19 @@ class RptAPI extends APIBase{
var x=await this.rptService.queryStatus(pobj); var x=await this.rptService.queryStatus(pobj);
return system.getResult(x); return system.getResult(x);
} }
async queryReport(pobj,query){ async queryReport(pobj,query){
console.log(JSON.stringify(pobj)); console.log(JSON.stringify(pobj));
if(pobj){ if(pobj){
var x=await this.rptService.queryReport(pobj.batchid); var x=await this.rptService.queryReport(pobj.batchid);
return system.getResult(x);
}else{
return system.getResult(null);
}
}
async queryPosMap(){
var x=await this.rptService.queryPosMap();
return system.getResult(x); return system.getResult(x);
}else{
return system.getResult(null);
} }
}
exam(){ exam(){
return "xxx"; return "xxx";
} }
......
const system=require("../../../system");
const settings=require("../../../../config/settings");
const uiconfig=system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("positionmap", {
rpttypecode: {
type:DataTypes.STRING,
allowNull: false,
},
nposition:{
type:DataTypes.STRING,
allowNull: false
},
position:{
type:DataTypes.STRING,
allowNull: false
},
desc:{
type:DataTypes.STRING,
allowNull: false
},
},{
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'pos_map',
validate: {
},
indexes:[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
...@@ -5,7 +5,7 @@ module.exports = (db, DataTypes) => { ...@@ -5,7 +5,7 @@ module.exports = (db, DataTypes) => {
return db.define("uploadbatch", { return db.define("uploadbatch", {
userid:{ userid:{
type:DataTypes.STRING, type:DataTypes.STRING,
allowNull: false, allowNull: true,
}, },
companycode:{ companycode:{
type:DataTypes.STRING, type:DataTypes.STRING,
......
...@@ -7,6 +7,21 @@ class RptTypeService extends ServiceBase{ ...@@ -7,6 +7,21 @@ class RptTypeService extends ServiceBase{
super("rpt",ServiceBase.getDaoName(RptTypeService)); super("rpt",ServiceBase.getDaoName(RptTypeService));
this.redisClient=system.getObject("util.redisClient"); this.redisClient=system.getObject("util.redisClient");
this.cacheBatchId={}; this.cacheBatchId={};
this.countMap={};//按照报表类型编码顺序号计数
this.posMap={};//位置映射编码--兼容初始公式
this.codeMap={};//编码映射位置,检查是否是否需要新增编码
}
async queryPosMap(){
if(Object.keys(this.posMap).length==0){
var codes=await this.db.models.positionmap.findAll({
attributes:['rpttypecode','nposition','desc','position'],
order:[["nposition","ASC"]]
});
return system.getResult(codes);
}
return this.posMap;
} }
async deleteUrlsCache(){ async deleteUrlsCache(){
await this.redisClient.delete("docurls"); await this.redisClient.delete("docurls");
...@@ -28,7 +43,23 @@ class RptTypeService extends ServiceBase{ ...@@ -28,7 +43,23 @@ class RptTypeService extends ServiceBase{
var hisdata=hs.hisdata; var hisdata=hs.hisdata;
var rptdate=hs.rptdate; var rptdate=hs.rptdate;
var rptcode=hs.rptcode; var rptcode=hs.rptcode;
//查询编码表构造缓存
var codeNewCache=[];
if(Object.keys(this.countMap).length==0){
var codes=await this.db.models.positionmap.findAll({
order:[["nposition","ASC"]]
});
codes.forEach((codeitem)=>{
this.countMap[codeitem.rpttypecode]=codeitem.nposition;
this.posMap[codeitem.rpttypecode+"~"+codeitem.nposition]=codeitem.position;
this.codeMap[codeitem.position]=codeitem.rpttypecode+"~"+codeitem.nposition;
});
}
hisdata.forEach(hd=>{ hisdata.forEach(hd=>{
var pposition=md5(hd.desc);
var h={ var h={
companycode:batch.companycode, companycode:batch.companycode,
companyname:batch.companyname, companyname:batch.companyname,
...@@ -36,7 +67,7 @@ class RptTypeService extends ServiceBase{ ...@@ -36,7 +67,7 @@ class RptTypeService extends ServiceBase{
batchdate:batch.batchdate, batchdate:batch.batchdate,
dateym:rptdate, dateym:rptdate,
rpttypecode:rptcode, rpttypecode:rptcode,
position:md5(hd.position), position:pposition,
valstr:hd.valstr, valstr:hd.valstr,
desc:hd.desc, desc:hd.desc,
uploadrpt_id:rptid, uploadrpt_id:rptid,
...@@ -44,8 +75,42 @@ class RptTypeService extends ServiceBase{ ...@@ -44,8 +75,42 @@ class RptTypeService extends ServiceBase{
nposition:hd.position, nposition:hd.position,
}; };
hisarray.push(h); hisarray.push(h);
//检查是否存在于编码表中
if(!this.codeMap[pposition]){
var rptcodetmp="";
if(rptcode.indexOf("_N")>=0){
rptcodetmp=rptcode.replace("_N","");
}else{
rptcodetmp=rptcode;
}
//检查当前坐标是否存在于字典,解决后期插入新的行问题
var pos=hd.position;
if(this.posMap[rptcodetmp]){//如果已经存在
//需要设置新的位置坐标,先从计数中取最后编码
var lastNum=this.countMap[rptcodetmp];
var nis=isNaN(lastNum);
if(nis){
lastNum="1";
}else{
lastNum=Number(lastNum)+1;
}
pos=lastNum+"";
}
this.codeMap[pposition]=rptcodetmp+"~"+pos;
this.posMap[rptcodetmp+"~"+pos]=pposition;
this.countMap[rptcodetmp]=pos;
var codetemp={
rpttypecode:rptcodetmp,
nposition:pos,
position:pposition,
desc:hd.desc
}
codeNewCache.push(codetemp);
}
}); });
await self.db.models.rpthistory.bulkCreate(hisarray,{transaction:t}); await self.db.models.rpthistory.bulkCreate(hisarray,{transaction:t});
await self.db.models.positionmap.bulkCreate(codeNewCache,{transaction:t});
//每保存一次历史数据,就是处理完成一个任务中的一个报表 //每保存一次历史数据,就是处理完成一个任务中的一个报表
var currentval= await self.redisClient.decr("batch"+batchid); var currentval= await self.redisClient.decr("batch"+batchid);
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+currentval); console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+currentval);
...@@ -164,6 +229,7 @@ class RptTypeService extends ServiceBase{ ...@@ -164,6 +229,7 @@ class RptTypeService extends ServiceBase{
await this.redisClient.set("batch"+batchtemp.id,lstspts.length); await this.redisClient.set("batch"+batchtemp.id,lstspts.length);
try{ try{
lstspts.forEach(async (rpt)=>{ lstspts.forEach(async (rpt)=>{
console.log(rpt.rpttypecode);
await this.redisClient.notifyConsume("k8stask","docurls",rpt.id+"~"+batchtemp.id+"~"+rpt.rptdate+"~"+rpt.rpttypecode+"~"+rpt.urlpath); await this.redisClient.notifyConsume("k8stask","docurls",rpt.id+"~"+batchtemp.id+"~"+rpt.rptdate+"~"+rpt.rpttypecode+"~"+rpt.urlpath);
}); });
}catch(e){ }catch(e){
......
class TestBase{ var x=isNaN("2")
constructor(){ console.log(x);
this.apiDoc={
group:"逻辑分组", // class TestBase{
desc:"请对当前类进行描述", // constructor(){
exam:"概要示例", // this.apiDoc={
methods:[] // group:"逻辑分组",
}; // desc:"请对当前类进行描述",
this.initClassDoc(); // exam:"概要示例",
} // methods:[]
initClassDoc(){ // };
throw new Error(` // this.initClassDoc();
请定义当前类的API文档,重写initClassDoc方法. // }
在initClassDoc方法中调用如下方法: // initClassDoc(){
1.descClass(groupName,classDesc,exam)增加当前类的描述和使用示例 // throw new Error(`
2.descMethod(methodName,paramName,paramType,defaultValue,paramDesc)增加方法的说明 // 请定义当前类的API文档,重写initClassDoc方法.
`); // 在initClassDoc方法中调用如下方法:
} // 1.descClass(groupName,classDesc,exam)增加当前类的描述和使用示例
descClass(groupName,classDesc,exam){ // 2.descMethod(methodName,paramName,paramType,defaultValue,paramDesc)增加方法的说明
this.group=groupName; // `);
this.apiDoc.desc=classDesc; // }
this.apiDoc.exam=exam; // descClass(groupName,classDesc,exam){
} // this.group=groupName;
descMethod(methodDesc,methodName,paramDesc,paramName,paramType,defaultValue,rtnTypeDesc,rtnType){ // this.apiDoc.desc=classDesc;
var mobj=this.apiDoc.methods.filter((m)=>{ // this.apiDoc.exam=exam;
if(m.name==methodName){ // }
return true; // descMethod(methodDesc,methodName,paramDesc,paramName,paramType,defaultValue,rtnTypeDesc,rtnType){
}else{ // var mobj=this.apiDoc.methods.filter((m)=>{
return false; // if(m.name==methodName){
} // return true;
})[0]; // }else{
var param={ // return false;
pname:paramName, // }
ptype:paramType, // })[0];
pdesc:paramDesc, // var param={
pdefaultValue:defaultValue, // pname:paramName,
}; // ptype:paramType,
if(mobj!=null){ // pdesc:paramDesc,
mobj.params.push(param); // pdefaultValue:defaultValue,
}else{ // };
this.apiDoc.methods.push( // if(mobj!=null){
{ // mobj.params.push(param);
methodDesc:methodDesc?methodDesc:"", // }else{
name:methodName, // this.apiDoc.methods.push(
params:[param], // {
rtnTypeDesc:rtnTypeDesc, // methodDesc:methodDesc?methodDesc:"",
rtnType:rtnType // name:methodName,
} // params:[param],
); // rtnTypeDesc:rtnTypeDesc,
} // rtnType:rtnType
} // }
} // );
// }
// }
class Test extends TestBase{ // }
constructor(){
super();
} // class Test extends TestBase{
initClassDoc(){ // constructor(){
this.descClass("class desc",` // super();
xxxxxx // }
xxxxx // initClassDoc(){
xxxxxxxx // this.descClass("class desc",`
`); // xxxxxx
this.descMethod("hello",{ // xxxxx
pname:"pname1", // xxxxxxxx
ptype:"int", // `);
pdesc:"xccccc" // this.descMethod("hello",{
}); // pname:"pname1",
this.descMethod("hello",{ // ptype:"int",
pname:"pname2", // pdesc:"xccccc"
ptype:"str", // });
pdesc:"xccccyyyc" // this.descMethod("hello",{
}); // pname:"pname2",
} // ptype:"str",
} // pdesc:"xccccyyyc"
class Test2 extends TestBase{ // });
constructor(){ // }
super(); // }
} // class Test2 extends TestBase{
initClassDoc(){ // constructor(){
this.descClass("class desc222222",` // super();
xxxxxx // }
xxxxx // initClassDoc(){
xxxxxxxx // this.descClass("class desc222222",`
`); // xxxxxx
this.descMethod("test2hello",{ // xxxxx
pname:"pname1", // xxxxxxxx
ptype:"int", // `);
pdesc:"xccccc" // this.descMethod("test2hello",{
}); // pname:"pname1",
this.descMethod("world",{ // ptype:"int",
pname:"pname2", // pdesc:"xccccc"
ptype:"str", // });
pdesc:"xccccyyyc" // this.descMethod("world",{
}); // pname:"pname2",
} // ptype:"str",
} // pdesc:"xccccyyyc"
class Test3 extends TestBase{ // });
constructor(){ // }
super(); // }
} // class Test3 extends TestBase{
} // constructor(){
module.exports={cls:Test,doc:new Test().apiDoc}; // super();
var t1=new Test(); // }
var t2=new Test2(); // }
// module.exports={cls:Test,doc:new Test().apiDoc};
console.log(t1.apiDoc); // var t1=new Test();
console.log(t2.apiDoc); // var t2=new Test2();
// console.log(t1.apiDoc);
// console.log(t2.apiDoc);
技术总监 职位描述
岗位职责:
// 技术总监 职位描述
负责公司基础平台的设计开发
// 岗位职责:
负责公司开发团队的建设
// • 负责公司基础平台的设计开发
负责制定项目技术方案,负责系统的架构设计、优化,参与核心架构部分代码编写;
// • 负责公司开发团队的建设
负责软件开发任务的需求分析、技术方案设计、开发计划制定,指导项目团队成员的日常开发工作、解决开发中的技术问题;
// • 负责制定项目技术方案,负责系统的架构设计、优化,参与核心架构部分代码编写;
职位要求
// • 负责软件开发任务的需求分析、技术方案设计、开发计划制定,指导项目团队成员的日常开发工作、解决开发中的技术问题;
财务软件开发经验者优先
// • 职位要求
8年以上Javaphp互联网开发经验,5年以上应用架构经验。
// • 财务软件开发经验者优先
熟悉分布式存储、搜索、异步框架、集群与负载均衡,消息中间件等技术;
// • 8年以上Java或php互联网开发经验,5年以上应用架构经验。
有大型分布式、高并发、高负载、高可用系统架构、设计、开发和调优经验;
// • 熟悉分布式存储、搜索、异步框架、集群与负载均衡,消息中间件等技术;
熟悉各种常用设计模式,能将设计模式应用到日常工作。
// • 有大型分布式、高并发、高负载、高可用系统架构、设计、开发和调优经验;
熟悉至少一种较为常见的主流数据库及SQL语言,有一定的sql调优经验;熟悉Linux操作系统以及常用版本管理软件操作(如:svn,git)
// • 熟悉各种常用设计模式,能将设计模式应用到日常工作。
// • 熟悉至少一种较为常见的主流数据库及SQL语言,有一定的sql调优经验;熟悉Linux操作系统以及常用版本管理软件操作(如:svn,git)。
熟悉至少一种nosql数据库 // • 熟悉至少一种nosql数据库
计算机相关专业本科以上学历。 // • 计算机相关专业本科以上学历。
具有良好的沟通表达能力和团队协作能力。 // • 具有良好的沟通表达能力和团队协作能力。
对标白兔 继续 // 对标白兔 继续
1,目前没使用 2,很少使用,3,使用中 // 1,目前没使用 2,很少使用,3,使用中
最后上传日期 2019.7.19 // 最后上传日期 2019.7.19
功能迁移到IGIRL,未产品化 // 功能迁移到IGIRL,未产品化
计税宝 注册用户 业务支持使用中 // 计税宝 注册用户 业务支持使用中
效果好,争取到了项目 // 效果好,争取到了项目
使用中,对外展示用 // 使用中,对外展示用
稳定 交易 // 稳定 交易
流量接入 效果不错 // 流量接入 效果不错
尹亚亭 // 尹亚亭
数据库设计 // 数据库设计
整合和运维各子系统 // 整合和运维各子系统
老系统商标导入蜂擎 // 老系统商标导入蜂擎
申洪蝉 // 申洪蝉
知产接入 // 知产接入
对接方案设计 // 对接方案设计
......
...@@ -269,3 +269,21 @@ module.exports = RedisClient; ...@@ -269,3 +269,21 @@ module.exports = RedisClient;
// }); // });
// },3000); // },3000);
// }); // });
//
//还要构造一个列表,存储新加入编码的数据列表
//程序启动后查询出编码表(按照位置升序),构造两个内存字典
//字典0:记录每类报表最后一个编码坐标值--key报表编码,值是位置
//字典1:key是报表编码+位置 value 是 汉字坐标编码---方便兼容以前公式查询使用
//字典2 : key是汉字编码, value是 报表编码+位置---------方便检查是否需要新增编码行
//如果上传数据不存在,那么需要新增编码行,需要按照报表编码最后编码进行数字转换
//判断是否数字字符串,如果不是,那么设置1,如果是则取值后加1
//构造新的编码数据,添加到新增列表,保存新的编码
//新增历史时候,按照报表编码
//按照报表类型 、位置 查询出 编码
//rpttype pos code desc
\ No newline at end of file
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