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
d000c665
Commit
d000c665
authored
Dec 02, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel
parents
83f0055d
1256381b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
257 additions
and
32 deletions
+257
-32
center-channel/app/base/api/impl/action/product.js
+3
-0
center-channel/app/base/api/impl/opreceive/need.js
+3
-1
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
+189
-2
center-channel/app/base/service/impl/utilsSve/utils360Sve.js
+11
-11
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+27
-18
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
+17
-0
center-channel/app/config/settings.js
+7
-0
No files found.
center-channel/app/base/api/impl/action/product.js
View file @
d000c665
...
...
@@ -40,6 +40,9 @@ class ProductAPI extends WEBBase {
case
"getProductRecommend"
:
opResult
=
await
this
.
utilsProductSve
.
getProductRecommend
(
pobj
,
pobj
.
actionBody
);
break
;
case
"updateProductPrice"
:
opResult
=
await
this
.
utilsProductSve
.
updateProductPrice
(
pobj
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
}
...
...
center-channel/app/base/api/impl/opreceive/need.js
View file @
d000c665
...
...
@@ -48,8 +48,10 @@ class Need extends APIBase {
opResult
=
await
this
.
utilsNeedSve
.
needDetailByChannelNo
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getItemByChannelNeedNo"
:
case
"getSolutionByChannelSolutionNo"
:
opResult
=
await
this
.
utilsNeedSve
.
getItemByChannelNeedNo
(
pobj
,
pobj
.
actionBody
);
break
case
"getSolutionByChannelSolutionNo"
:
opResult
=
await
this
.
utilsNeedSve
.
getSolutionByChannelSolutionNo
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getItemByNeedNo"
:
opResult
=
await
this
.
utilsNeedSve
.
getItemByNeedNo
(
pobj
,
pobj
.
actionBody
);
...
...
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
View file @
d000c665
...
...
@@ -14,7 +14,8 @@ const wangwenStatusDisct = {
//区分渠道的uappid
const
uappId
=
{
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
//(百度icp、edi)
'baidu'
:
"44"
,
//(百度icp、edi)
'zc360'
:
"50"
//360icp、edi
}
//tui song baidu zhuanyong pinyin 2020-11-6
const
cityLetter
=
{
...
...
@@ -79,6 +80,7 @@ class BaseCenterOrderService extends AppServiceBase {
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
baiduclient
=
system
.
getObject
(
"util.baiduClient"
);
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
)
};
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
)
{
...
...
@@ -105,6 +107,7 @@ class BaseCenterOrderService extends AppServiceBase {
needsolution
.
solutionContent
=
JSON
.
parse
(
needsolution
.
solutionContent
);
}
var
solution
=
needsolution
.
solutionContent
.
solution
;
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
){
var
reqPushParams
=
{
actionBody
:
{
uapp_id
:
needinfo
.
uapp_id
,
...
...
@@ -121,6 +124,57 @@ class BaseCenterOrderService extends AppServiceBase {
appInfo
:
pobj
.
appInfo
};
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"pushIcpSolution2Channel"
);
}
else
{
var
self
=
this
;
//2020-10-26 laolan 区分百度与阿里
if
(
needinfo
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
// var bizType = needinfo.channelTypeCode;//业务类型里
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
Source
:
"官网"
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
}
var
pushIcpSolutionRes
=
await
this
.
pushIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
if
(
needinfo
.
uapp_id
==
uappId
.
baidu
){
//推送数据至baidu
// var bizType = needinfo.channelTypeCode;//业务类型里
solution
.
Area
=
cityLetter
[
solution
.
Area
]
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
var
pushObj
=
{
requirementId
:
needinfo
.
channelNeedNo
,
companyName
:
solution
.
CompanyName
,
companyAddress
:
solution
.
CompanyAddress
,
area
:
solution
.
Area
,
type
:
solution
.
IcpType
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"bizId"
]
=
needsolution
.
channelSolutionNo
;
}
console
.
log
(
'pushObj++'
,
pushObj
)
var
pushIcpSolutionRes
=
await
this
.
pushBaiduIcpSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
}
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/submitIcpProgramme"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
needinfo
),
optitle
:
"createSolution推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
}
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
needinfo
.
channelNeedNo
,
...
...
@@ -316,7 +370,7 @@ class BaseCenterOrderService extends AppServiceBase {
};
var
self
=
this
;
//推送方案材料
var
ali
=
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
var
ali
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
console
.
log
(
'ali ----- +++'
,
ali
)
if
(
ali
&&
ali
.
status
==
200
){
var
aliFlag
=
200
...
...
@@ -395,9 +449,11 @@ class BaseCenterOrderService extends AppServiceBase {
}
var
material
=
ab
.
material
;
var
reqPushParams
=
{};
if
(
ab
.
isTest
&&
ab
.
isTest
==
1
){
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
reqPushParams
=
{
actionBody
:
{
"uapp_id"
:
res
.
data
.
uapp_id
,
...
...
@@ -459,8 +515,88 @@ class BaseCenterOrderService extends AppServiceBase {
var
result
=
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProviderSubmit2Material"
);
console
.
log
(
'result+++-cailiao--++++----'
,
result
)
console
.
log
(
'result+++-reqPushParams--++++----'
,
reqPushParams
)
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
BizId
=
needsolution
.
channelSolutionNo
;
//⽅案业务ID
var
pushObj
=
{
"CompanyName"
:
material
.
CompanyName
,
"BizId"
:
BizId
,
"Domain"
:
material
.
Domain
,
"CorporateName"
:
material
.
CorporateName
,
"IncludeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"PartnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"PartnerIdCardList"
:
material
.
PartnerIdCardList
,
"PartnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"PartnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"PartnerPlan"
:
material
.
PartnerPlan
||
""
,
"PartnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"PartnerLaw"
:
material
.
PartnerLaw
||
""
,
"PartnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"PartnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"PartnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
var
ali
=
await
self
.
aliclient
.
reqbyget
({
action
:
"SavePartnerSubmitMaterial"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
console
.
log
(
'ali tui ziliao ++'
,
ali
)
if
(
ali
&&
ali
.
status
==
200
){
var
aliFlag
=
200
}
else
{
var
aliFlag
=
-
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
//推送数据至百度
var
BizId
=
needsolution
.
orderChannelNo
;
console
.
log
(
'BizId++'
,
BizId
)
var
pushObj
=
{
"businessLicense"
:
{
"createdAt"
:
material
.
BusinessLicense
.
CreatedAt
||
""
,
"enterpriseCode"
:
material
.
BusinessLicense
.
EnterpriseCode
||
""
,
"legalRepresentative"
:
material
.
BusinessLicense
.
LegalRepresentative
||
""
,
"address"
:
material
.
BusinessLicense
.
Address
||
""
,
"registeredCapital"
:
material
.
BusinessLicense
.
RegisteredCapital
||
""
,
"name"
:
material
.
BusinessLicense
.
Name
||
""
,
"businessTerm"
:
material
.
BusinessLicense
.
BusinessTerm
||
""
,
"type"
:
material
.
BusinessLicense
.
Type
||
""
,
"scopeBusiness"
:
material
.
BusinessLicense
.
ScopeBusiness
||
""
},
"partnerForeignInvestment"
:
material
.
PartnerForeignInvestment
||
""
,
"orderNo"
:
BizId
,
"domain"
:
material
.
Domain
,
"corporateName"
:
material
.
CorporateName
,
"includeForeignInvestment"
:
material
.
IncludeForeignInvestment
,
"partnerBusinessLicense"
:
material
.
PartnerBusinessLicense
,
"partnerIdCardList"
:
material
.
PartnerIdCardList
,
"partnerDomainCertificate"
:
material
.
PartnerDomainCertificate
,
"partnerPreviewOtherList"
:
material
.
PartnerPreviewOtherList
||
[],
"partnerPlan"
:
material
.
PartnerPlan
||
""
,
"partnerLaw"
:
material
.
PartnerLaw
||
""
,
"partnerStampOtherList"
:
material
.
PartnerStampOtherList
||
[],
"partnerSignOtherList"
:
material
.
PartnerSignOtherList
||
[],
"partnerSignAndStampOtherList"
:
material
.
PartnerSignAndStampOtherList
||
[]
};
var
self
=
this
;
//推送方案材料
var
baidu
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/material"
,
reqbody
:
pushObj
});
console
.
log
(
'baidu tui ziliao +++++'
,
baidu
)
console
.
log
(
'baidu pushObj ziliao +++++'
,
pushObj
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
var
baiduFlag
=
200
}
else
{
var
baiduFlag
=
-
200
}
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
){
return
system
.
getResultSuccess
();
}
}
console
.
log
(
'rsrsr++++------------++++'
,
res
)
return
res
}
}
//队列通知交付状态变更
...
...
@@ -527,6 +663,7 @@ class BaseCenterOrderService extends AppServiceBase {
console
.
log
(
'zhuangtai ++++'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
)
{
if
(
pobj
.
actionBody
.
isTest
&&
pobj
.
actionBody
.
isTest
==
1
){
var
reqPushParams
=
{};
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
...
...
@@ -555,6 +692,56 @@ class BaseCenterOrderService extends AppServiceBase {
var
result
=
await
this
.
utilsPushSve
.
business2Channel
(
reqPushParams
,
"serviceProvider2Notification"
);
console
.
log
(
'reqPushParams+++-状态变更--++++----'
,
reqPushParams
)
console
.
log
(
'result+++-状态变更--++++----'
,
result
)
}
else
{
if
(
res
.
data
.
uapp_id
==
uappId
.
ali
){
//推送数据至阿里
var
pushObj
=
{
BizId
:
res
.
data
.
BizId
,
OfficialFileURL
:
res
.
data
.
OfficialFileURL
,
ApplicationStatus
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
var
ali
=
await
this
.
aliclient
.
reqbyget
({
action
:
"AcceptPartnerNotification"
,
reqbody
:
pushObj
,
apiVersion
:
"2019-05-08"
});
if
(
ali
&&
ali
.
status
==
200
){
var
aliFlag
=
200
}
else
{
var
aliFlag
=
-
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
baidu
){
res
.
data
.
ApplicationStatus
=
baiduIcpStatus
[
res
.
data
.
ApplicationStatus
];
console
.
log
(
'res.data.channelOrderNo'
,
res
.
data
.
channelOrderNo
)
//推送数据至百度
var
pushObj
=
{
orderNo
:
res
.
data
.
channelOrderNo
,
status
:
res
.
data
.
ApplicationStatus
};
//推送状态变更
var
baidu
=
await
this
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/license/update"
,
reqbody
:
pushObj
});
console
.
log
(
'res.data baidu +++++'
,
baidu
)
if
(
baidu
&&
baidu
.
data
&&
baidu
.
data
.
result
){
var
baiduFlag
=
200
}
else
{
var
baiduFlag
=
-
200
}
}
if
(
res
.
data
.
uapp_id
==
uappId
.
zc360
){
pobj
.
pushObj
=
res
.
data
;
let
zc360
=
await
this
.
utils360Sve
.
pushOrderStatus
(
pobj
);
if
(
zc360
&&
zc360
.
code
==
200
&&
zc360
.
msg
==
'ok'
){
var
zc360Flag
=
200
}
else
{
var
zc360Flag
=
-
200
}
}
if
(
aliFlag
==
200
||
baiduFlag
==
200
||
zc360Flag
==
200
){
return
system
.
getResultSuccess
();
}
}
return
res
;
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utils360Sve.js
View file @
d000c665
...
...
@@ -56,23 +56,23 @@ class utils360Sve extends AppServiceBase {
//更新订单状态到360
async
pushOrderStatus
(
pobj
)
{
try
{
var
verifyResult
=
await
this
.
verifyParam
(
pobj
);
if
(
verifyResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"status->pushOrderStatus->verifyResult"
,
this
.
pushlogFailType
.
FAILLOG
);
}
var
interface_params_info
=
verifyResult
.
data
;
//
var verifyResult = await this.verifyParam(pobj);
//
if (verifyResult.status != 0) {
//
return await this.disposePushResultFail(pobj, verifyResult, "status->pushOrderStatus->verifyResult", this.pushlogFailType.FAILLOG);
//
}
//
var interface_params_info = verifyResult.data;
let
token
=
await
this
.
utilsAuthSve
.
get360Token
();
let
url
=
interface_params_info
.
opUrl
+
'
?token='
+
token
.
access_token
;
let
url
=
settings
.
pushUrl360
()
+
'api/v1/eshop/GsbOrderUpdate
?token='
+
token
.
access_token
;
let
order_id
=
pobj
.
actionBody
.
orderNo
;
let
ApplicationStatus
=
pobj
.
pushObj
.
ApplicationStatus
;
let
status
=
0
;
if
(
Number
(
ApplicationStatus
)
<
508
)
{
status
=
30
}
else
{
let
status
=
30
;
if
(
Number
(
ApplicationStatus
)
>
510
){
status
=
40
;
}
let
pushObj
=
{
order_id
,
status
order_id
,
status
,
sub_status
:
ApplicationStatus
}
let
result
=
await
this
.
restPostUrl
(
pushObj
,
url
);
if
(
result
.
code
==
200
)
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
d000c665
...
...
@@ -17,6 +17,7 @@ class UtilsOrderService extends AppServiceBase {
this
.
centerAppUrl
=
settings
.
centerAppUrl
();
this
.
centerAppPayUrl
=
settings
.
centerAppUrl
()
+
"payment/paymentApi/springBoard"
;
this
.
paySecret
=
settings
.
paySecret
()
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
);
};
/*
* 订单验证
...
...
@@ -955,24 +956,32 @@ class UtilsOrderService extends AppServiceBase {
actionBody
:
opOrderResult
.
data
}
// 推送
let
yfRet
=
await
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
if
(
yfRet
.
status
!=
0
){
return
yfRet
;
}
if
([
'icpsq'
,
'edisq'
].
includes
(
opOrderResult
.
data
.
product_info
.
channel_item_code
))
{
//创建方案
pobj
.
salesmanInfo
=
{
"salesmanId"
:
yfRet
.
data
.
orderList
[
0
].
operator
||
""
,
"salesmanName"
:
yfRet
.
data
.
orderList
[
0
].
operatorName
||
""
,
"salesmanMobile"
:
yfRet
.
data
.
orderList
[
0
].
phone
||
""
,
"salesmanChannelId"
:
yfRet
.
data
.
orderList
[
0
].
channelUserId
||
""
}
let
pushRet
=
await
this
.
packagingPushData
(
pobj
);
if
(
pushRet
.
status
!=
0
)
{
throw
new
Error
(
'推送失败'
)
}
pobj
.
actionBody
=
pushRet
.
data
;
this
.
utilsPushSve
.
aliBusiness2Delivery
(
pobj
,
"pushDeliveryOrder"
);
// let yfRet = await this.utilsPushSve.pushBusInfo(pobj, "pushOrder", 0);
// if(yfRet.status !=0){
// return yfRet;
// }
// if (['icpsq', 'edisq'].includes(opOrderResult.data.product_info.channel_item_code)) {
// //创建方案
// pobj.salesmanInfo ={
// "salesmanId":yfRet.data.orderList[0].operator || "",
// "salesmanName":yfRet.data.orderList[0].operatorName || "",
// "salesmanMobile":yfRet.data.orderList[0].phone ||"",
// "salesmanChannelId":yfRet.data.orderList[0].channelUserId || ""
// }
// let pushRet = await this.packagingPushData(pobj);
// if (pushRet.status != 0) {
// throw new Error('推送失败')
// }
// pobj.actionBody = pushRet.data;
// this.utilsPushSve.aliBusiness2Delivery(pobj, "pushDeliveryOrder");
// }
//订单状态 已接单 目前360在用
pobj
.
actionBody
.
orderNo
=
params
.
orderNo
;
pobj
.
pushObj
=
{
ApplicationStatus
:
30
};
if
(
pobj
.
appInfo
.
uapp_id
==
'50'
){
this
.
utils360Sve
.
pushOrderStatus
(
pobj
)
}
opOrderResult
.
data
=
null
;
return
opOrderResult
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsProductSve.js
View file @
d000c665
...
...
@@ -117,6 +117,23 @@ class UtilsProductService extends AppServiceBase {
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
}
/**
* 修改产品销售价格
* @param pobj
* @param actionBody
* @returns {Promise<void>}
*/
async
updateProductPrice
(
pobj
,
actionBody
){
if
(
!
actionBody
.
payCode
){
return
system
.
getResultFail
(
-
1
,
'产品码 payCode 不能为空!'
)
}
if
(
!
actionBody
.
price
){
return
system
.
getResultFail
(
-
1
,
'价格 price 不能为空!'
)
}
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
}
}
module
.
exports
=
UtilsProductService
;
center-channel/app/config/settings.js
View file @
d000c665
...
...
@@ -267,6 +267,13 @@ var settings = {
return
"https://console.e.360.cn/"
//
}
},
pushUrl360
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://180.163.239.98:38086/"
// 360测试环境
}
else
{
return
"https://tobadmin.e.360.cn/"
//
}
},
aliUappId
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
18
// uapp_id
...
...
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