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
31bfd7bf
Commit
31bfd7bf
authored
Oct 18, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Plain Diff
laolan
parents
8177648b
289c60b0
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
493 additions
and
40 deletions
+493
-40
center-channel/app/base/api/impl/opaction/360tmOrder.js
+40
-0
center-channel/app/base/api/impl/opaction/order.js
+3
-0
center-channel/app/base/api/impl/payment/paymentApi.js
+3
-3
center-channel/app/base/service/app.base.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utils360Sve.js
+57
-0
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+5
-4
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+60
-0
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+139
-15
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+108
-14
center-channel/app/config/routes/api.js
+4
-0
center-channel/app/front/entry/public/apidoc/platform/tmOrder.md
+73
-3
No files found.
center-channel/app/base/api/impl/opaction/360tmOrder.js
0 → 100644
View file @
31bfd7bf
var
WEBBase
=
require
(
"../../web.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
ProductAPI
extends
WEBBase
{
constructor
()
{
super
();
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess参数不能为空"
);
}
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
pobj
.
requestId
=
req
.
requestId
;
var
opResult
=
null
;
switch
(
action_type
)
{
case
"getParamsFor360"
:
//创建订单
opResult
=
await
this
.
utils360Sve
.
getParamsFor360
(
pobj
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
ProductAPI
;
center-channel/app/base/api/impl/opaction/order.js
View file @
31bfd7bf
...
...
@@ -29,6 +29,9 @@ class ProductAPI extends WEBBase {
case
"addOrder"
:
//创建订单
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
break
;
case
"addOrderWeb"
:
//创建订单 官网
opResult
=
await
this
.
utilsOrderSve
.
addOrderWeb
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
break
;
...
...
center-channel/app/base/api/impl/payment/paymentApi.js
View file @
31bfd7bf
...
...
@@ -39,9 +39,9 @@ class PaymentAPI extends WEBBase {
case
"queryOrderStatus"
:
//通联支付查询
opResult
=
await
this
.
utilsOrderSve
.
queryOrderStatus
(
pobj
,
pobj
.
actionBody
);
break
;
// case "getQrCode"://获取pc端支付二维码--不跟订单关联
//
opResult = await this.utilsOrderSve.getQrCode(pobj, pobj.actionBody);
//
break;
case
"getQrCode"
:
//获取pc端支付二维码--不跟订单关联---目前百望在使用
opResult
=
await
this
.
utilsOrderSve
.
getQrCode
(
pobj
,
pobj
.
actionBody
);
break
;
case
"queryOrder"
:
//通联支付查询
opResult
=
await
this
.
utilsOrderSve
.
queryOrder
(
pobj
,
pobj
.
actionBody
);
break
;
...
...
center-channel/app/base/service/app.base.js
View file @
31bfd7bf
...
...
@@ -242,7 +242,7 @@ class AppServiceBase {
returnType
:
'1'
,
opTitle
:
opType
+
"数据推送成功->"
+
opTitleDesc
});
result
.
data
=
null
;
//
result.data = null;
return
result
;
}
/**
...
...
center-channel/app/base/service/impl/utilsSve/utils360Sve.js
0 → 100644
View file @
31bfd7bf
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
md5
=
require
(
'md5'
)
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
//阿里支付类
class
utils360Sve
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
centerAppUrl
=
settings
.
centerAppUrl
();
}
//-------------------------------------------钉钉h5支付-----------------开始
async
getParamsFor360
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100110"
);
}
pobj
.
actionType
=
"getPayOrderInfo"
;
var
orderUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
var
orderResult
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
if
(
orderResult
.
status
!=
0
)
{
return
orderResult
;
}
pobj
.
actionType
=
"getOrderDeliveryInfo"
;
var
deliveryResult
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
if
(
deliveryResult
.
status
!=
0
)
{
return
deliveryResult
;
}
let
sku_id
=
orderResult
.
data
.
orderProduct
.
itemCode
;
let
price
=
Number
(
orderResult
.
data
.
orderProduct
.
price
)
*
100
;
let
quantity
=
orderResult
.
data
.
orderProduct
.
quantity
;
let
amount
=
Number
(
orderResult
.
data
.
receiptVoucher
.
totalSum
)
*
100
;
let
order_id
=
orderResult
.
data
.
receiptVoucher
.
sourceOrderNo
;
let
consignee
=
deliveryResult
.
data
.
orderContact
.
contactName
;
let
mobile
=
deliveryResult
.
data
.
orderContact
.
mobile
;
let
email
=
deliveryResult
.
data
.
orderContact
.
email
;
let
singStr
=
sku_id
+
price
+
order_id
+
pobj
.
appInfo
.
uapp_secret
;
let
sign
=
md5
(
singStr
).
toUpperCase
();
let
result
=
{
sku_id
,
price
,
quantity
,
amount
,
order_id
,
consignee
,
mobile
,
email
,
sign
}
return
system
.
getResult
(
result
);
}
//-------------------------------------------钉钉h5支付-----------------结束
}
module
.
exports
=
utils360Sve
;
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
31bfd7bf
...
...
@@ -160,24 +160,25 @@ class UtilsAuthService extends AppServiceBase {
}
/**
*
官网首页跳转自主注册
*
解析用户,获取认证token
* @param pobj
* @param actionBody
* @param req
* @returns {Promise<void>}
*/
async
channelUserLogin
(
pobj
,
actionBody
,
req
){
//
官网
登录地址
let
skipUrl
=
'
http://gsbweb.qifu.gongsibao.com
'
;
//
360
登录地址
let
skipUrl
=
''
;
let
opResult
=
system
.
getResult
(
null
,
"req Failure"
);
//----通过Authorization 获取用户信息
let
Authorization
=
req
.
headers
[
"authorization"
]
||
""
;
if
(
!
Authorization
){
opResult
.
data
.
redirectUrl
=
skipUrl
;
opResult
=
system
.
getResultFail
(
-
99
,
'用户未登录'
,{
redirectUrl
:
'skipUrl'
});
return
opResult
;
}
let
icCompanyUrl
=
'
https://icompanytest.gongsibao.com/api/tUserInfo/info
'
;
let
icCompanyUrl
=
''
;
let
subData
=
{
Authorization
:
Authorization
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
31bfd7bf
...
...
@@ -100,6 +100,31 @@ class UtilsFqAliyunService extends AppServiceBase {
return
system
.
getResult
(
null
,
"推送操作异常->fq->opAliyunClientPost->error:"
+
e
.
stack
);
}
}
async
opICClientPost
(
pobj
,
url
,
key
,
secret
,
params
)
{
try
{
var
rc
=
system
.
getObject
(
"util.aliyunClient"
);
var
rtn
=
await
rc
.
post
(
url
,
key
,
secret
,
params
);
if
(
rtn
.
code
!=
200
||
rtn
.
success
!=
true
)
{
return
system
.
getResult
(
null
,
"推送失败,失败原因:"
+
rtn
.
errorMsg
+
",selfrequestId="
+
pobj
.
requestId
+
",requestId="
+
rtn
.
requestId
);
}
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
verifyParam
(
pobj
)
{
//参数信息验证
var
verify
=
system
.
getResultSuccess
();
if
(
!
pobj
.
interface_params
)
{
...
...
@@ -113,6 +138,41 @@ class UtilsFqAliyunService extends AppServiceBase {
return
verify
;
}
//下订单到ic
async
pushOrder2IC
(
pobj
,
opType
){
console
.
log
(
JSON
.
stringify
(
pobj
),
".................pushOrderBusinessByProductCode2Fq...............pobj"
);
var
interface_list
=
pobj
.
interface_info
?
pobj
.
interface_info
:
pobj
.
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
return
system
.
getResult
(
null
,
"暂无推送配置"
);
}
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
+
"】的推送配置"
);
}
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
}
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-----------------
}
module
.
exports
=
UtilsFqAliyunService
;
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
31bfd7bf
...
...
@@ -26,6 +26,9 @@ class UtilsNeedService extends AppServiceBase {
* @param {*} actionBody
*/
async
submitNeed
(
pobj
,
actionBody
)
{
if
(
actionBody
.
type
==
"esp.wangwen"
||
actionBody
.
type
==
"esp.food"
)
{
actionBody
.
area
=
this
.
wangwenAreaChange
(
actionBody
.
area
)
}
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100380"
);
}
...
...
@@ -204,13 +207,41 @@ class UtilsNeedService extends AppServiceBase {
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100395"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
if
(
!
actionBody
.
note
)
{
return
system
.
getResult
(
null
,
"actionBody.note can not be empty,100395"
);
}
pobj
.
actionBody
.
channelNeedNo
=
pobj
.
actionBody
.
intentionBizId
;
// 2020 1016 lin 新增 需求关闭时判断 方案状态 订单状态,打个比方如果已经生成订单了 那么肯定不能直接关闭需求
var
self
=
this
;
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
// 2020 1015 lin 新增 这里为什么只推送蜂擎 没有推送交付?
// 明天找栋源确认 如果需要增加 在这个文件搜索updateChanceStatus
// 2020 1016 lin 新增 需求关闭时判断 方案状态 订单状态,打个比方如果已经生成订单了 那么肯定不能直接关闭需求
if
(
result
.
status
==
0
)
{
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseNeed"
);
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
if
(
orderrtn
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
}
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
channelNeedNo
,
status
:
"closeNeed"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseICPNeed"
);
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResult
(
null
,
"
推送失敗 100388
"
);
return
system
.
getResult
(
null
,
"
close fail 100389
"
);
}
}
...
...
@@ -818,6 +849,81 @@ class UtilsNeedService extends AppServiceBase {
return
"35"
}
}
// 2020 1012 lin 新增 针对网文的地区转换。转换根据是栋源1012 11:22钉钉发来的
wangwenAreaChange
(
area
)
{
switch
(
area
)
{
case
"110000"
:
return
"北京市"
;
case
"120000"
:
return
"天津市"
case
"130000"
:
return
"河北省"
case
"140000"
:
return
"山西省"
case
"150000"
:
return
"内蒙古自治区"
case
"210000"
:
return
"辽宁省"
case
"220000"
:
return
"吉林省"
case
"230000"
:
return
"黑龙江省"
case
"310000"
:
return
"上海市"
case
"320000"
:
return
"江苏省"
case
"330000"
:
return
"浙江省"
case
"340000"
:
return
"安徽省"
case
"350000"
:
return
"福建省"
case
"360000"
:
return
"江西省"
case
"370000"
:
return
"山东省"
case
"410000"
:
return
"河南省"
case
"420000"
:
return
"湖北省"
case
"430000"
:
return
"湖南省"
case
"440000"
:
return
"广东省"
case
"450000"
:
return
"广西壮族自治区"
case
"460000"
:
return
"海南省"
case
"500000"
:
return
"重庆市"
case
"510000"
:
return
"四川省"
case
"520000"
:
return
"贵州省"
case
"530000"
:
return
"云南省"
case
"540000"
:
return
"西藏自治区"
case
"610000"
:
return
"陕西省"
case
"620000"
:
return
"甘肃省"
case
"630000"
:
return
"青海省"
case
"640000"
:
return
"宁夏回族自治区"
case
"650000"
:
return
"新疆维吾尔自治区"
// case "全外资":
// return "32"
// case "香港":
// return "33"
// case "海南":
// return "34"
// default:
// return "35"
}
}
bizTypeChange
(
bizType
)
{
switch
(
bizType
)
{
case
"ICP许可证"
:
...
...
@@ -898,7 +1004,7 @@ class UtilsNeedService extends AppServiceBase {
}
/**
* 2020 0926 lin 新增 阿里文网文 服务商侧提供接口2.
2 关闭需求
通知服务商
* 2020 0926 lin 新增 阿里文网文 服务商侧提供接口2.
3 服务单
通知服务商
* @param {*} pobj
* @param {*} actionBody
*/
...
...
@@ -940,9 +1046,30 @@ class UtilsNeedService extends AppServiceBase {
return
system
.
getResult
(
null
,
"needInfo is empty"
);
}
// 第二部 询价
pobj
.
actionBody
.
city
=
needInfoResult
.
data
.
city
pobj
.
actionBody
.
channelItemCode
=
needInfoResult
.
data
.
channelTypeCode
pobj
.
actionBody
.
pathCode
=
"/zzfw/wangwen/"
// 写死 needInfo不支持
// 询价前县查出方案
pobj
.
actionBody
.
channelSolutionNo
=
pobj
.
actionBody
.
solutionBizId
;
pobj
.
actionType
=
"getProgrammeInfoByChannelSolutionNo"
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/icapi/springBoard"
;
var
solutionrtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
if
(
!
solutionrtn
||
!
solutionrtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
var
solutiondata
=
JSON
.
parse
(
solutionrtn
.
stdout
);
if
(
solutiondata
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
if
(
!
solutiondata
.
data
)
{
return
system
.
getResultFail
(
-
5012
,
"方案查询数据为空"
);
}
if
(
solutiondata
.
data
&&
solutiondata
.
data
.
channelNeedNo
)
{
pobj
.
actionBody
.
needId
=
solutiondata
.
data
.
channelNeedNo
;
}
// 具体询价操作
// 城市 明天需要国旗存一下 这里也要询价 2020 1017 已存
pobj
.
actionBody
.
city
=
solutiondata
.
data
.
solutionContent
.
solution
.
solutionCity
;
// pobj.actionBody.city = needInfoResult.data.city
pobj
.
actionBody
.
channelItemCode
=
needInfoResult
.
data
.
channelTypeCode
;
pobj
.
actionBody
.
pathCode
=
"/zzfw/wangwen/"
;
// 写死 needInfo不支持
pobj
.
actionType
=
"getProductPrice"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
productPriceResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
...
...
@@ -1020,8 +1147,7 @@ class UtilsNeedService extends AppServiceBase {
if
(
orderrtn
.
data
)
{
pobj
.
actionBody
.
orderNo
=
orderrtn
.
data
.
orderNo
;
}
pobj
.
actionBody
.
channelSolutionNo
=
pobj
.
actionBody
.
bizId
;
// 2020 1017 lin 新增更新方案状态/价格/订单号
pobj
.
actionType
=
"receiveSolutionPayInfo"
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/icapi/springBoard"
;
var
solutionrtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
...
...
@@ -1035,9 +1161,6 @@ class UtilsNeedService extends AppServiceBase {
if
(
!
solutiondata
.
data
)
{
return
system
.
getResultFail
(
-
5012
,
"方案查询数据为空"
);
}
if
(
solutiondata
.
data
&&
solutiondata
.
data
.
channelNeedNo
)
{
pobj
.
actionBody
.
needId
=
solutiondata
.
data
.
channelNeedNo
;
}
// 第四步 整合推送参数 并推送
var
fqobj
=
{
...
...
@@ -1118,7 +1241,8 @@ class UtilsNeedService extends AppServiceBase {
if
(
rtn
.
status
)
{
return
rtn
;
}
if
((
actionBody
.
operationType
==
"USER_PAY_PRODUCE"
||
actionBody
.
operationType
==
"USER_UPLOAD_PRODUCE"
)
&&
rtn
.
data
)
{
// 只有上传材料才在这里推送,produceNoticeAliEsp不做关于材料上传的推送
if
((
actionBody
.
operationType
==
"USER_UPLOAD_PRODUCE"
)
&&
rtn
.
data
)
{
var
deliveryObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
//pobj.actionBody.channelOrder.channelOrderNo,
...
...
@@ -1166,8 +1290,8 @@ class UtilsNeedService extends AppServiceBase {
*/
async
soulutionFeebackAliEsp
(
pobj
,
actionBody
)
{
// 待定
solutionBizId
note
//
solutionBizId
//
note
if
(
actionBody
.
operateType
==
"INVALID"
)
{
var
url
=
settings
.
centerOrderUrl
()
+
"action/ediApi/springBoard"
;
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
31bfd7bf
...
...
@@ -8,6 +8,7 @@ class UtilsOrderService extends AppServiceBase {
constructor
()
{
super
();
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
utilsFqAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsFqAliyunSve"
);
this
.
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
qifuPayAfterH5JumpUrl
=
settings
.
qifuPayAfterH5JumpUrl
();
...
...
@@ -892,21 +893,22 @@ class UtilsOrderService extends AppServiceBase {
}
var
appInfo
=
appInfoRt
.
data
;
// 拿锁
var
locker
=
await
this
.
cacheManager
[
"TlPayLocker"
].
enter
(
params
.
orderNo
);
console
.
log
(
"拿锁结果"
,
locker
)
if
(
!
locker
||
locker
!=
"1"
)
{
this
.
logCtl
.
info
({
appid
:
appInfoRt
.
data
.
uappId
,
appkey
:
""
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/channelPayNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
params
),
clientIp
:
params
.
client_ip
||
""
,
optitle
:
"阿里回调操作频繁---太频繁了,太频繁了"
});
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
}
//
var locker = await this.cacheManager["TlPayLocker"].enter(params.orderNo);
//
console.log("拿锁结果", locker)
//
if (!locker || locker != "1") {
//
this.logCtl.info({
//
appid: appInfoRt.data.uappId,
//
appkey: "",
//
op: "service/impl/utilsSve/utilsOrderSve.js/channelPayNotify",
//
content: "参数=" + JSON.stringify(params),
//
clientIp: params.client_ip || "",
//
optitle: "阿里回调操作频繁---太频繁了,太频繁了"
//
});
//
return system.getResultFail(-200, "阿里回调操作频繁---太频繁了,太频繁了");
//
}
params
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
};
params
.
pay_type
=
params
.
payType
;
params
.
time_end
=
params
.
payTime
;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
var
orderUrl
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByChannel"
;
...
...
@@ -939,7 +941,11 @@ class UtilsOrderService extends AppServiceBase {
}
// 推送
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
if
([
'icpsq'
,
'edisq'
].
includes
(
opOrderResult
.
data
.
product_info
.
channel_item_code
)){
this
.
utilsPushSve
.
aliBusiness2Delivery
(
pobj
,
"pushDeliveryOrder"
);
}
else
{
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
}
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
...
...
@@ -1121,5 +1127,93 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
}
//创建订单 官网
async
addOrderWeb
(
pobj
,
actionBody
){
if
(
!
actionBody
.
quantity
||
Number
(
actionBody
.
quantity
)
<=
0
)
{
return
system
.
getResult
(
null
,
"订单数量为空或有误,100030"
);
}
if
(
!
actionBody
.
goodsId
){
return
system
.
getResult
(
null
,
"官网产品id不能为空"
)
}
if
(
!
actionBody
.
customerId
){
return
system
.
getResult
(
null
,
'客户Id不能为空'
)
}
if
(
actionBody
.
deliveryData
.
nclones
.
length
<=
0
){
return
system
.
getResult
(
null
,
'尼斯不能为空'
)
}
if
(
actionBody
.
quantity
!=
actionBody
.
deliveryData
.
nclones
.
length
||
Number
(
actionBody
.
quantity
)
!=
actionBody
.
deliveryData
.
nclones
.
length
)
{
return
system
.
getResult
(
null
,
"订单数量有误,100030"
);
}
pobj
.
actionType
=
"getProductDetail"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
productItemResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
productItemResult
.
status
!=
0
)
{
return
productItemResult
;
}
pobj
.
actionBody
.
product_info
=
productItemResult
.
data
;
pobj
.
actionType
=
"getProductInterface"
;
pobj
.
actionBody
.
product_id
=
productItemResult
.
data
.
id
;
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
pobj
.
actionBody
.
product_info
.
interface_info
=
productItemInterfaceResult
.
data
;
let
nclones
=
actionBody
.
deliveryData
.
nclones
;
//大项集合
let
product_item
=
[];
//产品项
for
(
let
i
=
0
;
i
<
nclones
.
length
;
i
++
){
let
nclone
=
nclones
[
i
];
if
(
nclone
.
nclThree
.
length
>
10
){
actionBody
.
additions
=
{
"payCode"
:
"zzsbzc-2"
,
// Y 支付价格code
"quantity"
:
nclone
.
nclThree
.
length
-
10
// Y 购买数量
}
}
actionBody
.
totalSum
=
0
;
actionBody
.
quantity
=
1
;
actionBody
.
deliveryData
.
nclones
=
[
nclone
]
var
verifyResult
=
await
this
.
isOrderVerify
(
pobj
,
pobj
.
actionBody
);
actionBody
.
payTotalSum
=
actionBody
.
totalSum
;
let
saveResult
=
await
this
.
addOrder
(
pobj
,
actionBody
);
if
(
saveResult
.
status
!=
0
){
return
saveResult
;
}
let
obj
=
{
idempotentId
:
saveResult
.
data
.
orderNo
,
//商标注册订单id
nclCount
:
nclone
.
nclThree
.
length
-
10
>
0
?
nclone
.
nclThree
.
length
-
10
:
0
//小项数量
}
product_item
.
push
(
obj
);
}
actionBody
.
product_item
=
product_item
;
//新增订单(商标自助注册) IC
let
icOrderResult
=
await
this
.
utilsFqAliyunSve
.
pushOrder2IC
(
pobj
,
"pushOrder2IC"
);
let
orderUrl
=
settings
.
centerOrderUrl
()
+
'action/order/springBoard'
;
if
(
icOrderResult
.
status
!=
0
){
for
(
let
i
=
0
;
i
<
product_item
.
length
;
i
++
){
actionBody
.
orderNo
=
product_item
[
i
].
idempotentId
;
pobj
.
actionType
=
'delOrder'
;
let
rt
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
}
return
icOrderResult
;
}
let
ids
=
icOrderResult
.
data
.
orderList
;
let
orderServiceNo
=
await
this
.
getBusUid
(
"CN"
);
pobj
.
actionType
=
'updateOrder'
;
let
orderNos
=
[];
let
orderIds
=
[];
for
(
let
i
=
0
;
i
<
ids
.
length
;
i
++
){
let
orderNo
=
ids
[
i
].
idempotentId
;
let
contractNo
=
ids
[
i
].
contractNo
;
orderNos
.
push
(
ids
[
i
].
orderNo
)
orderIds
.
push
(
ids
[
i
].
orderId
)
actionBody
.
orderNo
=
orderNo
;
actionBody
.
channelServiceNo
=
contractNo
;
actionBody
.
channelOrderNo
=
ids
[
i
].
orderNo
;
actionBody
.
orderServiceNo
=
orderServiceNo
;
let
rest
=
await
this
.
restPostUrl
(
pobj
,
orderUrl
);
}
let
result
=
{
orderNos
,
orderIds
}
return
system
.
getResultSuccess
(
result
)
}
}
module
.
exports
=
UtilsOrderService
;
center-channel/app/config/routes/api.js
View file @
31bfd7bf
...
...
@@ -283,7 +283,11 @@ module.exports = function (app) {
"tmAccept"
,
"tmStatus"
,
"needBatchUpload"
,
"serviceSubmitOption"
,
"submitWangwenSolution"
,
"closeNeed"
,
"recordLog"
,
"recordLogList"
,
<<<<<<<
HEAD
"foodServiceSubmitOption"
,
"submitFoodSolution"
,
"foodCloseNeed"
,
"foodRecordLog"
,
"foodRecordLogList"
=======
"getParamsFor360"
,
"addOrderWeb"
,
>>>>>>>
289
c60b02337e3420c39c1df54cda8d424447d4e
];
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
...
...
center-channel/app/front/entry/public/apidoc/platform/tmOrder.md
View file @
31bfd7bf
...
...
@@ -5112,6 +5112,7 @@
"actionBody"
:{
"channel_user_id"
:
"19219084323984"
,
"type"
:
"contact"
,
"contact_name"
:
""
}
}
...
...
@@ -5121,9 +5122,78 @@
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"2a3eada5bd6a4e30807bbb2af8c0b4a8"
"msg"
:
"操作成功"
,
"data"
:
[
{
"id"
:
18
,
"channel_user_id"
:
"5e38f8ef56badb0009165fd1"
,
"contact_name"
:
"张三"
,
"contacts_content"
:
{
"fax"
:
""
,
"tel"
:
"010-11111"
,
"email"
:
"saa@gongsibao.com"
,
"mobile"
:
"15010929368"
,
"contacts"
:
"张三"
},
"type"
:
"applicant"
},
{
"id"
:
19
,
"channel_user_id"
:
"5e38f8ef56badb0009165fd1"
,
"contact_name"
:
"张三ggg"
,
"contacts_content"
:
{
"fax"
:
""
,
"tel"
:
"010-11111"
,
"email"
:
"saa@gongsibao.com"
,
"mobile"
:
"15010929368"
,
"contacts"
:
"张三ggg"
},
"type"
:
"applicant"
},
{
"id"
:
20
,
"channel_user_id"
:
"5e38f8ef56badb0009165fd1"
,
"contact_name"
:
"张三ggg4"
,
"contacts_content"
:
{
"fax"
:
""
,
"tel"
:
"010-11111"
,
"email"
:
"saa@gongsibao.com"
,
"mobile"
:
"15010929368"
,
"contacts"
:
"张三ggg4"
},
"type"
:
"applicant"
},
{
"id"
:
40
,
"channel_user_id"
:
"5e38f8ef56badb0009165fd1"
,
"contact_name"
:
"李啥啊"
,
"contacts_content"
:
{
"code"
:
"91310110398635929J"
,
"name"
:
"李啥啊"
,
"zipCode"
:
"100000"
,
"applyAddr"
:
"上海市杨浦区国定路346号三楼0624室003"
,
"customerType"
:
"person"
,
"identityCardNo"
:
"140311111111111111"
},
"type"
:
"applicant"
},
{
"id"
:
50
,
"channel_user_id"
:
"5e38f8ef56badb0009165fd1"
,
"contact_name"
:
"起个名字吧"
,
"contacts_content"
:
{
"code"
:
"91310110398635929J"
,
"name"
:
"起个名字吧"
,
"zipCode"
:
"100000"
,
"applyAddr"
:
"上海市杨浦区国定路346号三楼0624室003"
,
"customerType"
:
"person"
,
"identityCardNo"
:
"13013399999999999"
},
"type"
:
"applicant"
}
],
"bizmsg"
:
"empty"
,
"requestId"
:
"9770a5c5a6da4305b8fc83e296716cf5"
}
```
...
...
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