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
3d4e0959
Commit
3d4e0959
authored
Mar 29, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加产品id
parent
dfea7fbf
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
407 additions
and
216 deletions
+407
-216
center-channel/app/base/service/impl/common/regCenterOrderSve.js
+5
-5
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+212
-184
center-channel/app/base/service/impl/utilsSve/utilsNeedCommSve.js
+70
-0
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+14
-6
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
+11
-4
center-channel/app/base/service/impl/utilsSve/utilsOpNeedSve.js
+5
-3
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+1
-1
center-channel/app/config/businessConfig.js
+88
-12
center-channel/app/config/routes/api.js
+1
-1
No files found.
center-channel/app/base/service/impl/common/regCenterOrderSve.js
View file @
3d4e0959
...
@@ -217,13 +217,15 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -217,13 +217,15 @@ class RegCenterOrderService extends AppServiceBase {
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求
類
型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求
类
型查询失败"
);
}
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5016
,
"需求
類
型查询失败"
);
return
system
.
getResultFail
(
-
5016
,
"需求
类
型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
...
@@ -263,8 +265,6 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -263,8 +265,6 @@ class RegCenterOrderService extends AppServiceBase {
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
pobj
.
actionBody
.
customerName
=
pobj
.
actionBody
.
userName
;
pobj
.
actionBody
.
customerName
=
pobj
.
actionBody
.
userName
;
//2021-1-21 laolan add new
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
||
''
,
this
.
utilsPushSve
.
baiduBusiness2Fq
(
pobj
,
"pushNeedICPBusinessNew"
);
this
.
utilsPushSve
.
baiduBusiness2Fq
(
pobj
,
"pushNeedICPBusinessNew"
);
}
}
return
result
;
return
result
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
3d4e0959
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
{
json
}
=
require
(
"sequelize"
);
const
{
json
}
=
require
(
"sequelize"
);
const
{
AREACOMM
}
=
require
(
"../../../../config/businessConfig"
);
//此类用来db中配置来进行调用-主要功能是推送蜂擎业务
//此类用来db中配置来进行调用-主要功能是推送蜂擎业务
class
UtilsFqAliyunService
extends
AppServiceBase
{
class
UtilsFqAliyunService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
ucommuneOperatorPhone
=
settings
.
ucommuneOperatorPhone
()
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
}
this
.
ucommuneOperatorPhone
=
settings
.
ucommuneOperatorPhone
()
async
pushOrderBusinessByProductCode2Fq
(
pobj
)
{
//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
console
.
log
(
JSON
.
stringify
(
pobj
),
".................pushOrderBusinessByProductCode2Fq...............pobj"
);
var
verifyResult
=
await
this
.
verifyParam
(
pobj
);
var
orderInfo
=
pobj
.
actionBody
.
order_info
;
var
orderContact
=
pobj
.
actionBody
.
order_contact
?
pobj
.
actionBody
.
order_contact
:
pobj
.
actionBody
.
delivery_content
.
orderContact
;
var
productInfo
=
pobj
.
actionBody
.
product_info
;
if
(
!
orderInfo
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo can not be empty,100420"
);
}
if
(
!
orderInfo
.
orderStatus
||
orderInfo
.
orderStatus
<
2
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo status must be paid,100423"
);
}
if
(
!
orderContact
||
!
orderContact
.
mobile
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.orderContact.mobile can not be empty,100425"
);
}
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
}
if
(
!
[
'360.icp'
,
'360.edi'
].
includes
(
productInfo
.
service_business_code
))
{
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
}
}
if
(
verifyResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushOrderBusinessByProductCode2Fq->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
}
}
var
interface_params_info
=
verifyResult
.
data
;
async
pushOrderBusinessByProductCode2Fq
(
pobj
)
{
//推送自定义产品码的订单商机到峰擎(订单已经支付成功才推送)
var
ucommuneOperatorPhone
=
pobj
.
appInfo
&&
pobj
.
appInfo
.
contact_mobile
?
pobj
.
appInfo
.
contact_mobile
:
this
.
ucommuneOperatorPhone
console
.
log
(
JSON
.
stringify
(
pobj
),
".................pushOrderBusinessByProductCode2Fq...............pobj"
);
console
.
log
(
"推送的业务员手机号为:"
,
ucommuneOperatorPhone
)
var
verifyResult
=
await
this
.
verifyParam
(
pobj
);
var
params
=
{
var
orderInfo
=
pobj
.
actionBody
.
order_info
;
idempotentId
:
orderInfo
.
orderNo
,
// 是 业务 ID
var
orderContact
=
pobj
.
actionBody
.
order_contact
?
pobj
.
actionBody
.
order_contact
:
pobj
.
actionBody
.
delivery_content
.
orderContact
;
idempotentSource
:
productInfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
var
productInfo
=
pobj
.
actionBody
.
product_info
;
idempotentSourceName
:
productInfo
.
service_business_name
||
productInfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
if
(
!
orderInfo
)
{
area
:
productInfo
.
price_item
.
price_desc
,
// 否 所属城市
verifyResult
=
system
.
getResult
(
null
,
"orderInfo can not be empty,100420"
);
phone
:
orderContact
.
mobile
,
// 是 手机号
}
userId
:
orderInfo
.
channelUserId
,
// 否 用户 ID
if
(
!
orderInfo
.
orderStatus
||
orderInfo
.
orderStatus
<
2
)
{
companyName
:
""
,
// 否 公司名称
verifyResult
=
system
.
getResult
(
null
,
"orderInfo status must be paid,100423"
);
orderNo
:
orderInfo
.
orderNo
,
}
orderPrice
:
orderInfo
.
totalSum
,
// 是 订单金额
if
(
!
orderContact
||
!
orderContact
.
mobile
)
{
productId
:
productInfo
.
price_item
.
service_code
,
// 是 产品 ID
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.orderContact.mobile can not be empty,100425"
);
productQuantity
:
orderInfo
.
quantity
,
// 是 产品数量
}
operator_phone
:
ucommuneOperatorPhone
,
// 2020 0704 推送fq 必填字段 这里以下为新增 7.7修改由写死改为从settings获取
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
createdat
:
orderInfo
.
created_at
,
// 2020 0722 lin新增 张超推送文档新增必填字段
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
thirdPartyCustomerId
:
orderInfo
.
channelUserId
,
}
pay_flow_no
:
orderInfo
.
pay_flow_no
,
// 支付流水号
if
(
!
[
'360.icp'
,
'360.edi'
].
includes
(
productInfo
.
service_business_code
))
{
pay_channel
:
orderInfo
.
pay_channel
,
// 支付渠道(微信、支付宝)(必填)
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
pay_time
:
orderInfo
.
pay_time
,
//付款时间
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
pay_payer_bank_no
:
orderInfo
.
pay_payer_bank_no
,
//付款人账号
}
sku
:
productInfo
.
price_item
.
service_code
,
}
appName
:
pobj
.
appInfo
.
app_name
if
(
verifyResult
.
status
!=
0
)
{
};
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushOrderBusinessByProductCode2Fq->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
// var result = await this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
}
var
result
=
await
this
.
opAliyunClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
params
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushOrderBusinessByProductCode2Fq->result"
,
this
.
pushlogFailType
.
FQ
);
}
/**
var
interface_params_info
=
verifyResult
.
data
;
* 推送阿里信息操作到峰擎
var
ucommuneOperatorPhone
=
pobj
.
appInfo
&&
pobj
.
appInfo
.
contact_mobile
?
pobj
.
appInfo
.
contact_mobile
:
this
.
ucommuneOperatorPhone
* 阿里操作的信息不变外加增加组装的一些参数(推送工商需求商机、推送工商订单商机、推送关闭工商需求)
console
.
log
(
"推送的业务员手机号为:"
,
ucommuneOperatorPhone
)
* @param {*} pobj
var
params
=
{
*/
idempotentId
:
orderInfo
.
orderNo
,
// 是 业务 ID
async
pushAliBusiness2Fq
(
pobj
)
{
//推送阿里信息操作到峰擎
idempotentSource
:
productInfo
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
var
verifyResult
=
await
this
.
verifyParam
(
pobj
);
idempotentSourceName
:
productInfo
.
service_business_name
||
productInfo
.
service_business_code
,
// 是 京东云应用、阿里云应用
if
(
verifyResult
.
status
!=
0
)
{
area
:
productInfo
.
price_item
.
price_desc
,
// 否 所属城市
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushAliBusiness2Fq->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
phone
:
orderContact
.
mobile
,
// 是 手机号
userId
:
orderInfo
.
channelUserId
,
// 否 用户 ID
companyName
:
""
,
// 否 公司名称
orderNo
:
orderInfo
.
orderNo
,
orderPrice
:
orderInfo
.
totalSum
,
// 是 订单金额
productId
:
productInfo
.
price_item
.
service_code
,
// 是 产品 ID
productQuantity
:
orderInfo
.
quantity
,
// 是 产品数量
operator_phone
:
ucommuneOperatorPhone
,
// 2020 0704 推送fq 必填字段 这里以下为新增 7.7修改由写死改为从settings获取
createdat
:
orderInfo
.
created_at
,
// 2020 0722 lin新增 张超推送文档新增必填字段
thirdPartyCustomerId
:
orderInfo
.
channelUserId
,
pay_flow_no
:
orderInfo
.
pay_flow_no
,
// 支付流水号
pay_channel
:
orderInfo
.
pay_channel
,
// 支付渠道(微信、支付宝)(必填)
pay_time
:
orderInfo
.
pay_time
,
//付款时间
pay_payer_bank_no
:
orderInfo
.
pay_payer_bank_no
,
//付款人账号
sku
:
productInfo
.
price_item
.
service_code
,
appName
:
pobj
.
appInfo
.
app_name
};
// var result = await this.opAliyunClientPost(pobj, "pushOrderBusiness", interface_params_info.opUrl, interface_params_info.key, interface_params_info.secret, params);
var
result
=
await
this
.
opAliyunClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
params
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushOrderBusinessByProductCode2Fq->result"
,
this
.
pushlogFailType
.
FQ
);
}
}
var
interface_params_info
=
verifyResult
.
data
;
var
result
=
await
this
.
opAliyunClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
pobj
.
actionBody
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushAliBusiness2Fq->result"
,
this
.
pushlogFailType
.
FQ
);
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
/**
* 推送阿里信息操作到峰擎
* 阿里操作的信息不变外加增加组装的一些参数(推送工商需求商机、推送工商订单商机、推送关闭工商需求)
* @param {*} pobj
*/
async
pushAliBusiness2Fq
(
pobj
)
{
//推送阿里信息操作到峰擎
var
verifyResult
=
await
this
.
verifyParam
(
pobj
);
if
(
verifyResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"fq->pushAliBusiness2Fq->verifyResult"
,
this
.
pushlogFailType
.
FQ
);
}
var
interface_params_info
=
verifyResult
.
data
;
if
(
interface_params_info
.
opUrl
.
indexOf
(
"/cts-open-agency/crm/opportunity/submit"
)
>=
0
)
{
async
opAliyunClientPost
(
pobj
,
url
,
key
,
secret
,
params
)
{
}
try
{
var
result
=
await
this
.
opAliyunClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
pobj
.
actionBody
);
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushAliBusiness2Fq->result"
,
this
.
pushlogFailType
.
FQ
);
var
rtn
=
await
rc
.
post
(
url
,
key
,
secret
,
params
);
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
rtn
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送结果1->fq->opAliyunClientPost"
,
});
// typeof element === 'string' || typeof element === 'number'
if
(
typeof
rtn
.
code
===
'number'
&&
rtn
.
code
!=
200
&&
rtn
.
success
!=
true
)
{
return
system
.
getResult
(
null
,
"推送失败,失败原因11:"
+
JSON
.
stringify
(
rtn
));
}
if
(
typeof
rtn
.
code
===
'string'
&&
rtn
.
code
!=
"200"
&&
rtn
.
success
!=
true
)
{
return
system
.
getResult
(
null
,
"推送失败,失败原因12:"
+
JSON
.
stringify
(
rtn
));
}
return
system
.
getResultSuccess
(
rtn
.
data
,
"推送成功"
);
}
catch
(
e
)
{
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
"error:"
+
e
.
stack
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->fq->opAliyunClientPost"
,
});
return
system
.
getResult
(
null
,
"推送操作异常->fq->opAliyunClientPost->error:"
+
e
.
stack
);
}
}
}
async
opICClientPost
(
pobj
,
url
,
key
,
secret
,
params
)
{
async
transformNeedActionBody
(
pobj
)
{
try
{
if
(
!
pobj
.
actionBody
.
area
)
{
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
pobj
.
actionBody
.
area
=
"全国"
;
var
rtn
=
await
rc
.
post
(
url
,
key
,
secret
,
params
);
}
this
.
logCtl
.
info
({
if
(
pobj
.
actionBody
.
area
!=
"全国"
&&
pobj
.
actionBody
.
area
.
indexOf
(
"市"
)
<
0
&&
pobj
.
actionBody
.
area
.
indexOf
(
"省"
)
<
0
)
{
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
pobj
.
actionBody
.
area
=
AREACOMM
.
areaTransform
[
pobj
.
actionBody
.
area
]
||
pobj
.
actionBody
.
area
;
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
}
requestId
:
pobj
.
requestId
||
""
,
if
(
pobj
.
actionBody
.
intentionBizId
&&
(
!
pobj
.
actionBody
.
appName
||
!
pobj
.
actionBody
.
productId
))
{
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
//获取需求信息
content
:
rtn
,
let
tmpActionBody
=
{
// clientIp: pobj.clientIp,
actionBody
:
{
needNo
:
pobj
.
actionBody
.
intentionBizId
}
optitle
:
pobj
.
opType
+
"推送结果2->fq->opAliyunClientPost"
,
}
});
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/getNeedItemByChannelNeedNo"
;
if
(
typeof
rtn
.
code
===
'number'
&&
rtn
.
code
!=
200
&&
rtn
.
success
!=
true
)
{
var
itemResult
=
await
this
.
restPostUrl
(
tmpActionBody
,
reqUrl
);
return
system
.
getResult
(
null
,
"推送失败,失败原因21:"
+
JSON
.
stringify
(
rtn
));
if
(
itemResult
.
status
==
0
&&
itemResult
.
data
)
{
}
pobj
.
actionBody
.
appName
=
itemResult
.
data
.
appName
;
if
(
typeof
rtn
.
code
===
'string'
&&
rtn
.
code
!=
"200"
&&
rtn
.
success
!=
true
)
{
pobj
.
actionBody
.
productId
=
itemResult
.
data
.
serviceProductId
;
return
system
.
getResult
(
null
,
"推送失败,失败原因22:"
+
JSON
.
stringify
(
rtn
));
}
}
}
return
system
.
getResultSuccess
(
rtn
.
data
,
"推送成功"
);
}
catch
(
e
)
{
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
"error:"
+
e
.
stack
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->fq->opAliyunClientPost"
,
});
return
system
.
getResult
(
null
,
"推送操作异常->fq->opAliyunClientPost->error:"
+
e
.
stack
);
}
}
}
//--------------------------------------------------内部辅助方法-------------------start-----------------
async
verifyParam
(
pobj
)
{
//参数信息验证
async
opAliyunClientPost
(
pobj
,
url
,
key
,
secret
,
params
)
{
var
verify
=
system
.
getResultSuccess
();
try
{
if
(
!
pobj
.
interface_params
)
{
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
verify
=
system
.
getResult
(
null
,
"interface_params can not be empty,100400"
);
var
rtn
=
await
rc
.
post
(
url
,
key
,
secret
,
params
);
}
this
.
logCtl
.
info
({
var
interface_params_info
=
JSON
.
parse
(
pobj
.
interface_params
);
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
verify
=
system
.
getResult
(
null
,
"interface_params(opUrl、key、secret) can not be empty,100410"
);
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
rtn
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送结果1->fq->opAliyunClientPost"
,
});
// typeof element === 'string' || typeof element === 'number'
if
(
typeof
rtn
.
code
===
'number'
&&
rtn
.
code
!=
200
&&
rtn
.
success
!=
true
)
{
return
system
.
getResult
(
null
,
"推送失败,失败原因11:"
+
JSON
.
stringify
(
rtn
));
}
if
(
typeof
rtn
.
code
===
'string'
&&
rtn
.
code
!=
"200"
&&
rtn
.
success
!=
true
)
{
return
system
.
getResult
(
null
,
"推送失败,失败原因12:"
+
JSON
.
stringify
(
rtn
));
}
return
system
.
getResultSuccess
(
rtn
.
data
,
"推送成功"
);
}
catch
(
e
)
{
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
"error:"
+
e
.
stack
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->fq->opAliyunClientPost"
,
});
return
system
.
getResult
(
null
,
"推送操作异常->fq->opAliyunClientPost->error:"
+
e
.
stack
);
}
}
}
verify
.
data
=
interface_params_info
;
return
verify
;
}
//下订单到ic
async
opICClientPost
(
pobj
,
url
,
key
,
secret
,
params
)
{
async
pushOrder2IC
(
pobj
,
opType
)
{
try
{
console
.
log
(
JSON
.
stringify
(
pobj
),
".................pushOrderBusinessByProductCode2Fq...............pobj"
);
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
var
rtn
=
await
rc
.
post
(
url
,
key
,
secret
,
params
);
if
(
!
interface_list
)
{
this
.
logCtl
.
info
({
return
system
.
getResult
(
null
,
"暂无推送配置"
);
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
rtn
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送结果2->fq->opAliyunClientPost"
,
});
if
(
typeof
rtn
.
code
===
'number'
&&
rtn
.
code
!=
200
&&
rtn
.
success
!=
true
)
{
return
system
.
getResult
(
null
,
"推送失败,失败原因21:"
+
JSON
.
stringify
(
rtn
));
}
if
(
typeof
rtn
.
code
===
'string'
&&
rtn
.
code
!=
"200"
&&
rtn
.
success
!=
true
)
{
return
system
.
getResult
(
null
,
"推送失败,失败原因22:"
+
JSON
.
stringify
(
rtn
));
}
return
system
.
getResultSuccess
(
rtn
.
data
,
"推送成功"
);
}
catch
(
e
)
{
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/opAliyunClientPost.js/opAliyunClientPost"
,
content
:
"error:"
+
e
.
stack
,
// clientIp: pobj.clientIp,
optitle
:
pobj
.
opType
+
"推送操作异常->fq->opAliyunClientPost"
,
});
return
system
.
getResult
(
null
,
"推送操作异常->fq->opAliyunClientPost->error:"
+
e
.
stack
);
}
}
}
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
if
(
!
interface_list_temp
||
interface_list_temp
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"暂无【"
+
opType
+
"】的推送配置"
);
async
verifyParam
(
pobj
)
{
//参数信息验证
}
var
verify
=
system
.
getResultSuccess
();
var
verifyResult
=
system
.
getResultSuccess
();
if
(
!
pobj
.
interface_params
)
{
var
productInfo
=
pobj
.
actionBody
.
product_info
;
verify
=
system
.
getResult
(
null
,
"interface_params can not be empty,100400"
);
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
}
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
var
interface_params_info
=
JSON
.
parse
(
pobj
.
interface_params
);
}
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
verify
=
system
.
getResult
(
null
,
"interface_params(opUrl、key、secret) can not be empty,100410"
);
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
}
verify
.
data
=
interface_params_info
;
return
verify
;
}
}
var
interface_params_info
=
JSON
.
parse
(
interface_list_temp
[
0
].
params
);
//新增订单(商标自助注册) IC
//下订单到ic
let
icOrderParams
=
{
async
pushOrder2IC
(
pobj
,
opType
)
{
"idempotentSource"
:
"pcwebsbzc"
,
// 来源编号,写死:pcwebsbzc,必填
console
.
log
(
JSON
.
stringify
(
pobj
),
".................pushOrderBusinessByProductCode2Fq...............pobj"
);
"idempotentSourceName"
:
"PC官网"
,
// 来源编号,写死:PC官网,必填
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
"product_img_url"
:
pobj
.
actionBody
.
deliveryData
.
tm
.
picUrl
,
//产品图片
if
(
!
interface_list
)
{
"productId"
:
productInfo
.
price_item
.
service_code
,
// 云服产品skuid,必填
return
system
.
getResult
(
null
,
"暂无推送配置"
);
"goodsId"
:
pobj
.
actionBody
.
goodsId
,
// 官网产品id
}
"customerId"
:
pobj
.
actionBody
.
customerId
,
//客户Id,必填
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
"product_item"
:
pobj
.
actionBody
.
product_item
,
if
(
!
interface_list_temp
||
interface_list_temp
.
length
==
0
)
{
"device_token"
:
pobj
.
actionBody
.
device_token
//设备编号参数
return
system
.
getResult
(
null
,
"暂无【"
+
opType
+
"】的推送配置"
);
}
var
verifyResult
=
system
.
getResultSuccess
();
var
productInfo
=
pobj
.
actionBody
.
product_info
;
if
(
!
productInfo
||
!
productInfo
.
service_business_code
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.service_business_code can not be empty,100427"
);
}
if
(
!
productInfo
||
!
productInfo
.
price_item
||
!
productInfo
.
price_item
.
service_code
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo.productInfo.price_item.service_code can not be empty,100430"
);
}
var
interface_params_info
=
JSON
.
parse
(
interface_list_temp
[
0
].
params
);
//新增订单(商标自助注册) IC
let
icOrderParams
=
{
"idempotentSource"
:
"pcwebsbzc"
,
// 来源编号,写死:pcwebsbzc,必填
"idempotentSourceName"
:
"PC官网"
,
// 来源编号,写死:PC官网,必填
"product_img_url"
:
pobj
.
actionBody
.
deliveryData
.
tm
.
picUrl
,
//产品图片
"productId"
:
productInfo
.
price_item
.
service_code
,
// 云服产品skuid,必填
"goodsId"
:
pobj
.
actionBody
.
goodsId
,
// 官网产品id
"customerId"
:
pobj
.
actionBody
.
customerId
,
//客户Id,必填
"product_item"
:
pobj
.
actionBody
.
product_item
,
"device_token"
:
pobj
.
actionBody
.
device_token
//设备编号参数
}
pobj
.
params
=
icOrderParams
;
var
result
=
await
this
.
opICClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
icOrderParams
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushOrder2IC->result"
,
this
.
pushlogFailType
.
FQ
);
}
}
pobj
.
params
=
icOrderParams
;
var
result
=
await
this
.
opICClientPost
(
pobj
,
interface_params_info
.
opUrl
,
interface_params_info
.
key
,
interface_params_info
.
secret
,
icOrderParams
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"fq->pushOrder2IC->result"
,
this
.
pushlogFailType
.
FQ
);
}
//--------------------------------------------------内部辅助方法-------------------end-----------------
//--------------------------------------------------内部辅助方法-------------------end-----------------
}
}
module
.
exports
=
UtilsFqAliyunService
;
module
.
exports
=
UtilsFqAliyunService
;
center-channel/app/base/service/impl/utilsSve/utilsNeedCommSve.js
0 → 100644
View file @
3d4e0959
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
fs
=
require
(
"fs"
);
const
{
json
}
=
require
(
"sequelize"
);
const
{
getResult
,
getResultSuccess
}
=
require
(
"../../../system"
);
//需求操作类----操作类型-公用的
class
UtilsNeedCommService
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
ossClient
=
system
.
getObject
(
"util.ossClient"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
qcCenterOrderSve
=
system
.
getObject
(
"service.common.qcCenterOrderSve"
);
this
.
opPushQueueUrl
=
settings
.
opPushQueueUrl
();
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
}
/**
* 提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async
submitNeed
(
pobj
,
actionBody
)
{
if
(
actionBody
.
type
==
"esp.wangwen"
||
actionBody
.
type
==
"esp.food"
)
{
actionBody
.
area
=
this
.
wangwenAreaChange
(
actionBody
.
area
)
}
if
(
!
actionBody
.
type
&&
actionBody
.
consultType
)
actionBody
.
type
=
actionBody
.
consultType
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100380"
);
}
var
sobj
=
pobj
;
sobj
.
actionType
=
"getProductTypeInfo"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
phone
=
pobj
.
actionBody
.
phone
||
pobj
.
actionBody
.
mobile
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentSourceName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionType
=
"submitNeed"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
//做推送信息
}
return
result
;
}
}
module
.
exports
=
UtilsNeedCommService
;
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
3d4e0959
...
@@ -39,19 +39,21 @@ class UtilsNeedService extends AppServiceBase {
...
@@ -39,19 +39,21 @@ class UtilsNeedService extends AppServiceBase {
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求
類
型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求
类
型查询失败"
);
}
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求
類
型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求
类
型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
phone
=
pobj
.
actionBody
.
phone
||
pobj
.
actionBody
.
mobile
;
pobj
.
actionBody
.
phone
=
pobj
.
actionBody
.
phone
||
pobj
.
actionBody
.
mobile
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentSourceName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
idempotentSourceName
=
pobj
.
appInfo
.
app_name
;
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
...
@@ -145,13 +147,15 @@ class UtilsNeedService extends AppServiceBase {
...
@@ -145,13 +147,15 @@ class UtilsNeedService extends AppServiceBase {
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
phone
=
pobj
.
actionBody
.
phone
||
pobj
.
actionBody
.
mobile
;
pobj
.
actionBody
.
phone
=
pobj
.
actionBody
.
phone
||
pobj
.
actionBody
.
mobile
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentSourceName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
idempotentSourceName
=
pobj
.
appInfo
.
app_name
;
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
...
@@ -294,6 +298,9 @@ class UtilsNeedService extends AppServiceBase {
...
@@ -294,6 +298,9 @@ class UtilsNeedService extends AppServiceBase {
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
...
@@ -1533,6 +1540,9 @@ class UtilsNeedService extends AppServiceBase {
...
@@ -1533,6 +1540,9 @@ class UtilsNeedService extends AppServiceBase {
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
...
@@ -1607,8 +1617,6 @@ class UtilsNeedService extends AppServiceBase {
...
@@ -1607,8 +1617,6 @@ class UtilsNeedService extends AppServiceBase {
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
pobj
.
actionBody
.
idempotentId
=
pobj
.
actionBody
.
intentionBizId
;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
// pobj.actionBody.idempotentSource = pobj.actionBody.type;
pobj
.
actionBody
.
customerName
=
pobj
.
actionBody
.
userName
;
pobj
.
actionBody
.
customerName
=
pobj
.
actionBody
.
userName
;
//2021-1-21 laolan add new
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
||
''
,
this
.
utilsPushSve
.
baiduBusiness2Fq
(
pobj
,
"pushNeedICPBusinessNew"
);
this
.
utilsPushSve
.
baiduBusiness2Fq
(
pobj
,
"pushNeedICPBusinessNew"
);
}
}
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
View file @
3d4e0959
...
@@ -53,12 +53,14 @@ class UtilsNeedService2 extends AppServiceBase {
...
@@ -53,12 +53,14 @@ class UtilsNeedService2 extends AppServiceBase {
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
pobj
.
actionBody
.
type
=
"ali.icp"
;
pobj
.
actionBody
.
type
=
"ali.icp"
;
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
7
)
{
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
7
)
{
...
@@ -147,6 +149,9 @@ class UtilsNeedService2 extends AppServiceBase {
...
@@ -147,6 +149,9 @@ class UtilsNeedService2 extends AppServiceBase {
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
...
@@ -1401,18 +1406,20 @@ class UtilsNeedService2 extends AppServiceBase {
...
@@ -1401,18 +1406,20 @@ class UtilsNeedService2 extends AppServiceBase {
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求
類
型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求
类
型查询失败"
);
}
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求
類
型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求
类
型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
data
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
pobj
.
actionBody
.
type
=
"baidu.icp"
;
pobj
.
actionBody
.
type
=
"baidu.icp"
;
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
7
)
{
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
7
)
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsOpNeedSve.js
View file @
3d4e0959
...
@@ -18,7 +18,7 @@ class UtilsOpNeedService extends AppServiceBase {
...
@@ -18,7 +18,7 @@ class UtilsOpNeedService extends AppServiceBase {
}
}
/**
/**
* 提交需求 h5/pc 通用
* 提交需求 h5/pc 通用
提交需求接口
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody
* @param {*} actionBody
*/
*/
...
@@ -32,18 +32,20 @@ class UtilsOpNeedService extends AppServiceBase {
...
@@ -32,18 +32,20 @@ class UtilsOpNeedService extends AppServiceBase {
if
(
opResult
.
status
!=
0
)
{
if
(
opResult
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
}
pobj
.
actionBody
.
service_product_id
=
opResult
.
data
.
service_product_id
;
pobj
.
actionBody
.
productId
=
opResult
.
data
.
service_product_id
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
pobj
.
actionBody
.
type_code
=
opResult
.
data
.
type_code
;
pobj
.
actionBody
.
type_code
=
opResult
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
opResult
.
data
.
type_name
;
pobj
.
actionBody
.
type_name
=
opResult
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
opResult
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_code
=
opResult
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
opResult
.
data
.
channel_type_name
;
pobj
.
actionBody
.
channel_type_name
=
opResult
.
data
.
channel_type_name
;
pobj
.
actionBody
.
appName
=
pobj
.
appInfo
.
app_name
;
}
}
// 提交需求 暂未做推送
// 提交需求 暂未做推送
pobj
.
actionType
=
"opSubmitNeed"
;
pobj
.
actionType
=
"opSubmitNeed"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/opNeed/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/opNeed/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
if
(
result
.
status
==
0
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
"esp.companyreg"
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
"esp.companyreg"
||
pobj
.
actionBody
.
channel_type_code
==
"esp.companyreg_cloud"
)
{
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedBusiness"
);
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedBusiness"
);
}
}
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
3d4e0959
...
@@ -808,7 +808,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -808,7 +808,7 @@ class UtilsOrderService extends AppServiceBase {
}
}
}
}
async
opH5AliDingPayBackNotify
(
parmas
,
client_ip
)
{
//操作回调业务逻辑
async
opH5AliDingPayBackNotify
(
parmas
,
client_ip
)
{
//操作回调业务逻辑
-钉钉接入的搁浅
try
{
try
{
//日志记录
//日志记录
this
.
logCtl
.
info
({
this
.
logCtl
.
info
({
...
...
center-channel/app/config/businessConfig.js
View file @
3d4e0959
...
@@ -17,25 +17,25 @@ module.exports = {
...
@@ -17,25 +17,25 @@ module.exports = {
"ncSubmitMaterial"
,
"ncNotification"
,
"ncSubmitSolution"
,
"ncCloseNeed"
,
"ncClosePlan"
,
"ncSubmitMaterial"
,
"ncNotification"
,
"ncSubmitSolution"
,
"ncCloseNeed"
,
"ncClosePlan"
,
"rtSubmitMaterial"
,
"rtNotification"
,
"rtSubmitSolution"
,
"rtCloseNeed"
,
"rtClosePlan"
,
"rtSubmitMaterial"
,
"rtNotification"
,
"rtSubmitSolution"
,
"rtCloseNeed"
,
"rtClosePlan"
,
"getParamsFor360"
,
"addOrderWeb"
,
"getPayRecords"
,
"getLoginInfo"
,
"putUserMobileByVcode"
,
"getParamsFor360"
,
"addOrderWeb"
,
"getPayRecords"
,
"getLoginInfo"
,
"putUserMobileByVcode"
,
"putUserPwdByMobile"
,
"icpNotifyNew"
,
"getOrderStatisticsByUappId"
,
"getOrderStatisticsByProduct"
,
"getOrdersComparison"
,
"getOrdersComparisonList"
,
"putUserPwdByMobile"
,
"icpNotifyNew"
,
"getOrderStatisticsByUappId"
,
"getOrderStatisticsByProduct"
,
"getOrdersComparison"
,
"getOrdersComparisonList"
,
"importOrders"
,
"importNeeds"
,
"receiveAliTmOrder"
,
"receiveAliTmOrderRefund"
,
"importOrders"
,
"importNeeds"
,
"receiveAliTmOrder"
,
"receiveAliTmOrderRefund"
,
//百度工商注册
//百度工商注册
"regGetInfoByChannelNeedNo"
,
"submitRegNeed"
,
"regFeedbackSubmit"
,
"regOrderStatus"
,
"regOrderClose"
,
"regGetInfoByChannelNeedNo"
,
"submitRegNeed"
,
"regFeedbackSubmit"
,
"regOrderStatus"
,
"regOrderClose"
,
"getSolutionByChannelOrderNo"
,
"regSubmitSolution"
,
"regNeedClose"
,
"getSolutionByChannelOrderNo"
,
"regSubmitSolution"
,
"regNeedClose"
,
"regWriteCommunicationLog"
,
"regQueryExpertCommunicationLogs"
,
"regUpdateOrderStatus"
,
"regPaySuccess"
,
"regWriteCommunicationLog"
,
"regQueryExpertCommunicationLogs"
,
"regUpdateOrderStatus"
,
"regPaySuccess"
,
//yiming/ename
//yiming/ename
"eNameCloseOrder"
,
"eNameCloseOrder"
,
],
],
apiMustUserpinList
:
[
apiMustUserpinList
:
[
"icpOrderClose"
,
"icpOrderClose"
,
"submitNeed"
,
"paySuccess"
,
"icpNotify"
,
"getLoginInfo"
,
"icpNotifyNew"
,
"submitIcpProgramme"
,
"serviceProviderSubmitMaterial"
,
"abolishIcpProgramme"
,
"submitNeed"
,
"paySuccess"
,
"icpNotify"
,
"getLoginInfo"
,
"icpNotifyNew"
,
"submitIcpProgramme"
,
"serviceProviderSubmitMaterial"
,
"abolishIcpProgramme"
,
"submitService"
,
"serviceProviderNotification"
,
"submitService"
,
"serviceProviderNotification"
,
"ncSubmitMaterial"
,
"ncNotification"
,
"ncSubmitSolution"
,
"ncCloseNeed"
,
"ncClosePlan"
,
"ncSubmitMaterial"
,
"ncNotification"
,
"ncSubmitSolution"
,
"ncCloseNeed"
,
"ncClosePlan"
,
"rtSubmitMaterial"
,
"rtNotification"
,
"rtSubmitSolution"
,
"rtCloseNeed"
,
"rtClosePlan"
,
"rtSubmitMaterial"
,
"rtNotification"
,
"rtSubmitSolution"
,
"rtCloseNeed"
,
"rtClosePlan"
,
//百度工商注册
//百度工商注册
"regGetInfoByChannelNeedNo"
,
"submitRegNeed"
,
"regFeedbackSubmit"
,
"regOrderStatus"
,
"regOrderClose"
,
"regGetInfoByChannelNeedNo"
,
"submitRegNeed"
,
"regFeedbackSubmit"
,
"regOrderStatus"
,
"regOrderClose"
,
"getSolutionByChannelOrderNo"
,
"regSubmitSolution"
,
"regNeedClose"
,
"getSolutionByChannelOrderNo"
,
"regSubmitSolution"
,
"regNeedClose"
,
"regWriteCommunicationLog"
,
"regQueryExpertCommunicationLogs"
,
"regUpdateOrderStatus"
,
"regPaySuccess"
,
"regWriteCommunicationLog"
,
"regQueryExpertCommunicationLogs"
,
"regUpdateOrderStatus"
,
"regPaySuccess"
,
//yiming/ename
//yiming/ename
"eNameCloseOrder"
,
"eNameCloseOrder"
,
],
],
...
@@ -59,5 +59,81 @@ module.exports = {
...
@@ -59,5 +59,81 @@ module.exports = {
"/api/tm/tmcase/nbtzreceiveAssistTmData"
,
"/api/tm/tmcase/nbtzreceiveAssistTmData"
,
"/api/tm/tmcase/nbtzreceiveEditAssistTmData"
"/api/tm/tmcase/nbtzreceiveEditAssistTmData"
]
]
},
AREACOMM
:
{
areaTransform
:
{
"上海"
:
"上海市"
,
"东莞"
:
"东莞市"
,
"佛山"
:
"佛山市"
,
"北京"
:
"北京市"
,
"南京"
:
"南京市"
,
"南昌"
:
"南昌市"
,
"南通"
:
"南通市"
,
"台州"
:
"台州市"
,
"合肥"
:
"合肥市"
,
"嘉兴"
:
"嘉兴市"
,
"大连"
:
"大连市"
,
"天津"
:
"天津市"
,
"太原"
:
"太原市"
,
"宁波"
:
"宁波市"
,
"常州"
:
"常州市"
,
"广州"
:
"广州市"
,
"徐州"
:
"徐州市"
,
"成都"
:
"成都市"
,
"扬州"
:
"扬州市"
,
"无锡"
:
"无锡市"
,
"昆明"
:
"昆明市"
,
"杭州"
:
"杭州市"
,
"武汉"
:
"武汉市"
,
"沈阳"
:
"沈阳市"
,
"济南"
:
"济南市"
,
"深圳"
:
"深圳市"
,
"温州"
:
"温州市"
,
"烟台"
:
"烟台市"
,
"福州"
:
"福州市"
,
"绍兴"
:
"绍兴市"
,
"苏州"
:
"苏州市"
,
"西安"
:
"西安市"
,
"贵阳"
:
"贵阳市"
,
"郑州"
:
"郑州市"
,
"重庆"
:
"重庆市"
,
"金华"
:
"金华市"
,
"长春"
:
"长春市"
,
"长沙"
:
"长沙市"
,
"青岛"
:
"青岛市"
,
"开封"
:
"开封市"
,
"哈尔滨"
:
"哈尔滨市"
,
"石家庄"
:
"石家庄市"
,
"福建"
:
"福建省"
,
"广西"
:
"广西"
,
"广东"
:
"广东省"
,
"安徽"
:
"安徽省"
,
"河南"
:
"河南省"
,
"湖北"
:
"湖北省"
,
"浙江"
:
"浙江省"
,
"江苏"
:
"江苏省"
,
"山东"
:
"山东省"
,
"陕西"
:
"陕西省"
,
"宁夏"
:
"宁夏"
,
"甘肃"
:
"甘肃省"
,
"新疆"
:
"新疆"
,
"青海"
:
"青海省"
,
"河北"
:
"河北省"
,
"山西"
:
"山西省"
,
"辽宁"
:
"辽宁省"
,
"吉林"
:
"吉林省"
,
"黑龙江"
:
"黑龙江省"
,
"江西"
:
"江西省"
,
"湖南"
:
"湖南省"
,
"四川"
:
"四川省"
,
"贵州"
:
"贵州省"
,
"云南"
:
"云南省"
,
"内蒙古"
:
"内蒙古"
,
"西藏"
:
"西藏"
,
"含外资"
:
"含外资"
,
"全外资"
:
"全外资"
,
"香港"
:
"香港"
,
"海南"
:
"海南省"
,
}
}
}
}
}
center-channel/app/config/routes/api.js
View file @
3d4e0959
...
@@ -12,7 +12,7 @@ const settings = require("../../config/settings");
...
@@ -12,7 +12,7 @@ const settings = require("../../config/settings");
module
.
exports
=
function
(
app
)
{
module
.
exports
=
function
(
app
)
{
//-----------------------新的模式---------web---------开始
//-----------------------新的模式---------web---------开始
app
.
use
(
'/tlpay/aliPayNotify'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/tlpay/aliPayNotify'
,
async
function
(
req
,
res
)
{
//钉钉接入的搁浅
try
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsOrderSve
.
opH5AliDingPayBackNotify
(
req
.
body
,
client_ip
);
var
result
=
await
utilsOrderSve
.
opH5AliDingPayBackNotify
(
req
.
body
,
client_ip
);
...
...
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