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
435dc37f
Commit
435dc37f
authored
Dec 07, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Plain Diff
dd
parents
c553b7f0
f5666332
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
7 deletions
+76
-7
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
+76
-7
No files found.
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
View file @
435dc37f
...
...
@@ -40,7 +40,7 @@ class IborderbaseService extends ServiceBase {
// if(!params.channelNo){
// return system.getResult(null, `参数错误 渠道名称错误`);
// }
if
(
!
params
.
thirdNo
)
{
if
(
!
params
.
thirdNo
)
{
return
system
.
getResult
(
null
,
`请传入订单id`
);
}
// if(!Number(params.price)<0){
...
...
@@ -81,6 +81,7 @@ class IborderbaseService extends ServiceBase {
params
.
productType
=
productType
;
params
.
price
=
Number
(
params
.
price
||
0
);
params
.
status
=
"1000"
;
// 待处理
params
.
payStatus
=
"10"
;
// 支付状态
params
.
channelOrderNo
=
params
.
channelNo
;
let
self
=
this
;
...
...
@@ -89,14 +90,15 @@ class IborderbaseService extends ServiceBase {
//创建基类表
let
_baseOrder
=
await
self
.
create
(
params
,
t
);
// 处理payment
if
(
payType
!=
2
)
{
if
(
productType
==
1010
&&
params
.
payType
==
1
)
{
// 代开订单按次支付的单子, 走异步支付流程
}
else
{
var
payment
=
{
order_id
:
_baseOrder
.
id
,
price
:
params
.
price
,
channelName
:
channel
.
channelName
,
companyName
:
""
,
payType
:
payType
,
payType
:
pa
rams
.
pa
yType
,
payStatus
:
"10"
,
};
payment
=
await
this
.
paymentSve
.
create
(
payment
);
...
...
@@ -126,8 +128,63 @@ class IborderbaseService extends ServiceBase {
*/
async
completedOrder
(
params
)
{
try
{
<<<<<<<
HEAD
let
childSve
=
this
.
getService
();
return
await
childSve
.
completedOrder
(
params
);
=======
//1 检查个体户是否存在 (根据统一社会信用代码查个体工商户是否存在)
this
.
trimObject
(
params
);
if
(
!
params
.
id
)
{
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
}
if
(
!
params
.
legalName
)
{
return
system
.
getResult
(
null
,
`参数错误 法人姓名不能为空`
);
}
if
(
!
params
.
legalMobile
)
{
return
system
.
getResult
(
null
,
`参数错误 法人电话不能为空`
);
}
if
(
!
params
.
creditCode
)
{
return
system
.
getResult
(
null
,
`参数错误 法人统一社会信用代码不能为空`
);
}
if
(
!
params
.
names
)
{
return
system
.
getResult
(
null
,
`参数错误 个体户名称不能为空`
);
}
if
(
!
params
.
businessScope
)
{
return
system
.
getResult
(
null
,
`参数错误 经营范围不能为空`
);
}
//2 如果不存在添加保存个体户 完善信息
let
_businessmenRes
=
await
this
.
businessmenSve
.
findBusinessmenByCreditCode
(
this
.
trim
(
params
.
creditCode
));
if
(
_businessmenRes
.
hasOwnProperty
(
"status"
))
{
return
_businessmenRes
;
}
let
childSve
=
this
.
getService
(
productType
);
if
(
_businessmenRes
.
id
)
{
//如果用户存在id 直接更新
let
_iborderbase
=
await
this
.
dao
.
findById
(
this
.
trim
(
params
.
id
));
if
(
!
_iborderbase
)
{
return
system
.
getResult
(
null
,
`参数错误 订单不存在`
);
}
let
self
=
this
;
await
this
.
db
.
transaction
(
async
t
=>
{
//更新主表
await
self
.
dao
.
update
({
businessmen_id
:
self
.
trim
(
_businessmenRes
.
id
),
id
:
self
.
trim
(
params
.
id
)},
t
);
//更新子表
await
childSve
.
dao
.
update
(
params
,
null
);
});
}
else
{
let
self
=
this
;
await
this
.
db
.
transaction
(
async
t
=>
{
//如果不存在id 创建后更新
let
_businessment
=
await
this
.
businessmenSve
.
dao
.
create
(
params
,
t
);
//更新主表
await
self
.
dao
.
update
({
businessmen_id
:
self
.
trim
(
_businessment
.
id
),
id
:
self
.
trim
(
params
.
id
)},
t
);
//更新子表
await
childSve
.
dao
.
update
(
params
,
null
);
});
}
return
system
.
getResultSuccess
();
>>>>>>>
f5666332088f65a7ad246b1415175ebe3678309f
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
...
...
@@ -135,16 +192,28 @@ class IborderbaseService extends ServiceBase {
/**
* 订单办理
* @param {} params
* @param {} params
*/
async
apiHandling
(
params
)
{
async
apiHandling
(
params
)
{
//1 检查个体户参数
//2 检查是否支付
}
/**
<<<<<<< HEAD
=======
* 计算 增值税 和 附加税
* @param {*} params
*/
async
calInvoiceAmount
(
params
)
{
let
res
=
await
this
.
cal
}
/**
>>>>>>> f5666332088f65a7ad246b1415175ebe3678309f
* 更新base表
* @param {*} params
* @param {*} params
*/
async
completedOrderInfo
(
params
,
t
)
{
try
{
...
...
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