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
855e7da1
Commit
855e7da1
authored
Dec 07, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
0ba098ef
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
1 deletions
+113
-1
xggsve-order/app/base/api/impl/op/action.js
+8
-1
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
+70
-0
xggsve-order/app/base/service/impl/order/iborderdkSve.js
+35
-0
xggsve-order/package-lock.json
+0
-0
No files found.
xggsve-order/app/base/api/impl/op/action.js
View file @
855e7da1
...
...
@@ -4,7 +4,7 @@ var settings = require("../../../../config/settings");
class
ActionAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
iborderSve
=
system
.
getObject
(
"service.order.iborderbaseSve"
);
this
.
iborder
base
Sve
=
system
.
getObject
(
"service.order.iborderbaseSve"
);
this
.
ibdeliverbaseSve
=
system
.
getObject
(
"service.order.ibdeliverbaseSve"
);
this
.
iborderSve
=
system
.
getObject
(
"service.order.iborderSve"
);
...
...
@@ -40,6 +40,13 @@ class ActionAPI extends APIBase {
var
opResult
=
null
;
switch
(
action_type
)
{
// 订单
case
"createOrder"
:
opResult
=
await
this
.
iborderbaseSve
.
apiCreateOrder
(
action_body
);
break
;
case
"completedOrder"
:
opResult
=
await
this
.
iborderbaseSve
.
apiCompletedOrder
(
action_body
);
break
;
case
"addOrder"
:
opResult
=
await
this
.
iborderSve
.
apiAdd
(
action_body
);
break
;
...
...
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
View file @
855e7da1
...
...
@@ -11,6 +11,76 @@ class IborderbaseService extends ServiceBase {
this
.
orderSve_3
=
system
.
getObject
(
"service.order.iborderdzSve"
);
}
/**
* 创建基类订单
* @param {*} params
*/
apiCreateOrder
(
params
)
{
// if(!params.productType){
// return system.getResult(null, `参数错误 产品类型错误`);
// }
// if(!params.productItems instanceof Array){
// return system.getResult(null, `参数错误 产品项目错误`);
// }
// if(!params.channelNo){
// return system.getResult(null, `参数错误 渠道名称错误`);
// }
// if(!params.thirdNo){
// return system.getResult(null, `参数错误 订单错误`);
// }
// if(!Number(params.price)<0){
// return system.getResult(null, `参数错误 订单价格错误`);
// }
// if(!params.payType){
// return system.getResult(null, `参数错误 支付方式错误`);
// }
// if(!params.legalName){
// return system.getResult(null, `参数错误 联系人不能为空`);
// }
// if(!params.legalMobile){
// return system.getResult(null, `参数错误 联系电话不能为空`);
// }
// if(!params.invoiceType){
// return system.getResult(null, `参数错误 发票类型错误`);
// }
try
{
params
.
channelNo
=
this
.
trim
(
params
.
channelNo
);
params
.
thirdNo
=
this
.
trim
(
params
.
thirdNo
);
params
.
notes
=
this
.
trim
(
params
.
notes
);
params
.
legalName
=
this
.
trim
(
params
.
legalName
);
params
.
legalMobile
=
this
.
trim
(
params
.
legalMobile
);
params
.
legalEmail
=
this
.
trim
(
params
.
legalEmail
);
params
.
payType
=
Number
(
params
.
payType
||
1
);
params
.
productType
=
Number
(
params
.
productType
||
1
);
params
.
price
=
Number
(
params
.
price
||
0
);
//1 保存基类的信息
await
this
.
db
.
transaction
(
async
t
=>
{
//创建基类表
let
_baseOrder
=
await
this
.
create
(
params
);
let
childSve
=
this
.
getService
(
params
);
//将id 赋值
params
.
id
=
_baseOrder
.
raw
.
id
;
await
childSve
.
createOrder
(
params
);
});
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 完善信息
* @param {*} params
*/
async
completedOrder
(
params
){
//1 检查个体户是否存在
//2 如果不存在添加保存个体户
//3 完善信息
}
getService
(
productType
)
{
return
this
[
"orderSve_"
+
productType
];
}
...
...
xggsve-order/app/base/service/impl/order/iborderdkSve.js
View file @
855e7da1
...
...
@@ -11,6 +11,41 @@ class IborderdkService extends ServiceBase {
async
addOrder
(
params
)
{
}
/**
* 创建订单
* @param {*} params
*/
async
createOrder
(
params
){
try
{
if
(
!
params
.
merchantId
){
return
system
.
getResult
(
null
,
`参数错误 商户ID不能为空`
);
}
if
(
!
params
.
businessmentId
){
return
system
.
getResult
(
null
,
`参数错误 个体户ID不能为空`
);
}
if
(
!
params
.
orderpayId
){
return
system
.
getResult
(
null
,
`参数错误 支付ID不能为空`
);
}
if
(
!
Number
(
params
.
price
)
<
0
){
return
system
.
getResult
(
null
,
`参数错误 订单金额格式错误`
);
}
for
(
let
key
in
params
)
{
if
(
params
[
key
]
instanceof
String
){
params
[
key
]
=
this
.
trim
(
params
[
key
]);
}
}
let
_ibOrderDk
=
null
;
if
(
!
params
.
id
){
_ibOrderDk
=
await
this
.
create
(
params
);
}
else
{
_ibOrderDk
=
await
this
.
dao
.
create
(
params
);
}
return
system
.
getResult
(
_ibOrderDk
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
IborderdkService
;
// var task=new UserService();
...
...
xggsve-order/package-lock.json
View file @
855e7da1
This diff is collapsed.
Click to expand it.
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