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
cbcc40e8
Commit
cbcc40e8
authored
Dec 09, 2019
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
gsb
parents
9624d732
44d903f0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
35 deletions
+34
-35
xggsve-order/app/base/db/impl/business/businessmenDao.js
+1
-1
xggsve-order/app/base/db/models/order/iborderbase.js
+1
-0
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
+3
-3
xggsve-order/app/base/service/impl/order/iborderdkSve.js
+26
-29
xggsve-order/app/base/system.js
+3
-2
xggsve-order/app/front/entry/public/apidoc/order/orderbase.md
+0
-0
No files found.
xggsve-order/app/base/db/impl/business/businessmenDao.js
View file @
cbcc40e8
...
...
@@ -86,7 +86,7 @@ class BusinessmenDao extends Dao {
async
findBusinessmenByCreditCode
(
creditCode
){
try
{
return
await
this
.
dao
.
model
.
findOne
({
creditCode
:
creditCode
})
;
return
await
this
.
model
.
findOne
({
where
:{
creditCode
:
creditCode
}})
||
{}
;
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
...
...
xggsve-order/app/base/db/models/order/iborderbase.js
View file @
cbcc40e8
...
...
@@ -18,6 +18,7 @@ module.exports = (db, DataTypes) => {
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
},
payType
:
DataTypes
.
INTEGER
,
field
:
'pay_type'
,
comment
:
'付款方式 10 按照次付费 20 按照年付费'
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
...
...
xggsve-order/app/base/service/impl/order/iborderbaseSve.js
View file @
cbcc40e8
...
...
@@ -63,7 +63,7 @@ class IborderbaseService extends ServiceBase {
params
.
status
=
"1000"
;
// 待处理
params
.
payStatus
=
"10"
;
// 支付状态
params
.
channelOrderNo
=
params
.
channelNo
;
params
.
payType
=
this
.
trim
(
params
.
payType
);
let
self
=
this
;
//1 保存基类的信息
await
this
.
db
.
transaction
(
async
t
=>
{
...
...
@@ -97,7 +97,7 @@ class IborderbaseService extends ServiceBase {
*/
async
apiCompletedOrder
(
params
)
{
try
{
let
childSve
=
this
.
getService
(
params
.
productType
);
let
childSve
=
this
.
getService
(
this
.
trim
(
params
.
productType
)
);
return
await
childSve
.
completedOrder
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
...
...
@@ -110,7 +110,7 @@ class IborderbaseService extends ServiceBase {
*/
async
apiHandling
(
params
)
{
try
{
let
childSve
=
this
.
getService
();
let
childSve
=
this
.
getService
(
params
.
productType
);
return
await
childSve
.
handling
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
...
...
xggsve-order/app/base/service/impl/order/iborderdkSve.js
View file @
cbcc40e8
...
...
@@ -21,18 +21,6 @@ class IborderdkService extends ServiceBase {
*/
async
createOrder
(
params
,
t
)
{
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
,
`参数错误 订单金额格式错误`
);
}
this
.
trimObject
(
params
);
let
_ibOrderDk
=
await
this
.
dao
.
create
(
params
,
t
);
return
system
.
getResult
(
_ibOrderDk
);
...
...
@@ -67,12 +55,15 @@ class IborderdkService extends ServiceBase {
* creditCode
* isBank
* businessScope
* orderId
*/
async
completedOrder
(
params
)
{
try
{
//1 检查个体户是否存在 (根据统一社会信用代码查个体工商户是否存在)
this
.
trimObject
(
params
);
if
(
!
params
.
id
)
{
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
}
if
(
!
params
.
orderId
)
{
return
system
.
getResult
(
null
,
`参数错误 ID 不能为空`
);
}
else
{
params
.
order_id
=
this
.
trim
(
params
.
orderId
);
}
if
(
!
params
.
legalName
)
{
return
system
.
getResult
(
null
,
`参数错误 法人姓名不能为空`
);
}
if
(
!
params
.
legalMobile
)
{
return
system
.
getResult
(
null
,
`参数错误 法人电话不能为空`
);
}
if
(
!
params
.
creditCode
)
{
return
system
.
getResult
(
null
,
`参数错误 法人统一社会信用代码不能为空`
);
}
...
...
@@ -86,19 +77,20 @@ class IborderdkService extends ServiceBase {
}
if
(
_businessmenRes
.
id
)
{
//如果用户存在id 直接更新
let
_iborderbase
=
await
this
.
iborderbaseDao
.
findById
(
this
.
trim
(
params
.
i
d
));
let
_iborderbase
=
await
this
.
iborderbaseDao
.
findById
(
this
.
trim
(
params
.
orderI
d
));
if
(
!
_iborderbase
)
{
return
system
.
getResult
(
null
,
`参数错误 订单不存在`
);
}
let
self
=
this
;
//向参数中添加 是否完善信息标识
params
.
isInfoComplete
=
1
;
await
this
.
db
.
transaction
(
async
t
=>
{
//更新主表
await
self
.
iborderbaseDao
.
update
({
businessmen_id
:
self
.
trim
(
_businessmenRes
.
id
),
id
:
self
.
trim
(
params
.
id
),
isInfoComplete
:
1
},
t
);
id
:
self
.
trim
(
params
.
order_
id
),
isInfoComplete
:
1
},
t
);
//更新子表
await
this
.
dao
.
update
(
params
,
t
);
params
.
id
=
self
.
trim
(
params
.
order_id
);
params
.
isInfoComplete
=
1
;
await
self
.
dao
.
update
(
params
,
t
);
});
}
else
{
let
self
=
this
;
...
...
@@ -106,10 +98,11 @@ class IborderdkService extends ServiceBase {
//如果不存在id 创建后更新
let
_businessment
=
await
this
.
businessmenDao
.
create
(
params
,
t
);
//更新主表
await
self
.
iborderbaseDao
.
update
({
businessmen_id
:
self
.
trim
(
_businessment
.
id
),
id
:
self
.
trim
(
params
.
id
),
isInfoComplete
:
1
},
t
);
params
.
id
=
self
.
trim
(
params
.
orderId
);
params
.
isInfoComplete
=
1
;
await
self
.
iborderbaseDao
.
update
({
businessmen_id
:
self
.
trim
(
_businessment
.
id
),
isInfoComplete
:
1
,
id
:
params
.
id
},
t
);
//更新子表
await
this
.
dao
.
update
(
params
,
t
);
await
self
.
dao
.
update
(
params
,
t
);
});
}
return
system
.
getResultSuccess
();
...
...
@@ -124,7 +117,7 @@ class IborderdkService extends ServiceBase {
* businessmenId 个体户ID
* id 订单ID
*/
async
handing
(
params
)
{
async
hand
l
ing
(
params
)
{
try
{
//1 检查个体户是否签约
let
_businessmen
=
await
this
.
businessmenDao
.
findById
(
this
.
trim
(
params
.
businessmenId
));
...
...
@@ -142,25 +135,29 @@ class IborderdkService extends ServiceBase {
///**************************************************************** */
if
(
1
!=
1
){
if
(
_iborderbase
.
payType
!=
20
){
//如果不是年付费 计算费用
let
invoiceParams
=
await
this
.
buildParamForCalInvoice
(
params
);
valueAddedTax
=
await
calInvoice
.
calculationValueAddedTax
(
invoiceParams
);
//填充 增值税参数
invoiceParams
.
valueAddedTax
=
valueAddedTax
;
additionalTax
=
await
calInvoice
.
calculationAdditionalTax
(
invoiceParams
);
//4 推送计算结果
let
res
=
{
valueAddedTax
:
valueAddedTax
,
additionalTax
:
additionalTax
};
//4 推送计算结果 暂不推送
return
system
.
getResult
(
res
);
}
else
{
//5 如果是不是按照年付款 直接更新订单金额
let
_arguments
=
{};
_arguments
.
price
=
Number
(
valueAddedTax
)
+
Number
(
additionalTax
);
let
updatePriceRes
=
await
this
.
updateOrder
(
_arguments
);
//
let _arguments = {};
//
_arguments.price=Number(valueAddedTax) + Number(additionalTax);
//
let updatePriceRes =await this.updateOrder(_arguments);
//6 提交发票申请
let
submitApplyInvoiceParams
=
await
this
.
buildParamForApplyInvoice
(
params
);
if
(
submitApplyInvoiceParams
.
hasOwnProperty
(
"status"
)
==
0
){
return
system
.
getResultSuccess
(
null
,
`发票申请已提交`
);
}
else
{
return
system
.
getResult
(
null
,
`发票申请失败`
);
}
}
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
...
...
xggsve-order/app/base/system.js
View file @
cbcc40e8
...
...
@@ -168,12 +168,13 @@ class System {
static
microsetting
()
{
var
path
=
"/api/op/action/springboard"
;
if
(
settings
.
env
==
"dev"
)
{
var
domain
=
"http://192.168.18.237"
;
// var domain = "http://192.168.18.237";
var
domain
=
"http://192.168.18.105"
;
return
{
common
:
domain
+
":3102"
+
path
,
merchant
:
domain
+
":3101"
+
path
,
order
:
domain
+
":3103"
+
path
,
invoice
:
"
"
+
path
,
invoice
:
domain
+
"3105
"
+
path
,
payment
:
""
+
path
,
}
}
else
{
...
...
xggsve-order/app/front/entry/public/apidoc/order/orderbase.md
0 → 100644
View file @
cbcc40e8
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