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
e11be24d
Commit
e11be24d
authored
Dec 13, 2019
by
赵庆
Browse files
Options
Browse Files
Download
Plain Diff
gsb
parents
e2ea4634
abf52cf3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
185 deletions
+14
-185
bpo-stat/app/base/db/models/all/load.js
+12
-0
bpo-stat/app/base/service/impl/business/businessmenSve.js
+0
-181
bpo-stat/app/config/routes/web.js
+2
-4
No files found.
bpo-stat/app/base/db/models/all/load.js
View file @
e11be24d
...
...
@@ -20,6 +20,18 @@ module.exports = function(sequelize, DataTypes) {
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
},
phone_no
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
},
id_no
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
},
bankno
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
true
},
workload
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
true
...
...
bpo-stat/app/base/service/impl/business/businessmenSve.js
deleted
100644 → 0
View file @
e2ea4634
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
class
BusinessmenService
extends
ServiceBase
{
constructor
()
{
super
();
}
async
allPage
(
params
)
{
var
rs
=
await
this
.
callms
(
"order"
,
"businessmenPage"
,
params
);
if
(
rs
.
status
!=
0
||
!
rs
.
data
||
!
rs
.
data
.
rows
)
{
return
rs
;
}
await
this
.
setMerchant
(
rs
.
data
.
rows
);
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
]
||
{};
}
}
transField
(
rows
)
{
if
(
!
rows
)
{
return
;
}
for
(
var
row
of
rows
)
{
row
.
costRate
=
system
.
f2y
(
row
.
costRate
);
row
.
taxRate
=
system
.
f2y
(
row
.
taxRate
);
row
.
serviceRate
=
system
.
f2y
(
row
.
serviceRate
);
this
.
parseJsonField
(
row
,
[
"commonTaxLadder"
,
"commonOtherLadder"
,
"specialTaxLadder"
,
"specialOtherLadder"
]);
}
}
parseJsonField
(
row
,
fields
)
{
if
(
!
row
||
!
fields
||
fields
.
length
==
0
)
{
return
;
}
for
(
var
f
of
fields
)
{
if
(
!
f
||
!
row
[
f
])
{
continue
;
}
try
{
row
[
f
]
=
JSON
.
parse
(
row
[
f
]);
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
}
}
module
.
exports
=
BusinessmenService
;
// var task=new UserService();
// task.getUserStatisticGroupByApp().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
\ No newline at end of file
bpo-stat/app/config/routes/web.js
View file @
e11be24d
...
...
@@ -70,8 +70,7 @@ module.exports = function (app) {
if
(
req
.
loginUser
)
{
req
.
query
=
req
.
query
||
{};
req
.
query
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
query
.
deliverId
=
req
.
loginUser
.
uctypeId
||
""
;
req
.
query
.
sign_body
=
req
.
loginUser
.
sign_body
;
}
params
.
push
(
methodName
);
params
.
push
(
req
.
body
);
...
...
@@ -103,8 +102,7 @@ module.exports = function (app) {
if
(
req
.
loginUser
)
{
req
.
body
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
body
.
deliverId
=
req
.
loginUser
.
uctypeId
||
""
;
req
.
body
.
delivererId
=
req
.
loginUser
.
uctypeId
||
""
;
req
.
body
.
sign_body
=
req
.
loginUser
.
sign_body
;
}
params
.
push
(
methodName
);
...
...
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