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
b183e84a
Commit
b183e84a
authored
Dec 09, 2019
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
cbcc40e8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
20 deletions
+41
-20
xggsve-order/app/base/db/models/order/iborderbase.js
+1
-1
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
+2
-1
xggsve-order/app/base/service/impl/order/iborderdkSve.js
+0
-0
xggsve-order/app/base/service/impl/order/iborderdzSve.js
+38
-18
No files found.
xggsve-order/app/base/db/models/order/iborderbase.js
View file @
b183e84a
...
@@ -18,7 +18,7 @@ module.exports = (db, DataTypes) => {
...
@@ -18,7 +18,7 @@ module.exports = (db, DataTypes) => {
type
:
DataTypes
.
BOOLEAN
,
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
defaultValue
:
false
},
},
payType
:
DataTypes
.
INTEGER
,
field
:
'pay_type'
,
comment
:
'付款方式 10 按照次付费 20 按照年付费'
payType
:
{
type
:
DataTypes
.
INTEGER
,
field
:
'pay_type'
,
comment
:
'付款方式 10 按照次付费 20 按照年付费'
},
},
{
},
{
paranoid
:
true
,
//假的删除
paranoid
:
true
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
View file @
b183e84a
...
@@ -97,7 +97,8 @@ class IborderbaseService extends ServiceBase {
...
@@ -97,7 +97,8 @@ class IborderbaseService extends ServiceBase {
*/
*/
async
apiCompletedOrder
(
params
)
{
async
apiCompletedOrder
(
params
)
{
try
{
try
{
let
childSve
=
this
.
getService
(
this
.
trim
(
params
.
productType
));
let
baseorder
=
await
this
.
dao
.
findById
(
params
.
id
);
let
childSve
=
this
.
getService
(
baseorder
.
productType
);
return
await
childSve
.
completedOrder
(
params
);
return
await
childSve
.
completedOrder
(
params
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
...
...
xggsve-order/app/base/service/impl/order/iborderdkSve.js
View file @
b183e84a
This diff is collapsed.
Click to expand it.
xggsve-order/app/base/service/impl/order/iborderdzSve.js
View file @
b183e84a
...
@@ -67,48 +67,68 @@ class IborderdzService extends ServiceBase {
...
@@ -67,48 +67,68 @@ class IborderdzService extends ServiceBase {
try
{
try
{
//1 检查个体户是否存在 (根据统一社会信用代码查个体工商户是否存在)
//1 检查个体户是否存在 (根据统一社会信用代码查个体工商户是否存在)
this
.
trimObject
(
params
);
this
.
trimObject
(
params
);
if
(
!
params
.
id
)
{
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
}
if
(
!
params
.
id
)
{
if
(
!
params
.
legalName
)
{
return
system
.
getResult
(
null
,
`参数错误 法人姓名不能为空`
);
}
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
if
(
!
params
.
legalMobile
)
{
return
system
.
getResult
(
null
,
`参数错误 法人电话不能为空`
);
}
}
if
(
!
params
.
creditCode
)
{
return
system
.
getResult
(
null
,
`参数错误 法人统一社会信用代码不能为空`
);
}
if
(
!
params
.
legalName
)
{
if
(
!
params
.
names
)
{
return
system
.
getResult
(
null
,
`参数错误 个体户名称不能为空`
);
}
return
system
.
getResult
(
null
,
`参数错误 法人姓名不能为空`
);
if
(
!
params
.
businessScope
)
{
return
system
.
getResult
(
null
,
`参数错误 经营范围不能为空`
);
}
}
if
(
!
params
.
legalMobile
)
{
//2 如果不存在添加保存个体户 完善信息
return
system
.
getResult
(
null
,
`参数错误 法人电话不能为空`
);
let
_businessmenRes
=
await
this
.
businessmenDao
.
findBusinessmenByCreditCode
(
this
.
trim
(
params
.
creditCode
));
if
(
_businessmenRes
.
hasOwnProperty
(
"status"
))
{
return
_businessmenRes
;
}
}
if
(
_businessmenRes
.
id
)
{
if
(
!
params
.
creditCode
)
{
//如果用户存在id 直接更新
return
system
.
getResult
(
null
,
`参数错误 法人统一社会信用代码不能为空`
);
}
if
(
!
params
.
names
)
{
return
system
.
getResult
(
null
,
`参数错误 个体户名称不能为空`
);
}
if
(
!
params
.
businessScope
)
{
return
system
.
getResult
(
null
,
`参数错误 经营范围不能为空`
);
}
params
.
order_id
=
params
.
id
;
//2 如果不存在添加保存个体户 完善信息
let
_businessmen
=
await
this
.
businessmenDao
.
findOne
({
creditCode
:
this
.
trim
(
params
.
creditCode
)});
if
(
_businessmen
)
{
//如果用户存在 直接更新
let
_iborderbase
=
await
this
.
iborderbaseDao
.
findById
(
this
.
trim
(
params
.
id
));
let
_iborderbase
=
await
this
.
iborderbaseDao
.
findById
(
this
.
trim
(
params
.
id
));
if
(
!
_iborderbase
)
{
if
(
!
_iborderbase
)
{
return
system
.
getResult
(
null
,
`参数错误 订单不存在`
);
return
system
.
getResult
(
null
,
`参数错误 订单不存在`
);
}
}
let
self
=
this
;
let
self
=
this
;
//向参数中添加 是否完善信息标识
//向参数中添加 是否完善信息标识
params
.
isInfoComplete
=
1
;
params
.
isInfoComplete
=
1
;
var
updateFields
=
{
businessmen_id
:
self
.
trim
(
_businessmen
.
id
),
id
:
self
.
trim
(
params
.
id
),
isInfoComplete
:
1
};
if
(
!
_businessmen
||
!
_businessmen
.
order_id
)
{
updateFields
.
order_id
=
_iborderbase
.
id
;
}
await
this
.
db
.
transaction
(
async
t
=>
{
await
this
.
db
.
transaction
(
async
t
=>
{
//更新主表
//更新主表
await
self
.
iborderbaseDao
.
update
({
businessmen_id
:
self
.
trim
(
_businessmenRes
.
id
),
await
self
.
iborderbaseDao
.
update
(
updateFields
,
t
);
id
:
self
.
trim
(
params
.
id
),
isInfoComplete
:
1
},
t
);
//更新子表
//更新子表
await
this
.
dao
.
update
(
params
,
t
);
await
this
.
dao
.
update
(
params
,
t
);
});
});
}
else
{
}
else
{
delete
params
.
id
;
let
self
=
this
;
let
self
=
this
;
await
this
.
db
.
transaction
(
async
t
=>
{
await
this
.
db
.
transaction
(
async
t
=>
{
//如果不存在id 创建后更新
//如果不存在id 创建后更新
let
_businessment
=
await
this
.
businessmenDao
.
create
(
params
,
t
);
let
_businessment
=
await
this
.
businessmenDao
.
create
(
params
,
t
);
//更新主表
//更新主表
await
self
.
iborderbaseDao
.
update
({
businessmen_id
:
self
.
trim
(
_businessment
.
id
),
id
:
self
.
trim
(
params
.
id
),
await
self
.
iborderbaseDao
.
update
({
isInfoComplete
:
1
},
t
);
businessmen_id
:
self
.
trim
(
_businessment
.
id
),
id
:
self
.
trim
(
params
.
id
),
isInfoComplete
:
1
},
t
);
//更新子表
//更新子表
await
this
.
dao
.
update
(
params
,
t
);
await
this
.
dao
.
update
(
params
,
t
);
});
});
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
...
...
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