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
db369724
Commit
db369724
authored
Mar 19, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
65d350a1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
41 deletions
+73
-41
center-app/app/base/api/impl/action/opProduct.js
+1
-1
center-app/app/base/db/impl/dbapp/interfaceinfoDao.js
+8
-0
center-app/app/base/db/impl/dbproduct/opinterfaceDao.js
+8
-0
center-app/app/base/db/impl/dbproduct/productinterfaceDao.js
+0
-26
center-app/app/base/db/metadata/apps/platform.js
+1
-1
center-app/app/base/db/models/dbapp/interfaceinfo.js
+2
-3
center-app/app/base/db/models/dbproduct/opinterface.js
+28
-0
center-app/app/base/service/impl/dbapp/interfaceinfoSve.js
+3
-3
center-app/app/base/service/impl/dbproduct/opinterfaceSve.js
+10
-0
center-app/app/base/service/impl/dbproduct/productSve.js
+12
-7
No files found.
center-app/app/base/api/impl/action/opProduct.js
View file @
db369724
...
...
@@ -29,7 +29,7 @@ class OpProductAPI extends APIBase {
opResult
=
await
this
.
productSve
.
getProductDetail
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
case
"getProductInterface"
:
//获取产品接口信息
opResult
=
await
this
.
productSve
.
getProductInterface
(
pobj
.
actionBody
);
opResult
=
await
this
.
productSve
.
getProductInterface
(
pobj
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-app/app/base/db/impl/dbapp/interfaceinfoDao.js
0 → 100644
View file @
db369724
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
InterfaceinfoDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
InterfaceinfoDao
));
}
}
module
.
exports
=
InterfaceinfoDao
;
center-app/app/base/db/impl/dbproduct/opinterfaceDao.js
0 → 100644
View file @
db369724
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
OpinterfaceDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
OpinterfaceDao
));
}
}
module
.
exports
=
OpinterfaceDao
;
center-app/app/base/db/impl/dbproduct/productinterfaceDao.js
deleted
100644 → 0
View file @
65d350a1
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
ProductInterfaceDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
ProductInterfaceDao
));
}
async
getListByProductPriceId
(
productPriceId
)
{
return
await
this
.
model
.
findAll
({
where
:
{
product_price_id
:
productPriceId
},
attributes
:
[
"id"
,
"interface_url"
,
"method_name"
,
"params"
,
"interface_type"
,
"interface_type_name"
,
"op_type"
,
"op_type_name"
,
"desc"
],
raw
:
true
});
}
}
module
.
exports
=
ProductInterfaceDao
;
center-app/app/base/db/metadata/apps/platform.js
View file @
db369724
...
...
@@ -29,7 +29,7 @@ module.exports = {
//接口类型
"interface_type"
:
{
"bd"
:
"本地"
,
"yc"
:
"远程"
},
//操作类型
"op_type"
:
{
"addOrder"
:
"添加订单"
,
"pushOrder"
:
"推送订单"
,
"push
Business"
:
"推送商机"
,
"pushUpdateOrder"
:
"推送修改订单"
,
"pushUpdateContacts"
:
"推送修改订单联系人
"
},
"op_type"
:
{
"addOrder"
:
"添加订单"
,
"pushOrder"
:
"推送订单"
,
"push
UpdateOrder"
:
"推送修改订单"
,
"pushUpdateOrderContacts"
:
"推送修改订单联系人"
,
"pushOrderBusiness"
:
"推送订单商机"
,
"pushOrderRefund"
:
"推送订单退款"
,
"pushNeedBusiness"
:
"推送需求商机"
,
"pushNeedNote"
:
"推送需求小计"
,
"pushCloseNeed"
:
"推送关闭需求"
,
"pushNeedSolution"
:
"推送需求方案"
,
"pushCloseNeedSolution"
:
"推送关闭需求方案
"
},
//---------
"logLevel"
:
{
"debug"
:
0
,
"info"
:
1
,
"warn"
:
2
,
"error"
:
3
,
"fatal"
:
4
},
...
...
center-app/app/base/db/models/db
product/productinterface
.js
→
center-app/app/base/db/models/db
app/interfaceinfo
.js
View file @
db369724
...
...
@@ -2,8 +2,7 @@ const system = require("../../../system");
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"productinterface"
,
{
product_id
:
DataTypes
.
INTEGER
,
return
db
.
define
(
"interfaceinfo"
,
{
interface_url
:
DataTypes
.
STRING
(
255
),
method_name
:
DataTypes
.
STRING
(
100
),
params
:
DataTypes
.
STRING
(
1024
),
...
...
@@ -33,7 +32,7 @@ module.exports = (db, DataTypes) => {
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
tableName
:
'p_
product_interface
'
,
tableName
:
'p_
interface_info
'
,
validate
:
{
},
...
...
center-app/app/base/db/models/dbproduct/opinterface.js
0 → 100644
View file @
db369724
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"opinterface"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
interface_id
:
DataTypes
.
INTEGER
,
product_id
:
DataTypes
.
INTEGER
,
is_enabled
:
{
//状态 0禁用 1启用
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
true
,
},
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
tableName
:
'p_op_interface'
,
validate
:
{
},
indexes
:
[
]
});
}
center-app/app/base/service/impl/db
product/productinterface
Sve.js
→
center-app/app/base/service/impl/db
app/interfaceinfo
Sve.js
View file @
db369724
...
...
@@ -2,9 +2,9 @@ const system = require("../../../system");
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
ProductInterface
Service
extends
ServiceBase
{
class
Interfaceinfo
Service
extends
ServiceBase
{
constructor
()
{
super
(
"db
product"
,
ServiceBase
.
getDaoName
(
ProductInterface
Service
));
super
(
"db
app"
,
ServiceBase
.
getDaoName
(
Interfaceinfo
Service
));
}
}
module
.
exports
=
ProductInterface
Service
;
module
.
exports
=
Interfaceinfo
Service
;
center-app/app/base/service/impl/dbproduct/opinterfaceSve.js
0 → 100644
View file @
db369724
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
OpinterfaceService
extends
ServiceBase
{
constructor
()
{
super
(
"dbproduct"
,
ServiceBase
.
getDaoName
(
OpinterfaceService
));
}
}
module
.
exports
=
OpinterfaceService
;
center-app/app/base/service/impl/dbproduct/productSve.js
View file @
db369724
...
...
@@ -6,7 +6,6 @@ class ProductService extends ServiceBase {
constructor
()
{
super
(
"dbproduct"
,
ServiceBase
.
getDaoName
(
ProductService
));
this
.
productpriceDao
=
system
.
getObject
(
"db.dbproduct.productpriceDao"
);
this
.
productinterfaceDao
=
system
.
getObject
(
"db.dbproduct.productinterfaceDao"
);
}
/**
* 通过产品类别编码路径获取产品列表
...
...
@@ -48,13 +47,19 @@ class ProductService extends ServiceBase {
* 获取产品接口信息
* @param {*} actionBody productId产品id
*/
async
getProductInterface
(
actionBody
)
{
var
list
=
await
this
.
productinterfaceDao
.
getListByProductPriceId
(
actionBody
.
productPriceId
);
// if (!item) {
// return system.getResult(null, "product to interface is data empty !");
// }
async
getProductInterface
(
pobj
,
actionBody
)
{
var
sql
=
"select * from v_op_interface where is_enabled=1 and uapp_id="
+
pobj
.
appInfo
.
uapp_id
+
" and product_id="
+
actionBody
.
product_id
;
var
list
=
await
this
.
customQuery
(
sql
);
return
system
.
getResultSuccess
(
list
);
}
/**
* 获取产品接口信息
* @param {*} actionBody productId产品id
*/
async
getAppInterface
(
pobj
,
actionBody
)
{
var
sql
=
"select * from v_op_interface where is_enabled=1 and product_id is null and uapp_id="
+
pobj
.
appInfo
.
uapp_id
;
var
list
=
await
this
.
customQuery
(
sql
);
return
system
.
getResultSuccess
(
list
);
}
}
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