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
70dd4d6a
Commit
70dd4d6a
authored
Apr 03, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
d560de0c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
75 deletions
+123
-75
xgg-saas-merchant/app/base/controller/impl/tax/taxCtl.js
+59
-40
xgg-saas-merchant/app/base/service/impl/tax/taxSve.js
+56
-32
xgg-saas-merchant/app/base/system.js
+2
-2
xgg-saas-merchant/app/config/settings.js
+6
-1
No files found.
xgg-saas-merchant/app/base/controller/impl/tax/taxCtl.js
View file @
70dd4d6a
...
@@ -2,53 +2,71 @@ var system = require("../../../system")
...
@@ -2,53 +2,71 @@ var system = require("../../../system")
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
CtlBase
=
require
(
"../../ctlms.base"
);
class
TaxCtl
extends
CtlBase
{
class
TaxCtl
extends
CtlBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
taxSve
=
system
.
getObject
(
"service.trade.trade
Sve"
);
this
.
taxSve
=
system
.
getObject
(
"service.tax.tax
Sve"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
}
/**
/**
* 月账期
* 月账期
* @param {*} params
* @param {*} params
*/
*/
async
getReportData
(
params
)
{
async
getReportData
(
params
)
{
try
{
try
{
let
res
=
await
this
.
taxSve
.
getReportData
(
params
);
let
res
=
await
this
.
taxSve
.
getReportData
(
params
);
return
system
.
getResult
(
res
);
return
system
.
getResult
(
res
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
/**
/**
* 季度账期
* 季度账期
* @param {*} params
* @param {*} params
*/
*/
async
getReportDataQuarter
(
params
)
{
async
getReportDataQuarter
(
params
)
{
try
{
try
{
let
res
=
await
this
.
taxSve
.
getReportData
(
params
);
let
res
=
await
this
.
taxSve
.
getReportDataQuarter
(
params
);
return
system
.
getResult
(
res
);
return
system
.
getResult
(
res
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
/**
/**
* 获取账簿用户信息
* 获取账簿用户信息
* @param {*} pobj
* @param {*} pobj
* @param {*} pobj2
* @param {*} pobj2
* @param {*} req
* @param {*} req
* @id
* @id
*/
*/
async
getCustomerById
(
pobj
,
pobj2
,
req
){
async
getCustomerById
(
pobj
,
pobj2
,
req
)
{
if
(
!
pobj
.
id
){
try
{
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
if
(
!
pobj
.
id
)
{
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
}
let
res
=
await
this
.
taxSve
.
getCustomerById
(
pobj
);
return
res
;
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
error
);
}
}
}
let
res
=
await
this
.
orderSve
.
getCustomerById
(
pobj
.
invoice_id
);
return
res
;
// async businessmenPage(pobj, pobj2, req) {
}
// try {
// if (!pobj.id) {
// return system.getResult(null, `参数错误 ID 不能为空`);
// }
// let res = await this.taxSve.businessmenPage(pobj);
// return res;
// } catch (error) {
// console.log(error);
// return system.getResult(error);
// }
// }
}
}
module
.
exports
=
TaxCtl
;
module
.
exports
=
TaxCtl
;
\ No newline at end of file
xgg-saas-merchant/app/base/service/impl/tax/taxSve.js
View file @
70dd4d6a
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
const
ServiceBase
=
require
(
"../../svems.base"
)
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
axios
=
require
(
"axios"
);
class
TaxService
extends
ServiceBase
{
class
TaxService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -12,14 +13,14 @@ class TaxService extends ServiceBase {
...
@@ -12,14 +13,14 @@ class TaxService extends ServiceBase {
async
getReportData
(
params
)
{
async
getReportData
(
params
)
{
try
{
try
{
let
data
=
{
let
data
=
{
"accountPeriod"
:
202003
,
"accountPeriod"
:
this
.
trim
(
params
.
accountPeriod
)
,
"companyId"
:
102
,
"companyId"
:
this
.
trim
(
params
.
companyId
)
,
"customerId"
:
498779
,
"customerId"
:
this
.
trim
(
params
.
customerId
)
,
"desc"
:
"string"
,
"desc"
:
this
.
trim
(
params
.
desc
)
||
"string"
,
"reportType"
:
2
,
"reportType"
:
this
.
trim
(
params
.
reportType
)
||
2
,
"signWithoutKey"
:
"string"
"signWithoutKey"
:
this
.
trim
(
params
.
signWithoutKey
)
||
"string"
}
}
let
url
=
settings
.
ntapi
().
getReportData
let
url
=
settings
.
ntapi
().
getReportData
;
return
await
this
.
callApi
(
url
,
data
,
"月账期"
);
return
await
this
.
callApi
(
url
,
data
,
"月账期"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
...
@@ -33,17 +34,15 @@ class TaxService extends ServiceBase {
...
@@ -33,17 +34,15 @@ class TaxService extends ServiceBase {
async
getReportDataQuarter
(
params
)
{
async
getReportDataQuarter
(
params
)
{
try
{
try
{
let
data
=
{
let
data
=
{
"companyId"
:
102
,
"accountPeriod"
:
this
.
trim
(
params
.
accountPeriod
),
"customerId"
:
498779
,
"companyId"
:
this
.
trim
(
params
.
companyId
),
"desc"
:
"string"
,
"customerId"
:
this
.
trim
(
params
.
customerId
),
"endPeriod"
:
202003
,
"desc"
:
this
.
trim
(
params
.
desc
)
||
"string"
,
"reportType"
:
2
,
"reportType"
:
this
.
trim
(
params
.
reportType
)
||
2
,
"signWithoutKey"
:
"string"
,
"signWithoutKey"
:
this
.
trim
(
params
.
signWithoutKey
)
||
"string"
"startPeriod"
:
202001
}
};
let
url
=
settings
.
ntapi
().
getReportDataQuarter
;
return
await
this
.
callApi
(
url
,
params
,
"季度账期"
);
let
url
=
settings
.
ntapi
().
getReportDataQuarter
return
await
this
.
callApi
(
url
,
data
,
"季度账期"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
...
@@ -56,25 +55,17 @@ class TaxService extends ServiceBase {
...
@@ -56,25 +55,17 @@ class TaxService extends ServiceBase {
*/
*/
async
getCustomerById
(
params
)
{
async
getCustomerById
(
params
)
{
try
{
try
{
//
let
businessmen
=
await
axios
({
// let res = await axios({
method
:
'post'
,
// method: 'post',
url
:
settings
.
deliverSysApi
().
info
,
// url: url,
data
:
{
id
:
params
.
id
}
// data: settings.deliverSysApi().orderPushApi
// });
// console.log(res.data);
if
(
res
.
status
==
200
&&
res
.
data
&&
res
.
data
.
status
==
0
&&
res
.
data
.
data
)
{
await
this
.
updateOrder
({
id
:
id
,
deliver_order_id
:
res
.
data
.
data
.
id
});
}
let
businessmen
=
await
this
.
callms
(
"order"
,
"queryObusinessmen"
,
{
id
:
params
.
id
});
});
if
(
!
businessmen
||
!
businessmen
.
data
)
{
if
(
businessmen
.
status
=!
200
||
businessmen
.
data
.
status
!=
0
||
!
businessmen
.
data
.
data
.
customer_id
)
{
return
system
.
getResult
(
null
,
`个体工商户不存在`
);
return
system
.
getResult
(
null
,
`个体工商户不存在`
);
}
}
let
url
=
settings
.
ntapi
().
getCustomerById
;
let
url
=
settings
.
ntapi
().
getCustomerById
;
let
res
=
await
this
.
callApi
(
url
,
{
let
res
=
await
this
.
callApi
(
url
,
{
id
:
businessmen
.
customer_id
id
:
businessmen
.
data
.
data
.
customer_id
},
"获取用户账簿信息"
);
},
"获取用户账簿信息"
);
return
res
;
return
res
;
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -82,5 +73,37 @@ class TaxService extends ServiceBase {
...
@@ -82,5 +73,37 @@ class TaxService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误`
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
}
/**
* 获取工商户列表
* @param {*} params
*/
// async businessmenPage(params) {
// try {
// let businessmen = await axios({
// method: 'post',
// url: settings.deliverSysApi().businessmenPage,
// data: {id: params.id}
// });
// if (businessmen.status=!200 || businessmen.data.status!=0 ) {
// return system.getResult(null, `系统错误`);
// }
// let url = settings.ntapi().getCustomerById;
// let res = await this.callApi(url, {
// id: businessmen.data.data.customer_id
// }, "获取用户账簿信息");
// return res;
// } catch (error) {
// console.log(error);
// return system.getResult(null, `系统错误`);
// }
// }
}
}
module
.
exports
=
TaxService
;
module
.
exports
=
TaxService
;
\ No newline at end of file
xgg-saas-merchant/app/base/system.js
View file @
70dd4d6a
...
@@ -182,8 +182,8 @@ class System {
...
@@ -182,8 +182,8 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
// 订单服务
order
:
dev
+
":3103"
+
path
,
//
order: dev + ":3103" + path,
//
order: "http://127.0.0.1:3103" + path,
order
:
"http://127.0.0.1:3103"
+
path
,
// 发票服务
// 发票服务
invoice
:
dev
+
":3105"
+
path
,
invoice
:
dev
+
":3105"
+
path
,
...
...
xgg-saas-merchant/app/config/settings.js
View file @
70dd4d6a
...
@@ -128,13 +128,18 @@ var settings = {
...
@@ -128,13 +128,18 @@ var settings = {
deliverSysApi
:
function
()
{
deliverSysApi
:
function
()
{
let
domain
=
""
;
let
domain
=
""
;
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
domain
=
"http://39.107.234.14:3002"
;
// domain = "http://39.107.234.14:3002";
domain
=
"http://127.0.0.1:3002"
;
}
else
{
}
else
{
domain
=
"https://xggadmin.gongsibao.com"
;
domain
=
"https://xggadmin.gongsibao.com"
;
}
}
return
{
return
{
// 推送订单s
// 推送订单s
orderPushApi
:
domain
+
"/web/order/orderCtl/addSourceOrder"
,
orderPushApi
:
domain
+
"/web/order/orderCtl/addSourceOrder"
,
// 获取个体工商户信息
info
:
domain
+
"/web/business/businessmenCtl/info"
,
//获取工商户列表
businessmenPage
:
"/web/business/businessmenCtl/businessmenPage"
,
}
}
},
},
redis
:
function
()
{
redis
:
function
()
{
...
...
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