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
99bbcad8
Commit
99bbcad8
authored
Mar 18, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel
parents
df7d888b
e9fc92d6
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
163 additions
and
39 deletions
+163
-39
center-channel/app/base/api/impl/action/opLog.js
+26
-0
center-channel/app/base/api/impl/action/opNeed.js
+3
-0
center-channel/app/base/api/impl/opreceive/need.js
+3
-0
center-channel/app/base/service/app.base.js
+6
-0
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
+15
-13
center-channel/app/base/service/impl/common/centerorderSve.js
+16
-2
center-channel/app/base/service/impl/common/pushlogSve.js
+39
-0
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+12
-12
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
+23
-3
center-channel/app/base/service/impl/utilsSve/utilsOpNeedSve.js
+14
-0
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+2
-8
center-channel/app/base/service/sve.base.js
+3
-0
center-channel/app/base/utils/dingClient.js
+1
-1
No files found.
center-channel/app/base/api/impl/action/opLog.js
View file @
99bbcad8
...
...
@@ -5,6 +5,7 @@ const logCtl = system.getObject("service.common.oplogSve");
class
opLog
extends
WEBBase
{
constructor
()
{
super
();
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
}
async
info
(
pobj
,
qobj
,
req
)
{
this
.
logCtl
.
info
(
pobj
);
...
...
@@ -12,5 +13,29 @@ class opLog extends WEBBase {
async
error
(
pobj
,
qobj
,
req
)
{
this
.
logCtl
.
error
(
pobj
);
}
/**
* 获取推送失败日志列表
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async
getPushFailLogList
(
pobj
,
qobj
,
req
){
let
list
=
await
this
.
pushlogSve
.
getPushFailLogList
(
pobj
.
actionBody
);
return
list
;
}
/**
* 重新推送
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async
rePush
(
pobj
,
qobj
,
req
){
let
result
=
await
this
.
pushlogSve
.
rePush
(
pobj
.
actionBody
);
return
result
;
}
}
module
.
exports
=
opLog
;
\ No newline at end of file
center-channel/app/base/api/impl/action/opNeed.js
View file @
99bbcad8
...
...
@@ -60,6 +60,9 @@ class OpNeed extends APIBase {
case
"getStatisticsByProduct"
:
opResult
=
await
this
.
utilsOpNeedSve
.
getStatisticsByProduct
(
pobj
);
break
;
case
"getNeedProductType"
:
opResult
=
await
this
.
utilsOpNeedSve
.
getNeedProductType
(
pobj
);
break
;
case
"getStatisticsByArea"
:
opResult
=
await
this
.
utilsOpNeedSve
.
getStatisticsByArea
(
pobj
);
break
;
...
...
center-channel/app/base/api/impl/opreceive/need.js
View file @
99bbcad8
...
...
@@ -127,6 +127,9 @@ class Need extends APIBase {
case
"importNeeds"
:
opResult
=
await
this
.
utilsNeedSve
.
importNeeds
(
pobj
,
req
);
break
;
case
"getymicpProduce"
:
//获取易名的icp产品信息
opResult
=
await
this
.
centerorderSve
.
getymicpProduce
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-channel/app/base/service/app.base.js
View file @
99bbcad8
...
...
@@ -245,6 +245,12 @@ class AppServiceBase {
returnType
:
'1'
,
opTitle
:
opType
+
"数据推送成功->"
+
opTitleDesc
});
// TODO 更改需求推送状态
if
(
opType
.
indexOf
(
'Need'
)
>=
0
&&
opType
.
indexOf
(
'Business'
)
>=
0
){
pobj
.
actionType
=
'updateNeedPushStatus'
;
let
url
=
settings
.
centerOrderUrl
()
+
'action/opNeed/springBoard'
;
let
result
=
await
this
.
execPostByTimeOut
(
null
,
pobj
,
url
,
null
,
null
,
60
);
}
// result.data = null;
return
result
;
}
...
...
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
View file @
99bbcad8
...
...
@@ -86,6 +86,7 @@ class BaseCenterOrderService extends AppServiceBase {
//提交Icp注册方案
async
submitIcpProgramme
(
pobj
)
{
console
.
log
(
'提交Icp注册方案---'
,
pobj
)
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
,
"action/qcapi/springBoard"
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
)
{
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
...
...
@@ -158,8 +159,9 @@ class BaseCenterOrderService extends AppServiceBase {
if
(
needinfo
.
uapp_id
==
uappId
.
ename
){
//推送数据至易名
// var bizType = needinfo.channelTypeCode;//业务类型里
solution
.
Area
=
cityLetter
[
solution
.
Area
]
//
solution.Area = cityLetter[solution.Area]
console
.
log
(
'solution.Area++'
,
solution
.
Area
)
console
.
log
(
'solution++'
,
solution
)
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
...
...
@@ -319,18 +321,18 @@ class BaseCenterOrderService extends AppServiceBase {
};
var
a
=
await
self
.
reqCenterOrderApi
(
reqObj2
);
//保存渠道方案id
console
.
log
(
"保存渠道方案id aaaa++ "
,
a
)
// if (a && a.status == 0 && resData.path
) {
//
var reqObj3 = {
//
actionType: "receiveIcpConfirmUrl",
//
appInfo: appInfo,
//
actionBody: {
//
solutionNo: solutionNo,
// confirmUrl: pushRes.path
//
}
//
};
//
var url = await self.reqCenterOrderApi(reqObj3);//保存用户确认方案url
//
console.log('save confirmUrl ++ ',url)
//
}
if
(
a
&&
a
.
status
==
0
&&
pushRes
.
ConfirmUrl
)
{
var
reqObj3
=
{
actionType
:
"receiveIcpConfirmUrl"
,
appInfo
:
appInfo
,
actionBody
:
{
solutionNo
:
solutionNo
,
confirmUrl
:
pushRes
.
ConfirmUrl
}
};
var
url
=
await
self
.
reqCenterOrderApi
(
reqObj3
);
//保存用户确认方案url
console
.
log
(
'save confirmUrl ++ '
,
url
)
}
}
return
pushRes
;
}
...
...
center-channel/app/base/service/impl/common/centerorderSve.js
View file @
99bbcad8
...
...
@@ -650,9 +650,14 @@ class CenterorderService extends AppServiceBase {
if
(
pobj
&&
pobj
.
appInfo
&&
pobj
.
appInfo
.
uapp_id
&&
pobj
.
appInfo
.
uapp_id
==
'52'
){
if
(
pobj
.
actionBody
.
channelItemCode
==
'5'
)
{
pobj
.
actionBody
.
regType
=
"
ename
.icp"
;
pobj
.
actionBody
.
regType
=
"
yiming
.icp"
;
}
else
if
(
pobj
.
actionBody
.
channelItemCode
==
'7'
)
{
pobj
.
actionBody
.
regType
=
"ename.edi"
;
pobj
.
actionBody
.
regType
=
"yiming.edi"
;
}
else
if
(
pobj
.
actionBody
.
channelItemCode
==
'icpnb'
)
{
pobj
.
actionBody
.
regType
=
"yiming.icpnb"
;
}
else
if
(
pobj
.
actionBody
.
channelItemCode
==
'edinb'
)
{
pobj
.
actionBody
.
regType
=
"yiming.edinb"
;
}
}
var
fqobj
=
{
...
...
@@ -715,9 +720,18 @@ class CenterorderService extends AppServiceBase {
}
return
system
.
getResultSuccess
();
}
//获取易名的icp产品信息
async
getymicpProduce
(
pobj
)
{
pobj
.
actionType
=
'getymicpProduce'
let
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
}
}
module
.
exports
=
CenterorderService
;
// var task = new CenterorderService();
// var pobj={
// "actionType":"submitProgramme",
// "actionBody":{
...
...
center-channel/app/base/service/impl/common/pushlogSve.js
View file @
99bbcad8
...
...
@@ -51,6 +51,45 @@ class PushlogService extends ServiceBase {
return
result
;
}
async
getPushFailLogList
(
actionBody
)
{
var
sql
=
"SELECT id,appid,`content`,failType,pushNumber,opTitle,resultInfo,created_at FROM `center_channel_pushfaillog` WHERE pushNumber=10 "
;
let
whereParams
=
{};
if
(
actionBody
.
appid
){
sql
+=
" and appid = :appid"
;
whereParams
.
appid
=
actionBody
.
appid
;
}
if
(
actionBody
.
likeStr
){
sql
+=
" and content like :likeStr"
;
whereParams
.
likeStr
=
"%"
+
actionBody
.
likeStr
+
"%"
;
}
sql
+=
" order by created_at desc"
var
list
=
await
this
.
pushfaillogDao
.
customQuery
(
sql
,
whereParams
);
var
result
=
system
.
getResultSuccess
(
list
);
return
result
;
}
/**
* 重新推送
* @param actionBody
* @returns {Promise<void>}
*/
async
rePush
(
actionBody
){
let
content
=
actionBody
.
content
;
let
sql
=
'update `center_channel_pushfaillog` set pushNumber = :pushNumber'
;
let
params
=
{
pushNumber
:
actionBody
.
pushNumber
||
9
}
if
(
Object
.
keys
(
content
).
length
>
0
){
sql
+=
',content=:content'
;
params
.
content
=
JSON
.
stringify
(
actionBody
.
content
);
}
sql
+=
' where id = :id'
;
params
.
id
=
actionBody
.
id
;
let
result
=
await
this
.
customUpdate
(
sql
,
params
);
return
system
.
getResult
(
result
);
}
async
addPublicServiceLog
(
pobj
,
req
)
{
var
sql
=
"INSERT INTO `igirl_api`.`center_channel_public_servicelog` (`appkey`,`pushUrl`,`pushContent`,`resultInfo`,`pushNumber`,`clientIp`,created_at)"
+
"VALUES(:appkey,:pushUrl,:pushContent,:resultInfo,:pushNumber,:clientIp,:created_at)"
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
99bbcad8
...
...
@@ -1436,11 +1436,17 @@ class UtilsNeedService extends AppServiceBase {
if
(
pobj
.
appInfo
&&
pobj
.
appInfo
.
uapp_id
&&
pobj
.
appInfo
.
uapp_id
==
"52"
){
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
pobj
.
actionBody
.
type
=
"
ename
.icp"
;
pobj
.
actionBody
.
idempotentSource
=
"
ename_
icp"
;
pobj
.
actionBody
.
type
=
"
yiming
.icp"
;
pobj
.
actionBody
.
idempotentSource
=
"
yiming.
icp"
;
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
7
)
{
pobj
.
actionBody
.
type
=
"ename.edi"
;
pobj
.
actionBody
.
idempotentSource
=
"ename_edi"
;
pobj
.
actionBody
.
type
=
"yiming.edi"
;
pobj
.
actionBody
.
idempotentSource
=
"yiming.edi"
;
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
"icpnb"
)
{
pobj
.
actionBody
.
type
=
"yiming.icpnb"
;
pobj
.
actionBody
.
idempotentSource
=
"yiming.icpnb"
;
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
"edinb"
)
{
pobj
.
actionBody
.
type
=
"yiming.edinb"
;
pobj
.
actionBody
.
idempotentSource
=
"yiming.edinb"
;
}
}
if
(
pobj
.
actionBody
.
description
&&
pobj
.
actionBody
.
description
.
indexOf
(
"备#"
)
<
0
)
{
...
...
@@ -1591,14 +1597,8 @@ class UtilsNeedService extends AppServiceBase {
return
system
.
getResultFail
(
-
1
,
'渠道id 不能为空'
);
}
pobj
.
actionType
=
'bulkCreateNeeds'
;
let
result
=
await
this
.
execPostByTimeOut
(
req
,
pobj
,
url
,
"json"
,
null
,
60
);
if
(
!
result
||
result
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
result
.
msg
);
}
if
(
!
result
.
data
||
result
.
data
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
result
.
data
.
msg
);
}
return
system
.
getResult
(
result
.
data
.
data
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
}
/**
...
...
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
View file @
99bbcad8
...
...
@@ -6,8 +6,9 @@ const { json } = require("sequelize");
const
{
getResult
,
getResultSuccess
}
=
require
(
"../../../system"
);
//区分渠道的uappid
const
uappId
=
{
'ali'
:
"18"
,
//(阿里icp、edi)
'baidu'
:
"44"
//(百度icp、edi)
'ali'
:
18
,
//(阿里icp、edi)
'baidu'
:
44
,
//(百度icp、edi)
'ename'
:
52
}
//需求操作类----ali对接的需求
class
UtilsNeedService2
extends
AppServiceBase
{
...
...
@@ -517,6 +518,11 @@ class UtilsNeedService2 extends AppServiceBase {
var
ress
=
await
self
.
baiduclient
.
baiduReqbyget
({
path
:
"/api/bla/provider/communication"
,
reqbody
:
{
requirementId
:
pobj
.
actionBody
.
intentionBizId
,
content
:
pobj
.
actionBody
.
note
}
});
console
.
log
(
"baidu+res"
,
ress
)
}
if
(
result
.
data
==
uappId
.
ename
)
{
console
.
log
(
'settings.enameClientUrl()+"WriteCommunicationLog"----'
,
settings
.
enameClientUrl
()
+
"WriteCommunicationLog"
)
var
resss
=
await
self
.
execClient
.
execEnamePost
({
IntentionBizId
:
pobj
.
actionBody
.
intentionBizId
,
Note
:
pobj
.
actionBody
.
note
},
settings
.
enameClientUrl
()
+
"WriteCommunicationLog"
);
console
.
log
(
"ename+resss"
,
resss
)
}
}
//推送交付系统
...
...
@@ -546,7 +552,7 @@ class UtilsNeedService2 extends AppServiceBase {
async
queryExpertApplyCommunicationLogs
(
pobj
)
{
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'jilu+++result++++'
,
result
)
console
.
log
(
'jilu+++result++++
1--
'
,
result
)
if
(
result
&&
result
.
status
==
0
&&
result
.
data
&&
result
.
data
.
uapp_id
)
{
if
(
result
.
data
.
uapp_id
==
uappId
.
ali
)
{
var
res
=
await
this
.
aliclient
.
reqbyget
({
...
...
@@ -576,6 +582,20 @@ class UtilsNeedService2 extends AppServiceBase {
});
console
.
log
(
'xxcc+++'
,
res
)
}
if
(
result
.
data
.
uapp_id
==
uappId
.
ename
)
{
// yiming / ename
console
.
log
(
"queryExpertApplyCommunicationLogs---ename---pobj--"
,
pobj
)
console
.
log
(
'settings.enameClientUrl()+"queryExpertApplyCommunicationLogs"----'
,
settings
.
enameClientUrl
()
+
"queryExpertApplyCommunicationLogs"
)
var
res
=
await
self
.
execClient
.
execEnamePost
({
BeginTime
:
pobj
.
actionBody
.
BeginTime
?
pobj
.
actionBody
.
BeginTime
:
""
,
EndTime
:
pobj
.
actionBody
.
EndTime
?
pobj
.
actionBody
.
EndTime
:
""
,
BizId
:
pobj
.
actionBody
.
intentionBizId
,
UserFeedBack
:
pobj
.
actionBody
.
userFeedBack
||
true
,
PageNum
:
pobj
.
actionBody
.
pageNum
||
1
,
PageSize
:
pobj
.
actionBody
.
pageSize
||
10
,
},
settings
.
enameClientUrl
()
+
"queryExpertApplyCommunicationLogs"
);
console
.
log
(
'ename+++queryExpertApplyCommunicationLogs---res---'
,
res
)
}
}
if
(
res
&&
res
.
data
&&
res
.
data
.
result
){
...
...
center-channel/app/base/service/impl/utilsSve/utilsOpNeedSve.js
View file @
99bbcad8
...
...
@@ -407,6 +407,20 @@ class UtilsOpNeedService extends AppServiceBase {
}
/**
* 获取需求 的产品类型
* @param pobj
* @returns {Promise<void>}
*/
async
getNeedProductType
(
pobj
){
let
url
=
this
.
centerOrderUrl
+
"action/opNeed/springBoard"
;
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
result
.
status
!=
0
){
return
system
.
getResultFail
(
-
1
);
}
return
result
;
}
/**
* 需求量对比
* @param pobj
* @returns {Promise<void>}
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
99bbcad8
...
...
@@ -300,14 +300,8 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResultFail
(
-
1
,
'渠道id 不能为空'
);
}
pobj
.
actionType
=
'bulkCreateOrders'
;
let
result
=
await
this
.
execPostByTimeOut
(
req
,
pobj
,
url
,
"json"
,
null
,
60
);
if
(
!
result
||
result
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
result
.
msg
);
}
if
(
!
result
.
data
||
result
.
data
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
result
.
data
.
msg
);
}
return
system
.
getResultSuccess
(
result
.
data
.
data
==
null
?[]:
result
.
data
.
data
);
let
result
=
await
this
.
restPostUrl
(
pobj
,
url
);
return
result
;
}
async
getOrderDetails
(
pobj
,
actionBody
)
{
...
...
center-channel/app/base/service/sve.base.js
View file @
99bbcad8
...
...
@@ -169,6 +169,9 @@ class ServiceBase {
async
customQuery
(
sql
,
paras
,
t
)
{
return
this
.
dao
.
customQuery
(
sql
,
paras
,
t
);
}
async
customUpdate
(
sql
,
paras
,
t
)
{
return
this
.
dao
.
customUpdate
(
sql
,
paras
,
t
);
}
async
findCount
(
whereObj
=
null
)
{
return
this
.
dao
.
findCount
(
whereObj
);
}
...
...
center-channel/app/base/utils/dingClient.js
View file @
99bbcad8
...
...
@@ -22,7 +22,7 @@ class dingClient {
//渠道钉钉提醒
async
gatewayPushByChannel
(
orderNo
,
appInfo
){
let
gatewayUrl
=
setttings
.
dingRobotUrl
(
appInfo
.
uapp_id
);
if
(
process
.
env
.
APP_ENV
!=
"dev"
&&
gatewayUrl
)
{
if
(
settings
.
env
!=
"dev"
&&
gatewayUrl
)
{
let
c
=
`注意提醒:
${
appInfo
.
app_name
}
->有订单待处理,订单号
${
orderNo
}
,老板们加油,加油,加油 !!!`
let
t
=
new
Date
().
toLocaleString
()
this
.
execClient
.
execPost
({
...
...
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