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
e9b42913
Commit
e9b42913
authored
Jun 09, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
171ce4b7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
3 deletions
+108
-3
center-manage/app/base/controller/impl/product/productcostCtl.js
+9
-0
center-manage/app/base/db/impl/common/connection.js
+3
-0
center-manage/app/base/db/impl/product/productcostDao.js
+25
-0
center-manage/app/base/db/models/product/pricecat.js
+1
-1
center-manage/app/base/db/models/product/product.js
+1
-1
center-manage/app/base/db/models/product/productcost.js
+66
-0
center-manage/app/base/db/models/product/productprice.js
+3
-1
No files found.
center-manage/app/base/controller/impl/product/productcostCtl.js
0 → 100644
View file @
e9b42913
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctl.base"
);
class
ProductcostCtl
extends
CtlBase
{
constructor
()
{
super
(
"product"
,
CtlBase
.
getServiceName
(
ProductcostCtl
));
// this.pricestrategyService=system.getObject("service.product.pricestrategySve")
}
}
module
.
exports
=
ProductcostCtl
;
center-manage/app/base/db/impl/common/connection.js
View file @
e9b42913
...
...
@@ -73,6 +73,9 @@ class DbFactory{
//产品价格引用定价策略
this
.
db
.
models
.
productprice
.
belongsTo
(
this
.
db
.
models
.
pricestrategy
,{
constraints
:
false
,});
//成本项目属于productprice
this
.
db
.
models
.
productcost
.
belongsTo
(
this
.
db
.
models
.
productprice
,{
constraints
:
false
,});
}
//async getCon(){,用于使用替换table模型内字段数据使用
getCon
(){
...
...
center-manage/app/base/db/impl/product/productcostDao.js
0 → 100644
View file @
e9b42913
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
ProductcostDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
ProductcostDao
));
}
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"
:[
{
model
:
this
.
db
.
models
.
productprice
,
attributes
:[
"id"
,
"lowpriceref"
]}]};
}
}
module
.
exports
=
ProductcostDao
;
// 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/product/pricecat.js
View file @
e9b42913
...
...
@@ -21,7 +21,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
}
//和user的from相同,在注册user时,去创建
},
{
paranoid
:
tru
e
,
//假的删除
paranoid
:
fals
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
center-manage/app/base/db/models/product/product.js
View file @
e9b42913
...
...
@@ -25,7 +25,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
},
//和user的from
},
{
paranoid
:
tru
e
,
//假的删除
paranoid
:
fals
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
center-manage/app/base/db/models/product/productcost.js
0 → 100644
View file @
e9b42913
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
//定价类型
return
db
.
define
(
"productcost"
,
{
costdesc
:{
//成本描述
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
expensetype
:{
//费用类型
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
costratio
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
allowNull
:
true
,
},
costamount
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
allowNull
:
true
},
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'p_productcost'
,
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/product/productprice.js
View file @
e9b42913
...
...
@@ -15,10 +15,12 @@ module.exports = (db, DataTypes) => {
lowpriceref
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
allowNull
:
true
,
defaultValue
:
0
},
hignpriceref
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
allowNull
:
true
,
defaultValue
:
0
},
deliverfile
:{
type
:
DataTypes
.
STRING
,
...
...
@@ -40,7 +42,7 @@ module.exports = (db, DataTypes) => {
defaultValue
:
false
}
},
{
paranoid
:
tru
e
,
//假的删除
paranoid
:
fals
e
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
...
...
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