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
84fce899
Commit
84fce899
authored
Aug 28, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tx-fi-tax' of gitlab.gongsibao.com:jiangyong/zhichan into tx-fi-tax
parents
44ada3dd
b444abec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
33 deletions
+138
-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/db/models/delivery/fi_tax_push_queue.js
+81
-0
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 @
84fce899
...
...
@@ -121,36 +121,64 @@ class BizOptCtl extends CtlBase {
async
closeBizopt
(
mobj
,
qobj
,
req
)
{
let
pobj
=
mobj
.
d
;
pobj
.
business_status
=
"isClosed"
;
if
(
!
qobj
.
demand_code
||
!
qobj
.
close_reason
)
{
return
system
.
getResultError
(
"缺少必要参数."
);
}
//根据需求编号去更新该条需求的状态为已关闭
try
{
let
res
=
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
//添加到记录表
pobj
.
operator
=
{
id
:
mobj
.
userid
?
mobj
.
userid
:
""
,
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
);
//异步将该需求关闭信息同步到其他系统(走队列,融易算接口文档2.3)
//构造参数
//TODO 构造参数,添加判断(有方案信息的才走队列同步到融易算,没有的直接关闭)
let
pushUrl
=
this
.
rysUrl
+
"leads/proposal/close"
;
let
pushObj
=
{
pushUrl
:
pushUrl
,
actionType
:
"close"
,
messageBody
:
pobj
,
headData
:
{
'Authorization'
:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1OTg0MzQ2ODcsImlzcyI6InJFRVN6TU5ZUlM2RnBWNnZlY09vdExPNWdPcUNXSmFQIiwiaWF0IjoxNTk4NDMxMDg3fQ.isQ40HqHHfJ-rTsUQOhRIdu4XCitZU-AfzeqSH4kPbQ'
,
'XAPPKEY'
:
'f6b59b74-f943-4735-bb86-e05d6b7fd78e'
,
'Source'
:
'GSB'
}
//构造参数,添加判断(有方案信息的才走队列同步到融易算,没有的直接关闭)
let
schemeRes
=
await
this
.
schemeSve
.
findInfo
(
pobj
);
if
(
schemeRes
&&
schemeRes
.
solution_bizid
)
{
let
pushObj
=
this
.
buildObj
(
pobj
,
schemeRes
);
system
.
queueOper
(
pushObj
);
}
else
{
console
.
log
(
pobj
.
demand_code
+
"该需求没有方案信息,不需要同步"
);
}
system
.
queueOper
(
pushObj
);
return
system
.
getResult
(
"关闭需求成功!"
);
}
catch
(
error
)
{
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
...
...
tx-fi-tax/app/base/controller/impl/bizchance/fitaxschemeCtl.js
View file @
84fce899
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
{
json
,
JSON
}
=
require
(
"sequelize"
);
const
appconfig
=
system
.
getSysConfig
();
class
FitaxschemeCtl
extends
CtlBase
{
constructor
()
{
...
...
@@ -124,21 +125,3 @@ class FitaxschemeCtl extends CtlBase {
}
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/db/models/delivery/fi_tax_push_queue.js
0 → 100644
View file @
84fce899
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
/**
* 财税-方案表
*/
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"fitaxpushqueue"
,
{
delivery_code
:
{
// 交付单id
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
current_period
:
{
// 当前帐期
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
req_data
:
{
// 推送请求数据
allowNull
:
true
,
type
:
DataTypes
.
JSON
},
res_data
:
{
// 推送返回数据
allowNull
:
true
,
type
:
DataTypes
.
JSON
},
push_status
:
{
// 推送状态
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
rys_check
:
{
// 融易算是否确认
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
check_date
:
{
// 融易算确认时间
allowNull
:
true
,
type
:
DataTypes
.
DATE
}
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'fi_tax_push_queue'
,
validate
:
{
},
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
tx-fi-tax/app/base/service/impl/bizchance/fitaxschemeSve.js
View file @
84fce899
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
{
json
}
=
require
(
"sequelize"
);
const
appconfig
=
system
.
getSysConfig
();
class
FitaxschemeService
extends
ServiceBase
{
constructor
()
{
...
...
@@ -30,4 +31,16 @@ class FitaxschemeService extends ServiceBase {
})
}
}
module
.
exports
=
FitaxschemeService
;
\ No newline at end of file
module
.
exports
=
FitaxschemeService
;
// 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