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
052d61b2
Commit
052d61b2
authored
Aug 07, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update OpSubmitNeed
parent
80e8813e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
171 deletions
+31
-171
center-channel/app/base/api/impl/action/opNeed.js
+9
-10
center-channel/app/base/service/impl/utilsSve/utilsOpNeedSve.js
+21
-160
center-channel/app/config/routes/api.js
+1
-1
No files found.
center-channel/app/base/api/impl/action/opNeed.js
View file @
052d61b2
...
...
@@ -4,7 +4,7 @@ var settings = require("../../../../config/settings");
class
OpNeed
extends
APIBase
{
constructor
()
{
super
();
this
.
utils
NeedSve
=
system
.
getObject
(
"service.utilsSve.utils
NeedSve"
);
this
.
utils
OpNeedSve
=
system
.
getObject
(
"service.utilsSve.utilsOp
NeedSve"
);
this
.
centerorderSve
=
system
.
getObject
(
"service.common.centerorderSve"
);
}
...
...
@@ -26,23 +26,22 @@ class OpNeed extends APIBase {
}
async
opActionProcess
(
pobj
,
action_process
,
action_type
,
action_body
,
req
)
{
pobj
.
requestId
=
req
.
requestId
;
var
self
=
this
;
var
opResult
=
null
;
switch
(
action_type
)
{
case
"submitNeed"
:
//提交需求
opResult
=
await
this
.
utilsNeedSve
.
submitNeed
(
pobj
,
pobj
.
actionBody
);
case
"submitNeed"
:
//提交需求 2020 0807 lin 新增
opResult
=
await
this
.
utilsOpNeedSve
.
submitNeed
(
pobj
,
pobj
.
actionBody
);
break
;
case
"needList"
:
//需求列表
opResult
=
await
this
.
utilsOpNeedSve
.
needList
(
pobj
,
pobj
.
actionBody
);
break
;
// case "submitNeed"://需求列表
// opResult = await this.utilsNeedSve.submitNeed(pobj, pobj.actionBody);
// break;
case
"needClose"
:
//关闭需求
opResult
=
await
this
.
utilsNeedSve
.
needClose
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utils
Op
NeedSve
.
needClose
(
pobj
,
pobj
.
actionBody
);
break
;
case
"needDetailByChannelNo"
:
//需求详情--包含方案
opResult
=
await
this
.
utilsNeedSve
.
needDetailByChannelNo
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utils
Op
NeedSve
.
needDetailByChannelNo
(
pobj
,
pobj
.
actionBody
);
break
;
// case "getItemByChannelNeedNo"://方案反馈
// opResult = await this.utilsNeedSve.getItemByChannelNeedNo(pobj, pobj.actionBody);
// opResult = await this.utils
Op
NeedSve.getItemByChannelNeedNo(pobj, pobj.actionBody);
// break;
// case "receiveFeedback"://关闭方案
// opResult = await this.centerorderSve.reqCenterOrderApi(pobj);
...
...
center-channel/app/base/service/impl/utilsSve/utilsOpNeedSve.js
View file @
052d61b2
...
...
@@ -3,7 +3,8 @@ var settings = require("../../../../config/settings");
const
AppServiceBase
=
require
(
"../../app.base"
);
const
fs
=
require
(
"fs"
);
const
{
json
}
=
require
(
"sequelize"
);
//需求操作类----ali对接的需求
// 2020 0807 lin 新增 需求相关
// 接口文档地址:
class
UtilsOpNeedService
extends
AppServiceBase
{
constructor
()
{
super
();
...
...
@@ -17,118 +18,38 @@ class UtilsOpNeedService extends AppServiceBase {
}
/**
* 提交需求
* 提交需求
h5/pc 通用
* @param {*} pobj
* @param {*} actionBody
*/
async
submitNeed
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100380"
);
}
var
sobj
=
pobj
;
sobj
.
actionType
=
"getProductTypeInfo"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
}
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionType
=
"submitNeed"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
"esp.companyreg"
)
{
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedBusiness"
);
}
else
{
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
pobj
.
actionBody
.
type
=
"ali.icp"
;
}
else
{
pobj
.
actionBody
.
type
=
"ali.edi"
;
}
var
reqParams
=
{
actionBody
:
pobj
.
actionBody
,
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"addChance"
);
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedICPBusiness"
);
}
}
return
result
;
}
//调用center-order icp需求反馈
async
reqCenterOrderQcApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
if
(
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
var
self
=
this
;
pobj
.
actionType
=
"receiveIcpFeedback"
;
// 2020 0803 lin 修改;
if
(
pobj
.
intentionStatus
)
{
// 如果需求当前字段为5(已关闭)则通知fq
if
(
pobj
.
intentionStatus
==
5
)
{
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseICPNeed"
);
}
}
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
}
/**
* 提交需求-----del
* @param {*} pobj
* @param {*} actionBody
*/
async
submitNeedH5
(
pobj
,
actionBody
)
{
var
sobj
=
pobj
;
// 获取商品类型
sobj
.
actionType
=
"getProductTypeInfo"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
var
opResult
=
await
this
.
restPostUrl
(
sobj
,
url
);
if
(
opResult
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求类型查询失败"
);
}
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionType
=
"submitNeedH5"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
pobj
.
actionBody
.
type_code
=
opResult
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
opResult
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
opResult
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
opResult
.
data
.
channel_type_name
;
// 提交需求 暂未做推送
pobj
.
actionType
=
"submitNeed"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/opNeed/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
"esp.companyreg"
)
{
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedBusiness"
);
}
// else{
// if(pobj.actionBody.channel_type_code==5){
// pobj.actionBody.regType="ali.icp";
// }else{
// pobj.actionBody.regType="ali.edi";
// }
// this.utilsPushSve.aliBusiness2Fq(pobj, "intention");
// }
}
return
result
;
}
/**
* 获取需求详情
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody needNo 需求号
*/
async
getItemByNeedNo
(
pobj
,
actionBody
)
{
...
...
@@ -139,85 +60,25 @@ class UtilsOpNeedService extends AppServiceBase {
var
itemResult
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
itemResult
;
}
/**
* 获取需求详情
* @param {*} pobj
* @param {*} actionBody needNo 需求号
*/
async
getItemByChannelNeedNo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100390"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
itemResult
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
itemResult
;
}
/**
* 获取需求详情
* @param {*} pobj
* @param {*} actionBody bizId 渠道方案号
*/
async
getItemByChannelSolutionNo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
bizId
)
{
return
system
.
getResult
(
null
,
"actionBody.bizId can not be empty,100390"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
itemResult
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
itemResult
;
}
/**
* 关闭需求
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody
*/
async
needClose
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100395"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseNeed"
);
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResult
(
null
,
"推送失敗 100388"
);
}
}
/**
* icp关闭需求
* @param {*} pobj
* @param {*} actionBody
*/
async
needCloseIcp
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
channelNeedNo
)
{
if
(
!
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.channelNeedNo can not be empty,100395"
);
}
if
(
!
actionBody
.
note
)
{
return
system
.
getResult
(
null
,
"actionBody.note can not be empty,100395"
);
}
var
self
=
this
;
pobj
.
actionBody
.
intentionBizId
=
pobj
.
actionBody
.
channelNeedNo
;
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/opNeed/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
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
,
"订单关闭失败"
);
}
}
// 推送ali
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntention"
,
reqbody
:
{
BizId
:
actionBody
.
channelNeedNo
,
Note
:
actionBody
.
note
},
apiVersion
:
"2019-05-08"
});
console
.
log
(
a
);
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseICPNeed"
);
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResult
(
null
,
"close fail 100389 "
);
if
(
result
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"推送失敗 100388"
);
}
return
system
.
getResultSuccess
();
}
//查询需求详情
...
...
center-channel/app/config/routes/api.js
View file @
052d61b2
...
...
@@ -243,7 +243,7 @@ module.exports = function (app) {
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"delOrder"
,
"submitProgramme"
,
"getProgrammeListByUser"
,
"getProgrammeInfoByNeedNo"
,
"abolishProgramme"
,
"getAliPayInfo"
,
"getPaidLogoListByUser"
,
"getCollectibleLogoListByUser"
,
"collectLogo"
,
"getLogoMaterial"
,
"cancelCollectLogo"
,
"icpNotify"
,
"createName"
,
"getNameDetail"
,
"orderConfirm"
,
"orderTotalSum"
,
"collect"
,
"reg"
,
"orderCheck"
,
"getReOrderList"
,
"getOfficalList"
,
"addReviewList"
"orderTotalSum"
,
"collect"
,
"reg"
,
"orderCheck"
,
"getReOrderList"
,
"getOfficalList"
,
"addReviewList"
,
"submitNeedWeb"
,
"needCloseWeb"
,
"needListWeb"
,
"needDetailByChannelNoWeb"
];
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
...
...
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