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
5f2dba7b
Commit
5f2dba7b
authored
Jun 24, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-manage' of gitlab.gongsibao.com:jiangyong/zhichan into center-manage
parents
142336d7
5b33f505
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
351 additions
and
10 deletions
+351
-10
center-manage/app/base/controller/impl/common/articleCtl.js
+14
-0
center-manage/app/base/controller/impl/common/treearchCtl.js
+10
-2
center-manage/app/base/db/impl/common/articleDao.js
+29
-0
center-manage/app/base/db/models/common/article.js
+90
-0
center-manage/app/base/db/models/common/treearch.js
+2
-1
center-manage/app/base/service/impl/common/treearchSve.js
+11
-0
center-manage/app/base/service/impl/product/a.txt
+2
-2
center-manage/app/base/service/impl/product/productSve.js
+3
-2
center-manage/app/base/service/impl/product/productpriceSve.js
+1
-1
center-manage/app/base/service/impl/product/xproductSve.js
+4
-2
center-manage/app/base/test.js
+184
-0
center-manage/app/config/settings.js
+1
-0
No files found.
center-manage/app/base/controller/impl/common/articleCtl.js
0 → 100644
View file @
5f2dba7b
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctl.base"
);
class
ArticleCtl
extends
CtlBase
{
constructor
()
{
super
(
"common"
,
CtlBase
.
getServiceName
(
ArticleCtl
));
}
async
create
(
p
,
q
,
req
){
p
.
creator_id
=
p
.
userid
p
.
creator
=
p
.
username
let
rtn
=
await
this
.
service
.
create
(
p
,
q
,
req
)
return
system
.
getResult
(
rtn
)
}
}
module
.
exports
=
ArticleCtl
;
center-manage/app/base/controller/impl/common/treearchCtl.js
View file @
5f2dba7b
...
@@ -11,8 +11,16 @@ class TreearchCtl extends CtlBase {
...
@@ -11,8 +11,16 @@ class TreearchCtl extends CtlBase {
return
system
.
getResult
(
rtn
)
return
system
.
getResult
(
rtn
)
}
}
async
getRegions
(
p
,
q
,
req
){
async
getRegions
(
p
,
q
,
req
){
let
regionjson
=
await
this
.
service
.
getRegions
();
let
regionjson
=
await
this
.
service
.
getRegions
();
return
system
.
getResult
({
regionJson
:
regionjson
})
return
system
.
getResult
({
regionJson
:
regionjson
})
}
async
getSysArchJSON
(
p
,
q
,
req
){
let
sysArchJSON
=
await
this
.
service
.
getSysArchJSON
();
return
system
.
getResult
({
sysArchJSON
:
sysArchJSON
})
}
async
saveSysArchJSON
(
p
,
q
,
req
){
let
sysArchJSON
=
await
this
.
service
.
saveSysArchJSON
(
p
.
sysArchJSON
);
return
system
.
getResult
({
sysArchJSON
:
sysArchJSON
})
}
}
async
saveRegions
(
p
,
q
,
req
){
async
saveRegions
(
p
,
q
,
req
){
let
regionjson
=
await
this
.
service
.
saveRegions
(
p
.
regionJson
);
let
regionjson
=
await
this
.
service
.
saveRegions
(
p
.
regionJson
);
...
...
center-manage/app/base/db/impl/common/articleDao.js
0 → 100644
View file @
5f2dba7b
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
ArticleDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
ArticleDao
));
}
orderBy
(
qobj
)
{
//return {"key":"include","value":{model:this.db.models.app}};
if
(
!
qobj
.
orderInfo
||
qobj
.
orderInfo
.
length
==
0
){
return
[[
"created_at"
,
"ASC"
]];
}
else
{
return
qobj
.
orderInfo
;
}
}
}
module
.
exports
=
ArticleDao
;
// var u=new UserDao();
// var roledao=system.getObject("db.roleDao");
// (async ()=>{
// var users=await u.model.findAll({where:{app_id:1}});
// var role=await roledao.model.findOne({where:{code:"guest"}});
// console.log(role);
// for(var i=0;i<users.length;i++){
// await users[i].setRoles([role]);
// console.log(i);
// }
//
// })();
center-manage/app/base/db/models/common/article.js
0 → 100644
View file @
5f2dba7b
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"article"
,
{
title
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
//和user的from相同,在注册user时,去创建
desc
:
{
//概述
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
//和us
listimg
:
{
//简图
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
//和us
isPubed
:{
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
},
htmlcontent
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
//和user的from相同,在注册user时,去创建
tags
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
//和user的from相同,在注册user时,去创建
archpath
:{
//文档路径
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
},
seq
:{
type
:
DataTypes
.
INTEGER
,
allowNull
:
true
,
defaultValue
:
0
},
creator_id
:{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
},
creator
:{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
}
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'p_article'
,
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}]
// }
]
});
}
center-manage/app/base/db/models/common/treearch.js
View file @
5f2dba7b
...
@@ -4,7 +4,8 @@ const appconfig=system.getSysConfig();
...
@@ -4,7 +4,8 @@ const appconfig=system.getSysConfig();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"treearch"
,
{
return
db
.
define
(
"treearch"
,
{
regionJSON
:
DataTypes
.
TEXT
,
//功能清单地址--前端通过loadJson下载数据
regionJSON
:
DataTypes
.
TEXT
,
//功能清单地址--前端通过loadJson下载数据
productcatJSON
:
DataTypes
.
TEXT
productcatJSON
:
DataTypes
.
TEXT
,
sysArchJSON
:
DataTypes
.
TEXT
,
//系统的文档树
},
{
},
{
paranoid
:
false
,
//假的删除
paranoid
:
false
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
center-manage/app/base/service/impl/common/treearchSve.js
View file @
5f2dba7b
...
@@ -8,6 +8,17 @@ class TreeArchService extends ServiceBase {
...
@@ -8,6 +8,17 @@ class TreeArchService extends ServiceBase {
let
rs
=
await
this
.
dao
.
model
.
findAll
({
attributes
:
[
'regionJSON'
]
})
let
rs
=
await
this
.
dao
.
model
.
findAll
({
attributes
:
[
'regionJSON'
]
})
return
JSON
.
parse
(
rs
[
0
].
regionJSON
)
return
JSON
.
parse
(
rs
[
0
].
regionJSON
)
}
}
async
getSysArchJSON
()
{
let
rs
=
await
this
.
dao
.
model
.
findAll
({
attributes
:
[
'sysArchJSON'
]
})
return
JSON
.
parse
(
rs
[
0
].
sysArchJSON
)
}
async
saveSysArchJSON
(
sysArchJSON
)
{
let
rs
=
await
this
.
dao
.
model
.
findAll
()
let
upobj
=
rs
[
0
]
upobj
.
sysArchJSON
=
JSON
.
stringify
(
sysArchJSON
)
upobj
.
save
()
return
sysArchJSON
}
async
saveRegions
(
regionJson
)
{
async
saveRegions
(
regionJson
)
{
let
rs
=
await
this
.
dao
.
model
.
findAll
()
let
rs
=
await
this
.
dao
.
model
.
findAll
()
let
upobj
=
rs
[
0
]
let
upobj
=
rs
[
0
]
...
...
center-manage/app/base/service/impl/product/a.txt
View file @
5f2dba7b
国外
新疆维吾尔自治区
\ No newline at end of file
\ No newline at end of file
center-manage/app/base/service/impl/product/productSve.js
View file @
5f2dba7b
...
@@ -29,7 +29,7 @@ class ProductService extends ServiceBase {
...
@@ -29,7 +29,7 @@ class ProductService extends ServiceBase {
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
let
tmpdic
=
await
self
.
findPriceStrategys
(
stragetyids
,
t
)
stragetyids
.
forEach
(
stragetyid
=>
{
stragetyids
.
forEach
(
stragetyid
=>
{
if
(
skucodemap
){
if
(
skucodemap
){
p
.
skucode
=
skucodemap
[
stragetyid
]
.
pricecode
p
.
skucode
=
skucodemap
[
stragetyid
]
}
}
let
pps
=
{
let
pps
=
{
...
@@ -40,7 +40,8 @@ class ProductService extends ServiceBase {
...
@@ -40,7 +40,8 @@ class ProductService extends ServiceBase {
company_id
:
p
.
company_id
,
company_id
:
p
.
company_id
,
skucode
:
p
.
skucode
?
p
.
skucode
:
self
.
getUUID
(),
skucode
:
p
.
skucode
?
p
.
skucode
:
self
.
getUUID
(),
skuname
:
p
.
skuname
?
p
.
skuname
:
p
.
name
,
skuname
:
p
.
skuname
?
p
.
skuname
:
p
.
name
,
sptags
:
p
.
sptags
sptags
:
p
.
sptags
,
channeltags
:
p
.
channeltags
}
}
productprices
.
push
(
pps
)
productprices
.
push
(
pps
)
})
})
...
...
center-manage/app/base/service/impl/product/productpriceSve.js
View file @
5f2dba7b
...
@@ -29,7 +29,7 @@ class ProductpriceService extends ServiceBase {
...
@@ -29,7 +29,7 @@ class ProductpriceService extends ServiceBase {
regioninfo
[
"label"
]
=
regionName
regioninfo
[
"label"
]
=
regionName
//按照名字去取地区编码
//按照名字去取地区编码
let
areainfos
=
rs
.
filter
(
f
=>
{
let
areainfos
=
rs
.
filter
(
f
=>
{
if
(
f
.
name
==
regionName
)
{
if
(
f
.
name
.
indexOf
(
regionName
)
>=
0
)
{
return
true
return
true
}
else
{
}
else
{
return
false
return
false
...
...
center-manage/app/base/service/impl/product/xproductSve.js
View file @
5f2dba7b
...
@@ -35,14 +35,16 @@ function findTitlePath(items, findstr, results) {
...
@@ -35,14 +35,16 @@ function findTitlePath(items, findstr, results) {
let
product
=
{}
let
product
=
{}
product
.
code
=
xp
.
path_code
+
xp
.
id
product
.
code
=
xp
.
path_code
+
xp
.
id
results
=
[]
results
=
[]
findTitlePath
(
rs
,
xp
.
region_name
,
results
)
//
findTitlePath(rs, xp.region_name, results)
if
(
results
.
length
==
0
||
!
results
[
0
]){
if
(
results
.
length
==
0
||
!
results
[
0
]){
fs
.
writeFileSync
(
"./a.txt"
,
xp
.
region_name
)
fs
.
writeFileSync
(
"./a.txt"
,
xp
.
region_name
)
}
}
product
.
regionpath
=
results
[
0
]
//product.regionpath = results[0]//反查国家标准地区名称
product
.
regionpath
=
xp
.
region_name
product
.
productcatpath
=
"产品分类"
+
xp
.
path_name
product
.
productcatpath
=
"产品分类"
+
xp
.
path_name
product
.
name
=
product
.
productcatpath
+
"~"
+
product
.
regionpath
product
.
name
=
product
.
productcatpath
+
"~"
+
product
.
regionpath
product
.
sptags
=
xp
.
servicer_name
product
.
sptags
=
xp
.
servicer_name
product
.
channeltags
=
"腾讯"
product
.
desc
=
product
.
name
product
.
desc
=
product
.
name
product
.
company_id
=
1
product
.
company_id
=
1
//构造策略ids
//构造策略ids
...
...
center-manage/app/base/test.js
View file @
5f2dba7b
...
@@ -31,3 +31,187 @@ console.log(mid)
...
@@ -31,3 +31,187 @@ console.log(mid)
[
{
"title"
:
"中心功能清单"
,
"code"
:
"root"
,
"expand"
:
true
,
"orgpath"
:
"root"
,
"children"
:[
{
"seq"
:
2
,
"code"
:
"businessManagement"
,
"title"
:
"商机管理"
,
"nodeKey"
:
1
,
"orgpath"
:
"root/businessManagement"
,
"expand"
:
true
,
"children"
:[
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
2
,
"code"
:
"wailtingDispose"
,
"title"
:
"待处理商机"
,
"nodeKey"
:
2
,
"orgpath"
:
"root/businessManagement/wailtingDispose"
,
"expand"
:
true
,
"children"
:[
],
"sels"
:[
],
"titlepath"
:
"中心功能清单/商机管理/待处理商机"
,
"level"
:
3
},
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
2
,
"code"
:
"allDispose"
,
"title"
:
"全部商机"
,
"nodeKey"
:
3
,
"orgpath"
:
"root/businessManagement/allDispose"
,
"expand"
:
true
,
"children"
:[
],
"sels"
:[
],
"titlepath"
:
"中心功能清单/商机管理/全部商机"
,
"level"
:
3
}],
"titlepath"
:
"中心功能清单/商机管理"
,
"level"
:
2
},
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
3
,
"code"
:
"deliveryManagement"
,
"title"
:
"资质交付管理"
,
"nodeKey"
:
4
,
"orgpath"
:
"root/deliveryManagement"
,
"expand"
:
true
,
"children"
:[
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
1
,
"code"
:
"deliveryWaiting"
,
"title"
:
"待我处理"
,
"nodeKey"
:
5
,
"orgpath"
:
"root/deliveryManagement/deliveryWaiting"
,
"expand"
:
true
,
"children"
:[
],
"sels"
:[
],
"titlepath"
:
"中心功能清单/资质交付管理/待我处理"
,
"level"
:
3
},
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
1
,
"code"
:
"deliveryAll"
,
"title"
:
"全部交付单"
,
"nodeKey"
:
6
,
"orgpath"
:
"root/deliveryManagement/deliveryAll"
,
"expand"
:
true
,
"children"
:[
],
"sels"
:[
],
"titlepath"
:
"中心功能清单/资质交付管理/全部交付单"
,
"level"
:
3
}],
"titlepath"
:
"中心功能清单/资质交付管理"
,
"level"
:
2
},
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
4
,
"code"
:
"annualReport"
,
"title"
:
"年报交付管理"
,
"nodeKey"
:
7
,
"orgpath"
:
"root/annualReport"
,
"expand"
:
true
,
"children"
:[
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
1
,
"code"
:
"annualReportWait"
,
"title"
:
"待我处理"
,
"nodeKey"
:
8
,
"orgpath"
:
"root/annualReport/annualReportWait"
,
"expand"
:
true
,
"children"
:[
],
"titlepath"
:
"中心功能清单/年报交付管理/待我处理"
,
"level"
:
3
,
"sels"
:[
]
},
{
"auths"
:[
"add"
,
"edit"
,
"delete"
,
"export"
,
"show"
],
"seq"
:
2
,
"code"
:
"annualReportAll"
,
"title"
:
"全部交付单"
,
"nodeKey"
:
9
,
"orgpath"
:
"root/annualReport/annualReportAll"
,
"expand"
:
true
,
"children"
:[
],
"sels"
:[
],
"titlepath"
:
"中心功能清单/年报交付管理/全部交付单"
,
"level"
:
3
}],
"titlepath"
:
"中心功能清单/年报交付管理"
,
"level"
:
2
}],
"nodeKey"
:
0
,
"titlepath"
:
"中心功能清单"
,
"level"
:
1
}]
center-manage/app/config/settings.js
View file @
5f2dba7b
...
@@ -63,6 +63,7 @@ var settings = {
...
@@ -63,6 +63,7 @@ var settings = {
idle
:
1000000
idle
:
1000000
},
},
debug
:
false
,
debug
:
false
,
timezone
:
'+08:00'
,
dialectOptions
:{
dialectOptions
:{
requestTimeout
:
999999
,
requestTimeout
:
999999
,
// instanceName:'DEV'
// instanceName:'DEV'
...
...
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