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
8f12e877
Commit
8f12e877
authored
Aug 27, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Plain Diff
合并冲突
parents
e8e019fd
3ade885b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
44 deletions
+133
-44
tx-fi-tax/app/base/controller/impl/bizchance/bizoptCtl.js
+1
-1
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
+77
-42
tx-fi-tax/app/base/db/impl/bizchance/fitaxschemeDao.js
+1
-0
tx-fi-tax/app/base/system.js
+53
-0
tx-fi-tax/app/config/settings.js
+1
-1
No files found.
tx-fi-tax/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
8f12e877
...
...
@@ -123,7 +123,7 @@ class BizOptCtl extends CtlBase {
//根据需求编号去更新该条需求的状态为已关闭
try
{
let
res
=
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
//TODO 同步该需求关闭信息到其他系统
//TODO 同步该需求关闭信息到其他系统
(走队列,直接扔到队列里面)
//添加到记录表
pobj
.
operator
=
{
...
...
tx-fi-tax/app/base/controller/impl/bizchance/deliverybillCtl.js
View file @
8f12e877
...
...
@@ -8,6 +8,8 @@ const moment = require('moment');
const
System
=
require
(
"../../../system"
);
const
toFtClient
=
require
(
"../../../utils/toFtClient"
);
const
appconfig
=
system
.
getSysConfig
();
const
sha235
=
require
(
"sha256"
);
const
{
getResult
}
=
require
(
"../../../system"
);
class
DeliverybillCtl
extends
CtlBase
{
constructor
()
{
super
(
"bizchance"
,
CtlBase
.
getServiceName
(
DeliverybillCtl
));
...
...
@@ -291,6 +293,8 @@ class DeliverybillCtl extends CtlBase {
}
}
//根据bizId查询deliverybill表中的所有信息
async
getInfo
(
pobj
,
qobj
,
req
)
{
try
{
...
...
@@ -305,55 +309,86 @@ class DeliverybillCtl extends CtlBase {
}
}
async
portog
()
{
console
.
log
(
settings
.
port
);
//服务状态变更通知
async
notifyServiceStatusChange
(
pobj
,
qobj
,
req
)
{
let
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
requestId
||
ab
.
requestId
==
"undefined"
)
{
return
system
.
getResultFail
(
-
1
,
"请求id不能为空"
);
}
if
(
!
ab
.
bizId
||
ab
.
bizId
==
"undefined"
)
{
return
system
.
getResultFail
(
-
1
,
"服务实例编号不能为空"
);
}
if
(
!
ab
.
status
||
ab
.
status
==
"undefined"
)
{
return
system
.
getResultFail
(
-
1
,
"服务状态不能为空"
);
}
try
{
let
cacheStr
=
sha235
(
JSON
.
stringify
(
ab
));
let
cacheInfo
=
await
this
.
cacheManager
[
"TxCache"
].
getCache
(
cacheStr
);
if
(
cacheInfo
&&
cacheInfo
!==
"undefined"
)
{
return
{
"status"
:
1
,
"msg"
:
"已处理成功"
,
"data"
:
cacheInfo
,
"requestId"
:
ab
.
requestId
,
};
}
else
{
// 变更服务状态
let
whereObj
=
{
biz_id
:
ab
.
bizId
};
let
rtn
=
await
this
.
service
.
findOne
(
whereObj
);
if
(
!
rtn
)
{
return
system
.
getResultFail
(
-
1
,
"未知服务信息"
);
}
let
deliveryInfo
=
{};
Object
.
assign
(
deliveryInfo
,
rtn
.
delivery_info
,
{
"serviceStartTime"
:
ab
.
serviceStartTime
,
"serviceEndTime"
:
ab
.
serviceEndTime
,
});
let
upObj
=
{
delivery_status
:
ab
.
status
,
delivery_info
:
deliveryInfo
,
};
await
rtn
.
update
(
upObj
,
{
where
:
whereObj
});
// 将变更结果插入到redis中
await
this
.
cacheManager
[
"TxCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
return
{
"status"
:
1
,
"msg"
:
"处理成功"
,
"data"
:
rtn
,
"requestId"
:
ab
.
requestId
};
}
}
catch
(
err
)
{
return
system
.
getResultError
(
err
);
}
}
}
module
.
exports
=
DeliverybillCtl
;
var
task
=
new
DeliverybillCtl
();
var
obj
=
{
"actionType"
:
"produceData"
,
"actionBody"
:
{
"pushUrl"
:
"http://ic.com:8000/web/bizchance/deliverybillCtl"
,
"actionType"
:
"insertInfo"
,
"identifyCode"
:
"book-manage"
,
"messageBody"
:
{
"requestId"
:
"825da0a74432-738f-4bed-468d-d51aa880"
,
"bizId"
:
"2292748809"
,
"userId"
:
"24173452443103825"
,
"orderId"
:
"235184456620496"
,
"areatype"
:
"city"
,
"area"
:
"100010"
,
"topOrgCode"
:
"rong_yi_suan"
,
"taxpayerType"
:
1
,
"contactMobile"
:
"18510669321"
}
}
"requestId"
:
"1111111"
,
"bizId"
:
2592748677
,
"status"
:
"inservice"
,
"serviceStartTime"
:
"today"
,
"serviceEndTime"
:
"tomorrow"
,
}
task
.
portog
(
).
then
(
d
=>
{
task
.
notifyServiceStatusChange
({
actionBody
:
obj
},
{},
{}
).
then
(
d
=>
{
console
.
log
(
JSON
.
stringify
(
d
));
})
// var obj = {
// "actionType": "produceData",
// "actionBody": {
// "pushUrl": "http://ic.com:8000/web/bizchance/deliverybillCtl",
// "actionType": "insertInfo",
// "identifyCode": "book-manage",
// "messageBody": {
// "requestId": "825da0a74432-738f-4bed-468d-d51aa880",
// "bizId": "2292748809",
// "orderId": "235184456620496",
// "companyName": "北京融易算",
// "contactName": "JAMES7",
// "taxpayerType": 5,
// "contactMobile": "18510669367",
// "companyBizType": 1,
// "uscc": "911101053516460817K"
// }
// }
// }
// task.updateServer(obj, {}, {}).then(d => {
// console.log(JSON.stringify(d));
// })
// (async () => {
// var task = new DeliverybillCtl();
// var obj = {
// "deliverId":"1111111",
// "company1": "华为技术有限公司",
// "company2": "中兴通讯股份有限公司",
// "keyword1":"用户设备,通信领域,通信技术,设备发送,指示信息,通信系统,通信方法,设备接收,对应关系,基站发送,终端发送,用户体验,配置信息,请求消息,数据传输方法,用户终端,网络侧,移动终端,通信设备,传输方法",
// "keyword2":"用户体验,移动终端,用户设备,相关技术,网络侧,终端发送,用户终端,配置信息,指示信息,请求消息,对应关系,传输方法,基站发送,通信系统,数据传输方法,通信领域,通信技术,设备发送,响应消息,发送方法"
// };
// var d = await task.deliverInfo(obj,{},{})
// console.log("dddddd---------" + JSON.stringify(d));
// })()
tx-fi-tax/app/base/db/impl/bizchance/fitaxschemeDao.js
View file @
8f12e877
...
...
@@ -18,6 +18,7 @@ class FitaxschemeDao extends Dao {
/**
* 插入方案信息
* TODO 同步方案信息,获取方案编号(走队列,再写一个接收队列方案编号的方法,将方案编号更新到数据库)
* @param {*} qobj
* @param {*} t
*/
...
...
tx-fi-tax/app/base/system.js
View file @
8f12e877
...
...
@@ -367,6 +367,59 @@ class System {
}
return
svrSign
;
}
/**
* 队列操作
* @param {json}
pushUrl string 推送URL地址
actionType string 推送地址接收时的功能名称
notifyUrl string 推送成功后通知的Url
messageBody json 推送的业务消息,必须有一项对象属性值
headData json 请求头信息
requestId string 请求id
*/
static
queueOper
(
obj
)
{
if
(
obj
.
pushUrl
&&
obj
.
actionType
&&
obj
.
messageBody
)
{
try
{
var
exec
=
this
.
getObject
(
"util.execClient"
);
var
reqUrl
=
settings
.
queueUrl
;
var
param
=
{
actionType
:
"produceData"
,
actionBody
:
{
pushUrl
:
obj
.
pushUrl
,
actionType
:
obj
.
actionType
,
identifyCode
:
"book-manage"
,
messageBody
:
obj
.
messageBody
}
}
if
(
obj
.
notifyUrl
)
{
param
.
actionBody
.
notifyUrl
=
obj
.
notifyUrl
;
}
if
(
obj
.
headData
)
{
param
.
actionBody
.
headData
;
}
if
(
obj
.
requestId
)
{
param
.
requestId
=
obj
.
requestId
;
}
var
result
=
await
exec
.
execPost
(
param
,
reqUrl
);
var
j
=
JSON
.
parse
(
result
.
stdout
);
if
(
j
.
status
==
1
){
return
this
.
getResult
(
j
);
}
else
{
return
this
.
getResultError
(
"队列返回失败"
);
}
}
catch
(
error
)
{
return
this
.
getResultError
(
error
);
}
}
else
{
return
this
.
getResultError
(
"参数错误"
);
}
}
}
Date
.
prototype
.
Format
=
function
(
fmt
)
{
//author: meizz
...
...
tx-fi-tax/app/config/settings.js
View file @
8f12e877
...
...
@@ -40,7 +40,7 @@ var settings = {
},
queueUrl
:
function
()
{
if
(
this
.
env
==
"localhost"
)
{
return
"http://192.168.1.
128
:4018/api/queueAction/producer/springBoard"
;
return
"http://192.168.1.
9
:4018/api/queueAction/producer/springBoard"
;
}
else
{
return
"http://sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
...
...
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