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
5c6cafa6
Commit
5c6cafa6
authored
Jan 13, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
3bad1f9d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
4 deletions
+128
-4
xggsve-order/app/base/api/impl/op/action.js
+7
-0
xggsve-order/app/base/db/models/order/obusinessmen.js
+1
-1
xggsve-order/app/base/service/impl/order/obusinessmenSve.js
+79
-1
xggsve-order/app/front/entry/public/apidoc/business/businessmen.md
+41
-2
No files found.
xggsve-order/app/base/api/impl/op/action.js
View file @
5c6cafa6
...
...
@@ -84,6 +84,13 @@ class ActionAPI extends APIBase {
opResult
=
await
this
.
obusinessmenSve
.
queryObusinessmen
(
action_body
);
break
;
case
"signing"
:
//签约
opResult
=
await
this
.
obusinessmenSve
.
signing
(
action_body
);
break
;
case
"createAccount"
:
//签约
opResult
=
await
this
.
obusinessmenSve
.
createAccount
(
action_body
);
break
;
//******************************************************************** */
// 订单
...
...
xggsve-order/app/base/db/models/order/obusinessmen.js
View file @
5c6cafa6
...
...
@@ -42,7 +42,7 @@ module.exports = function (db, DataTypes) {
service_begin_time
:
{
type
:
DataTypes
.
DATE
,
field
:
'service_begin_time'
,
allowNull
:
true
,
defaultValue
:
null
,
comment
:
'服务开始时间'
},
service_end_time
:
{
type
:
DataTypes
.
DATE
,
field
:
'service_end_time'
,
allowNull
:
true
,
defaultValue
:
null
,
comment
:
'服务结束时间'
},
cost_rate
:
{
type
:
DataTypes
.
INTEGER
,
field
:
'cost_rate'
,
allowNull
:
true
,
defaultValue
:
0
,
comment
:
'核定成本费用率'
},
tax_rate
:
{
type
:
DataTypes
.
INTEGER
,
field
:
'tax_rate'
,
allowNull
:
true
,
defaultValue
:
0
,
comment
:
'
服务开始时间
'
},
tax_rate
:
{
type
:
DataTypes
.
INTEGER
,
field
:
'tax_rate'
,
allowNull
:
true
,
defaultValue
:
0
,
comment
:
'
含税价百分比
'
},
add_value_up_type
:
{
type
:
DataTypes
.
STRING
,
field
:
'add_value_up_type'
,
allowNull
:
true
,
defaultValue
:
'1'
,
comment
:
'增值税累计类型 1按月 2按季度'
},
tax_up_type
:
{
type
:
DataTypes
.
STRING
,
field
:
'tax_up_type'
,
allowNull
:
true
,
defaultValue
:
'1'
,
comment
:
'个税累计类型 1按月累计 2按年累计'
},
service_rate
:
{
type
:
DataTypes
.
INTEGER
,
field
:
'service_rate'
,
allowNull
:
true
,
defaultValue
:
0
,
comment
:
'服务费比例'
},
...
...
xggsve-order/app/base/service/impl/order/obusinessmenSve.js
View file @
5c6cafa6
...
...
@@ -13,7 +13,7 @@ class ObusinessmenService extends ServiceBase {
* @param {*} params
* @Id 个体户ID
*/
async
queryObusinessmen
(
params
){
async
queryObusinessmen
(
params
)
{
try
{
let
obj
=
await
this
.
findById
(
this
.
trim
(
params
.
id
));
return
system
.
getResult
(
obj
);
...
...
@@ -23,6 +23,83 @@ class ObusinessmenService extends ServiceBase {
}
}
/**
* 签约
*/
async
signing
(
params
)
{
if
(
!
params
.
hasOwnProperty
(
'credit_code'
)
&&
!
params
.
credit_code
)
{
return
system
.
getResult
(
null
,
`参数错误 同意社会信用代码不能为空`
);
}
if
(
!
params
.
hasOwnProperty
(
'cost_rate'
))
{
return
system
.
getResult
(
null
,
`参数错误 核定成本费用率不能为空`
);
}
if
(
!
params
.
hasOwnProperty
(
'add_value_up_type'
)
&&
!
params
.
add_value_up_type
)
{
return
system
.
getResult
(
null
,
`参数错误 增值税累计类型不能为空`
);
}
if
(
!
params
.
hasOwnProperty
(
'tax_up_type'
))
{
return
system
.
getResult
(
null
,
`参数错误 个税累计类型不能为空`
);
}
if
(
!
params
.
hasOwnProperty
(
'service_begin_time'
))
{
return
system
.
getResult
(
null
,
`参数错误 服务开始时间不能为空`
);
}
if
(
!
params
.
hasOwnProperty
(
'service_end_time'
))
{
return
system
.
getResult
(
null
,
`参数错误 服务结束时间不能为空`
);
}
if
(
!
params
.
hasOwnProperty
(
'service_rate'
)
&&
!
params
.
service_rate
)
{
return
system
.
getResult
(
null
,
`参数错误 服务费比例不能为空`
);
}
if
(
!
params
.
hasOwnProperty
(
'tax_rate'
)
&&
!
params
.
tax_rate
)
{
return
system
.
getResult
(
null
,
`参数错误 含税价百分比不能为空`
);
}
let
_obusinessmen
=
await
this
.
dao
.
model
.
findOne
({
where
:{
credit_code
:
this
.
trim
(
params
.
credit_code
)
}});
if
(
!
_obusinessmen
){
return
system
.
getResult
(
null
,
`个体户不存在`
);
}
_obusinessmen
.
cost_rate
=
this
.
trim
(
params
.
cost_rate
);
_obusinessmen
.
add_value_up_type
=
this
.
trim
(
params
.
add_value_up_type
);
_obusinessmen
.
tax_up_type
=
this
.
trim
(
params
.
tax_up_type
);
_obusinessmen
.
service_begin_time
=
this
.
trim
(
params
.
service_begin_time
);
_obusinessmen
.
service_end_time
=
this
.
trim
(
params
.
service_end_time
);
_obusinessmen
.
service_rate
=
this
.
trim
(
params
.
service_rate
);
_obusinessmen
.
tax_rate
=
this
.
trim
(
params
.
tax_rate
);
_obusinessmen
.
sign_time
=
new
Date
();
_obusinessmen
.
sign_notes
=
this
.
trim
(
params
.
sign_notes
);
try
{
await
_obusinessmen
.
save
();
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 建账
* @param {*} params
*/
async
createAccount
(
params
){
if
(
!
params
.
hasOwnProperty
(
'credit_code'
)
&&
!
params
.
credit_code
)
{
return
system
.
getResult
(
null
,
`参数错误 同意社会信用代码不能为空`
);
}
let
_obusinessmen
=
await
this
.
dao
.
model
.
findOne
({
where
:{
credit_code
:
this
.
trim
(
params
.
credit_code
)
}});
if
(
!
_obusinessmen
){
return
system
.
getResult
(
null
,
`个体户不存在`
);
}
_obusinessmen
.
is_create_account
=
true
;
try
{
await
_obusinessmen
.
save
();
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
console
.
log
(
error
);
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
ObusinessmenService
;
\ No newline at end of file
xggsve-order/app/front/entry/public/apidoc/business/businessmen.md
View file @
5c6cafa6
...
...
@@ -5,8 +5,8 @@
1.
[
用户签约
](
#businessmenSign
)
1.
[
签约管理列表
](
#signList
)
1.
[
个体户信息列表
](
#infoList
)
1.
[
个体户签约
](
#signing
)
1.
[
是否建账
](
#createAccount
)
## **<a name="nameList"> 个体户nameList </a>**
[
返回到目录
](
#menu
)
...
...
@@ -336,3 +336,41 @@
```
## **<a name="signing"> 个体户签约 </a>**
[
返回到目录
](
#menu
)
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"action_process"
:
"test"
,
"action_type"
:
"createAccount"
,
"action_body"
:
{
"credit_code"
:
"1"
,
//同意社会信用代码
"cost_rate"
:
"5"
,
//核定成本费用率
"add_value_up_type"
:
""
,
//增值税累计类型
"tax_up_type"
:
""
,
//个税累计类型
"service_begin_time"
:
"1"
,
//服务开始时间
"service_end_time"
:
"5"
,
//服务结束时间
"service_rate"
:
""
,
//服务费比例
"tax_rate"
:
""
,
//含税价百分比、
"sign_notes"
:
""
//签约备注
}
}
```
## **<a name="createAccount"> 是否建账 </a>**
[
返回到目录
](
#menu
)
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"action_process"
:
"test"
,
"action_type"
:
"signing"
,
"action_body"
:
{
"credit_code"
:
"1"
,
//同意社会信用代码
}
}
```
\ 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