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
22235441
Commit
22235441
authored
Feb 12, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
d5d373fc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
15 deletions
+41
-15
center-app/app/base/api/impl/action/opProduct.js
+3
-0
center-app/app/base/db/impl/dbproduct/productDao.js
+1
-0
center-app/app/base/db/impl/dbproduct/productinterfaceDao.js
+15
-0
center-app/app/base/db/metadata/apps/platform.js
+1
-3
center-app/app/base/db/models/dbproduct/productinterface.js
+2
-11
center-app/app/base/service/impl/dbproduct/productSve.js
+19
-1
No files found.
center-app/app/base/api/impl/action/opProduct.js
View file @
22235441
...
@@ -28,6 +28,9 @@ class OpProductAPI extends APIBase {
...
@@ -28,6 +28,9 @@ class OpProductAPI extends APIBase {
case
"getProductDetail"
:
//获取产品详情
case
"getProductDetail"
:
//获取产品详情
opResult
=
await
this
.
productSve
.
getProductDetail
(
pobj
.
actionBody
,
pobj
.
appInfo
);
opResult
=
await
this
.
productSve
.
getProductDetail
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
break
;
case
"getProductInterface"
:
//获取产品接口信息
opResult
=
await
this
.
productSve
.
getProductInterface
(
pobj
.
actionBody
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-app/app/base/db/impl/dbproduct/productDao.js
View file @
22235441
...
@@ -13,6 +13,7 @@ class ProductDao extends Dao {
...
@@ -13,6 +13,7 @@ class ProductDao extends Dao {
attributes
:
[
attributes
:
[
"id"
,
"id"
,
"uapp_id"
,
"uapp_id"
,
"is_enabled"
,
"path_code"
,
"path_code"
,
"path_name"
,
"path_name"
,
"item_code"
,
"item_code"
,
...
...
center-app/app/base/db/impl/dbproduct/productinterfaceDao.js
View file @
22235441
...
@@ -4,5 +4,20 @@ class ProductInterfaceDao extends Dao {
...
@@ -4,5 +4,20 @@ class ProductInterfaceDao extends Dao {
constructor
()
{
constructor
()
{
super
(
Dao
.
getModelName
(
ProductInterfaceDao
));
super
(
Dao
.
getModelName
(
ProductInterfaceDao
));
}
}
async
getItemByProductId
(
productId
)
{
return
this
.
model
.
findOne
({
where
:
{
product_id
:
productId
},
attributes
:
[
"id"
,
"interface_url"
,
"interface_type"
,
"interface_type_name"
,
"params"
,
"desc"
],
raw
:
true
});
}
}
}
module
.
exports
=
ProductInterfaceDao
;
module
.
exports
=
ProductInterfaceDao
;
center-app/app/base/db/metadata/apps/platform.js
View file @
22235441
...
@@ -23,10 +23,8 @@ module.exports = {
...
@@ -23,10 +23,8 @@ module.exports = {
//定价类型
//定价类型
"price_type"
:
{
"mj"
:
"每件"
,
"mc"
:
"每次"
,
"mt"
:
"每天"
,
"my"
:
"每月"
,
"mn"
:
"每年"
,
"qj"
:
"区间"
},
"price_type"
:
{
"mj"
:
"每件"
,
"mc"
:
"每次"
,
"mt"
:
"每天"
,
"my"
:
"每月"
,
"mn"
:
"每年"
,
"qj"
:
"区间"
},
//请求类型
"req_type"
:
{
"bd"
:
"本地"
,
"yc"
:
"远程"
},
//接口类型
//接口类型
"interface_type"
:
{
"sjts"
:
"商机推送"
,
"ddcz"
:
"订单操作
"
},
"interface_type"
:
{
"bd"
:
"本地"
,
"yc"
:
"远程
"
},
//---------
//---------
"logLevel"
:
{
"debug"
:
0
,
"info"
:
1
,
"warn"
:
2
,
"error"
:
3
,
"fatal"
:
4
},
"logLevel"
:
{
"debug"
:
0
,
"info"
:
1
,
"warn"
:
2
,
"error"
:
3
,
"fatal"
:
4
},
...
...
center-app/app/base/db/models/dbproduct/productinterface.js
View file @
22235441
...
@@ -4,17 +4,8 @@ const uiconfig = system.getUiConfig2(settings.appKey);
...
@@ -4,17 +4,8 @@ const uiconfig = system.getUiConfig2(settings.appKey);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"productinterface"
,
{
return
db
.
define
(
"productinterface"
,
{
product_id
:
DataTypes
.
INTEGER
,
product_id
:
DataTypes
.
INTEGER
,
interface_url
:
DataTypes
.
STRING
(
255
),
//推送到服务商的产品编码
interface_url
:
DataTypes
.
STRING
(
255
),
//操作接口地址
req_type
:
{
//请求类型,bd本地,yc远程
interface_type
:
{
//接口类型,bd本地,yc远程
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
req_type
),
set
:
function
(
val
)
{
this
.
setDataValue
(
"req_type"
,
val
);
this
.
setDataValue
(
"req_type_name"
,
uiconfig
.
config
.
pdict
.
req_type
[
val
]);
},
},
req_type_name
:
DataTypes
.
STRING
(
255
),
interface_type
:
{
//接口类型sjts商机推送,ddcz订单操作
type
:
DataTypes
.
ENUM
,
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
interface_type
),
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
interface_type
),
set
:
function
(
val
)
{
set
:
function
(
val
)
{
...
...
center-app/app/base/service/impl/dbproduct/productSve.js
View file @
22235441
...
@@ -6,6 +6,7 @@ class ProductService extends ServiceBase {
...
@@ -6,6 +6,7 @@ class ProductService extends ServiceBase {
constructor
()
{
constructor
()
{
super
(
"dbproduct"
,
ServiceBase
.
getDaoName
(
ProductService
));
super
(
"dbproduct"
,
ServiceBase
.
getDaoName
(
ProductService
));
this
.
productpriceDao
=
system
.
getObject
(
"db.dbproduct.productpriceDao"
);
this
.
productpriceDao
=
system
.
getObject
(
"db.dbproduct.productpriceDao"
);
this
.
productinterfaceDao
=
system
.
getObject
(
"db.dbproduct.productinterfaceDao"
);
}
}
/**
/**
* 通过产品类别编码路径获取产品列表
* 通过产品类别编码路径获取产品列表
...
@@ -25,7 +26,10 @@ class ProductService extends ServiceBase {
...
@@ -25,7 +26,10 @@ class ProductService extends ServiceBase {
async
getProductDetail
(
actionBody
,
appInfo
)
{
async
getProductDetail
(
actionBody
,
appInfo
)
{
var
item
=
await
this
.
dao
.
getItemByChannelItemCode
(
actionBody
.
channelItemCode
,
appInfo
.
uapp_id
);
var
item
=
await
this
.
dao
.
getItemByChannelItemCode
(
actionBody
.
channelItemCode
,
appInfo
.
uapp_id
);
if
(
!
item
)
{
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"item is data empty"
);
return
system
.
getResult
(
null
,
"product item is data empty !"
);
}
if
(
item
.
is_enabled
!=
1
)
{
return
system
.
getResult
(
null
,
"product to item is Disable !"
);
}
}
var
pList
=
await
this
.
productpriceDao
.
model
.
findAll
({
var
pList
=
await
this
.
productpriceDao
.
model
.
findAll
({
where
:
{
product_id
:
item
.
id
},
where
:
{
product_id
:
item
.
id
},
...
@@ -34,9 +38,23 @@ class ProductService extends ServiceBase {
...
@@ -34,9 +38,23 @@ class ProductService extends ServiceBase {
],
],
raw
:
true
raw
:
true
});
});
if
(
!
pList
||
pList
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"product to price is data empty !"
);
}
item
.
price_list
=
pList
;
item
.
price_list
=
pList
;
return
system
.
getResultSuccess
(
item
);
return
system
.
getResultSuccess
(
item
);
}
}
/**
* 获取产品接口信息
* @param {*} actionBody productId产品id
*/
async
getProductInterface
(
actionBody
)
{
var
item
=
await
this
.
productinterfaceDao
.
getItemByProductId
(
actionBody
.
productId
);
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"product to interface is data empty !"
);
}
return
system
.
getResultSuccess
(
item
);
}
}
}
module
.
exports
=
ProductService
;
module
.
exports
=
ProductService
;
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