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
8b91e952
Commit
8b91e952
authored
Jan 13, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
a94786e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
278 deletions
+67
-278
xgg-admin/app/base/controller/impl/business/businessmenCtl.js
+41
-66
xgg-admin/app/base/controller/impl/order/orderCtl.js
+0
-58
xgg-admin/app/base/service/impl/business/businessmenSve.js
+26
-125
xgg-admin/app/base/service/impl/order/orderSve.js
+0
-29
No files found.
xgg-admin/app/base/controller/impl/business/businessmenCtl.js
View file @
8b91e952
...
...
@@ -58,88 +58,63 @@ class BusinessmenCtl extends CtlBase {
}
}
async
info
(
pobj
,
pobj2
,
req
)
{
try
{
var
condition
=
{
id
:
pobj
.
id
,
}
return
await
this
.
businessmenSve
.
info
(
condition
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
"接口异常:"
+
error
.
message
);
/**
* 个体户签约
* @param {*} params
*/
async
signing
(
pobj
,
pobj2
,
req
)
{
if
(
!
pobj
.
hasOwnProperty
(
'credit_code'
)
&&
!
pobj
.
credit_code
)
{
return
system
.
getResult
(
null
,
`参数错误 同意社会信用代码不能为空`
);
}
}
async
sign
(
pobj
,
pobj2
,
req
)
{
var
params
=
{
id
:
pobj
.
id
,
taxUpType
:
pobj
.
taxUpType
||
0
,
addValueUpType
:
pobj
.
addValueUpType
,
costRate
:
system
.
y2f
(
pobj
.
costRate
||
0
),
taxRate
:
system
.
y2f
(
pobj
.
taxRate
),
serviceRate
:
system
.
y2f
(
pobj
.
serviceRate
),
serviceBeginTime
:
pobj
.
serviceBeginTime
,
serviceEndTime
:
pobj
.
serviceEndTime
,
signNotes
:
this
.
trim
(
pobj
.
signNotes
),
commonTaxLadder
:
JSON
.
stringify
(
pobj
.
commonTaxLadder
||
[]),
commonOtherLadder
:
JSON
.
stringify
(
pobj
.
commonOtherLadder
||
[]),
specialTaxLadder
:
JSON
.
stringify
(
pobj
.
specialTaxLadder
||
[]),
specialOtherLadder
:
JSON
.
stringify
(
pobj
.
specialOtherLadder
||
[]),
invoicecontents
:
pobj
.
invoicecontents
,
if
(
!
pobj
.
hasOwnProperty
(
'cost_rate'
))
{
return
system
.
getResult
(
null
,
`参数错误 核定成本费用率不能为空`
);
}
try
{
return
await
this
.
businessmenSve
.
sign
(
params
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
"接口异常:"
+
error
.
message
);
if
(
!
pobj
.
hasOwnProperty
(
'add_value_up_type'
)
&&
!
pobj
.
add_value_up_type
)
{
return
system
.
getResult
(
null
,
`参数错误 增值税累计类型不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'tax_up_type'
))
{
return
system
.
getResult
(
null
,
`参数错误 个税累计类型不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'service_begin_time'
))
{
return
system
.
getResult
(
null
,
`参数错误 服务开始时间不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'service_end_time'
))
{
return
system
.
getResult
(
null
,
`参数错误 服务结束时间不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'service_rate'
)
&&
!
pobj
.
service_rate
)
{
return
system
.
getResult
(
null
,
`参数错误 服务费比例不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'tax_rate'
)
&&
!
pobj
.
tax_rate
)
{
return
system
.
getResult
(
null
,
`参数错误 含税价百分比不能为空`
);
}
}
async
signNames
(
pobj
,
pobj2
,
req
)
{
try
{
var
condition
=
{
bstatuses
:
[
"2020"
],
}
return
await
this
.
businessmenSve
.
nameList
(
condition
);
pobj
.
service_rate
=
system
.
y2f
(
pobj
.
service_rate
);
pobj
.
tax_rate
=
system
.
y2f
(
pobj
.
tax_rate
);
pobj
.
cost_rate
=
system
.
y2f
(
pobj
.
cost_rate
);
return
await
this
.
businessmenSve
.
signing
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
Fail
(
500
,
"接口异常:"
+
error
.
message
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
signPage
(
pobj
,
pobj2
,
req
)
{
try
{
var
condition
=
{
currentPage
:
pobj
.
currentPage
,
pageSize
:
pobj
.
pageSize
,
businessmenId
:
pobj
.
businessmenId
,
}
return
await
this
.
businessmenSve
.
signPage
(
condition
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
"接口异常:"
+
error
.
message
);
/**
* 建帐
* @param {*} params
*/
async
createAccount
(
pobj
,
pobj2
,
req
)
{
if
(
!
pobj
.
hasOwnProperty
(
'credit_code'
)
&&
!
pobj
.
credit_code
)
{
return
system
.
getResult
(
null
,
`参数错误 同意社会信用代码不能为空`
);
}
}
async
deliverPage
(
pobj
,
pobj2
,
req
)
{
try
{
var
condition
=
{
currentPage
:
pobj
.
currentPage
,
pageSize
:
pobj
.
pageSize
,
orderId
:
pobj
.
orderId
,
dstatus
:
pobj
.
status
,
deliverId
:
""
,
}
return
await
this
.
businessmenSve
.
deliverPage
(
condition
);
try
{
return
await
this
.
businessmenSve
.
createAccount
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
Fail
(
500
,
"接口异常:"
+
error
.
message
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
...
...
xgg-admin/app/base/controller/impl/order/orderCtl.js
View file @
8b91e952
...
...
@@ -342,64 +342,6 @@ class OrderCtl extends CtlBase {
}
}
/**
* 个体户签约
* @param {*} params
*/
async
signing
(
pobj
,
pobj2
,
req
)
{
if
(
!
pobj
.
hasOwnProperty
(
'credit_code'
)
&&
!
pobj
.
credit_code
)
{
return
system
.
getResult
(
null
,
`参数错误 同意社会信用代码不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'cost_rate'
))
{
return
system
.
getResult
(
null
,
`参数错误 核定成本费用率不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'add_value_up_type'
)
&&
!
pobj
.
add_value_up_type
)
{
return
system
.
getResult
(
null
,
`参数错误 增值税累计类型不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'tax_up_type'
))
{
return
system
.
getResult
(
null
,
`参数错误 个税累计类型不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'service_begin_time'
))
{
return
system
.
getResult
(
null
,
`参数错误 服务开始时间不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'service_end_time'
))
{
return
system
.
getResult
(
null
,
`参数错误 服务结束时间不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'service_rate'
)
&&
!
pobj
.
service_rate
)
{
return
system
.
getResult
(
null
,
`参数错误 服务费比例不能为空`
);
}
if
(
!
pobj
.
hasOwnProperty
(
'tax_rate'
)
&&
!
pobj
.
tax_rate
)
{
return
system
.
getResult
(
null
,
`参数错误 含税价百分比不能为空`
);
}
try
{
pobj
.
service_rate
=
system
.
y2f
(
pobj
.
service_rate
);
pobj
.
tax_rate
=
system
.
y2f
(
pobj
.
tax_rate
);
pobj
.
cost_rate
=
system
.
y2f
(
pobj
.
cost_rate
);
return
await
this
.
orderSve
.
signing
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 建帐
* @param {*} params
*/
async
createAccount
(
pobj
,
pobj2
,
req
)
{
if
(
!
pobj
.
hasOwnProperty
(
'credit_code'
)
&&
!
pobj
.
credit_code
)
{
return
system
.
getResult
(
null
,
`参数错误 同意社会信用代码不能为空`
);
}
try
{
return
await
this
.
orderSve
.
createAccount
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
...
...
xgg-admin/app/base/service/impl/business/businessmenSve.js
View file @
8b91e952
...
...
@@ -15,132 +15,33 @@ class BusinessmenService extends ServiceBase {
this
.
transField
(
rs
.
data
.
rows
);
return
rs
;
}
//
// async signPage(params) {
// var rs = await this.callms("order", "businessmenSignPage", params);
// if (rs.status != 0 || !rs.data || !rs.data.rows) {
// return rs;
// }
// this.transField(rs.data.rows);
// return rs;
// }
//
// async deliverPage(params) {
// var rs = await this.callms("order", "businessmenDeliverPage", params);
// if (rs.status != 0 || !rs.data || !rs.data.rows) {
// return rs;
// }
// this.transField(rs.data.rows);
// return rs;
// }
//
// async info(params) {
// var rs = await this.callms("order", "businessmenInfo", params);
// await this.setMerchant([rs.data]);
// this.transField([rs.data]);
// return rs;
// }
//
// async sign(params) {
// return await this.callms("order", "businessmenSign", params);
// }
//
// async nameList(params) {
// return await this.callms("order", "businessmenNameList", params);
// }
//
// async queryBusinessmen(params) {
// var condition = {
// merchantId: this.trim(params.merchant_id || params.merchantId),
// channelOrderNo: this.trim(params.channelOrderNo),
// }
// var rs = await this.callms("order", "businessmenByChannelOrderNo", condition);
// if (rs.status != 0 && !rs.data) {
// return rs;
// }
// var businessmen = rs.data;
// if (!businessmen) {
// return system.getResult(null, "个体户不存在");
// }
// var dto = {};
//
// dto.orderNo = this.trim(businessmen.orderNo);
// dto.channelOrderNo = this.trim(businessmen.channelOrderNo);
// dto.status = this.trim(businessmen.gstatus);
// dto.legalName = this.trim(businessmen.legalName);
// dto.legalMobile = this.trim(businessmen.legalMobile);
// dto.legalIdCard = this.trim(businessmen.legalIdCard);
// dto.name = this.trim(businessmen.name);
// dto.creditCode = this.trim(businessmen.creditCode);
// dto.businessPlace = this.trim(businessmen.businessPlace);
// dto.businessScope = this.trim(businessmen.businessScope);
// dto.regDate = this.trim(businessmen.regDate);
// dto.businessImg = this.trim(businessmen.businessImg);
// dto.gongzhang = this.trim(businessmen.gongzhang);
// dto.caiwuzhang = this.trim(businessmen.caiwuzhang);
// dto.fapiaozhang = this.trim(businessmen.fapiaozhang);
// dto.hetongzhang = this.trim(businessmen.hetongzhang);
// dto.farenzhang = this.trim(businessmen.farenzhang);
// dto.isBank = businessmen.isBank ? 1 : 0;
// dto.bankName = this.trim(businessmen.bankName);
// dto.bankNo = this.trim(businessmen.bankNo);
// dto.bank = this.trim(businessmen.bank);
// dto.bankImg = this.trim(businessmen.bankImg);
// dto.caImg = this.trim(businessmen.caImg);
// dto.taxRegDay = this.trim(businessmen.taxRegDay);
// dto.taxOrg = this.trim(businessmen.taxOrg);
// dto.courierNo = this.trim(businessmen.courierNo);
// dto.courierImg = this.trim(businessmen.courierImg);
// dto.addedValueRate = this.trim(businessmen.addedValueRate);
// dto.supertaxRate = this.trim(businessmen.supertaxRate);
// dto.commonTaxLadder = this.trim(businessmen.commonTaxLadder);
// dto.commonOtherLadder = this.trim(businessmen.commonOtherLadder);
// dto.specialTaxLadder = this.trim(businessmen.specialTaxLadder);
// dto.specialOtherLadder = this.trim(businessmen.specialOtherLadder);
// dto.contractStartData = this.trim(businessmen.contractStartData);
// dto.contractEndData = this.trim(businessmen.contractEndData);
// dto.contract = this.trim(businessmen.contract);
// dto.opNotes = this.trim(businessmen.opNotes);
// dto.taxUpType = this.trim(businessmen.taxUpType);
// dto.costRate = this.trim(businessmen.costRate);
// dto.signNotes = this.trim(businessmen.signNotes);
// dto.invoiceContents = this.trim(businessmen.invoiceContents);
// return system.getResultSuccess(dto);
// }
//
// async putContract(params) {
// var merchantId = params.merchant_id || params.merchantId;
//
// var condition = {
// merchantId: merchantId,
// channelOrderNo: params.channelOrderNo,
// contractStartData: params.contractStartData,
// contractEndData: params.contractEndData,
// contract: params.contract,
// };
// var rs = await this.callms("order", "addBusinessmenContract", condition);
// return rs;
// }
// async setMerchant(rows) {
// if (!rows || rows.length == 0) {
// return;
// }
//
// var merchantIds = [];
// for (var row of rows) {
// merchantIds.push(row.merchant_id);
// }
//
// var mmap = await this.callms("merchant", "getMapByIds", {
// ids: merchantIds,
// attrs: "id, name"
// });
// mmap = mmap.data || {};
// for (var row of rows) {
// row.merchant = mmap[row.merchant_id] || {};
// }
// }
/**
* @params 个体户签约
*/
async
signing
(
params
){
try
{
return
await
this
.
callms
(
"order"
,
"signing"
,
params
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
error
);
}
}
/**
* @params 建仗
*/
async
createAccount
(
params
){
try
{
//todo somthing ...
if
(
1
==
1
){
return
await
this
.
callms
(
"order"
,
"createAccount"
,
params
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
error
);
}
}
transField
(
rows
)
{
if
(
!
rows
)
{
...
...
xgg-admin/app/base/service/impl/order/orderSve.js
View file @
8b91e952
...
...
@@ -170,33 +170,5 @@ class OrderService extends ServiceBase {
await
this
.
pushapiSve
.
push
(
options
);
}
/**
* @params 个体户签约
*/
async
signing
(
params
){
try
{
return
await
this
.
callms
(
"order"
,
"signing"
,
params
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
error
);
}
}
/**
* @params 建仗
*/
async
createAccount
(
params
){
try
{
//todo somthing ...
if
(
1
==
1
){
return
await
this
.
callms
(
"order"
,
"createAccount"
,
params
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
error
);
}
}
}
module
.
exports
=
OrderService
;
\ 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