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
8dec9120
Commit
8dec9120
authored
Nov 09, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 取值bug && feat: 磐农信息推送启服通
parent
f3ea4a47
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
17 deletions
+39
-17
icp-deliver/app/base/controller/impl/agriculture/servicebillCtl.js
+0
-1
icp-deliver/app/base/service/impl/agriculture/servicebillSve.js
+6
-2
icp-deliver/app/base/utils/toQft/baseClient.js
+3
-2
icp-deliver/app/base/utils/toQft/index.js
+4
-1
icp-deliver/app/base/utils/toQft/pannongClient.js
+14
-0
icp-deliver/app/base/utils/toQft/vatClient.js
+1
-1
icp-deliver/app/base/utils/toQft/wangwenClient.js
+1
-1
icp-deliver/app/base/utils/ydzClient.js
+10
-9
No files found.
icp-deliver/app/base/controller/impl/agriculture/servicebillCtl.js
View file @
8dec9120
...
...
@@ -13,7 +13,6 @@ class servicebillCtl extends CtlBase {
}
async
create
(
obj
)
{
//TODO: 复写create 校验服务单是否已存在
const
res
=
await
this
.
service
.
findOne
({
bizId
:
obj
.
bizId
});
if
(
res
!=
null
)
{
return
system
.
getResult
({
massage
:
"该服务单已创建"
});
...
...
icp-deliver/app/base/service/impl/agriculture/servicebillSve.js
View file @
8dec9120
...
...
@@ -3,12 +3,13 @@ const ydzPush = require("./../../../utils/ydzClient");
const
settings
=
require
(
"./../../../../config/settings"
);
const
System
=
require
(
"../../../system"
);
const
moment
=
require
(
"moment"
);
const
toQft
=
require
(
"./../../../utils/toQft/index"
)
const
TOQFT
=
require
(
"../../../utils/toQft"
);
class
ServicebillService
extends
ServiceBase
{
constructor
()
{
super
(
"agriculture"
,
ServiceBase
.
getDaoName
(
ServicebillService
));
this
.
accountsetSve
=
s
ystem
.
getObject
(
"service.agriculture.accountsetSve"
);
this
.
accountsetSve
=
S
ystem
.
getObject
(
"service.agriculture.accountsetSve"
);
}
async
findAndCountAll
(
obj
)
{
...
...
@@ -44,6 +45,7 @@ class ServicebillService extends ServiceBase {
// dev gsbweb.qifu-dev.gongsibao.com/api/opreceive/service/notice
// pro gsbweb.qifu.gongsibao.com/api/opreceive/service/notice
// pushQiFuTong({"actionType":"accountingInfo","actionBody": backData});
await
TOQFT
.
getClientByType
(
"pannong"
).
pushQiFuTong
(
obj
.
username
,
{
"actionType"
:
"accountingInfo"
,
"actionBody"
:
data
});
// TODO: 分配会计并推送易代账新建帐套 回传后新建本地帐套
const
accountset
=
await
ydzPush
.
pushYiDaZhang
(
user
,
data
);
...
...
@@ -51,6 +53,7 @@ class ServicebillService extends ServiceBase {
// TODO: 推送企服通帐套信息
// pushQiFuTong({"actionType":"booksInfo","actionBody": res});
await
TOQFT
.
getClientByType
(
"pannong"
).
pushQiFuTong
(
obj
.
username
,
{
"actionType"
:
"booksInfo"
,
"actionBody"
:
res
});
}
else
{
console
.
log
(
'查无此单:'
+
obj
.
bizId
);
}
...
...
@@ -74,6 +77,7 @@ class ServicebillService extends ServiceBase {
}
//TODO: 推送企服通
// pushQiFuTong({"actionType":"feedback","actionBody": backData});
await
TOQFT
.
getClientByType
(
"pannong"
).
pushQiFuTong
(
obj
.
username
,
{
"actionType"
:
"feedback"
,
"actionBody"
:
backData
});
}
else
{
console
.
log
(
'查无此单:'
+
obj
.
bizId
);
}
...
...
icp-deliver/app/base/utils/toQft/baseClient.js
View file @
8dec9120
...
...
@@ -11,9 +11,10 @@ const qifutongUrl = settings.qifutongUrl();
* 统一日志记录
*/
class
BaseClient
{
constructor
(
appKey
,
secret
)
{
constructor
(
appKey
,
secret
,
url
)
{
this
.
appKey
=
appKey
;
this
.
secret
=
secret
;
this
.
url
=
url
}
/**
* 推送到 启服通
...
...
@@ -22,7 +23,7 @@ class BaseClient {
*/
async
pushQiFuTong
(
user
,
data
)
{
const
header
=
await
this
.
getLoginByUserName
(
user
);
await
this
.
postRequest
(
`
${
qifutongUrl
}
/web/action/qcapi/springBoard
`
,
data
,
header
);
await
this
.
postRequest
(
`
${
qifutongUrl
}
${
this
.
url
}
`
,
data
,
header
);
}
async
getLoginByUserName
(
user
)
{
...
...
icp-deliver/app/base/utils/toQft/index.js
View file @
8dec9120
const
vatClient
=
require
(
"./vatClient"
)
const
wangwenClient
=
require
(
"./wangwenClient"
)
const
pannongClient
=
require
(
"./pannongClient"
)
const
system
=
require
(
"../../system"
);
...
...
@@ -14,8 +15,10 @@ function getClientByType(type) {
return
new
vatClient
()
case
system
.
SERVICECODE
.
WANGWEN
:
return
new
wangwenClient
()
case
system
.
SERVICECODE
.
PANNONG
:
return
new
pannongClient
()
default
:
throw
new
Error
(
"
此状态手动不能更改
"
);
throw
new
Error
(
"
无此产品类型
"
);
}
}
...
...
icp-deliver/app/base/utils/toQft/pannongClient.js
0 → 100644
View file @
8dec9120
const
BaseClient
=
require
(
"./baseClient"
)
const
settings
=
require
(
"../../../config/settings"
);
const
{
appKey
,
secret
}
=
settings
;
/**
* 磐农 产品
*/
class
PannongClient
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
,
"/api/opreceive/service/notice"
);
}
}
module
.
exports
=
PannongClient
\ No newline at end of file
icp-deliver/app/base/utils/toQft/vatClient.js
View file @
8dec9120
...
...
@@ -8,7 +8,7 @@ const qualificationDao = system.getObject("db.delivery.qualificationDao");
*/
class
VatClient
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
);
super
(
appKey
,
secret
,
"/web/action/qcapi/springBoard"
);
this
.
CIRCUITSTATUS
=
{
ACCOUNTREGISTRATION
:
507
,
// 完成账户注册
SUBMITING
:
508
,
// 提交材料到工信部
...
...
icp-deliver/app/base/utils/toQft/wangwenClient.js
View file @
8dec9120
...
...
@@ -7,7 +7,7 @@ const { appKey, secret } = settings;
*/
class
WangwenClient
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
);
super
(
appKey
,
secret
,
"/web/action/qcapi/springBoard"
);
}
/**
...
...
icp-deliver/app/base/utils/ydzClient.js
View file @
8dec9120
...
...
@@ -8,7 +8,7 @@ const centerChannelUrl = settings.centerChannelUrl();
* 封装 获取 userpin token
*/
const
pushYiDaZhang
=
async
(
data
=
{})
=>
{
const
pushYiDaZhang
=
async
(
data
=
{})
=>
{
const
ydzUrl
=
settings
.
ydzUrl
();
const
{
appKey
,
appSecret
}
=
settings
.
ydzKey
();
// const openToken = getOpenTokenByAppKey(appKey, appSecret);
...
...
@@ -22,7 +22,7 @@ const pushYiDaZhang = async(data = {}) => {
await
this
.
postRequest
(
`
${
ydzUrl
}
/ydz/easyacctg/customer/create/{
${
manageId
}
}`
,
data
,
header
);
}
const
getOpenTokenByAppKey
=
async
(
appKey
,
appSecret
)
=>
{
const
getOpenTokenByAppKey
=
async
(
appKey
,
appSecret
)
=>
{
const
data
=
await
this
.
postRequest
(
`
${
ydzUrl
}
/api/opreceive/accessAuth/getAppTokenByAppKey`
,
{
"Content-Type"
:
"application/json"
,
"appKey"
:
appKey
,
...
...
@@ -31,12 +31,12 @@ const getOpenTokenByAppKey = async(appKey, appSecret) => {
return
data
.
token
}
const
getManageIdByOpenToken
=
async
(
header
)
=>
{
const
getManageIdByOpenToken
=
async
(
header
)
=>
{
const
data
=
await
this
.
postRequest
(
`
${
centerChannelUrl
}
/ydz/setup/openAccess/MainTenant/findMainTenant`
,
{},
header
);
return
{
manageId
:
data
.
id
}
}
const
postRequest
=
async
(
url
,
data
,
headers
=
{})
=>
{
const
postRequest
=
async
(
url
,
data
,
headers
=
{})
=>
{
try
{
console
.
log
(
`
${
url
}
: 请求信息 ------- `
);
console
.
log
(
JSON
.
stringify
(
data
))
...
...
@@ -52,10 +52,10 @@ const postRequest = async(url, data, headers = {}) => {
console
.
log
(
result
);
system
.
execLogs
(
`请求易代账`
,
{
url
,
data
,
headers
},
url
,
data
,
headers
},
'交付请求'
,
result
,
null
...
...
@@ -78,6 +78,6 @@ const postRequest = async(url, data, headers = {}) => {
module
.
exports
=
{
pushYiDaZhang
,
getManageIdByOpenToken
,
getAppTokenByAppKey
,
//
getAppTokenByAppKey,
postRequest
}
\ 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