Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
12e1881e
Commit
12e1881e
authored
Feb 06, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
3a5f8ff1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
317 additions
and
162 deletions
+317
-162
fi-taxctl/app/base/api/api.base.js
+2
-1
fi-taxctl/app/base/api/impl/rpt/rptApi.js
+4
-3
fi-taxctl/app/base/db/models/rpt/positionmap.js
+65
-0
fi-taxctl/app/base/db/models/rpt/uploadbatch.js
+1
-1
fi-taxctl/app/base/service/impl/rpt/rpttypeSve.js
+67
-1
fi-taxctl/app/base/test2.js
+159
-156
fi-taxctl/app/base/utils/redisClient.js
+19
-0
No files found.
fi-taxctl/app/base/api/api.base.js
View file @
12e1881e
...
...
@@ -15,7 +15,8 @@ class APIBase extends DocBase {
"rpt.saveRptHistory"
,
"rpt.saveRpt"
,
"rpt.queryStatus"
,
"rpt.queryReport"
"rpt.queryReport"
,
"rpt.queryPosMap"
];
var
x
=
lst
.
indexOf
(
fullname
);
return
x
>=
0
;
...
...
fi-taxctl/app/base/api/impl/rpt/rptApi.js
View file @
12e1881e
...
...
@@ -80,7 +80,6 @@ class RptAPI extends APIBase{
var
x
=
await
this
.
rptService
.
queryStatus
(
pobj
);
return
system
.
getResult
(
x
);
}
async
queryReport
(
pobj
,
query
){
console
.
log
(
JSON
.
stringify
(
pobj
));
if
(
pobj
){
...
...
@@ -89,9 +88,11 @@ class RptAPI extends APIBase{
}
else
{
return
system
.
getResult
(
null
);
}
}
async
queryPosMap
(){
var
x
=
await
this
.
rptService
.
queryPosMap
();
return
system
.
getResult
(
x
);
}
exam
(){
return
"xxx"
;
}
...
...
fi-taxctl/app/base/db/models/rpt/positionmap.js
0 → 100644
View file @
12e1881e
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}]
// }
]
});
}
fi-taxctl/app/base/db/models/rpt/uploadbatch.js
View file @
12e1881e
...
...
@@ -5,7 +5,7 @@ module.exports = (db, DataTypes) => {
return
db
.
define
(
"uploadbatch"
,
{
userid
:{
type
:
DataTypes
.
STRING
,
allowNull
:
fals
e
,
allowNull
:
tru
e
,
},
companycode
:{
type
:
DataTypes
.
STRING
,
...
...
fi-taxctl/app/base/service/impl/rpt/rpttypeSve.js
View file @
12e1881e
...
...
@@ -7,6 +7,21 @@ class RptTypeService extends ServiceBase{
super
(
"rpt"
,
ServiceBase
.
getDaoName
(
RptTypeService
));
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
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
(){
await
this
.
redisClient
.
delete
(
"docurls"
);
...
...
@@ -28,7 +43,23 @@ class RptTypeService extends ServiceBase{
var
hisdata
=
hs
.
hisdata
;
var
rptdate
=
hs
.
rptdate
;
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
=>
{
var
pposition
=
md5
(
hd
.
desc
);
var
h
=
{
companycode
:
batch
.
companycode
,
companyname
:
batch
.
companyname
,
...
...
@@ -36,7 +67,7 @@ class RptTypeService extends ServiceBase{
batchdate
:
batch
.
batchdate
,
dateym
:
rptdate
,
rpttypecode
:
rptcode
,
position
:
md5
(
hd
.
position
)
,
position
:
pposition
,
valstr
:
hd
.
valstr
,
desc
:
hd
.
desc
,
uploadrpt_id
:
rptid
,
...
...
@@ -44,8 +75,42 @@ class RptTypeService extends ServiceBase{
nposition
:
hd
.
position
,
};
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
.
positionmap
.
bulkCreate
(
codeNewCache
,{
transaction
:
t
});
//每保存一次历史数据,就是处理完成一个任务中的一个报表
var
currentval
=
await
self
.
redisClient
.
decr
(
"batch"
+
batchid
);
console
.
log
(
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+
currentval
);
...
...
@@ -164,6 +229,7 @@ class RptTypeService extends ServiceBase{
await
this
.
redisClient
.
set
(
"batch"
+
batchtemp
.
id
,
lstspts
.
length
);
try
{
lstspts
.
forEach
(
async
(
rpt
)
=>
{
console
.
log
(
rpt
.
rpttypecode
);
await
this
.
redisClient
.
notifyConsume
(
"k8stask"
,
"docurls"
,
rpt
.
id
+
"~"
+
batchtemp
.
id
+
"~"
+
rpt
.
rptdate
+
"~"
+
rpt
.
rpttypecode
+
"~"
+
rpt
.
urlpath
);
});
}
catch
(
e
){
...
...
fi-taxctl/app/base/test2.js
View file @
12e1881e
class
TestBase
{
constructor
(){
this
.
apiDoc
=
{
group
:
"逻辑分组"
,
desc
:
"请对当前类进行描述"
,
exam
:
"概要示例"
,
methods
:[]
};
this
.
initClassDoc
();
}
initClassDoc
(){
throw
new
Error
(
`
请定义当前类的API文档,重写initClassDoc方法.
在initClassDoc方法中调用如下方法:
1.descClass(groupName,classDesc,exam)增加当前类的描述和使用示例
2.descMethod(methodName,paramName,paramType,defaultValue,paramDesc)增加方法的说明
`
);
}
descClass
(
groupName
,
classDesc
,
exam
){
this
.
group
=
groupName
;
this
.
apiDoc
.
desc
=
classDesc
;
this
.
apiDoc
.
exam
=
exam
;
}
descMethod
(
methodDesc
,
methodName
,
paramDesc
,
paramName
,
paramType
,
defaultValue
,
rtnTypeDesc
,
rtnType
){
var
mobj
=
this
.
apiDoc
.
methods
.
filter
((
m
)
=>
{
if
(
m
.
name
==
methodName
){
return
true
;
}
else
{
return
false
;
}
})[
0
];
var
param
=
{
pname
:
paramName
,
ptype
:
paramType
,
pdesc
:
paramDesc
,
pdefaultValue
:
defaultValue
,
};
if
(
mobj
!=
null
){
mobj
.
params
.
push
(
param
);
}
else
{
this
.
apiDoc
.
methods
.
push
(
{
methodDesc
:
methodDesc
?
methodDesc
:
""
,
name
:
methodName
,
params
:[
param
],
rtnTypeDesc
:
rtnTypeDesc
,
rtnType
:
rtnType
}
);
}
}
}
class
Test
extends
TestBase
{
constructor
(){
super
();
}
initClassDoc
(){
this
.
descClass
(
"class desc"
,
`
xxxxxx
xxxxx
xxxxxxxx
`
);
this
.
descMethod
(
"hello"
,{
pname
:
"pname1"
,
ptype
:
"int"
,
pdesc
:
"xccccc"
});
this
.
descMethod
(
"hello"
,{
pname
:
"pname2"
,
ptype
:
"str"
,
pdesc
:
"xccccyyyc"
});
}
}
class
Test2
extends
TestBase
{
constructor
(){
super
();
}
initClassDoc
(){
this
.
descClass
(
"class desc222222"
,
`
xxxxxx
xxxxx
xxxxxxxx
`
);
this
.
descMethod
(
"test2hello"
,{
pname
:
"pname1"
,
ptype
:
"int"
,
pdesc
:
"xccccc"
});
this
.
descMethod
(
"world"
,{
pname
:
"pname2"
,
ptype
:
"str"
,
pdesc
:
"xccccyyyc"
});
}
}
class
Test3
extends
TestBase
{
constructor
(){
super
();
}
}
module
.
exports
=
{
cls
:
Test
,
doc
:
new
Test
().
apiDoc
};
var
t1
=
new
Test
();
var
t2
=
new
Test2
();
console
.
log
(
t1
.
apiDoc
);
console
.
log
(
t2
.
apiDoc
);
技术总监
职位描述
岗位职责:
•
负责公司基础平台的设计开发
•
负责公司开发团队的建设
•
负责制定项目技术方案,负责系统的架构设计、优化,参与核心架构部分代码编写;
•
负责软件开发任务的需求分析、技术方案设计、开发计划制定,指导项目团队成员的日常开发工作、解决开发中的技术问题;
•
职位要求
•
财务软件开发经验者优先
•
8
年以上
Java
或
php
互联网开发经验,
5
年以上应用架构经验。
•
熟悉分布式存储、搜索、异步框架、集群与负载均衡,消息中间件等技术;
•
有大型分布式、高并发、高负载、高可用系统架构、设计、开发和调优经验;
•
熟悉各种常用设计模式,能将设计模式应用到日常工作。
•
熟悉至少一种较为常见的主流数据库及
SQL
语言,有一定的
sql
调优经验;熟悉
Linux
操作系统以及常用版本管理软件操作
(
如:
svn
,
git
)
。
var
x
=
isNaN
(
"2"
)
console
.
log
(
x
);
// class TestBase{
// constructor(){
// this.apiDoc={
// group:"逻辑分组",
// desc:"请对当前类进行描述",
// exam:"概要示例",
// methods:[]
// };
// this.initClassDoc();
// }
// initClassDoc(){
// throw new Error(`
// 请定义当前类的API文档,重写initClassDoc方法.
// 在initClassDoc方法中调用如下方法:
// 1.descClass(groupName,classDesc,exam)增加当前类的描述和使用示例
// 2.descMethod(methodName,paramName,paramType,defaultValue,paramDesc)增加方法的说明
// `);
// }
// descClass(groupName,classDesc,exam){
// this.group=groupName;
// this.apiDoc.desc=classDesc;
// this.apiDoc.exam=exam;
// }
// descMethod(methodDesc,methodName,paramDesc,paramName,paramType,defaultValue,rtnTypeDesc,rtnType){
// var mobj=this.apiDoc.methods.filter((m)=>{
// if(m.name==methodName){
// return true;
// }else{
// return false;
// }
// })[0];
// var param={
// pname:paramName,
// ptype:paramType,
// pdesc:paramDesc,
// pdefaultValue:defaultValue,
// };
// if(mobj!=null){
// mobj.params.push(param);
// }else{
// this.apiDoc.methods.push(
// {
// methodDesc:methodDesc?methodDesc:"",
// name:methodName,
// params:[param],
// rtnTypeDesc:rtnTypeDesc,
// rtnType:rtnType
// }
// );
// }
// }
// }
// class Test extends TestBase{
// constructor(){
// super();
// }
// initClassDoc(){
// this.descClass("class desc",`
// xxxxxx
// xxxxx
// xxxxxxxx
// `);
// this.descMethod("hello",{
// pname:"pname1",
// ptype:"int",
// pdesc:"xccccc"
// });
// this.descMethod("hello",{
// pname:"pname2",
// ptype:"str",
// pdesc:"xccccyyyc"
// });
// }
// }
// class Test2 extends TestBase{
// constructor(){
// super();
// }
// initClassDoc(){
// this.descClass("class desc222222",`
// xxxxxx
// xxxxx
// xxxxxxxx
// `);
// this.descMethod("test2hello",{
// pname:"pname1",
// ptype:"int",
// pdesc:"xccccc"
// });
// this.descMethod("world",{
// pname:"pname2",
// ptype:"str",
// pdesc:"xccccyyyc"
// });
// }
// }
// class Test3 extends TestBase{
// constructor(){
// super();
// }
// }
// module.exports={cls:Test,doc:new Test().apiDoc};
// var t1=new Test();
// var t2=new Test2();
// console.log(t1.apiDoc);
// console.log(t2.apiDoc);
// 技术总监 职位描述
// 岗位职责:
// • 负责公司基础平台的设计开发
// • 负责公司开发团队的建设
// • 负责制定项目技术方案,负责系统的架构设计、优化,参与核心架构部分代码编写;
// • 负责软件开发任务的需求分析、技术方案设计、开发计划制定,指导项目团队成员的日常开发工作、解决开发中的技术问题;
// • 职位要求
// • 财务软件开发经验者优先
// • 8年以上Java或php互联网开发经验,5年以上应用架构经验。
// • 熟悉分布式存储、搜索、异步框架、集群与负载均衡,消息中间件等技术;
// • 有大型分布式、高并发、高负载、高可用系统架构、设计、开发和调优经验;
// • 熟悉各种常用设计模式,能将设计模式应用到日常工作。
// • 熟悉至少一种较为常见的主流数据库及SQL语言,有一定的sql调优经验;熟悉Linux操作系统以及常用版本管理软件操作(如:svn,git)。
•
熟悉至少一种
nosql
数据库
//
• 熟悉至少一种nosql数据库
•
计算机相关专业本科以上学历。
//
• 计算机相关专业本科以上学历。
•
具有良好的沟通表达能力和团队协作能力。
//
• 具有良好的沟通表达能力和团队协作能力。
对标白兔
继续
//
对标白兔 继续
1
,目前没使用
2
,很少使用,
3
,使用中
//
1,目前没使用 2,很少使用,3,使用中
最后上传日期
2019.7
.
19
//
最后上传日期 2019.7.19
功能迁移到
IGIRL
,未产品化
//
功能迁移到IGIRL,未产品化
计税宝
注册用户
业务支持使用中
//
计税宝 注册用户 业务支持使用中
效果好,争取到了项目
//
效果好,争取到了项目
使用中,对外展示用
稳定
交易
流量接入
效果不错
//
使用中,对外展示用
//
稳定 交易
//
流量接入 效果不错
尹亚亭
//
尹亚亭
数据库设计
//
数据库设计
整合和运维各子系统
//
整合和运维各子系统
老系统商标导入蜂擎
//
老系统商标导入蜂擎
申洪蝉
知产接入
对接方案设计
//
申洪蝉
//
知产接入
//
对接方案设计
...
...
fi-taxctl/app/base/utils/redisClient.js
View file @
12e1881e
...
...
@@ -269,3 +269,21 @@ module.exports = RedisClient;
// });
// },3000);
// });
//
//还要构造一个列表,存储新加入编码的数据列表
//程序启动后查询出编码表(按照位置升序),构造两个内存字典
//字典0:记录每类报表最后一个编码坐标值--key报表编码,值是位置
//字典1:key是报表编码+位置 value 是 汉字坐标编码---方便兼容以前公式查询使用
//字典2 : key是汉字编码, value是 报表编码+位置---------方便检查是否需要新增编码行
//如果上传数据不存在,那么需要新增编码行,需要按照报表编码最后编码进行数字转换
//判断是否数字字符串,如果不是,那么设置1,如果是则取值后加1
//构造新的编码数据,添加到新增列表,保存新的编码
//新增历史时候,按照报表编码
//按照报表类型 、位置 查询出 编码
//rpttype pos code desc
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment