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
5706edb2
Commit
5706edb2
authored
Jun 10, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
e9b42913
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
45 additions
and
9 deletions
+45
-9
center-manage/app/base/controller/impl/auth/userCtl.js
+4
-0
center-manage/app/base/db/cache/userCache.js
+1
-1
center-manage/app/base/db/impl/common/connection.js
+3
-1
center-manage/app/base/db/impl/product/productDao.js
+14
-0
center-manage/app/base/db/impl/product/productpriceDao.js
+14
-0
center-manage/app/base/db/models/product/pricecat.js
+1
-1
center-manage/app/base/db/models/product/pricestrategy.js
+1
-1
center-manage/app/base/db/models/product/product.js
+1
-1
center-manage/app/base/db/models/product/productcost.js
+1
-1
center-manage/app/base/db/models/product/productprice.js
+1
-1
center-manage/app/base/service/impl/product/productSve.js
+4
-2
No files found.
center-manage/app/base/controller/impl/auth/userCtl.js
View file @
5706edb2
...
...
@@ -27,6 +27,10 @@ class UserCtl extends CtlBase {
await
this
.
service
.
updateByWhere
({
isEnabled
:
!
pobj
.
isEnabled
},{
company_id
:
pobj
.
company_id
})
return
system
.
getResult
({});
}
async
allowOrNotToOne
(
pobj
,
qobj
,
req
){
await
this
.
service
.
updateByWhere
({
isEnabled
:
!
pobj
.
isEnabled
},{
id
:
pobj
.
curid
})
return
system
.
getResult
({});
}
async
initNewInstance
(
queryobj
,
req
)
{
var
rtn
=
{};
rtn
.
roles
=
[];
...
...
center-manage/app/base/db/cache/userCache.js
View file @
5706edb2
...
...
@@ -17,7 +17,7 @@ class UserCache extends CacheBase{
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
const
configValue
=
await
this
.
userDao
.
model
.
findAll
({
where
:
{
userName
:
inputkey
,
app_id
:
settings
.
pmappid
},
where
:
{
userName
:
inputkey
,
app_id
:
settings
.
pmappid
,
isEnabled
:
true
},
attributes
:
[
'id'
,
'userName'
,
'nickName'
,
'headUrl'
,
'jwtkey'
,
'jwtsecret'
,
'created_at'
,
'isSuper'
,
'isAdmin'
,
'mail'
,
'opath'
,
'ptags'
],
include
:
[
{
model
:
this
.
db
.
models
.
company
,
attributes
:[
'id'
,
'name'
,
'companykey'
,
'appids'
],
raw
:
true
},
...
...
center-manage/app/base/db/impl/common/connection.js
View file @
5706edb2
...
...
@@ -70,9 +70,11 @@ class DbFactory{
//产品相关
this
.
db
.
models
.
productprice
.
belongsTo
(
this
.
db
.
models
.
product
,{
constraints
:
false
,});
this
.
db
.
models
.
product
.
hasMany
(
this
.
db
.
models
.
productprice
,{
as
:
"skus"
,
constraints
:
false
,});
this
.
db
.
models
.
product
.
belongsTo
(
this
.
db
.
models
.
company
,{
constraints
:
false
,});
//产品价格引用定价策略
this
.
db
.
models
.
productprice
.
belongsTo
(
this
.
db
.
models
.
pricestrategy
,{
constraints
:
false
,});
this
.
db
.
models
.
productprice
.
belongsTo
(
this
.
db
.
models
.
company
,{
constraints
:
false
,});
//成本项目属于productprice
this
.
db
.
models
.
productcost
.
belongsTo
(
this
.
db
.
models
.
productprice
,{
constraints
:
false
,});
...
...
center-manage/app/base/db/impl/product/productDao.js
View file @
5706edb2
...
...
@@ -4,6 +4,20 @@ class ProductDao extends Dao {
constructor
()
{
super
(
Dao
.
getModelName
(
ProductDao
));
}
extraWhere
(
obj
,
w
,
qc
,
linkAttrs
){
if
(
obj
.
bizpath
&&
obj
.
bizpath
!=
""
){
if
(
obj
.
bizpath
.
indexOf
(
"productdef"
)
>
0
){
//说明是租户查询自己创建的应用
w
[
"company_id"
]
=
obj
.
company_id
;
}
}
if
(
linkAttrs
.
length
>
0
){
var
search
=
obj
.
search
;
var
lnkKey
=
linkAttrs
[
0
];
var
strq
=
"$"
+
lnkKey
.
replace
(
"~"
,
"."
)
+
"$"
;
w
[
strq
]
=
{[
this
.
db
.
Op
.
like
]:
"%"
+
search
[
lnkKey
]
+
"%"
};
}
return
w
;
}
extraModelFilter
()
{
//return {"key":"include","value":[{model:this.db.models.app,},{model:this.db.models.role,as:"Roles",attributes:["id","name"],joinTableAttributes:['created_at']}]};
return
{
...
...
center-manage/app/base/db/impl/product/productpriceDao.js
View file @
5706edb2
...
...
@@ -4,6 +4,20 @@ class ProductpriceDao extends Dao{
constructor
(){
super
(
Dao
.
getModelName
(
ProductpriceDao
));
}
extraWhere
(
obj
,
w
,
qc
,
linkAttrs
){
if
(
obj
.
bizpath
&&
obj
.
bizpath
!=
""
){
if
(
obj
.
bizpath
.
indexOf
(
"platformprice"
)
>
0
){
//说明是租户查询自己创建的应用
w
[
"company_id"
]
=
obj
.
company_id
;
}
}
if
(
linkAttrs
.
length
>
0
){
var
search
=
obj
.
search
;
var
lnkKey
=
linkAttrs
[
0
];
var
strq
=
"$"
+
lnkKey
.
replace
(
"~"
,
"."
)
+
"$"
;
w
[
strq
]
=
{[
this
.
db
.
Op
.
like
]:
"%"
+
search
[
lnkKey
]
+
"%"
};
}
return
w
;
}
extraModelFilter
(){
//return {"key":"include","value":[{model:this.db.models.app,},{model:this.db.models.role,as:"Roles",attributes:["id","name"],joinTableAttributes:['created_at']}]};
return
{
"key"
:
"include"
,
"value"
:[
...
...
center-manage/app/base/db/models/product/pricecat.js
View file @
5706edb2
...
...
@@ -21,7 +21,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
}
//和user的from相同,在注册user时,去创建
},
{
paranoid
:
fals
e
,
//假的删除
paranoid
:
tru
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
center-manage/app/base/db/models/product/pricestrategy.js
View file @
5706edb2
...
...
@@ -17,7 +17,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
}
//和user的from相同,在注册user时,去创建
},
{
paranoid
:
fals
e
,
//假的删除
paranoid
:
tru
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
center-manage/app/base/db/models/product/product.js
View file @
5706edb2
...
...
@@ -25,7 +25,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
},
//和user的from
},
{
paranoid
:
fals
e
,
//假的删除
paranoid
:
tru
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
center-manage/app/base/db/models/product/productcost.js
View file @
5706edb2
...
...
@@ -21,7 +21,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
},
},
{
paranoid
:
fals
e
,
//假的删除
paranoid
:
tru
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
center-manage/app/base/db/models/product/productprice.js
View file @
5706edb2
...
...
@@ -42,7 +42,7 @@ module.exports = (db, DataTypes) => {
defaultValue
:
false
}
},
{
paranoid
:
fals
e
,
//假的删除
paranoid
:
tru
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
center-manage/app/base/service/impl/product/productSve.js
View file @
5706edb2
...
...
@@ -31,7 +31,8 @@ class ProductService extends ServiceBase {
product_id
:
pnew
.
id
,
pricestrategy_id
:
stragetyid
,
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
]
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
}
productprices
.
push
(
pps
)
})
...
...
@@ -83,7 +84,8 @@ class ProductService extends ServiceBase {
product_id
:
p
.
id
,
pricestrategy_id
:
stragetyid
,
pname
:
p
.
name
,
strategyitems
:
tmpdic
[
stragetyid
+
''
]
strategyitems
:
tmpdic
[
stragetyid
+
''
],
company_id
:
p
.
company_id
}
productprices
.
push
(
pps
)
})
...
...
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