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
e295e1d1
Commit
e295e1d1
authored
Aug 28, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pp
parent
6965e60b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
33 deletions
+57
-33
tx-fi-tax/app/base/controller/impl/bizchance/bizoptCtl.js
+41
-13
tx-fi-tax/app/base/controller/impl/bizchance/fitaxschemeCtl.js
+1
-18
tx-fi-tax/app/base/service/impl/bizchance/fitaxschemeSve.js
+15
-2
No files found.
tx-fi-tax/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
e295e1d1
...
@@ -121,36 +121,64 @@ class BizOptCtl extends CtlBase {
...
@@ -121,36 +121,64 @@ class BizOptCtl extends CtlBase {
async
closeBizopt
(
mobj
,
qobj
,
req
)
{
async
closeBizopt
(
mobj
,
qobj
,
req
)
{
let
pobj
=
mobj
.
d
;
let
pobj
=
mobj
.
d
;
pobj
.
business_status
=
"isClosed"
;
pobj
.
business_status
=
"isClosed"
;
if
(
!
qobj
.
demand_code
||
!
qobj
.
close_reason
)
{
return
system
.
getResultError
(
"缺少必要参数."
);
}
//根据需求编号去更新该条需求的状态为已关闭
//根据需求编号去更新该条需求的状态为已关闭
try
{
try
{
let
res
=
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
let
res
=
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
//添加到记录表
//添加到记录表
pobj
.
operator
=
{
pobj
.
operator
=
{
id
:
mobj
.
userid
?
mobj
.
userid
:
""
,
id
:
mobj
.
userid
?
mobj
.
userid
:
""
,
name
:
mobj
.
username
?
mobj
.
username
:
""
name
:
mobj
.
username
?
mobj
.
username
:
""
}
}
pobj
.
operation_type
=
"close"
;
pobj
.
operation_details
=
{
close_reason
:
pobj
.
close_reason
,
remarks
:
pobj
.
remarks
}
let
recordRes
=
await
this
.
operationrecordSve
.
insertInfo
(
pobj
);
let
recordRes
=
await
this
.
operationrecordSve
.
insertInfo
(
pobj
);
//异步将该需求关闭信息同步到其他系统(走队列,融易算接口文档2.3)
//异步将该需求关闭信息同步到其他系统(走队列,融易算接口文档2.3)
//构造参数
//构造参数,添加判断(有方案信息的才走队列同步到融易算,没有的直接关闭)
//TODO 构造参数,添加判断(有方案信息的才走队列同步到融易算,没有的直接关闭)
let
schemeRes
=
await
this
.
schemeSve
.
findInfo
(
pobj
);
let
pushUrl
=
this
.
rysUrl
+
"leads/proposal/close"
;
if
(
schemeRes
&&
schemeRes
.
solution_bizid
)
{
let
pushObj
=
{
let
pushObj
=
this
.
buildObj
(
pobj
,
schemeRes
);
pushUrl
:
pushUrl
,
system
.
queueOper
(
pushObj
);
actionType
:
"close"
,
}
else
{
messageBody
:
pobj
,
console
.
log
(
pobj
.
demand_code
+
"该需求没有方案信息,不需要同步"
);
headData
:
{
'Authorization'
:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTg0MzQ2ODcsImlzcyI6InJFRVN6TU5ZUlM2RnBWNnZlY09vdExPNWdPcUNXSmFQIiwiaWF0IjoxNTk4NDMxMDg3fQ.isQ40HqHHfJ-rTsUQOhRIdu4XCitZU-AfzeqSH4kPbQ'
,
'XAPPKEY'
:
'f6b59b74-f943-4735-bb86-e05d6b7fd78e'
,
'Source'
:
'GSB'
}
}
}
system
.
queueOper
(
pushObj
);
return
system
.
getResult
(
"关闭需求成功!"
);
return
system
.
getResult
(
"关闭需求成功!"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResultError
(
"bizoptCtl/closeBizopt 关闭需求出错!"
);
return
system
.
getResultError
(
"bizoptCtl/closeBizopt 关闭需求出错!"
);
}
}
}
}
buildObj
(
pobj
,
schemeRes
)
{
let
pushUrl
=
this
.
rysUrl
+
"leads/proposal/close"
;
let
solutionBizId
;
if
(
schemeRes
.
solution_bizid
)
{
solutionBizId
=
schemeRes
.
solution_bizid
;
}
let
pushObj
=
{
pushUrl
:
pushUrl
,
actionType
:
"close"
,
messageBody
:
{
IntentionBizId
:
pobj
.
demand_code
,
BizType
:
"bookkeeping"
,
Solution
:
{
SolutionBizId
:
solutionBizId
,
//方案编号
Note
:
pobj
.
close_reason
//备注
}
},
headData
:
{
'Source'
:
'GSB'
}
}
return
pushObj
;
}
/**
/**
* 获取跟进详情页所有信息
* 获取跟进详情页所有信息
* @param {*} mobj
* @param {*} mobj
...
...
tx-fi-tax/app/base/controller/impl/bizchance/fitaxschemeCtl.js
View file @
e295e1d1
var
system
=
require
(
"../../../system"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
{
json
,
JSON
}
=
require
(
"sequelize"
);
const
appconfig
=
system
.
getSysConfig
();
const
appconfig
=
system
.
getSysConfig
();
class
FitaxschemeCtl
extends
CtlBase
{
class
FitaxschemeCtl
extends
CtlBase
{
constructor
()
{
constructor
()
{
...
@@ -124,21 +125,3 @@ class FitaxschemeCtl extends CtlBase {
...
@@ -124,21 +125,3 @@ class FitaxschemeCtl extends CtlBase {
}
}
module
.
exports
=
FitaxschemeCtl
;
module
.
exports
=
FitaxschemeCtl
;
// var task = new FitaxschemeCtl();
// var obj = {
// d: {
// "demand_code": "20200728103902194844_book",
// "solution_bizid": "22222",
// "service_type": "代理记账",
// "service_name": "海南省三亚市",
// "company_type": "特殊行业",
// "buy_duration": 2,
// "remarks": "SaaS",
// "taxpayer_type": "小规模纳税人",
// "total_cost": "2222"
// }
// }
// task.insertInfo(obj, {}, {}).then(d => {
// console.log(JSON.stringify(d));
// })
tx-fi-tax/app/base/service/impl/bizchance/fitaxschemeSve.js
View file @
e295e1d1
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
{
json
}
=
require
(
"sequelize"
);
const
appconfig
=
system
.
getSysConfig
();
const
appconfig
=
system
.
getSysConfig
();
class
FitaxschemeService
extends
ServiceBase
{
class
FitaxschemeService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
...
@@ -30,4 +31,16 @@ class FitaxschemeService extends ServiceBase {
...
@@ -30,4 +31,16 @@ class FitaxschemeService extends ServiceBase {
})
})
}
}
}
}
module
.
exports
=
FitaxschemeService
;
module
.
exports
=
FitaxschemeService
;
\ No newline at end of file
// var task = new FitaxschemeService();
// test()
// async function test() {
// var obj = {
// "demand_code": "20200728103902194844_book",
// }
// let res = await task.findInfo(obj);
// if (res) {
// console.log("返回结果:" + JSON.stringify(res));
// }
// }
\ No newline at end of file
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