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
f08f1ec0
Commit
f08f1ec0
authored
Jul 07, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
c9dc7756
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
brg-user-center/app/base/api/api.base.js
+23
-1
brg-user-center/app/base/service/impl/need/needInfoSve.js
+1
-1
brg-user-center/app/base/service/impl/need/needSolutionSve.js
+1
-1
brg-user-center/app/base/service/impl/order/orderInfoSve.js
+1
-1
No files found.
brg-user-center/app/base/api/api.base.js
View file @
f08f1ec0
...
...
@@ -2,10 +2,12 @@ const system = require("../system");
const
settings
=
require
(
"../../config/settings"
);
const
moment
=
require
(
'moment'
);
const
uuid
=
require
(
'uuid'
);
const
sha256
=
require
(
'sha256'
);
class
APIBase
{
constructor
()
{
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
userCenterAction
=
{
"GetOverviewInfoByUser"
:
"getOverviewInfoByUser"
,
"GetOrderList"
:
"getOrderList"
,
...
...
@@ -15,7 +17,7 @@ class APIBase {
"GetApplyListByUserAndType"
:
"getApplyListByUserAndType"
,
"GetApplyAndSolutionInfo"
:
"getApplyAndSolutionInfo"
,
"GetPriceDetail"
:
"selPrice2TX"
,
"GetOverviewInfoByUser"
:
"getOverviewInfoByUser"
,
//
"GetOverviewInfoByUser": "getOverviewInfoByUser",
"SubmitGoodsInfo"
:
"submitGoodsinfo"
,
"SubmitNeed"
:
"needSubmit"
,
"GetNeedList"
:
"needList"
,
...
...
@@ -27,6 +29,15 @@ class APIBase {
"SendVerificationCode"
:
"sendVerificationCode"
,
"CheckBusinessNameList"
:
"checkBusinessNameList"
,
};
this
.
queryAction
=
[
"GetOrderList"
,
"getOrderList"
,
"GetOverviewInfoByUser"
,
"getOverviewInfoByUser"
,
"GetOrderList"
,
"getOrderList"
,
"GetQualificationCertificateOrderList"
,
"getQcOrderList"
,
"GetQcOrderList"
,
"GetOrderDetail"
,
"getOrderDetail"
,
"GetApplyListByUserAndType"
,
"getApplyListByUserAndType"
,
"GetApplyAndSolutionInfo"
,
"getApplyAndSolutionInfo"
,
"GetPriceDetail"
,
"getPriceDetail"
,
"GetNeedList"
,
"getNeedList"
,
"GetNeedDetail"
,
"getNeedDetail"
,
"GetOrderListByStatus"
,
"getOrderListByStatus"
,
"GetQualificationCertificateListByUserAndType"
,
"getQualificationCertificateListByUserAndType"
,
"GetQualificationCertificateDetail"
,
"getQualificationCertificateDetail"
];
}
//-----------------------新的模式------------------开始
...
...
@@ -46,6 +57,14 @@ class APIBase {
}
console
.
log
(
JSON
.
stringify
(
reqParams
),
"....req......base......"
);
try
{
var
shaStr
=
await
sha256
(
JSON
.
stringify
(
reqParams
));
//查询缓存
if
(
this
.
queryAction
.
indexOf
(
reqParams
.
actionType
)
>=
0
){
var
cacheRes
=
await
this
.
redisClient
.
getCache
(
shaStr
);
if
(
cacheRes
){
return
JSON
.
parse
(
cacheRes
);
}
}
var
result
=
await
this
[
methodname
](
reqParams
,
query
,
req
);
if
(
!
result
)
{
result
=
system
.
getResult
(
null
,
"请求的方法返回值为空"
);
...
...
@@ -57,6 +76,9 @@ class APIBase {
result
=
await
this
.
handleTxResult
(
result
);
delete
req
.
body
[
"Action"
];
}
//处理tx返回数据
//保存缓存
await
this
.
redisClient
.
setWithEx
(
shaStr
,
JSON
.
stringify
(
result
),
5
);
return
result
;
}
catch
(
error
)
{
var
stackStr
=
error
.
stack
?
error
.
stack
:
JSON
.
stringify
(
error
);
...
...
brg-user-center/app/base/service/impl/need/needInfoSve.js
View file @
f08f1ec0
...
...
@@ -78,7 +78,7 @@ class NeedInfoService extends ServiceBase {
return
system
.
getResultFail
(
-
203
,
"servicer is empty"
);
}
if
(
!
serviceinfo
.
data
.
is_enabled
)
{
return
system
.
getResultFail
(
-
300
,
"servicer isn
'
t enable"
);
return
system
.
getResultFail
(
-
300
,
"servicer isnt enable"
);
}
actionBody
.
ServicerCode
=
serviceinfo
.
data
.
servicer_code
;
actionBody
.
ServicerName
=
serviceinfo
.
data
.
servicer_name
;
...
...
brg-user-center/app/base/service/impl/need/needSolutionSve.js
View file @
f08f1ec0
...
...
@@ -160,7 +160,7 @@ class NeedSolutionService extends ServiceBase {
path_code
:
needInfo
.
dataValues
.
consult_type
,
region_id
:
needInfo
.
dataValues
.
region_id
}
var
serviceinfo
=
await
this
.
needInfoDao
.
findServiceByProductType
(
urlobj
);
var
serviceinfo
=
await
self
.
needInfoDao
.
findServiceByProductType
(
urlobj
);
if
(
serviceinfo
.
status
<
0
)
{
return
system
.
getResultFail
(
-
203
,
"servicer is empty"
);
}
...
...
brg-user-center/app/base/service/impl/order/orderInfoSve.js
View file @
f08f1ec0
...
...
@@ -646,7 +646,7 @@ class OrderInfoService extends ServiceBase {
return
system
.
getResultFail
(
-
203
,
"txproduct is empty"
);
}
if
(
!
txproductinfo
.
data
.
is_enabled
)
{
return
system
.
getResultFail
(
-
300
,
"servicer isn
'
t enable"
);
return
system
.
getResultFail
(
-
300
,
"servicer isnt enable"
);
}
var
txobj
=
{
"version"
:
"1.0"
,
...
...
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