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
2ad4065d
Commit
2ad4065d
authored
Mar 25, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
d0892f31
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
103 deletions
+168
-103
center-channel/.gitignore
+4
-0
center-channel/app/base/api/api.base.js
+1
-1
center-channel/app/base/api/impl/opaction/order.js
+26
-7
center-channel/app/base/api/web.base.js
+11
-11
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+126
-84
No files found.
center-channel/.gitignore
View file @
2ad4065d
node_modules/
node_modules/
.idea
.history/
.vscode
\ No newline at end of file
center-channel/app/base/api/api.base.js
View file @
2ad4065d
...
@@ -53,7 +53,7 @@ class APIBase {
...
@@ -53,7 +53,7 @@ class APIBase {
await
this
.
redisClient
.
setWithEx
(
shaStr
,
JSON
.
stringify
(
result
),
3600
);
await
this
.
redisClient
.
setWithEx
(
shaStr
,
JSON
.
stringify
(
result
),
3600
);
}
}
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
this
.
execClientNew
.
execLogs
(
"center-channel-doexecMethod-reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod"
,
tmpResult
,
null
);
this
.
execClientNew
.
execLogs
(
"
api-
center-channel-doexecMethod-reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod"
,
tmpResult
,
null
);
return
result
;
return
result
;
}
catch
(
e
)
{
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
...
...
center-channel/app/base/api/impl/opaction/order.js
View file @
2ad4065d
var
WEBBase
=
require
(
"../../web.base"
);
var
WEBBase
=
require
(
"../../web.base"
);
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
ProductAPI
extends
WEBBase
{
class
ProductAPI
extends
WEBBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
* action_process 执行的流程
* action_process 执行的流程
...
@@ -22,15 +24,19 @@ class ProductAPI extends WEBBase {
...
@@ -22,15 +24,19 @@ class ProductAPI extends WEBBase {
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
return
result
;
}
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
pobj
.
requestId
=
req
.
requestId
;
pobj
.
requestId
=
req
.
requestId
;
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"addOrder"
:
//创建订单
case
"addOrder"
:
//创建订单
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
//处理推送到峰擎
// opType:值为query、add
this
.
pushNewFq
(
pobj
,
opResult
);
break
;
break
;
case
"addOrderWeb"
:
//创建订单 官网
case
"addOrderWeb"
:
//创建订单 官网
opResult
=
await
this
.
utilsOrderSve
.
addOrderWeb
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
addOrderWeb
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
case
"getOrderInfo"
:
//获取订单列表信息
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
...
@@ -69,22 +75,22 @@ class ProductAPI extends WEBBase {
...
@@ -69,22 +75,22 @@ class ProductAPI extends WEBBase {
// opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// break;
// break;
case
"addUsuallyContacts"
:
//添加常用联系人、申请人
case
"addUsuallyContacts"
:
//添加常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
addUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
addUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
case
"delUsuallyContacts"
:
//删除常用联系人、申请人
case
"delUsuallyContacts"
:
//删除常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
delUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
delUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
case
"updateUsuallyContacts"
:
//修改常用联系人、申请人
case
"updateUsuallyContacts"
:
//修改常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
updateUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
updateUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
case
"getUsuallyContacts"
:
//查询常用联系人、申请人
case
"getUsuallyContacts"
:
//查询常用联系人、申请人
opResult
=
await
this
.
utilsOrderSve
.
getUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
getUsuallyContacts
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
case
"importOrders"
:
case
"importOrders"
:
opResult
=
await
this
.
utilsOrderSve
.
importOrders
(
pobj
,
req
);
opResult
=
await
this
.
utilsOrderSve
.
importOrders
(
pobj
,
req
);
break
;
break
;
case
"pushTest"
:
case
"pushTest"
:
opResult
=
await
this
.
utilsOrderSve
.
pushTest
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
pushTest
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
@@ -93,5 +99,18 @@ class ProductAPI extends WEBBase {
...
@@ -93,5 +99,18 @@ class ProductAPI extends WEBBase {
return
opResult
;
return
opResult
;
}
}
async
pushNewFq
(
pobj
,
result
)
{
if
(
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
channelOrderNo
)
{
try
{
pobj
.
actionType
=
"getOrderInfoByChannelOrderNo"
;
pobj
.
actionBody
.
channelOrderNo
=
result
.
data
.
channelOrderNo
;
await
this
.
utilsOrderSve
.
pushNewFqByChannelOrderNo
(
pobj
);
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
this
.
execClientNew
.
execLogs
(
"pushNewFq异常:"
,
pobj
,
"center-channel-pushNewFq"
,
null
,
stackStr
);
}
}
}
}
}
module
.
exports
=
ProductAPI
;
module
.
exports
=
ProductAPI
;
center-channel/app/base/api/web.base.js
View file @
2ad4065d
...
@@ -38,7 +38,7 @@ class WEBBase {
...
@@ -38,7 +38,7 @@ class WEBBase {
opTitle
:
"api服务提供方appKey:"
+
settings
.
appKey
,
opTitle
:
"api服务提供方appKey:"
+
settings
.
appKey
,
});
});
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
var
tmpResult
=
pobj
.
actionType
&&
pobj
.
actionType
.
indexOf
(
"List"
)
<
0
?
result
:
{
status
:
result
.
status
,
message
:
result
.
message
,
requestId
:
result
.
requestId
};
this
.
execClientNew
.
execLogs
(
"reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod-web"
,
tmpResult
,
null
);
this
.
execClientNew
.
execLogs
(
"
web-center-channel--
reqPath:"
+
req
.
path
,
pobj
,
"center-channel-doexecMethod-web"
,
tmpResult
,
null
);
return
result
;
return
result
;
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
.
stack
,
"api调用出现异常,请联系管理员.........."
)
console
.
log
(
e
.
stack
,
"api调用出现异常,请联系管理员.........."
)
...
@@ -53,16 +53,16 @@ class WEBBase {
...
@@ -53,16 +53,16 @@ class WEBBase {
agent
:
req
.
uagent
,
agent
:
req
.
uagent
,
opTitle
:
"api调用出现异常,请联系管理员error,appKey:"
+
settings
.
appKey
,
opTitle
:
"api调用出现异常,请联系管理员error,appKey:"
+
settings
.
appKey
,
});
});
this
.
logCtl
.
error
({
//
this.logCtl.error({
appid
:
req
.
app
.
id
,
//
appid: req.app.id,
appkey
:
req
.
app
.
uappKey
,
//
appkey: req.app.uappKey,
requestId
:
req
.
requestId
,
//
requestId: req.requestId,
op
:
req
.
classname
+
"/"
+
methodname
,
//
op: req.classname + "/" + methodname,
content
:
e
.
stack
,
//
content: e.stack,
clientIp
:
pobj
.
clientIp
,
//
clientIp: pobj.clientIp,
agent
:
req
.
uagent
,
//
agent: req.uagent,
optitle
:
"api调用出现异常,请联系管理员"
,
//
optitle: "api调用出现异常,请联系管理员",
});
//
});
var
rtnerror
=
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
var
rtnerror
=
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
rtnerror
.
requestId
=
req
.
requestId
;
rtnerror
.
requestId
=
req
.
requestId
;
return
rtnerror
;
return
rtnerror
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
2ad4065d
...
@@ -4,6 +4,7 @@ const querystring = require('querystring');
...
@@ -4,6 +4,7 @@ const querystring = require('querystring');
const
AppServiceBase
=
require
(
"../../app.base"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
axios
=
require
(
'axios'
)
const
axios
=
require
(
'axios'
)
const
md5
=
require
(
'md5'
)
const
md5
=
require
(
'md5'
)
class
UtilsOrderService
extends
AppServiceBase
{
class
UtilsOrderService
extends
AppServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -20,9 +21,33 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -20,9 +21,33 @@ class UtilsOrderService extends AppServiceBase {
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
);
this
.
utils360Sve
=
system
.
getObject
(
"service.utilsSve.utils360Sve"
);
this
.
dingClient
=
system
.
getObject
(
"util.dingClient"
);
this
.
dingClient
=
system
.
getObject
(
"util.dingClient"
);
};
};
async
pushNewFqByChannelOrderNo
(
pobj
)
{
let
url
=
this
.
centerOrderUrl
+
"opaction/order/springBoard"
;
let
opResult
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
opResult
.
status
==
0
)
{
opResult
.
data
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
,
uapp_key
:
appInfo
.
uapp_key
,
app_code
:
appInfo
.
app_code
,
contact_mobile
:
appInfo
.
contact_mobile
};
opResult
.
data
.
userInfo
=
{
channel_userid
:
opResult
.
data
.
order_info
.
channelUserId
,
channel_username
:
opResult
.
data
.
order_info
.
channelUserId
,
channel_nickname
:
opResult
.
data
.
order_info
.
channelUserId
};
let
tmpPobj
=
{
appInfo
:
opResult
.
data
.
appInfo
,
actionBody
:
opResult
.
data
}
this
.
utilsPushSve
.
pushBusInfo
(
tmpPobj
,
"pushOrder"
,
1
);
}
}
/*
/*
* 订单验证
* 订单验证
*/
*/
async
isOrderVerify
(
pobj
,
actionBody
)
{
async
isOrderVerify
(
pobj
,
actionBody
)
{
var
price_list
=
actionBody
.
product_info
.
price_list
;
var
price_list
=
actionBody
.
product_info
.
price_list
;
if
(
!
price_list
)
{
if
(
!
price_list
)
{
...
@@ -63,6 +88,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -63,6 +88,7 @@ class UtilsOrderService extends AppServiceBase {
pobj
.
actionBody
.
product_info
.
price_list
=
tmpPriceList
;
pobj
.
actionBody
.
product_info
.
price_list
=
tmpPriceList
;
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
/**
/**
* 创建订单
* 创建订单
* @param {*} pobj
* @param {*} pobj
...
@@ -110,6 +136,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -110,6 +136,7 @@ class UtilsOrderService extends AppServiceBase {
result
.
data
.
totalSum
=
actionBody
.
totalSum
;
result
.
data
.
totalSum
=
actionBody
.
totalSum
;
return
result
.
data
;
return
result
.
data
;
}
}
async
delOrder
(
pobj
,
actionBody
)
{
async
delOrder
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100025"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100025"
);
...
@@ -128,6 +155,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -128,6 +155,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
async
getOrderInfo
(
pobj
,
actionBody
)
{
async
getOrderInfo
(
pobj
,
actionBody
)
{
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
...
@@ -139,47 +167,47 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -139,47 +167,47 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @param pobj
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
getOrdersStatisticsByUappId
(
pobj
)
{
async
getOrdersStatisticsByUappId
(
pobj
)
{
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
1
);
return
system
.
getResultFail
(
-
1
);
}
}
let
data
=
result
.
data
;
let
data
=
result
.
data
;
let
temp
=
0
;
let
temp
=
0
;
let
arr
=
[];
let
arr
=
[];
let
reArr
=
[];
let
reArr
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
((
temp
!=
data
[
i
].
uapp_id
&&
temp
!=
0
))
{
if
((
temp
!=
data
[
i
].
uapp_id
&&
temp
!=
0
))
{
let
obj
=
{
let
obj
=
{
uapp_id
:
temp
,
uapp_id
:
temp
,
data
:
arr
data
:
arr
}
}
reArr
.
push
(
obj
);
reArr
.
push
(
obj
);
arr
=
[];
arr
=
[];
}
}
let
dArr
=
{
let
dArr
=
{
time
:
data
[
i
].
time
,
time
:
data
[
i
].
time
,
count
:
data
[
i
].
count
count
:
data
[
i
].
count
}
}
arr
.
push
(
dArr
);
arr
.
push
(
dArr
);
temp
=
data
[
i
].
uapp_id
;
temp
=
data
[
i
].
uapp_id
;
if
(
i
==
data
.
length
-
1
)
{
if
(
i
==
data
.
length
-
1
)
{
let
obj
=
{
let
obj
=
{
uapp_id
:
temp
,
uapp_id
:
temp
,
data
:
arr
data
:
arr
}
}
reArr
.
push
(
obj
);
reArr
.
push
(
obj
);
}
}
}
}
reArr
.
sort
((
a
,
b
)
=>
{
reArr
.
sort
((
a
,
b
)
=>
{
return
a
.
uapp_id
-
b
.
uapp_id
;
return
a
.
uapp_id
-
b
.
uapp_id
;
})
})
let
temp2
=
0
;
let
temp2
=
0
;
let
arr2
=
[];
let
arr2
=
[];
let
final
=
[];
let
final
=
[];
for
(
let
i
=
0
;
i
<
reArr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
reArr
.
length
;
i
++
)
{
if
((
temp2
!=
reArr
[
i
].
uapp_id
&&
temp2
!=
0
))
{
if
((
temp2
!=
reArr
[
i
].
uapp_id
&&
temp2
!=
0
))
{
let
o
=
{
let
o
=
{
uapp_id
:
temp2
,
uapp_id
:
temp2
,
data
:
arr2
data
:
arr2
...
@@ -190,10 +218,10 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -190,10 +218,10 @@ class UtilsOrderService extends AppServiceBase {
console
.
log
(
reArr
[
i
].
data
)
console
.
log
(
reArr
[
i
].
data
)
arr2
=
arr2
.
concat
(
reArr
[
i
].
data
);
arr2
=
arr2
.
concat
(
reArr
[
i
].
data
);
temp2
=
reArr
[
i
].
uapp_id
;
temp2
=
reArr
[
i
].
uapp_id
;
if
(
i
==
reArr
.
length
-
1
)
{
if
(
i
==
reArr
.
length
-
1
)
{
let
obj
=
{
let
obj
=
{
uapp_id
:
temp2
,
uapp_id
:
temp2
,
data
:
arr2
data
:
arr2
}
}
final
.
push
(
obj
);
final
.
push
(
obj
);
}
}
...
@@ -206,50 +234,50 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -206,50 +234,50 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @param pobj
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
getOrdersStatisticsByProduct
(
pobj
)
{
async
getOrdersStatisticsByProduct
(
pobj
)
{
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
1
);
return
system
.
getResultFail
(
-
1
);
}
}
let
data
=
result
.
data
;
let
data
=
result
.
data
;
let
temp
=
""
;
let
temp
=
""
;
let
arr
=
[];
let
arr
=
[];
let
reArr
=
[];
let
reArr
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
data
[
i
].
typeCode
==
'10202010202001'
)
{
if
(
data
[
i
].
typeCode
==
'10202010202001'
)
{
data
[
i
].
typeCode
=
'zzsbzc'
;
data
[
i
].
typeCode
=
'zzsbzc'
;
}
}
if
(
data
[
i
].
typeCode
==
'10202010202002'
)
{
if
(
data
[
i
].
typeCode
==
'10202010202002'
)
{
data
[
i
].
typeCode
=
'fzsbzc'
;
data
[
i
].
typeCode
=
'fzsbzc'
;
}
}
if
(
data
[
i
].
typeCode
==
'10202010202003'
)
{
if
(
data
[
i
].
typeCode
==
'10202010202003'
)
{
data
[
i
].
typeCode
=
'dbsbzc'
;
data
[
i
].
typeCode
=
'dbsbzc'
;
}
}
if
(
data
[
i
].
typeCode
==
'10202010204002'
)
{
if
(
data
[
i
].
typeCode
==
'10202010204002'
)
{
data
[
i
].
typeCode
=
'icpsq'
;
data
[
i
].
typeCode
=
'icpsq'
;
}
}
if
(
data
[
i
].
typeCode
==
'10202010204001'
)
{
if
(
data
[
i
].
typeCode
==
'10202010204001'
)
{
data
[
i
].
typeCode
=
'edisq'
;
data
[
i
].
typeCode
=
'edisq'
;
}
}
if
((
temp
!=
data
[
i
].
typeCode
&&
temp
!=
""
))
{
if
((
temp
!=
data
[
i
].
typeCode
&&
temp
!=
""
))
{
let
obj
=
{
let
obj
=
{
type_code
:
temp
,
type_code
:
temp
,
data
:
arr
data
:
arr
}
}
reArr
.
push
(
obj
);
reArr
.
push
(
obj
);
arr
=
[];
arr
=
[];
}
}
let
dArr
=
{
let
dArr
=
{
uapp_id
:
data
[
i
].
uapp_id
,
uapp_id
:
data
[
i
].
uapp_id
,
count
:
data
[
i
].
count
count
:
data
[
i
].
count
}
}
arr
.
push
(
dArr
);
arr
.
push
(
dArr
);
temp
=
data
[
i
].
typeCode
;
temp
=
data
[
i
].
typeCode
;
if
(
i
==
data
.
length
-
1
)
{
if
(
i
==
data
.
length
-
1
)
{
let
obj
=
{
let
obj
=
{
type_code
:
temp
,
type_code
:
temp
,
data
:
arr
data
:
arr
}
}
reArr
.
push
(
obj
);
reArr
.
push
(
obj
);
}
}
...
@@ -262,10 +290,10 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -262,10 +290,10 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @param pobj
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
getOrdersComparison
(
pobj
)
{
async
getOrdersComparison
(
pobj
)
{
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
1
);
return
system
.
getResultFail
(
-
1
);
}
}
return
result
;
return
result
;
...
@@ -276,10 +304,10 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -276,10 +304,10 @@ class UtilsOrderService extends AppServiceBase {
* @param pobj
* @param pobj
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
getOrdersComparisonList
(
pobj
)
{
async
getOrdersComparisonList
(
pobj
)
{
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
url
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
1
);
return
system
.
getResultFail
(
-
1
);
}
}
return
result
;
return
result
;
...
@@ -291,16 +319,16 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -291,16 +319,16 @@ class UtilsOrderService extends AppServiceBase {
* @param req
* @param req
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
importOrders
(
pobj
,
req
)
{
async
importOrders
(
pobj
,
req
)
{
let
url
=
this
.
centerOrderUrl
+
'action/order/springBoard'
;
let
url
=
this
.
centerOrderUrl
+
'action/order/springBoard'
;
if
(
!
pobj
.
actionBody
.
ordersArr
)
{
if
(
!
pobj
.
actionBody
.
ordersArr
)
{
return
system
.
getResultFail
(
-
1
,
'导入数据不能为空'
);
return
system
.
getResultFail
(
-
1
,
'导入数据不能为空'
);
}
}
if
(
!
pobj
.
actionBody
.
uapp_id
)
{
if
(
!
pobj
.
actionBody
.
uapp_id
)
{
return
system
.
getResultFail
(
-
1
,
'渠道id 不能为空'
);
return
system
.
getResultFail
(
-
1
,
'渠道id 不能为空'
);
}
}
pobj
.
actionType
=
'bulkCreateOrders'
;
pobj
.
actionType
=
'bulkCreateOrders'
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
return
result
;
}
}
...
@@ -309,6 +337,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -309,6 +337,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
async
getOrderDeliveryInfo
(
pobj
,
actionBody
)
{
async
getOrderDeliveryInfo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100290"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100290"
);
...
@@ -317,6 +346,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -317,6 +346,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
async
getOrderDeliveryFlowInfo
(
pobj
,
actionBody
)
{
async
getOrderDeliveryFlowInfo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
sourceOrderNo
)
{
if
(
!
actionBody
.
sourceOrderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty,100300"
);
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty,100300"
);
...
@@ -325,6 +355,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -325,6 +355,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
async
getOrderDeliveryFlowList
(
pobj
,
actionBody
)
{
async
getOrderDeliveryFlowList
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
sourceOrderNoList
)
{
if
(
!
actionBody
.
sourceOrderNoList
)
{
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNoList can not be empty,100070"
);
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNoList can not be empty,100070"
);
...
@@ -336,6 +367,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -336,6 +367,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
async
getOrderLogInfo
(
pobj
,
actionBody
)
{
async
getOrderLogInfo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
sourceOrderNo
)
{
if
(
!
actionBody
.
sourceOrderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty,100090"
);
return
system
.
getResult
(
null
,
"actionBody.sourceOrderNo can not be empty,100090"
);
...
@@ -344,6 +376,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -344,6 +376,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
async
icOrderStatusNotify
(
pobj
,
actionBody
)
{
async
icOrderStatusNotify
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
orderNo
)
{
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100100"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100100"
);
...
@@ -352,6 +385,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -352,6 +385,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
/**
/**
* 获取H5支付地址
* 获取H5支付地址
* @param {*} pobj
* @param {*} pobj
...
@@ -381,6 +415,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -381,6 +415,7 @@ class UtilsOrderService extends AppServiceBase {
await
this
.
cacheManager
[
"TlPayLocker"
].
init
(
orderResult
.
data
.
receiptVoucher
.
sourceOrderNo
);
await
this
.
cacheManager
[
"TlPayLocker"
].
init
(
orderResult
.
data
.
receiptVoucher
.
sourceOrderNo
);
return
result
;
return
result
;
}
}
/**
/**
* 获取二维码
* 获取二维码
* @param {*} pobj
* @param {*} pobj
...
@@ -459,6 +494,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -459,6 +494,7 @@ class UtilsOrderService extends AppServiceBase {
result
.
aliPayOrderCode
=
receiptVoucher
.
aliPayOrderCode
;
result
.
aliPayOrderCode
=
receiptVoucher
.
aliPayOrderCode
;
return
result
;
return
result
;
}
}
/**
/**
* 查询订单状态
* 查询订单状态
* @param {*} pobj
* @param {*} pobj
...
@@ -491,12 +527,12 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -491,12 +527,12 @@ class UtilsOrderService extends AppServiceBase {
this
.
opPayStatusSuccess
(
payStatus
.
data
,
pobj
.
appInfo
,
null
);
this
.
opPayStatusSuccess
(
payStatus
.
data
,
pobj
.
appInfo
,
null
);
// return system.getResultFail(-100130,'订单已支付,请勿重复付款,100130')
// return system.getResultFail(-100130,'订单已支付,请勿重复付款,100130')
return
system
.
getResultSuccess
(
payStatus
.
data
,
'订单已支付,请勿重复付款,100130'
);
return
system
.
getResultSuccess
(
payStatus
.
data
,
'订单已支付,请勿重复付款,100130'
);
}
}
else
if
(
payStatus
.
data
&&
payStatus
.
data
.
trxstatus
==
"3045"
)
{
else
if
(
payStatus
.
data
&&
payStatus
.
data
.
trxstatus
==
"3045"
)
{
return
system
.
getResultFail
(
-
100170
,
"超时未支付,请刷新页面,100170"
);
return
system
.
getResultFail
(
-
100170
,
"超时未支付,请刷新页面,100170"
);
}
}
return
system
.
getResultFail
(
-
100180
,
"请及时支付,100180"
);
return
system
.
getResultFail
(
-
100180
,
"请及时支付,100180"
);
}
}
async
opPayStatusSuccess
(
parmas
,
appInfo
,
client_ip
)
{
//操作回调业务逻辑---查询支付状态为已支付时进行调用
async
opPayStatusSuccess
(
parmas
,
appInfo
,
client_ip
)
{
//操作回调业务逻辑---查询支付状态为已支付时进行调用
try
{
try
{
//日志记录
//日志记录
...
@@ -563,6 +599,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -563,6 +599,7 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
}
}
/**
/**
* 获取pc端支付二维码--不跟订单关联
* 获取pc端支付二维码--不跟订单关联
* @param {*} pobj
* @param {*} pobj
...
@@ -593,6 +630,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -593,6 +630,7 @@ class UtilsOrderService extends AppServiceBase {
return
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppPayUrl
);
return
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppPayUrl
);
}
}
/**
/**
* 只是检查支付状态--不跟订单关联
* 只是检查支付状态--不跟订单关联
* @param {*} pobj
* @param {*} pobj
...
@@ -605,6 +643,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -605,6 +643,7 @@ class UtilsOrderService extends AppServiceBase {
return
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppPayUrl
);
return
await
this
.
restPostUrl
(
pobj
,
this
.
centerAppPayUrl
);
}
}
async
receiveCallBackNotify
(
parmas
,
client_ip
)
{
async
receiveCallBackNotify
(
parmas
,
client_ip
)
{
try
{
try
{
if
(
!
parmas
||
!
parmas
.
trxcode
)
{
if
(
!
parmas
||
!
parmas
.
trxcode
)
{
...
@@ -618,7 +657,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -618,7 +657,7 @@ class UtilsOrderService extends AppServiceBase {
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
var
param
=
{
var
param
=
{
"actionBody"
:
{
parmas
:
parmas
},
"actionBody"
:
{
parmas
:
parmas
},
"client_ip"
:
client_ip
"client_ip"
:
client_ip
};
};
var
qftstr
=
await
this
.
restClient
.
execPost
(
param
,
this
.
centerAppUrl
+
"payment/paymentApi/receiveCallBackNotify"
);
var
qftstr
=
await
this
.
restClient
.
execPost
(
param
,
this
.
centerAppUrl
+
"payment/paymentApi/receiveCallBackNotify"
);
...
@@ -652,7 +691,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -652,7 +691,7 @@ class UtilsOrderService extends AppServiceBase {
});
});
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getAppInfo"
;
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getAppInfo"
;
var
opResult
=
await
this
.
restPostUrl
({
uappId
:
parmas
.
uappid
},
url
);
var
opResult
=
await
this
.
restPostUrl
({
uappId
:
parmas
.
uappid
},
url
);
if
(
opResult
.
status
!=
0
)
{
if
(
opResult
.
status
!=
0
)
{
opResult
.
msg
=
opResult
.
msg
+
",100270"
;
opResult
.
msg
=
opResult
.
msg
+
",100270"
;
return
opResult
;
return
opResult
;
...
@@ -720,6 +759,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -720,6 +759,7 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
}
}
async
opH5AliDingPayBackNotify
(
parmas
,
client_ip
)
{
//操作回调业务逻辑
async
opH5AliDingPayBackNotify
(
parmas
,
client_ip
)
{
//操作回调业务逻辑
try
{
try
{
//日志记录
//日志记录
...
@@ -766,7 +806,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -766,7 +806,7 @@ class UtilsOrderService extends AppServiceBase {
});
});
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
}
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
pay_type
=
"alipay"
;
parmas
.
pay_type
=
"alipay"
;
//修改并返回订单支付状态,创建收款单
//修改并返回订单支付状态,创建收款单
...
@@ -803,6 +843,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -803,6 +843,7 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
}
}
async
orderClose
(
pobj
)
{
//阿里退款
async
orderClose
(
pobj
)
{
//阿里退款
if
(
!
pobj
.
actionBody
.
orderNo
)
{
if
(
!
pobj
.
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty"
);
...
@@ -881,7 +922,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -881,7 +922,7 @@ class UtilsOrderService extends AppServiceBase {
}
}
// 2020 07.03 lin 修改 获取app信息 推送蜂擎使用
// 2020 07.03 lin 修改 获取app信息 推送蜂擎使用
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getAppInfo"
;
var
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getAppInfo"
;
var
appInfoResult
=
await
this
.
restPostUrl
({
uappId
:
opResult
.
data
.
uappId
},
url
);
var
appInfoResult
=
await
this
.
restPostUrl
({
uappId
:
opResult
.
data
.
uappId
},
url
);
if
(
appInfoResult
.
status
!=
0
)
{
if
(
appInfoResult
.
status
!=
0
)
{
appInfoResult
.
msg
=
appInfoResult
.
msg
+
",100270"
;
appInfoResult
.
msg
=
appInfoResult
.
msg
+
",100270"
;
return
appInfoResult
;
return
appInfoResult
;
...
@@ -901,7 +942,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -901,7 +942,7 @@ class UtilsOrderService extends AppServiceBase {
});
});
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
return
system
.
getResultFail
(
-
200
,
"阿里回调操作频繁---太频繁了,太频繁了"
);
}
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
pay_type
=
"alipay"
;
parmas
.
pay_type
=
"alipay"
;
//修改并返回订单支付状态,创建收款单
//修改并返回订单支付状态,创建收款单
...
@@ -1009,7 +1050,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1009,7 +1050,7 @@ class UtilsOrderService extends AppServiceBase {
});
});
return
system
.
getResultFail
(
-
200
,
"微信回调操作频繁---太频繁了,太频繁了"
);
return
system
.
getResultFail
(
-
200
,
"微信回调操作频繁---太频繁了,太频繁了"
);
}
}
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
appInfo
=
{
appInfo
:
{
uapp_id
:
opResult
.
data
.
uappId
}
};
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
parmas
.
orderNo
=
opResult
.
data
.
orderNo
;
// 注意 微信支付要写wx 不要wxpay等其他。c_order_receiptvoucher收款单的accountType会对应wx:微信"alipay":"支付宝","other":"其它"等其他方式
// 注意 微信支付要写wx 不要wxpay等其他。c_order_receiptvoucher收款单的accountType会对应wx:微信"alipay":"支付宝","other":"其它"等其他方式
parmas
.
pay_type
=
"wx"
;
parmas
.
pay_type
=
"wx"
;
...
@@ -1077,7 +1118,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1077,7 +1118,7 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResult
(
null
,
'payOrderNo can be not null'
)
return
system
.
getResult
(
null
,
'payOrderNo can be not null'
)
}
}
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
params
.
appkey
},
url
);
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
params
.
appkey
},
url
);
if
(
appInfoRt
.
status
!=
0
)
{
if
(
appInfoRt
.
status
!=
0
)
{
appInfoRt
.
msg
=
appInfoRt
.
msg
+
",100270"
;
appInfoRt
.
msg
=
appInfoRt
.
msg
+
",100270"
;
return
appInfoRt
;
return
appInfoRt
;
...
@@ -1102,7 +1143,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1102,7 +1143,7 @@ class UtilsOrderService extends AppServiceBase {
// });
// });
// return system.getResultFail(-200, "阿里回调操作频繁---太频繁了,太频繁了");
// return system.getResultFail(-200, "阿里回调操作频繁---太频繁了,太频繁了");
// }
// }
params
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
};
params
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
};
params
.
pay_type
=
params
.
payType
;
params
.
pay_type
=
params
.
payType
;
params
.
time_end
=
params
.
payTime
;
params
.
time_end
=
params
.
payTime
;
//修改并返回订单支付状态,创建收款单
//修改并返回订单支付状态,创建收款单
...
@@ -1121,7 +1162,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1121,7 +1162,7 @@ class UtilsOrderService extends AppServiceBase {
uapp_key
:
appInfo
.
uapp_key
,
uapp_key
:
appInfo
.
uapp_key
,
app_code
:
appInfo
.
app_code
,
app_code
:
appInfo
.
app_code
,
app_name
:
appInfo
.
app_name
,
app_name
:
appInfo
.
app_name
,
contact_mobile
:
appInfo
.
contact_mobile
contact_mobile
:
appInfo
.
contact_mobile
};
};
opOrderResult
.
data
.
userInfo
=
{
opOrderResult
.
data
.
userInfo
=
{
channel_userid
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
channel_userid
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
...
@@ -1140,16 +1181,16 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1140,16 +1181,16 @@ class UtilsOrderService extends AppServiceBase {
}
}
// 推送
// 推送
let
yfRet
=
await
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
let
yfRet
=
await
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
if
(
yfRet
.
status
!=
0
)
{
if
(
yfRet
.
status
!=
0
)
{
return
yfRet
;
return
yfRet
;
}
}
if
([
'icpsq'
,
'edisq'
].
includes
(
opOrderResult
.
data
.
product_info
.
channel_item_code
))
{
if
([
'icpsq'
,
'edisq'
].
includes
(
opOrderResult
.
data
.
product_info
.
channel_item_code
))
{
//创建方案
//创建方案
pobj
.
salesmanInfo
=
{
pobj
.
salesmanInfo
=
{
"salesmanId"
:
yfRet
.
data
.
orderList
[
0
].
operator
||
""
,
"salesmanId"
:
yfRet
.
data
.
orderList
[
0
].
operator
||
""
,
"salesmanName"
:
yfRet
.
data
.
orderList
[
0
].
operatorName
||
""
,
"salesmanName"
:
yfRet
.
data
.
orderList
[
0
].
operatorName
||
""
,
"salesmanMobile"
:
yfRet
.
data
.
orderList
[
0
].
phone
||
""
,
"salesmanMobile"
:
yfRet
.
data
.
orderList
[
0
].
phone
||
""
,
"salesmanChannelId"
:
yfRet
.
data
.
orderList
[
0
].
channelUserId
||
""
"salesmanChannelId"
:
yfRet
.
data
.
orderList
[
0
].
channelUserId
||
""
}
}
let
pushRet
=
await
this
.
packagingPushData
(
pobj
);
let
pushRet
=
await
this
.
packagingPushData
(
pobj
);
if
(
pushRet
.
status
!=
0
)
{
if
(
pushRet
.
status
!=
0
)
{
...
@@ -1160,13 +1201,13 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1160,13 +1201,13 @@ class UtilsOrderService extends AppServiceBase {
}
}
//订单状态 已接单 目前360在用
//订单状态 已接单 目前360在用
if
(
pobj
.
appInfo
.
uapp_id
==
'50'
)
{
if
(
pobj
.
appInfo
.
uapp_id
==
'50'
)
{
pobj
.
actionBody
.
orderNo
=
params
.
orderNo
;
pobj
.
actionBody
.
orderNo
=
params
.
orderNo
;
let
ApplicationStatus
=
30
;
let
ApplicationStatus
=
30
;
if
(
opOrderResult
.
data
.
product_info
.
channel_item_code
==
'zzsbzc'
)
{
if
(
opOrderResult
.
data
.
product_info
.
channel_item_code
==
'zzsbzc'
)
{
ApplicationStatus
=
2
;
ApplicationStatus
=
2
;
}
}
if
(
opOrderResult
.
data
.
product_info
.
channel_item_code
==
'fzsbzc'
||
opOrderResult
.
data
.
product_info
.
channel_item_code
==
'dbsbzc'
)
{
if
(
opOrderResult
.
data
.
product_info
.
channel_item_code
==
'fzsbzc'
||
opOrderResult
.
data
.
product_info
.
channel_item_code
==
'dbsbzc'
)
{
ApplicationStatus
=
1
;
ApplicationStatus
=
1
;
}
}
pobj
.
pushObj
=
{
pobj
.
pushObj
=
{
...
@@ -1174,7 +1215,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1174,7 +1215,7 @@ class UtilsOrderService extends AppServiceBase {
};
};
this
.
utils360Sve
.
pushOrderStatus
(
pobj
);
this
.
utils360Sve
.
pushOrderStatus
(
pobj
);
//钉钉机器人
//钉钉机器人
this
.
dingClient
.
gatewayPushByChannel
(
params
.
orderNo
,
pobj
.
appInfo
);
this
.
dingClient
.
gatewayPushByChannel
(
params
.
orderNo
,
pobj
.
appInfo
);
}
}
opOrderResult
.
data
=
null
;
opOrderResult
.
data
=
null
;
return
opOrderResult
;
return
opOrderResult
;
...
@@ -1209,7 +1250,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1209,7 +1250,7 @@ class UtilsOrderService extends AppServiceBase {
"CompanyName"
:
""
,
"CompanyName"
:
""
,
"licenseType"
:
""
,
"licenseType"
:
""
,
"solutionCity"
:
ab
.
product_info
.
price_item
.
price_desc
,
"solutionCity"
:
ab
.
product_info
.
price_item
.
price_desc
,
"solutionPrice"
:
Number
(
ab
.
order_info
.
totalSum
)
*
100
,
"solutionPrice"
:
Number
(
ab
.
order_info
.
totalSum
)
*
100
,
"channelTypeCode"
:
ab
.
product_info
.
service_business_code
,
"channelTypeCode"
:
ab
.
product_info
.
service_business_code
,
"companyLocation"
:
ab
.
product_info
.
price_item
.
price_desc
"companyLocation"
:
ab
.
product_info
.
price_item
.
price_desc
}
}
...
@@ -1217,7 +1258,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1217,7 +1258,7 @@ class UtilsOrderService extends AppServiceBase {
"status"
:
"USER_PAY_PRODUCE"
,
"status"
:
"USER_PAY_PRODUCE"
,
"bizType"
:
ab
.
product_info
.
channel_item_code
,
"bizType"
:
ab
.
product_info
.
channel_item_code
,
"solution"
:
solution
,
"solution"
:
solution
,
"totalSum"
:
Number
(
ab
.
order_info
.
totalSum
)
*
100
,
"totalSum"
:
Number
(
ab
.
order_info
.
totalSum
)
*
100
,
"typeCode"
:
ab
.
product_info
.
channel_item_code
,
"typeCode"
:
ab
.
product_info
.
channel_item_code
,
"typeName"
:
ab
.
product_info
.
channel_item_name
,
"typeName"
:
ab
.
product_info
.
channel_item_name
,
"statusName"
:
"⽤户⽀付"
,
"statusName"
:
"⽤户⽀付"
,
...
@@ -1225,7 +1266,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1225,7 +1266,7 @@ class UtilsOrderService extends AppServiceBase {
"publishName"
:
ab
.
order_contact
.
contactName
||
""
,
"publishName"
:
ab
.
order_contact
.
contactName
||
""
,
"publishMobile"
:
ab
.
order_contact
.
mobile
||
""
"publishMobile"
:
ab
.
order_contact
.
mobile
||
""
},
},
"salesmanInfo"
:
pobj
.
salesmanInfo
"salesmanInfo"
:
pobj
.
salesmanInfo
}
}
//推送数据
//推送数据
let
pushObj
=
{
let
pushObj
=
{
...
@@ -1270,7 +1311,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1270,7 +1311,7 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResult
(
null
,
'payOrderNo can be not null'
)
return
system
.
getResult
(
null
,
'payOrderNo can be not null'
)
}
}
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
params
.
appkey
},
url
);
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
params
.
appkey
},
url
);
if
(
appInfoRt
.
status
!=
0
)
{
if
(
appInfoRt
.
status
!=
0
)
{
appInfoRt
.
msg
=
appInfoRt
.
msg
+
",100270"
;
appInfoRt
.
msg
=
appInfoRt
.
msg
+
",100270"
;
return
appInfoRt
;
return
appInfoRt
;
...
@@ -1281,7 +1322,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1281,7 +1322,7 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResultFail
(
-
1
,
'验证签名失败'
)
return
system
.
getResultFail
(
-
1
,
'验证签名失败'
)
}
}
var
appInfo
=
appInfoRt
.
data
;
var
appInfo
=
appInfoRt
.
data
;
params
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
};
params
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
};
params
.
pay_type
=
params
.
payType
;
params
.
pay_type
=
params
.
payType
;
params
.
time_end
=
params
.
payTime
;
params
.
time_end
=
params
.
payTime
;
// 修改并返回订单支付状 态,创建收款单
// 修改并返回订单支付状 态,创建收款单
...
@@ -1360,7 +1401,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1360,7 +1401,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
{
var
result
=
{
"errorCode"
:
"error"
,
"errorCode"
:
"error"
,
"errorMsg"
:
"标源状态不符合"
,
"errorMsg"
:
"标源状态不符合"
,
"module"
:
{
"orderNumber"
:
""
},
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
pobj
.
requestId
,
"requestId"
:
pobj
.
requestId
,
"success"
:
false
"success"
:
false
}
}
...
@@ -1370,7 +1411,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1370,7 +1411,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
{
var
result
=
{
"errorCode"
:
"error"
,
"errorCode"
:
"error"
,
"errorMsg"
:
"标源状态不符合"
,
"errorMsg"
:
"标源状态不符合"
,
"module"
:
{
"orderNumber"
:
""
},
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
pobj
.
requestId
,
"requestId"
:
pobj
.
requestId
,
"success"
:
false
"success"
:
false
}
}
...
@@ -1411,7 +1452,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1411,7 +1452,7 @@ class UtilsOrderService extends AppServiceBase {
var
tmResult
=
{
var
tmResult
=
{
"errorCode"
:
"OK"
,
"errorCode"
:
"OK"
,
"errorMsg"
:
"操作成功"
,
"errorMsg"
:
"操作成功"
,
"module"
:
{
"orderNumber"
:
result
.
data
.
orderNo
},
"module"
:
{
"orderNumber"
:
result
.
data
.
orderNo
},
"requestId"
:
pobj
.
requestId
,
"requestId"
:
pobj
.
requestId
,
"success"
:
true
"success"
:
true
}
}
...
@@ -1422,7 +1463,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1422,7 +1463,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
{
var
result
=
{
"errorCode"
:
"error"
,
"errorCode"
:
"error"
,
"errorMsg"
:
e
,
"errorMsg"
:
e
,
"module"
:
{
"orderNumber"
:
""
},
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
pobj
.
requestId
,
"requestId"
:
pobj
.
requestId
,
"success"
:
false
"success"
:
false
}
}
...
@@ -1455,7 +1496,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1455,7 +1496,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
{
var
result
=
{
"ErrorCode"
:
"error"
,
"ErrorCode"
:
"error"
,
"ErrorMsg"
:
e
,
"ErrorMsg"
:
e
,
"Module"
:
{
"orderNumber"
:
""
},
"Module"
:
{
"orderNumber"
:
""
},
"RequestId"
:
pobj
.
requestId
,
"RequestId"
:
pobj
.
requestId
,
"Success"
:
false
"Success"
:
false
}
}
...
@@ -1542,7 +1583,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1542,7 +1583,7 @@ class UtilsOrderService extends AppServiceBase {
"payCode"
:
"zzsbzc-2"
,
// Y 支付价格code
"payCode"
:
"zzsbzc-2"
,
// Y 支付价格code
"quantity"
:
nclone
.
nclThree
.
length
-
10
// Y 购买数量
"quantity"
:
nclone
.
nclThree
.
length
-
10
// Y 购买数量
}
}
totalSum
+=
(
nclone
.
nclThree
.
length
-
10
)
*
30
totalSum
+=
(
nclone
.
nclThree
.
length
-
10
)
*
30
}
}
actionBody
.
totalSum
=
totalSum
;
actionBody
.
totalSum
=
totalSum
;
actionBody
.
quantity
=
1
;
actionBody
.
quantity
=
1
;
...
@@ -1601,10 +1642,11 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -1601,10 +1642,11 @@ class UtilsOrderService extends AppServiceBase {
}
}
//测试
//测试
async
pushTest
(
pobj
,
actionBody
)
{
async
pushTest
(
pobj
,
actionBody
)
{
let
url
=
this
.
centerOrderUrl
+
"notifyaction/internalCallsNotify/updateTmStatus"
;
let
url
=
this
.
centerOrderUrl
+
"notifyaction/internalCallsNotify/updateTmStatus"
;
let
result
=
await
this
.
restPostUrl
(
actionBody
,
url
);
let
result
=
await
this
.
restPostUrl
(
actionBody
,
url
);
return
result
return
result
}
}
}
}
module
.
exports
=
UtilsOrderService
;
module
.
exports
=
UtilsOrderService
;
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