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
12e518aa
Commit
12e518aa
authored
Sep 28, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-app' of
http://gitlab.gongsibao.com/jiangyong/zhichan
into center-app
parents
0f1ac400
a0f62b88
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
1 deletions
+71
-1
center-app/app/base/api/api.base.js
+1
-1
center-app/app/base/api/impl/action/opProduct.js
+3
-0
center-app/app/base/api/impl/payment/paymentApi.js
+5
-0
center-app/app/base/db/impl/dbapp/appDao.js
+8
-0
center-app/app/base/service/impl/dbproduct/productSve.js
+46
-0
center-app/app/base/service/impl/utilsSve/utilstlbankSve.js
+8
-0
No files found.
center-app/app/base/api/api.base.js
View file @
12e518aa
...
...
@@ -53,7 +53,7 @@ class APIBase {
async
doexec
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
req
.
requestId
=
this
.
getUUID
();
try
{
if
([
"getTokenByHosts"
,
"receiveCallBackNotify"
,
"getAppInfo"
,
"getPayInfo"
,
"verifyAliPayReturnSign"
,
"test"
].
indexOf
(
methodname
)
<
0
)
{
if
([
"getTokenByHosts"
,
"receiveCallBackNotify"
,
"getAppInfo"
,
"get
AppInfoByAppKey"
,
"get
PayInfo"
,
"verifyAliPayReturnSign"
,
"test"
].
indexOf
(
methodname
)
<
0
)
{
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !"
);
}
...
...
center-app/app/base/api/impl/action/opProduct.js
View file @
12e518aa
...
...
@@ -50,6 +50,9 @@ class OpProductAPI extends APIBase {
case
"getMinPrice"
:
//最低价
opResult
=
await
this
.
productSve
.
getMinPrice
(
pobj
);
break
;
case
"getProductRecommend"
:
opResult
=
await
this
.
productSve
.
getProductRecommend
(
pobj
.
actionBody
,
pobj
.
appInfo
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-app/app/base/api/impl/payment/paymentApi.js
View file @
12e518aa
...
...
@@ -50,5 +50,9 @@ class PaymentAPI extends APIBase {
async
getAppInfo
(
pobj
,
qobj
,
req
)
{
return
await
this
.
utilstlbankSve
.
getAppItem
(
pobj
.
uappId
);
}
async
getAppInfoByAppKey
(
pobj
,
qobj
,
req
){
return
await
this
.
utilstlbankSve
.
getAppItemByAppkey
(
pobj
.
appKey
)
}
}
module
.
exports
=
PaymentAPI
;
\ No newline at end of file
center-app/app/base/db/impl/dbapp/appDao.js
View file @
12e518aa
...
...
@@ -29,5 +29,13 @@ class AppDao extends Dao {
raw
:
true
});
}
async
getItemByAppKey
(
appKey
)
{
return
this
.
model
.
findOne
({
where
:
{
uapp_key
:
appKey
},
raw
:
true
});
}
}
module
.
exports
=
AppDao
;
center-app/app/base/service/impl/dbproduct/productSve.js
View file @
12e518aa
...
...
@@ -14,6 +14,9 @@ class ProductService extends ServiceBase {
*/
async
getProductList
(
actionBody
,
appInfo
)
{
var
sql
=
"select * from v_product where uapp_id="
+
appInfo
.
uapp_id
+
" and path_code like '"
+
actionBody
.
pathCode
+
"%'"
;
if
(
actionBody
.
productName
){
sql
=
"select * from v_product where uapp_id="
+
appInfo
.
uapp_id
+
" and item_name like '"
+
actionBody
.
productName
+
"%'"
;
}
var
list
=
await
this
.
customQuery
(
sql
);
return
system
.
getResultSuccess
(
list
);
}
...
...
@@ -208,5 +211,48 @@ class ProductService extends ServiceBase {
}
return
system
.
getResultSuccess
(
data
);
}
/**
* 获取推荐产品列表
* @param pobj
* @returns {Promise<void>}
*/
async
getProductRecommend
(
actionBody
,
appInfo
){
const
type
=
actionBody
.
type
;
let
sql
=
``
;
let
paramsWhere
=
{};
if
(
type
==
1
){
sql
=
`select DISTINCT(recommend_code) from p_company_recommend where company_name = :companyName`
;
paramsWhere
[
'companyName'
]
=
actionBody
.
companyName
;
}
if
(
type
==
2
){
sql
=
`select DISTINCT(recommend_code) from p_company_recommend where company_name = :companyName and product_code = :productCode`
;
paramsWhere
[
'companyName'
]
=
actionBody
.
companyName
;
paramsWhere
[
'productCode'
]
=
actionBody
.
productCode
;
}
if
(
type
==
3
){
sql
=
`select DISTINCT(recommend_code) from p_product_recommend where product_code = :productCode`
;
paramsWhere
[
'productCode'
]
=
actionBody
.
productCode
;
}
let
result
=
await
this
.
customQuery
(
sql
,
paramsWhere
);
if
(
result
.
length
==
0
){
return
system
.
getResultFail
(
-
1
,
'暂无配置数据'
)
}
let
codes
=
[];
result
.
forEach
(
item
=>
{
if
(
item
.
recommend_code
){
codes
.
push
(
item
.
recommend_code
)
}
})
paramsWhere
=
{};
let
productSql
=
`select * from v_product where channel_item_code in (:codes) and uapp_id = :uapp_id`
paramsWhere
[
'uapp_id'
]
=
appInfo
.
uapp_id
;
let
rtn
=
{};
if
(
codes
.
length
>
0
){
paramsWhere
[
'codes'
]
=
codes
;
rtn
=
await
this
.
customQuery
(
productSql
,
paramsWhere
);
}
return
system
.
getResult
(
rtn
);
}
}
module
.
exports
=
ProductService
;
center-app/app/base/service/impl/utilsSve/utilstlbankSve.js
View file @
12e518aa
...
...
@@ -31,6 +31,14 @@ class utilsTlBankSve extends AppServiceBase {
}
return
system
.
getResultSuccess
(
item
);
}
async
getAppItemByAppkey
(
uappId
)
{
//根据appKey获取应用信息
var
item
=
await
this
.
appDao
.
getItemByAppKey
(
uappId
);
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"应用数据为空"
);
}
return
system
.
getResultSuccess
(
item
);
}
//-------------------------------------------h5支付-----------------开始
/**
...
...
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