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
7913f0d4
Commit
7913f0d4
authored
Apr 12, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
afc7df87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
16 deletions
+85
-16
center-order/app/base/api/impl/opaction/opPayOrder.js
+5
-0
center-order/app/base/db/impl/dbcorder/orderproductDao.js
+2
-2
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+78
-14
No files found.
center-order/app/base/api/impl/opaction/opPayOrder.js
View file @
7913f0d4
...
@@ -11,5 +11,9 @@ class OpPayOrder extends APIBase {
...
@@ -11,5 +11,9 @@ class OpPayOrder extends APIBase {
var
result
=
await
this
.
orderinfoSve
.
opOrderPayCallBackTl
(
pobj
,
pobj
.
appInfo
);
var
result
=
await
this
.
orderinfoSve
.
opOrderPayCallBackTl
(
pobj
,
pobj
.
appInfo
);
return
result
;
return
result
;
}
}
async
receivePayCallBackNotifyByAliDing
(
pobj
,
qobj
,
req
)
{
var
result
=
await
this
.
orderinfoSve
.
opOrderPayCallBackAliDing
(
pobj
,
pobj
.
appInfo
);
return
result
;
}
}
}
module
.
exports
=
OpPayOrder
;
module
.
exports
=
OpPayOrder
;
\ No newline at end of file
center-order/app/base/db/impl/dbcorder/orderproductDao.js
View file @
7913f0d4
...
@@ -10,7 +10,6 @@ class OrderProductDao extends Dao {
...
@@ -10,7 +10,6 @@ class OrderProductDao extends Dao {
sourceOrderNo
:
orderNo
,
uapp_id
:
uapp_id
sourceOrderNo
:
orderNo
,
uapp_id
:
uapp_id
},
},
attributes
:
[
attributes
:
[
"id"
,
"sourceOrderNo"
,
"sourceOrderNo"
,
"productType_id"
,
"productType_id"
,
"pathCode"
,
"pathCode"
,
...
@@ -23,7 +22,8 @@ class OrderProductDao extends Dao {
...
@@ -23,7 +22,8 @@ class OrderProductDao extends Dao {
"payAfterJumpPcUrl"
,
"payAfterJumpPcUrl"
,
"picUrl"
,
"picUrl"
,
"price"
,
"price"
,
"quantity"
],
"quantity"
,
"serviceItemSnapshot"
],
raw
:
true
raw
:
true
});
});
}
}
...
...
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
7913f0d4
...
@@ -756,6 +756,9 @@ class OrderInfoService extends ServiceBase {
...
@@ -756,6 +756,9 @@ class OrderInfoService extends ServiceBase {
if
(
!
item
)
{
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"订单已经付款成功,请勿重复支付,30000"
);
return
system
.
getResult
(
null
,
"订单已经付款成功,请勿重复支付,30000"
);
}
}
var
produceinfo
=
JSON
.
parse
(
productItem
.
serviceItemSnapshot
);
productItem
.
id
=
produceinfo
.
id
;
productItem
.
serviceItemSnapshot
=
null
;
var
param
=
{
var
param
=
{
receiptVoucher
:
item
,
receiptVoucher
:
item
,
orderProduct
:
productItem
orderProduct
:
productItem
...
@@ -1161,7 +1164,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -1161,7 +1164,7 @@ class OrderInfoService extends ServiceBase {
};
};
var
moneyJourney
=
await
self
.
moneyJourneyDao
.
create
(
moneyObj
,
t
);
var
moneyJourney
=
await
self
.
moneyJourneyDao
.
create
(
moneyObj
,
t
);
});
});
item
.
orderStatus
=
2
;
//已付款
var
resultParams
=
{
var
resultParams
=
{
order_info
:
item
,
order_info
:
item
,
delivery_content
:
null
,
//包含订单联系人orderContact
delivery_content
:
null
,
//包含订单联系人orderContact
...
@@ -1178,6 +1181,66 @@ class OrderInfoService extends ServiceBase {
...
@@ -1178,6 +1181,66 @@ class OrderInfoService extends ServiceBase {
return
system
.
getResultSuccess
(
resultParams
);
return
system
.
getResultSuccess
(
resultParams
);
}
}
async
opOrderPayCallBackAliDing
(
parmas
,
appInfo
)
{
//操作订单付款回调---阿里钉钉
var
item
=
await
this
.
dao
.
getItemStatusByOrderNo
(
parmas
.
orderNo
)
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"order data is empty!"
);
}
if
(
item
.
orderStatus
>
1
)
{
return
system
.
getResult
(
null
,
"order status is pay!"
);
}
var
self
=
this
;
await
self
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
dao
.
updateByWhere
({
orderStatus
:
2
,
payTime
:
parmas
.
gmt_payment
},
{
where
:
{
orderNo
:
parmas
.
orderNo
}
},
t
);
var
putFields
=
{
auditStatus
:
"tg"
,
accountType
:
parmas
.
pay_type
,
passTradeNo
:
parmas
.
notify_id
||
""
,
//通知校验ID
payOrderNo
:
parmas
.
trade_no
||
""
,
//支付凭证流水单号,如:微信支付凭证单号--该交易在支付宝系统中的交易流水号。最短16位,最长64位。
busPayOrderCode
:
parmas
.
out_trade_no
||
""
,
//业务支付订单号
buyerOpenId
:
parmas
.
buyer_id
||
""
,
//用户在支付商户appid下的唯一标识或买家在支付宝的用户id
buyerAliLogonId
:
parmas
.
buyer_email
||
""
,
//买家支付宝账号
updated_at
:
parmas
.
gmt_payment
,
//该笔交易的买家付款时间。格式为yyyy-MM-dd HH:mm:ss。
notes
:
parmas
.
gmt_create
||
""
//该笔交易创建的时间。格式为yyyy-MM-dd HH:mm:ss。
};
await
self
.
orderReceiptVoucherDao
.
updateByWhere
(
putFields
,
{
where
:
{
sourceOrderNo
:
parmas
.
orderNo
}
},
t
);
var
orderLog
=
{
uapp_id
:
appInfo
.
uapp_id
,
sourceOrderNo
:
parmas
.
orderNo
,
opContent
:
"您成功支付了订单,请等待服务商服务"
,
isShow
:
1
};
await
self
.
flowlogDao
.
create
(
orderLog
,
t
);
var
moneyObj
=
{
uapp_id
:
appInfo
.
uapp_id
,
sourceOrderNo
:
parmas
.
orderNo
,
// 来源单号
channelUserId
:
item
.
channelUserId
,
ownerUserId
:
item
.
ownerUserId
,
accountType
:
parmas
.
pay_type
,
//帐户类型( 支付类型):"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
directionType
:
"sr"
,
//凭单类型,"sr": "收","zc": "支"
voucherDate
:
parmas
.
gmt_payment
,
//new Date(),//凭单时间
recvAmount
:
item
.
totalSum
,
//收总额
sourceType
:
"orderinfo"
,
//来源类型 "orderinfo": "订单","expensevoucher": "费用单"
auditStatus
:
"tg"
,
//审核状态"dsh": "待审核", "btg": "不通过", "tg": "通过"
};
await
self
.
moneyJourneyDao
.
create
(
moneyObj
,
t
);
});
item
.
orderStatus
=
2
;
//已付款
var
resultParams
=
{
order_info
:
item
,
delivery_content
:
null
,
//包含订单联系人orderContact
product_info
:
null
};
var
deliveryInfoResult
=
await
this
.
getOrderDeliveryInfo
(
null
,
parmas
);
if
(
deliveryInfoResult
&&
deliveryInfoResult
.
status
==
0
)
{
resultParams
.
delivery_content
=
deliveryInfoResult
.
data
;
}
var
orderProductItem
=
await
this
.
orderproductDao
.
getItemInfoByOrderNo
(
parmas
.
orderNo
);
if
(
orderProductItem
)
{
resultParams
.
product_info
=
JSON
.
parse
(
orderProductItem
.
serviceItemSnapshot
);
}
return
system
.
getResultSuccess
(
resultParams
);
}
//-------------------------------服务商通知订单流程-------------end----------------
//-------------------------------服务商通知订单流程-------------end----------------
//商标方案确认
//商标方案确认
async
tmConfirm
(
pobj
)
{
async
tmConfirm
(
pobj
)
{
...
@@ -1205,7 +1268,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -1205,7 +1268,7 @@ class OrderInfoService extends ServiceBase {
}
}
//获取订单信息
//获取订单信息
var
orderinfo
=
await
this
.
dao
.
model
.
findOne
({
var
orderinfo
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
orderNo
:
orderNo
,
uapp_id
:
app
.
uapp_id
},
raw
:
true
where
:
{
orderNo
:
orderNo
,
uapp_id
:
app
.
uapp_id
},
raw
:
true
});
});
if
(
!
orderinfo
||
!
orderinfo
.
id
)
{
if
(
!
orderinfo
||
!
orderinfo
.
id
)
{
return
system
.
getResultFail
(
-
110
,
"未知订单信息"
);
return
system
.
getResultFail
(
-
110
,
"未知订单信息"
);
...
@@ -1215,7 +1278,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -1215,7 +1278,7 @@ class OrderInfoService extends ServiceBase {
}
}
//获取交付单信息
//获取交付单信息
var
orderdeliveryRes
=
await
this
.
getOrderDelivery
(
orderNo
);
var
orderdeliveryRes
=
await
this
.
getOrderDelivery
(
orderNo
);
if
(
!
orderdeliveryRes
||
orderdeliveryRes
.
length
<
1
)
{
if
(
!
orderdeliveryRes
||
orderdeliveryRes
.
length
<
1
)
{
return
system
.
getResultFail
(
-
104
,
"未知订单交付信息"
);
return
system
.
getResultFail
(
-
104
,
"未知订单交付信息"
);
}
}
var
orderdelivery
=
orderdeliveryRes
[
0
];
var
orderdelivery
=
orderdeliveryRes
[
0
];
...
@@ -1223,7 +1286,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -1223,7 +1286,7 @@ class OrderInfoService extends ServiceBase {
// if (!deliveryContent || !deliveryContent.deliveryStatus || deliveryContent.deliveryStatus != "dqrfa") {
// if (!deliveryContent || !deliveryContent.deliveryStatus || deliveryContent.deliveryStatus != "dqrfa") {
// return system.getResultFail(-105, "方案确认失败,方案交付状态错误");
// return system.getResultFail(-105, "方案确认失败,方案交付状态错误");
// }
// }
if
(
!
deliveryContent
.
deliveryStatusList
)
{
if
(
!
deliveryContent
.
deliveryStatusList
)
{
deliveryContent
.
deliveryStatusList
=
[];
deliveryContent
.
deliveryStatusList
=
[];
}
}
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
...
@@ -1234,10 +1297,10 @@ class OrderInfoService extends ServiceBase {
...
@@ -1234,10 +1297,10 @@ class OrderInfoService extends ServiceBase {
isShow
:
1
isShow
:
1
};
};
var
orderInfoObj
=
{
var
orderInfoObj
=
{
id
:
orderinfo
.
id
id
:
orderinfo
.
id
};
};
if
(
ab
.
notes
)
{
if
(
ab
.
notes
)
{
orderInfoObj
[
"opNotes"
]
=
ab
.
notes
;
orderInfoObj
[
"opNotes"
]
=
ab
.
notes
;
}
}
if
(
isConfirm
==
"0"
)
{
if
(
isConfirm
==
"0"
)
{
if
(
!
ab
.
notes
)
{
if
(
!
ab
.
notes
)
{
...
@@ -1248,11 +1311,11 @@ class OrderInfoService extends ServiceBase {
...
@@ -1248,11 +1311,11 @@ class OrderInfoService extends ServiceBase {
deliveryContent
[
"opNotes"
]
=
ab
.
notes
;
deliveryContent
[
"opNotes"
]
=
ab
.
notes
;
orderLog
[
"opContent"
]
=
"商标方案不通过"
;
orderLog
[
"opContent"
]
=
"商标方案不通过"
;
deliveryContent
.
deliveryStatusList
.
push
({
deliveryContent
.
deliveryStatusList
.
push
({
deliveryStatus
:
"fabtg"
,
deliveryStatus
:
"fabtg"
,
deliveryStatusName
:
"方案不通过"
,
deliveryStatusName
:
"方案不通过"
,
deliveryUpdated
:
new
Date
()
deliveryUpdated
:
new
Date
()
});
});
orderInfoObj
[
"isSolution"
]
=
0
;
orderInfoObj
[
"isSolution"
]
=
0
;
}
}
if
(
isConfirm
==
"1"
)
{
if
(
isConfirm
==
"1"
)
{
deliveryContent
[
"deliveryStatus"
]
=
"dsh"
;
deliveryContent
[
"deliveryStatus"
]
=
"dsh"
;
...
@@ -1260,14 +1323,14 @@ class OrderInfoService extends ServiceBase {
...
@@ -1260,14 +1323,14 @@ class OrderInfoService extends ServiceBase {
deliveryContent
[
"opNotes"
]
=
ab
.
notes
||
""
;
deliveryContent
[
"opNotes"
]
=
ab
.
notes
||
""
;
orderLog
[
"opContent"
]
=
"商标方案确认通过"
;
orderLog
[
"opContent"
]
=
"商标方案确认通过"
;
deliveryContent
.
deliveryStatusList
.
push
({
deliveryContent
.
deliveryStatusList
.
push
({
deliveryStatus
:
"dsh"
,
deliveryStatus
:
"dsh"
,
deliveryStatusName
:
"待审核"
,
deliveryStatusName
:
"待审核"
,
deliveryUpdated
:
new
Date
()
deliveryUpdated
:
new
Date
()
});
});
orderInfoObj
[
"isSolution"
]
=
0
;
orderInfoObj
[
"isSolution"
]
=
0
;
}
}
self
.
putOrderDelivery
(
deliveryContent
,
orderNo
);
//修改订单交付信息
self
.
putOrderDelivery
(
deliveryContent
,
orderNo
);
//修改订单交付信息
await
self
.
dao
.
update
(
orderInfoObj
,
t
);
//修改订单信息
await
self
.
dao
.
update
(
orderInfoObj
,
t
);
//修改订单信息
await
self
.
flowlogDao
.
create
(
orderLog
,
t
);
//添加流程信息
await
self
.
flowlogDao
.
create
(
orderLog
,
t
);
//添加流程信息
// var pushObj = {//推送参数
// var pushObj = {//推送参数
...
@@ -1277,13 +1340,13 @@ class OrderInfoService extends ServiceBase {
...
@@ -1277,13 +1340,13 @@ class OrderInfoService extends ServiceBase {
// notes:ab.notes || ""
// notes:ab.notes || ""
// };
// };
orderdeliveryRes
=
await
self
.
getOrderDelivery
(
orderNo
);
orderdeliveryRes
=
await
self
.
getOrderDelivery
(
orderNo
);
if
(
orderdeliveryRes
&&
orderdeliveryRes
.
length
>
0
)
{
if
(
orderdeliveryRes
&&
orderdeliveryRes
.
length
>
0
)
{
return
system
.
getResultSuccess
(
orderdeliveryRes
[
0
]);
return
system
.
getResultSuccess
(
orderdeliveryRes
[
0
]);
}
}
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
})
})
}
}
}
}
module
.
exports
=
OrderInfoService
;
module
.
exports
=
OrderInfoService
;
\ 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