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
7c1e4cb3
Commit
7c1e4cb3
authored
Apr 13, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改推送记录
parent
fa4fdbcc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
47 deletions
+86
-47
center-channel/app/base/service/app.base.js
+9
-7
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+5
-1
center-channel/app/base/system.js
+72
-39
No files found.
center-channel/app/base/service/app.base.js
View file @
7c1e4cb3
...
...
@@ -249,7 +249,7 @@ class AppServiceBase {
let
url
=
settings
.
centerOrderUrl
()
+
'action/opNeed/springBoard'
;
this
.
execPostByTimeOut
(
null
,
pobj
,
url
,
null
,
null
,
60
);
}
if
([
"pushOrder"
,
"pushOrderBusiness"
,
"pushOrderICPBusiness"
].
includes
(
opType
)
&&
pobj
.
actionBody
&&
pobj
.
actionBody
.
orderNo
)
{
if
([
"pushOrder"
,
"pushOrderBusiness"
,
"pushOrderICPBusiness"
,
"pushOrderICPBusinessNew"
].
includes
(
opType
)
&&
pobj
.
actionBody
&&
pobj
.
actionBody
.
orderNo
)
{
pobj
.
actionBody
.
pushNumber
=
pobj
.
pushNumber
||
1
;
pobj
.
actionBody
.
pushStatus
=
3
;
//推送状态0待推送2推送失败3已成功推送
this
.
disposeOrderPush
(
pobj
);
...
...
@@ -267,6 +267,14 @@ class AppServiceBase {
async
disposePushResultFail
(
pobj
,
result
,
opTitleDesc
,
failType
)
{
//处理失败的结果信息--内部使用
var
opType
=
pobj
.
opType
||
""
;
let
pushNumber
=
pobj
.
pushNumber
||
1
;
if
(
pushNumber
==
10
)
{
pobj
.
actionBody
.
pushNumber
=
pushNumber
;
pobj
.
actionBody
.
pushStatus
=
2
;
//推送状态0待推送2推送失败3已成功推送
this
.
disposeOrderPush
(
pobj
);
if
(
result
.
errorMsg
&&
result
.
errorMsg
==
"订单产品查询出来产品与传递得产品数量不一致"
)
{
this
.
disposeOrderPushFailSendDing
(
pobj
);
}
}
let
resultInfo
=
JSON
.
stringify
(
result
);
this
.
pushlogSve
.
createFailLogDb
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
...
...
@@ -280,12 +288,6 @@ class AppServiceBase {
pushNumber
:
pushNumber
});
result
.
data
=
null
;
if
(
pushNumber
==
10
&&
resultInfo
.
indexOf
(
"订单产品查询出来产品与传递得产品数量不一致,请重新选择"
)
>=
0
)
{
pobj
.
actionBody
.
pushNumber
=
pushNumber
;
pobj
.
actionBody
.
pushStatus
=
2
;
//推送状态0待推送2推送失败3已成功推送
this
.
disposeOrderPushFailSendDing
(
pobj
);
this
.
disposeOrderPush
(
pobj
);
}
return
result
;
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
7c1e4cb3
...
...
@@ -121,7 +121,11 @@ class UtilsFqAliyunService extends AppServiceBase {
if
(
rtn
.
success
&&
rtn
.
code
==
200
)
{
return
system
.
getResultSuccess
(
rtn
.
data
,
"推送成功"
);
}
else
{
return
system
.
getResultFail
(
-
1
,
`推送失败,失败原因11:
${
JSON
.
stringify
(
rtn
)}
`
);
let
errorMsg
=
""
;
if
(
rtn
.
errorMessage
&&
rtn
.
errorMessage
.
indexOf
(
"订单产品查询出来产品与传递得产品数量不一致"
)
>=
0
)
{
errorMsg
=
"订单产品查询出来产品与传递得产品数量不一致"
;
}
return
system
.
getResultNewFail
(
-
1
,
`推送失败,失败原因11:
${
JSON
.
stringify
(
rtn
)}
`
,
null
,
errorMsg
);
}
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
...
...
center-channel/app/base/system.js
View file @
7c1e4cb3
var
fs
=
require
(
"fs"
);
var
objsettings
=
require
(
"../config/objsettings"
);
var
settings
=
require
(
"../config/settings"
);
class
System
{
static
declare
(
ns
)
{
var
ar
=
ns
.
split
(
'.'
);
...
...
@@ -15,6 +16,7 @@ class System {
}
}
}
static
register
(
key
,
ClassObj
)
{
if
(
System
.
objTable
[
key
]
!=
null
)
{
throw
new
Error
(
"相同key的对象已经存在"
);
...
...
@@ -25,6 +27,7 @@ class System {
return
System
.
objTable
[
key
];
}
static
getResult
(
data
,
opmsg
=
"操作成功"
,
req
)
{
return
{
status
:
!
data
?
-
1
:
0
,
...
...
@@ -33,9 +36,11 @@ class System {
bizmsg
:
req
&&
req
.
session
&&
req
.
session
.
bizmsg
?
req
.
session
.
bizmsg
:
"empty"
};
}
static
getErrResult2
(
errmsg
)
{
return
this
.
getResult2
(
null
,
null
,
null
,
errmsg
);
}
static
getResult2
(
data
,
req
,
okmsg
=
"操作成功"
,
errmsg
=
"操作失败"
)
{
var
result
=
{
status
:
0
,
...
...
@@ -54,11 +59,12 @@ class System {
}
return
result
;
}
static
getResult3
(
data
,
req
,
okmsg
=
"操作成功"
,
errmsg
=
"操作失败"
)
{
var
total
=
data
.
total
;
data
=
data
.
hits
;
var
sources
=
[];
data
.
forEach
(
function
(
d
)
{
data
.
forEach
(
function
(
d
)
{
sources
.
push
(
d
.
_source
);
})
var
result
=
{
...
...
@@ -80,20 +86,21 @@ class System {
}
return
result
;
}
static
getResult4
(
j
,
req
,
okmsg
=
"操作成功"
,
errmsg
=
"操作失败"
)
{
var
aggs
=
j
.
aggregations
;
var
codes_count
=
aggs
.
ncl_one_codes_count
;
var
bucketlist
=
codes_count
.
buckets
;
var
bucklist
=
[];
bucketlist
.
forEach
(
function
(
d
)
{
bucketlist
.
forEach
(
function
(
d
)
{
bucklist
.
push
(
d
);
})
var
data
=
j
.
hits
;
var
total
=
data
.
total
;
var
hit
=
data
.
hits
;
var
sources
=
[];
hit
.
forEach
(
function
(
d
)
{
hit
.
forEach
(
function
(
d
)
{
sources
.
push
(
d
.
_source
);
})
var
result
=
{
...
...
@@ -115,13 +122,14 @@ class System {
}
return
result
;
}
static
getResultjuhe4
(
j
,
req
,
okmsg
=
"操作成功"
,
errmsg
=
"操作失败"
)
{
var
aggs
=
j
.
aggregations
;
var
codes_count
=
aggs
.
ncl_one_codes_count
;
var
bucketlist
=
codes_count
.
buckets
;
var
bucklist
=
[];
bucketlist
.
forEach
(
function
(
d
)
{
bucketlist
.
forEach
(
function
(
d
)
{
bucklist
.
push
(
d
);
})
var
result
=
{
...
...
@@ -135,44 +143,47 @@ class System {
}
return
result
;
}
static
getResultjuhetwo
(
j
,
req
,
okmsg
=
"操作成功"
,
errmsg
=
"操作失败"
)
{
var
aggs
=
j
.
aggregations
;
var
notice_count
=
aggs
.
notice_count
;
var
bucketlist
=
notice_count
.
buckets
;
var
bucklist
=
[];
bucketlist
.
forEach
(
function
(
d
)
{
var
notice_issue
=
d
.
key
;
var
date
=
d
.
date_max
.
value
;
var
data
=
{
notice_issue
:
notice_issue
,
date
:
date
}
bucklist
.
push
(
data
);
})
var
result
=
{
status
:
0
,
msg
:
okmsg
,
buckets
:
bucklist
,
};
if
(
!
bucklist
)
{
result
.
status
=
-
1
;
result
.
msg
=
errmsg
;
var
aggs
=
j
.
aggregations
;
var
notice_count
=
aggs
.
notice_count
;
var
bucketlist
=
notice_count
.
buckets
;
var
bucklist
=
[];
bucketlist
.
forEach
(
function
(
d
)
{
var
notice_issue
=
d
.
key
;
var
date
=
d
.
date_max
.
value
;
var
data
=
{
notice_issue
:
notice_issue
,
date
:
date
}
return
result
;
bucklist
.
push
(
data
);
})
var
result
=
{
status
:
0
,
msg
:
okmsg
,
buckets
:
bucklist
,
};
if
(
!
bucklist
)
{
result
.
status
=
-
1
;
result
.
msg
=
errmsg
;
}
/**
* 请求返回成功
* @param {*} data 操作成功返回的数据
* @param {*} okmsg 操作成功的描述
*/
return
result
;
}
/**
* 请求返回成功
* @param {*} data 操作成功返回的数据
* @param {*} okmsg 操作成功的描述
*/
static
getResultSuccess
(
data
,
okmsg
=
"success"
)
{
return
{
status
:
0
,
msg
:
okmsg
,
data
:
data
||
"成功"
};
}
// 2020 0916 lin 新增返回格式 成功status为1
return
{
status
:
0
,
msg
:
okmsg
,
data
:
data
||
"成功"
};
}
// 2020 0916 lin 新增返回格式 成功status为1
static
getResultRedisQueueSuccess
(
data
,
okmsg
=
"success"
)
{
return
{
status
:
1
,
...
...
@@ -207,6 +218,24 @@ class System {
data
:
data
,
};
}
/**
* 请求返回失败
* @param status
* @param errmsg
* @param data
* @param errorMsg
* @returns {{msg: string, data: string, status: number, errorMsg: *}}
*/
static
getResultNewFail
(
status
=
-
1
,
errmsg
=
"fail"
,
data
=
""
,
errorMsg
)
{
return
{
status
:
status
,
msg
:
errmsg
,
errorMsg
:
errorMsg
,
data
:
data
,
};
}
static
getObject
(
objpath
)
{
var
pathArray
=
objpath
.
split
(
"."
);
var
packageName
=
pathArray
[
0
];
...
...
@@ -230,6 +259,7 @@ class System {
return
System
.
register
(
objabspath
,
ClassObj
);
}
}
static
getUiConfig
(
appid
)
{
var
configPath
=
settings
.
basepath
+
"/app/base/db/metadata/"
+
appid
+
"/index.js"
;
if
(
settings
.
env
==
"dev"
)
{
...
...
@@ -238,6 +268,7 @@ class System {
var
configValue
=
require
(
configPath
);
return
configValue
;
}
static
getUiConfig2
(
appid
)
{
var
configPath
=
settings
.
basepath
+
"/app/base/db/metadata/index.js"
;
// if(settings.env=="dev"){
...
...
@@ -248,6 +279,7 @@ class System {
var
configValue
=
require
(
configPath
);
return
configValue
[
appid
];
}
static
get_client_ip
(
req
)
{
var
ip
=
req
.
headers
[
'x-forwarded-for'
]
||
req
.
ip
||
...
...
@@ -296,7 +328,8 @@ class System {
}
}
}
Date
.
prototype
.
Format
=
function
(
fmt
)
{
//author: meizz
Date
.
prototype
.
Format
=
function
(
fmt
)
{
//author: meizz
var
o
=
{
"M+"
:
this
.
getMonth
()
+
1
,
//月份
"d+"
:
this
.
getDate
(),
//日
...
...
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