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
9525337d
Commit
9525337d
authored
Jul 08, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
c9dc7756
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
120 additions
and
83 deletions
+120
-83
brg-user-center/app/base/api/api.base.js
+29
-3
brg-user-center/app/base/api/impl/action/txapi.js
+9
-6
brg-user-center/app/base/service/impl/common/txPushLogSve.js
+61
-58
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/applyInfoSve.js
+16
-11
brg-user-center/app/base/service/impl/order/orderDeliverySve.js
+0
-0
brg-user-center/app/base/service/impl/order/orderInfoSve.js
+1
-1
brg-user-center/app/config/platform.js
+0
-0
brg-user-center/app/config/settings.js
+2
-2
No files found.
brg-user-center/app/base/api/api.base.js
View file @
9525337d
...
...
@@ -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
);
...
...
@@ -107,6 +129,10 @@ class APIBase {
if
(
typeof
element
===
'string'
||
typeof
element
===
"number"
||
element
instanceof
Date
||
!
element
)
{
newResult
.
Response
[
instanceSet
]
=
element
;
}
else
if
(
element
instanceof
Array
)
{
if
(
element
.
length
==
0
)
{
newResult
.
Response
[
instanceSet
]
=
null
;
continue
;
}
newResult
.
Response
[
instanceSet
]
=
[];
for
(
let
h
=
0
;
h
<
element
.
length
;
h
++
)
{
const
arrayElement
=
element
[
h
];
...
...
@@ -147,9 +173,9 @@ class APIBase {
}
//data处理
}
else
{
if
(
tKey
!=
"data"
)
{
newResult
.
Response
[
newTKey
]
=
""
;
newResult
.
Response
[
newTKey
]
=
typeof
element
===
"number"
?
element
:
null
;
}
else
{
newResult
.
Response
[
instanceSet
]
=
""
;
newResult
.
Response
[
instanceSet
]
=
null
;
}
}
}
...
...
brg-user-center/app/base/api/impl/action/txapi.js
View file @
9525337d
...
...
@@ -22,22 +22,25 @@ class Need extends APIBase {
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"qcloud.
domain
.checkCreate"
:
//新购参数检查
case
"qcloud.
gsb
.checkCreate"
:
//新购参数检查
opResult
=
await
this
.
txPushLogSve
.
checkCreate
(
pobj
,
req
);
break
;
case
"qcloud.
cbs.CreateCbsInstan
ce"
:
//支付回调
case
"qcloud.
gsb.createResour
ce"
:
//支付回调
opResult
=
await
this
.
txPushLogSve
.
createCbsInstance
(
pobj
,
req
);
break
;
case
"qcloud.
PRODUCT_NAME
.queryFlow"
:
//发货状态查询
case
"qcloud.
gsb
.queryFlow"
:
//发货状态查询
opResult
=
await
this
.
txPushLogSve
.
queryFlow
(
pobj
,
req
);
break
;
case
"qcloud.
PRODUCT_NAME
.isolateResource"
:
//资源隔离
case
"qcloud.
gsb
.isolateResource"
:
//资源隔离
opResult
=
await
this
.
txPushLogSve
.
isolateResource
(
pobj
,
req
);
break
;
case
"qcloud.
PRODUCT_NAME
.queryResources"
:
//资源拉取
case
"qcloud.
gsb
.queryResources"
:
//资源拉取
opResult
=
await
this
.
txPushLogSve
.
queryResources
(
pobj
,
req
);
break
;
case
"qcloud.PRODUCT_NAME.destroyResource"
:
//销毁资源
case
"qcloud.gsb.queryUserResources"
:
//用户所有资源拉取
opResult
=
await
this
.
txPushLogSve
.
queryUserResources
(
pobj
,
req
);
break
;
case
"qcloud.gsb.destroyResource"
:
//销毁资源
opResult
=
await
this
.
txPushLogSve
.
destroyResource
(
pobj
,
req
);
break
;
default
:
...
...
brg-user-center/app/base/service/impl/common/txPushLogSve.js
View file @
9525337d
...
...
@@ -15,6 +15,7 @@ class TxPushLogService extends ServiceBase {
"componentName"
:
componentName
,
"returnValue"
:
status
,
"returnCode"
:
status
,
"timestamp"
:
Date
.
now
(),
"returnMessage"
:
message
,
"data"
:
data
}
...
...
@@ -95,70 +96,72 @@ class TxPushLogService extends ServiceBase {
if
(
!
pobj
.
interface
.
para
.
resourceIds
[
0
])
{
return
self
.
returnTX
(
-
1
,
"cgateway"
,
"参数错误"
,
null
)
}
var
orderProduct
=
await
this
.
orderProductDao
.
findOne
({
order_num
:
loginfo
.
dataValues
.
dealName
});
if
(
!
orderProduct
)
{
var
resources
=
[];
for
(
let
i
=
0
;
i
<
pobj
.
interface
.
para
.
resourceIds
.
length
;
i
++
)
{
var
orderProduct
=
await
this
.
orderProductDao
.
findOne
({
order_num
:
pobj
.
interface
.
para
.
resourceIds
[
i
]
});
if
(
!
orderProduct
)
{
return
self
.
returnTX
(
-
1
,
"cgateway"
,
"资源不存在"
,
null
)
}
var
resource
=
{
"appId"
:
orderProduct
.
tx_order_snapshot
.
appId
,
"uin"
:
orderProduct
.
tx_order_snapshot
.
ownerUin
,
"resourceId"
:
pobj
.
interface
.
para
.
resourceIds
[
i
],
//站内信自定义字段层级和此字段同一层级
"projectId"
:
0
,
"autoRenewFlag"
:
0
,
"region"
:
1
,
"zoneId"
:
orderProduct
.
tx_order_snapshot
.
zoneId
,
"status"
:
orderProduct
.
status
,
"payMode"
:
1
,
// 必传,1预付费 0后付费
"isolatedTimestamp"
:
orderProduct
.
isolated_timestamp
||
"0000-00-00 00:00:00"
,
"createTime"
:
orderProduct
.
start_time
,
"expireTime"
:
orderProduct
.
end_time
||
"0000-00-00 00:00:00"
,
"goodsDetail"
:
orderProduct
.
tx_order_snapshot
.
goodsDetail
}
resources
.
push
(
resource
);
}
return
self
.
returnTX
(
1
,
"cgateway"
,
"ok"
,
{
"resources"
:
resources
})
}
//用户所有资源拉取
async
queryUserResources
(
pobj
)
{
var
self
=
this
;
if
(
!
pobj
.
interface
.
para
.
uin
)
{
return
self
.
returnTX
(
-
1
,
"cgateway"
,
"参数错误"
,
null
)
}
var
orderProduct
=
await
this
.
orderProductDao
.
findAndCountAll
({
search
:
{
user_id
:
pobj
.
interface
.
para
.
uin
},
pageInfo
:
{
pageNo
:
Number
(
pobj
.
interface
.
para
.
pageNo
)
||
1
,
pageSize
:
Number
(
pobj
.
interface
.
para
.
pageSize
)
||
1000
}
});
if
(
orderProduct
.
count
<
1
)
{
return
self
.
returnTX
(
-
1
,
"cgateway"
,
"资源不存在"
,
null
)
}
var
r
=
{
"eventId"
:
186993048
,
"version"
:
1
,
"componentName"
:
"cgateway"
,
"timestamp"
:
1500912302
,
"returnValue"
:
0
,
"returnCode"
:
0
,
"returnMessage"
:
"ok"
,
"data"
:
{
"resources"
:
[
{
"appId"
:
appId
,
"uin"
:
ownerUin
,
"resourceId"
:
tx_order_snapshot
,
//站内信自定义字段层级和此字段同一层级
"projectId"
:
0
,
"autoRenewFlag"
:
0
,
"region"
:
1
,
"zoneId"
:
200001
,
"status"
:
orderProduct
.
status
,
"payMode"
:
1
,
// 必传,1预付费 0后付费
"isolatedTimestamp"
:
orderProduct
.
isolated_timestamp
||
"0000-00-00 00:00:00"
,
"createTime"
:
orderProduct
.
start_time
,
"expireTime"
:
orderProduct
.
end_time
||
"0000-00-00 00:00:00"
,
"goodsDetail"
:
orderProduct
.
tx_order_snapshot
.
goodsDetail
}
]
var
resources
=
[];
for
(
let
i
=
0
;
i
<
orderProduct
.
rows
.
length
;
i
++
)
{
const
resource
=
{
"appId"
:
orderProduct
.
rows
[
i
].
tx_order_snapshot
.
appId
,
"uin"
:
orderProduct
.
rows
[
i
].
tx_order_snapshot
.
ownerUin
,
"resourceId"
:
orderProduct
.
rows
[
i
].
order_num
,
//站内信自定义字段层级和此字段同一层级
"projectId"
:
0
,
"autoRenewFlag"
:
0
,
"region"
:
1
,
"zoneId"
:
orderProduct
.
rows
[
i
].
tx_order_snapshot
.
zoneId
,
"status"
:
orderProduct
.
status
,
"payMode"
:
1
,
// 必传,1预付费 0后付费
"isolatedTimestamp"
:
orderProduct
.
rows
[
i
].
isolated_timestamp
||
"0000-00-00 00:00:00"
,
"createTime"
:
orderProduct
.
rows
[
i
].
start_time
,
"expireTime"
:
orderProduct
.
rows
[
i
].
end_time
||
"0000-00-00 00:00:00"
,
"goodsDetail"
:
orderProduct
.
rows
[
i
].
tx_order_snapshot
.
goodsDetail
}
resources
.
push
(
resource
);
}
return
self
.
returnTX
(
1
,
"cgateway"
,
"ok"
,
{
"
status"
:
loginfo
.
push_statu
s
})
return
self
.
returnTX
(
1
,
"cgateway"
,
"ok"
,
{
"
total"
:
orderProduct
.
count
,
"resources"
:
resource
s
})
}
// {
// "version": "1.0",
// "caller": "mall_logic",
// "componentName": "mall_logic",
// "password": "mall_logic",
// "callee": "cdb",
// "eventId": 843836670,
// "seqId": "1501802577.465723597230350480",
// "spanId": "logical;1",
// "timestamp": 1501802577,
// "interface": {
// "interfaceName": "qcloud.PRODUCT_NAME.isolateResource",
// "para": {
// "appId": 123,
// "uin": "123",
// "operateUin": "123",
// "type": "cdb",
// "region": 4,
// "resourceId": "cdb-dfe8t7i9"
// "renewFlag": 0,
// "newDeadline": "2016-10-22 12:00:00",
// "billingIsolateType": "refund",
// "billingExtParam":{
// "sv_xxx":"sv_xxx"// 查询用量时业务返回的数据
// }
// }
// }
// }
//隔离资源
async
isolateResource
(
pobj
)
{
var
self
=
this
;
...
...
brg-user-center/app/base/service/impl/need/needInfoSve.js
View file @
9525337d
...
...
@@ -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 @
9525337d
...
...
@@ -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/applyInfoSve.js
View file @
9525337d
...
...
@@ -119,19 +119,24 @@ class ApplyInfoService extends ServiceBase {
var
selfEmployedPersonCount
=
await
this
.
dao
.
findCount
({
where
:
{
apply_type
:
2
,
user_id
:
ab
.
UserId
}
});
//个体户数量
var
waitConfirmCount
=
await
this
.
needInfoDao
.
findCount
({
where
:
{
status
:
3
,
user_id
:
ab
.
UserId
,
consult_type
:
{
[
this
.
db
.
Op
.
like
]:
productTypeOne
}
}
});
//待确认方案数量
var
waitReceiveFileOrderCount
=
await
this
.
orderDeliveryDao
.
findOverviewCount
(
150
,
ab
.
UserId
,
ab
.
ProductTypeOne
);
//待收文件数量
// var unpaidCount = await this.orderInfoDao.findCount({where:{order_status:0}});//待支付订单数量
if
(
ab
.
ProductTypeOne
==
"qcfw"
){
//资质证照
var
internetContentProviderCount
=
await
this
.
orderInfoDao
.
findOrderCountByProductPathCode
(
"/qcfw/icp/"
,
ab
.
UserId
);
//icp数量
var
electronicDataInterchangeCount
=
await
this
.
orderInfoDao
.
findOrderCountByProductPathCode
(
"/qcfw/edi/"
,
ab
.
UserId
);
//edi数量
var
resultObj
=
{
internetContentProviderCount
:
internetContentProviderCount
,
waitConfirmCount
:
waitConfirmCount
,
electronicDataInterchangeCount
:
electronicDataInterchangeCount
,
waitReceiveFileOrderCount
:
waitReceiveFileOrderCount
};
return
system
.
getResult
(
resultObj
);
}
// if(ab.ProductTypeOne == "qcfw"){//资质证照
// var internetContentProviderCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/icp/",ab.UserId);//icp数量
// var electronicDataInterchangeCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/edi/",ab.UserId);//edi数量
// var resultObj = {
// internetContentProviderCount: internetContentProviderCount, waitConfirmCount: waitConfirmCount, electronicDataInterchangeCount: electronicDataInterchangeCount,
// waitReceiveFileOrderCount: waitReceiveFileOrderCount
// };
// return system.getResult(resultObj);
// }
var
internetContentProviderCount
=
await
this
.
orderInfoDao
.
findOrderCountByProductPathCode
(
"/qcfw/icp/"
,
ab
.
UserId
);
//icp数量
var
electronicDataInterchangeCount
=
await
this
.
orderInfoDao
.
findOrderCountByProductPathCode
(
"/qcfw/edi/"
,
ab
.
UserId
);
//edi数量
// var resultObj = {
// internetContentProviderCount: internetContentProviderCount, waitConfirmCount: waitConfirmCount, electronicDataInterchangeCount: electronicDataInterchangeCount,
// waitReceiveFileOrderCount: waitReceiveFileOrderCount
// };
var
resultObj
=
{
companyCount
:
companyCount
,
waitConfirmCount
:
waitConfirmCount
,
selfEmployedPersonCount
:
selfEmployedPersonCount
,
waitReceiveFileOrderCount
:
waitReceiveFileOrderCount
waitReceiveFileOrderCount
:
waitReceiveFileOrderCount
,
internetContentProviderCount
:
internetContentProviderCount
,
electronicDataInterchangeCount
:
electronicDataInterchangeCount
};
return
system
.
getResult
(
resultObj
);
}
...
...
brg-user-center/app/base/service/impl/order/orderDeliverySve.js
View file @
9525337d
This diff is collapsed.
Click to expand it.
brg-user-center/app/base/service/impl/order/orderInfoSve.js
View file @
9525337d
...
...
@@ -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"
,
...
...
brg-user-center/app/config/platform.js
View file @
9525337d
This diff is collapsed.
Click to expand it.
brg-user-center/app/config/settings.js
View file @
9525337d
...
...
@@ -18,14 +18,14 @@ var settings = {
port
:
process
.
env
.
NODE_PORT
||
4011
,
opLogUrl
:
function
()
{
if
(
this
.
env
==
"dev"
||
this
.
env
==
"test"
)
{
return
"http://192.168.
1.128
:4019/api/queueAction/producer/springBoard"
;
return
"http://192.168.
210.205
:4019/api/queueAction/producer/springBoard"
;
}
else
{
return
"http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
},
opPushUrl
:
function
()
{
if
(
this
.
env
==
"dev"
||
this
.
env
==
"test"
)
{
return
"http://192.168.
1.128
:4018/api/queueAction/producer/springBoard"
;
return
"http://192.168.
210.205
:4018/api/queueAction/producer/springBoard"
;
}
else
{
return
"http://sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
...
...
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