1
This commit is contained in:
@@ -17,7 +17,7 @@ func TestPrintMsg(t *testing.T) {
|
|||||||
ModelIDCULD: model.ModelIDCULD{},
|
ModelIDCULD: model.ModelIDCULD{},
|
||||||
PrintNo: "20220707000002",
|
PrintNo: "20220707000002",
|
||||||
Content: "<center>居中文字</center>",
|
Content: "<center>居中文字</center>",
|
||||||
OrderNo: "11111111", // 2147483648111
|
OrderNo: "1", // 2147483648111
|
||||||
Status: 0,
|
Status: 0,
|
||||||
Comment: "",
|
Comment: "",
|
||||||
MsgID: "1",
|
MsgID: "1",
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"github.com/astaxie/beego/client/orm"
|
"github.com/astaxie/beego/client/orm"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -42,7 +41,6 @@ func AddBillExpend(txDB orm.TxOrmer, billID int64, billType, expendPrice, jobID
|
|||||||
ExpendPrice: expendPrice,
|
ExpendPrice: expendPrice,
|
||||||
JobID: jobID,
|
JobID: jobID,
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("进入AddBillExpend")
|
|
||||||
dao.WrapAddIDCULEntity(billExpend, jxcontext.AdminCtx.GetUserName())
|
dao.WrapAddIDCULEntity(billExpend, jxcontext.AdminCtx.GetUserName())
|
||||||
return dao.CreateEntityTx(txDB, billExpend)
|
return dao.CreateEntityTx(txDB, billExpend)
|
||||||
}
|
}
|
||||||
@@ -70,7 +68,6 @@ func GetUserBillDetail(ctx *jxcontext.Context, userID, fromTime, toTime string,
|
|||||||
|
|
||||||
func AddExpendUpdateAccount(txDB orm.TxOrmer, userBill *model.UserBill, billType, price, jobID int) (err error) {
|
func AddExpendUpdateAccount(txDB orm.TxOrmer, userBill *model.UserBill, billType, price, jobID int) (err error) {
|
||||||
//1、账户支出增加一条记录
|
//1、账户支出增加一条记录
|
||||||
globals.SugarLogger.Debug("进入AddExpendUpdateAccount")
|
|
||||||
err = AddBillExpend(txDB, userBill.BillID, billType, price, jobID)
|
err = AddBillExpend(txDB, userBill.BillID, billType, price, jobID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -245,7 +245,6 @@ func OnTLPayCallback(call *tonglianpayapi.CallBackResult) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) {
|
func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) {
|
||||||
globals.SugarLogger.Debug("进入微信回调============================")
|
|
||||||
order := &model.Order{
|
order := &model.Order{
|
||||||
OrderID: call.CusorderID,
|
OrderID: call.CusorderID,
|
||||||
TransactionID: call.TrxID,
|
TransactionID: call.TrxID,
|
||||||
@@ -334,8 +333,6 @@ func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dao.Commit(db, txdb)
|
dao.Commit(db, txdb)
|
||||||
globals.SugarLogger.Debug("call.TrxStatus======================", call.TrxStatus)
|
|
||||||
globals.SugarLogger.Debug("order.OrderType======================", order.OrderType)
|
|
||||||
if call.TrxStatus == tonglianpayapi.TrxStatusSuccess {
|
if call.TrxStatus == tonglianpayapi.TrxStatusSuccess {
|
||||||
switch order.OrderType {
|
switch order.OrderType {
|
||||||
case model.PayType4Express:
|
case model.PayType4Express:
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
|
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||||
@@ -33,7 +32,7 @@ func SendUserMessage(msgType string, user *model.User, title, content string) (e
|
|||||||
}
|
}
|
||||||
err = ddmsg.SendDDUserMessage(msgType, auth.AuthID, title, content)
|
err = ddmsg.SendDDUserMessage(msgType, auth.AuthID, title, content)
|
||||||
} else if auth.Type == weixin.AuthTypeMP && msgType != dingdingapi.MsgTypeMarkdown {
|
} else if auth.Type == weixin.AuthTypeMP && msgType != dingdingapi.MsgTypeMarkdown {
|
||||||
err = weixinmsg.NotifyStoreStatusChanged(auth.AuthID, title, content)
|
//err = weixinmsg.NotifyStoreStatusChanged(auth.AuthID, title, content)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,14 +68,12 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr
|
|||||||
param.ReceiveAddress = v + param.ReceiveAddress
|
param.ReceiveAddress = v + param.ReceiveAddress
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("检测param是否加上前缀", param.SendAddress, param.ReceiveAddress)
|
|
||||||
// 给快递默认值
|
// 给快递默认值
|
||||||
result := make(map[string]*bida.GetExpressPriceRes, 0)
|
result := make(map[string]*bida.GetExpressPriceRes, 0)
|
||||||
if param.Type == 0 {
|
if param.Type == 0 {
|
||||||
// 渠道费每公斤加价五毛
|
// 渠道费每公斤加价五毛
|
||||||
switch param.ChannelType {
|
switch param.ChannelType {
|
||||||
case 1: // 快递
|
case 1: // 快递
|
||||||
globals.SugarLogger.Debug("进入QueryExpressPrice case1 ")
|
|
||||||
for i := 0; i < len(ExpressCompany); i++ {
|
for i := 0; i < len(ExpressCompany); i++ {
|
||||||
param.Type = ExpressCompany[i]
|
param.Type = ExpressCompany[i]
|
||||||
fee, err := api.QBiDaAPI.GetExpressPrice(param)
|
fee, err := api.QBiDaAPI.GetExpressPrice(param)
|
||||||
@@ -267,12 +265,10 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return FailCode, err
|
return FailCode, err
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("回调获取order详情", orderWay)
|
|
||||||
userBill, err := dao.GetUserBill(db, orderWay.UserID, "")
|
userBill, err := dao.GetUserBill(db, orderWay.UserID, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return FailCode, err
|
return FailCode, err
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("回调获取user_bill详情", userBill)
|
|
||||||
|
|
||||||
if orderWay.Status == 110 {
|
if orderWay.Status == 110 {
|
||||||
if orderWay.PayMethod == 1 { // 余额支付
|
if orderWay.PayMethod == 1 { // 余额支付
|
||||||
@@ -306,15 +302,12 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if orderWay.PayMethod == 5 { //混合支付
|
if orderWay.PayMethod == 5 { //混合支付
|
||||||
globals.SugarLogger.Debug("回调进入混合支付流程")
|
|
||||||
//余额增加相应金额
|
//余额增加相应金额
|
||||||
globals.SugarLogger.Debug("回调输出订单id", orderWay.OrderID)
|
|
||||||
mixPayInfo, err := dao.GetMixPayDetail(orderWay.OrderID)
|
mixPayInfo, err := dao.GetMixPayDetail(orderWay.OrderID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return FailCode, err
|
return FailCode, err
|
||||||
}
|
}
|
||||||
//userBill.AccountBalance = mixPayInfo.BalancePrice
|
//userBill.AccountBalance = mixPayInfo.BalancePrice
|
||||||
globals.SugarLogger.Debug("回调输出userBill.AccountBalance", userBill.AccountBalance)
|
|
||||||
if err := dao.UpdateUserBill(userBill.UserID, mixPayInfo.BalancePrice); err != nil {
|
if err := dao.UpdateUserBill(userBill.UserID, mixPayInfo.BalancePrice); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@@ -327,10 +320,6 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd
|
|||||||
return FailCode, err
|
return FailCode, err
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.SugarLogger.Debug("回调进入微信退款")
|
|
||||||
globals.SugarLogger.Debug("orderWay==============", orderWay)
|
|
||||||
globals.SugarLogger.Debug("order==============", order)
|
|
||||||
globals.SugarLogger.Debug("order.OtherWayBill==============", order.OtherWayBill)
|
|
||||||
res, err := RefundOrderByTL(ctx, orderWay, order, order.OtherWayBill, int(orderWay.PayPrice*100), "申请退款")
|
res, err := RefundOrderByTL(ctx, orderWay, order, order.OtherWayBill, int(orderWay.PayPrice*100), "申请退款")
|
||||||
if len(res.VendorRefundID) > 0 {
|
if len(res.VendorRefundID) > 0 {
|
||||||
return SuccessCode, err
|
return SuccessCode, err
|
||||||
@@ -435,7 +424,6 @@ func CreateOrder2QBiDa(order *model.UserVendorOrder, orderId string) error {
|
|||||||
// globals.SugarLogger.Debug("Callback Success But Order Status Update Fail ....")
|
// globals.SugarLogger.Debug("Callback Success But Order Status Update Fail ....")
|
||||||
// return errors.New("Callback Success But Order Status Update Fail ")
|
// return errors.New("Callback Success But Order Status Update Fail ")
|
||||||
//}
|
//}
|
||||||
globals.SugarLogger.Debug("我到qbd回调接口了")
|
|
||||||
// 创建QBIDA订单
|
// 创建QBIDA订单
|
||||||
makeOrder := &bida.MakeOrderReq{
|
makeOrder := &bida.MakeOrderReq{
|
||||||
PromiseTimeType: order.PromiseTimeType,
|
PromiseTimeType: order.PromiseTimeType,
|
||||||
@@ -472,9 +460,7 @@ func CreateOrder2QBiDa(order *model.UserVendorOrder, orderId string) error {
|
|||||||
otherId, err := createOtherOrder(makeOrder)
|
otherId, err := createOtherOrder(makeOrder)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
order.ErrorMsg = err.Error()
|
order.ErrorMsg = err.Error()
|
||||||
globals.SugarLogger.Debug("err==========", err)
|
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("otherId==========", otherId)
|
|
||||||
order.OtherWayBill = otherId
|
order.OtherWayBill = otherId
|
||||||
order.OrderStatus = model.OrderStatusWaitPickup
|
order.OrderStatus = model.OrderStatusWaitPickup
|
||||||
order.UpdatedAt = time.Now()
|
order.UpdatedAt = time.Now()
|
||||||
@@ -486,16 +472,12 @@ func CreateOrder2QBiDa(order *model.UserVendorOrder, orderId string) error {
|
|||||||
|
|
||||||
// RefundOrderByTL 发起取消订单
|
// RefundOrderByTL 发起取消订单
|
||||||
func RefundOrderByTL(ctx *jxcontext.Context, orderPay *model.Order, order *model.UserVendorOrder, refundID string, refundFee int, refundDesc string) (orderPayRefund *model.OrderPayRefund, err error) {
|
func RefundOrderByTL(ctx *jxcontext.Context, orderPay *model.Order, order *model.UserVendorOrder, refundID string, refundFee int, refundDesc string) (orderPayRefund *model.OrderPayRefund, err error) {
|
||||||
globals.SugarLogger.Debug("进入取消订单流程")
|
|
||||||
globals.SugarLogger.Debug("进入取消订单流程,输出退款金额", refundFee)
|
|
||||||
result, err := api.TLpayAPI.PayRefund(&tonglianpayapi.PayRefundParam{
|
result, err := api.TLpayAPI.PayRefund(&tonglianpayapi.PayRefundParam{
|
||||||
Trxamt: refundFee / 100,
|
Trxamt: refundFee / 100,
|
||||||
Reqsn: utils.GetUUID(),
|
Reqsn: utils.GetUUID(),
|
||||||
Remark: refundDesc,
|
Remark: refundDesc,
|
||||||
OldTrxID: orderPay.TransactionID,
|
OldTrxID: orderPay.TransactionID,
|
||||||
})
|
})
|
||||||
globals.SugarLogger.Debug("result===============", result)
|
|
||||||
globals.SugarLogger.Debug("errerrerr===============", err)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
orderPayRefund = &model.OrderPayRefund{
|
orderPayRefund = &model.OrderPayRefund{
|
||||||
RefundID: refundID,
|
RefundID: refundID,
|
||||||
|
|||||||
@@ -282,7 +282,6 @@ func (c *EventController) UploadImg() {
|
|||||||
// @router /UploadAudio [post]
|
// @router /UploadAudio [post]
|
||||||
func (c *EventController) UploadAudio() {
|
func (c *EventController) UploadAudio() {
|
||||||
c.callUploadAudio(func(params *tEventUploadAudioParams) (retVal interface{}, errCode string, err error) {
|
c.callUploadAudio(func(params *tEventUploadAudioParams) (retVal interface{}, errCode string, err error) {
|
||||||
globals.SugarLogger.Debug("我进入UploadAudio了")
|
|
||||||
var (
|
var (
|
||||||
timeStr = time.Now().Format("20060102")
|
timeStr = time.Now().Format("20060102")
|
||||||
filePath = audioPath + timeStr
|
filePath = audioPath + timeStr
|
||||||
@@ -308,7 +307,6 @@ func (c *EventController) UploadAudio() {
|
|||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
io.Copy(f, file)
|
io.Copy(f, file)
|
||||||
globals.SugarLogger.Debug("打印一下f========", f, file)
|
|
||||||
//c.SaveToFile("rsmAudio", filePath+fileName)
|
//c.SaveToFile("rsmAudio", filePath+fileName)
|
||||||
return &model.ImMessageRecord{
|
return &model.ImMessageRecord{
|
||||||
//Content: "https://www.jxcs.net/jxdata/cthrgw/dist/audio/" + timeStr + "/" + fileName,
|
//Content: "https://www.jxcs.net/jxdata/cthrgw/dist/audio/" + timeStr + "/" + fileName,
|
||||||
|
|||||||
Reference in New Issue
Block a user