:fix:修复下单时间问题

This commit is contained in:
sunxiaolong
2024-01-13 18:42:24 +08:00
parent 57b84d0b42
commit e35ceb4421
8 changed files with 39 additions and 39 deletions

View File

@@ -1,30 +1,21 @@
package common
/***************************************************
** @Desc : This file for ...
** @Time : 2019/11/25 14:14
** @Author : yuebin
** @File : consts.go
** @Last Modified by : yuebin
** @Last Modified time: 2019/11/25 14:14
** @Software: GoLand
****************************************************/
const (
ACTIVE = "active"
UNACTIVE = "unactive"
DELETE = "delete"
REFUND = "refund"
ORDERROLL = "order_roll"
WAIT = "wait"
SUCCESS = "success"
FAIL = "fail"
YES = "yes"
NO = "no"
ZERO = 0.0 //0元手续费
VERIFY_CODE_LEN = 4 //验证码的长度
PAYFOR_FEE = 2.00 //代付手续费
PAYFOR_INTERVAL = 5 //每过5分钟执行一次代付
ACTIVE = "active"
UNACTIVE = "unactive"
DELETE = "delete"
REFUND = "refund"
ORDERROLL = "order_roll"
OrderStatusWait = "wait"
OrderStatusSuccess = "success"
OrderStatusFail = "fail"
OrderStatusCreated = "created"
YES = "yes"
NO = "no"
ZERO = 0.0 //0元手续费
VERIFY_CODE_LEN = 4 //验证码的长度
PAYFOR_FEE = 2.00 //代付手续费
PAYFOR_INTERVAL = 5 //每过5分钟执行一次代付
PLUS_AMOUNT = "plus_amount" //加款操作
SUB_AMOUNT = "sub_amount" //减款操作

View File

@@ -794,7 +794,7 @@ func (c *GetController) GetOrder() {
orderDataJSON.OrderList = order.GetOrderByMap(params, c.DisplayCount, c.Offset)
//orderDataJSON.SuccessRate = order.GetSuccessRateByMap(params)
params["status"] = common.SUCCESS
params["status"] = common.OrderStatusSuccess
//orderDataJSON.AllAmount = order.GetAllAmountByMap(params)
c.GenerateJSON(orderDataJSON)

View File

@@ -51,12 +51,13 @@ type OrderInfo struct {
ExValue string
CardData string
UpdateTime string
CreateTime string
CreateTime string // 订单创建时间
PayTime string // 用户支付时间
}
const ORDER_INFO = "order_info"
func BankOrderIdIsEixst(bankOrderId string) bool {
func BankOrderIdIsExist(bankOrderId string) bool {
o := orm.NewOrm()
exists := o.QueryTable(ORDER_INFO).Filter("bank_order_id", bankOrderId).Exist()
return exists

View File

@@ -45,7 +45,7 @@ func OrderQuery(bankOrderId string) string {
func (c *QueryService) SupplierOrderQuery(bankOrderId string) *datas.KeyDataJSON {
keyDataJSON := new(datas.KeyDataJSON)
keyDataJSON.Code = 200
exist := order.BankOrderIdIsEixst(bankOrderId)
exist := order.BankOrderIdIsExist(bankOrderId)
if !exist {
keyDataJSON.Msg = "该订单不存在"
keyDataJSON.Code = -1
@@ -110,7 +110,7 @@ func QueryTotalSummary() order.Summary {
totalNum += 1
allAmount += v.ShowAmount //订单总金额
if v.Status != common.SUCCESS {
if v.Status != common.OrderStatusSuccess {
continue
}
@@ -157,7 +157,7 @@ func QuerySummaryByOrderInfo(infoInfoList []order.OrderInfo) order.Summary {
totalNum += 0
todayAllAmount += info.FactAmount
if info.Status != common.SUCCESS {
if info.Status != common.OrderStatusSuccess {
continue
}
@@ -205,7 +205,7 @@ func QueryTodaySummary() order.Summary {
totalNum += 0
todayAllAmount += info.FactAmount
if info.Status != common.SUCCESS {
if info.Status != common.OrderStatusSuccess {
continue
}

View File

@@ -18,7 +18,7 @@ func (c *SendNotifyMerchantService) SendNotifyToMerchant(bankOrderId string) *da
keyDataJSON := new(datas.KeyDataJSON)
keyDataJSON.Code = -1
orderInfo := order.GetOrderByBankOrderId(bankOrderId)
if orderInfo.Status == common.WAIT {
if orderInfo.Status == common.OrderStatusWait {
keyDataJSON.Msg = "该订单不是成功状态,不能回调"
} else {
notifyInfo := notify.GetNotifyInfoByBankOrderId(bankOrderId)

View File

@@ -31,7 +31,7 @@ func (s *OrderSummary) GetTodaySummary() (todaySummary order.Summary) {
amount += info.OrderAmount
// 统计成功订单
if info.Status == common.SUCCESS {
if info.Status == common.OrderStatusSuccess {
paidNum += 1
paidAmount += info.OrderAmount
}

View File

@@ -425,7 +425,7 @@ func (c *UpdateService) ResultPayFor(resultType, bankOrderId string) *datas.KeyD
u, _ := web.AppConfig.String("gateway::host")
u = u + "/solve/payfor/result?" + "resultType=" + resultType + "&bankOrderId=" + bankOrderId
s, err := httplib.Get(u).String()
if err != nil || s == common.FAIL {
if err != nil || s == common.OrderStatusFail {
logs.Error("手动处理代付结果请求gateway系统失败", err)
keyDataJSON.Msg = "处理失败"
keyDataJSON.Code = -1

View File

@@ -235,6 +235,7 @@
<th>冻结状态</th>
<th>退款状态</th>
<th>下单时间</th>
<th>支付时间</th>
<th>上游供应商</th>
<th>支付类型</th>
<th>操作</th>
@@ -482,28 +483,35 @@
} else if (v.Status === "fail") {
tmp = "<tr style='color: red;'>"
}
let exValue = {}
try {
exValue = JSON.parse(v.ExValue)
} catch (e) {
exValue = {}
}
tmp = tmp + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.MerchantName + "</th>" + "<th>" + v.MerchantOrderId + "</th>" +
"<th>" + v.BankOrderId + "</th>" +
"<th>" + v.FactAmount + "</th>" +
"<th>" + `卡号:${JSON.parse(v.ExValue)['cardNo']}<br />卡密:${JSON.parse(v.ExValue)['data']}` + "</th>" +
"<th>" + `卡号:${exValue.cardNo !== undefined ? exValue.cardNo : ''}<br />卡密:${exValue.data !== undefined ? exValue.data : ''}` + "</th>" +
"<th>" + v.Status + "</th>";
if (v.Freeze === "yes") {
tmp = tmp + "<th style='color: red;'>" + "已经冻结" + "</th>"
} else {
tmp = tmp + "<th>" + "未被冻结" + "</th>"
}
if (v.Refund === "yes") {
tmp = tmp + "<th style='color: red;'>" + "已经退款" + "</th>"
} else {
tmp = tmp + "<th>" + "未被退款" + "</th>"
}
console.log(v)
tmp = tmp +
"<th>" + v.CreateTime + "</th>" + "<th>" +
v.PayProductName + "</th>" +
`<th>${v.CreateTime}</th><th>${v.PayTime}</th><th>${v.PayProductName}</th>` +
"<th>" + v.PayTypeName + "</th>";
tmp = tmp.replace("wait", "等待支付").replace("success", "支付成功").replace("fail", "支付失败").replace("cancel", "放弃支付");
tmp = tmp.replace("wait", "等待支付").replace("success", "支付成功").replace("fail", "支付失败").replace("cancel", "放弃支付").replace("created", "创建");
;
tmp = tmp +
"<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" class="btn btn-default" style="padding:0;margin-right: 5px;" value="' +