1
This commit is contained in:
@@ -128,26 +128,20 @@ func InitPrint(printer *model.Printer, printParam *model.AddPrinterParam) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印机标号唯一,判断打印机是否存在设置
|
|
||||||
//var setting []*model.PrintSetting
|
|
||||||
//if err := dao.GetRowsTx(txDb, &setting, `SELECT * FROM print_setting WHERE print_no = ?`, []interface{}{printer.PrintNo}...); err != nil {
|
|
||||||
// txDb.Rollback()
|
|
||||||
// return err
|
|
||||||
//}
|
|
||||||
//if len(setting) == 0 {
|
|
||||||
// txDb.Rollback()
|
|
||||||
// return fmt.Errorf("此打印机已经被绑定过了")
|
|
||||||
//}
|
|
||||||
|
|
||||||
// 赋予打印机默认配置
|
// 赋予打印机默认配置
|
||||||
day := time.Now()
|
day := time.Now()
|
||||||
param, err := MarshalJson2String(&model.PrintSetting{
|
param, err := MarshalJson2String(&model.PrintSetting{
|
||||||
CreatedAt: day,
|
CreatedAt: day,
|
||||||
UpdatedAt: day,
|
UpdatedAt: day,
|
||||||
DeletedAt: utils.DefaultTimeValue,
|
DeletedAt: utils.DefaultTimeValue,
|
||||||
PrintNo: printer.PrintNo,
|
PrintNo: printer.PrintNo,
|
||||||
CallNameSetting: 64,
|
CallNameSetting: 64, // 老板
|
||||||
SystemVoice: 1,
|
BusinessOffLineVoice: 1, // 离线开关
|
||||||
|
BalanceNotEnoughVoice: 1, // 余额不足
|
||||||
|
EveryDayGreetVoice: 1, // 问好
|
||||||
|
BusinessPrintNum: 1, // 商户侧打印次数
|
||||||
|
CustomerPrintNum: 1, // 用户侧打印次数
|
||||||
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -181,78 +175,45 @@ func InitPrint(printer *model.Printer, printParam *model.AddPrinterParam) error
|
|||||||
|
|
||||||
// MarshalJson2String 工具类
|
// MarshalJson2String 工具类
|
||||||
func MarshalJson2String(param *model.PrintSetting) (*model.PrintSetting, error) {
|
func MarshalJson2String(param *model.PrintSetting) (*model.PrintSetting, error) {
|
||||||
// 打印机提示语音设置
|
// 语音设置
|
||||||
printVoiceSetting := &model.PrintVoice{
|
voiceSetting := &model.VoiceSettingDetail{
|
||||||
TimeVoice: model.SettingClose,
|
WaitOrderVoice: model.SettingOpen,
|
||||||
PaperShortageVoice: model.SettingOpen,
|
RiderTakeOrderVoice: model.SettingOpen,
|
||||||
DisconnectVoice: model.SettingOpen,
|
ApplyUserOrderCancelVoice: model.SettingOpen,
|
||||||
LoseAuthorization: model.SettingOpen,
|
ApplyRefundOrderVoice: model.SettingOpen,
|
||||||
|
ApplyRefundGoodsVoice: model.SettingOpen,
|
||||||
|
RefundGoodsVoice: model.SettingOpen,
|
||||||
|
ConfirmGoodsVoice: model.SettingOpen,
|
||||||
|
SuccessGoodsVoice: model.SettingOpen,
|
||||||
|
ConsultingPrint: model.SettingOpen,
|
||||||
|
ReminderVoice: model.SettingOpen,
|
||||||
|
CustomerRejectionVoice: model.SettingOpen,
|
||||||
|
CusterRefundVoice: model.SettingOpen,
|
||||||
|
LoseAuthorization: model.SettingOpen,
|
||||||
}
|
}
|
||||||
printVoiceSettingByte, err := json.Marshal(printVoiceSetting)
|
customerVoiceSettingByte, err := json.Marshal(voiceSetting)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
param.PrintVoiceSetting = string(printVoiceSettingByte)
|
param.VoiceSetting = string(customerVoiceSettingByte)
|
||||||
|
|
||||||
// 订单提示设置
|
// 打印设置
|
||||||
orderVoiceSetting := &model.OrderVoice{
|
printSetting := &model.PrintSettingDetail{
|
||||||
PrintOrder: model.SettingOpen,
|
UserOrderCancel: model.SettingOpen,
|
||||||
OrderNotice: model.SettingOpen,
|
RefundOrder: model.SettingOpen,
|
||||||
UserOrderCancel: model.SettingClose,
|
BusinessOrderCancel: model.SettingOpen,
|
||||||
UserOrderCancelVoice: model.SettingOpen,
|
RiderTakeOrder: model.SettingOpen,
|
||||||
RefundOrder: model.SettingOpen,
|
CusterRefundPrint: model.SettingOpen,
|
||||||
RefundOrderVoice: model.SettingOpen,
|
WaitOrderPrint: model.SettingOpen,
|
||||||
BusinessOrderCancel: model.SettingClose,
|
ApplyUserCancelOrder: model.SettingOpen,
|
||||||
BusinessOrderCancelVoice: model.SettingOpen,
|
ApplyUserRefund: model.SettingOpen,
|
||||||
|
OrderCancelSuccess: model.SettingOpen,
|
||||||
}
|
}
|
||||||
orderVoiceSettingByte, err := json.Marshal(orderVoiceSetting)
|
pickingSettingByte, err := json.Marshal(printSetting)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
param.OrderVoiceSetting = string(orderVoiceSettingByte)
|
param.PrintSetting = string(pickingSettingByte)
|
||||||
|
|
||||||
// 送达设置
|
|
||||||
riderVoiceSetting := &model.RiderVoice{
|
|
||||||
RiderTakeOrder: model.SettingOpen,
|
|
||||||
RiderTakeOrderVoice: model.SettingOpen,
|
|
||||||
RiderServiceVoice: model.SettingOpen,
|
|
||||||
RiderReminderVoice: model.SettingOpen,
|
|
||||||
}
|
|
||||||
riderVoiceSettingByte, err := json.Marshal(riderVoiceSetting)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
param.RiderVoiceSetting = string(riderVoiceSettingByte)
|
|
||||||
|
|
||||||
// 客户收货语音设置
|
|
||||||
customerVoiceSetting := &model.CustomerReceivingGoods{
|
|
||||||
CustomerRejectionPrint: model.SettingClose,
|
|
||||||
CustomerRejectionVoice: model.SettingOpen,
|
|
||||||
CustcareRefundPrint: model.SettingClose,
|
|
||||||
CustcareRefundVoice: model.SettingOpen,
|
|
||||||
ConsultingPrint: model.SettingClose,
|
|
||||||
ConsultingVoice: model.SettingClose,
|
|
||||||
}
|
|
||||||
customerVoiceSettingByte, err := json.Marshal(customerVoiceSetting)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
param.CustomerVoiceSetting = string(customerVoiceSettingByte)
|
|
||||||
|
|
||||||
// 拣货设置
|
|
||||||
pickingSetting := &model.ShopPickingVoice{
|
|
||||||
BusinessOffLine: model.SettingClose,
|
|
||||||
BusinessOffLineVoice: model.SettingOpen,
|
|
||||||
WaitOrderPrint: model.SettingClose,
|
|
||||||
WaitOrderVoice: model.SettingOpen,
|
|
||||||
WaitPickingPrint: model.SettingClose,
|
|
||||||
WaitPickingVoice: model.SettingOpen,
|
|
||||||
}
|
|
||||||
pickingSettingByte, err := json.Marshal(pickingSetting)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
param.PickingSetting = string(pickingSettingByte)
|
|
||||||
return param, nil
|
return param, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
31
business/model/print_edition.go
Normal file
31
business/model/print_edition.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
// PrintEdition 版本控制
|
||||||
|
type PrintEdition struct {
|
||||||
|
ID int `orm:"column(id)" json:"id" db:"id"`
|
||||||
|
CreatedAt time.Time `orm:"type(datetime)" json:"created_at" db:"created_at"` // 创建时间
|
||||||
|
UpdatedAt time.Time `orm:"type(datetime)" json:"updated_at" db:"updated_at"` // 更新时间
|
||||||
|
EditionNo string `orm:"type(varchar);size(64)" json:"edition_no" db:"edition_no"` // 版本号
|
||||||
|
EditionMsg string `orm:"type(text)" json:"edition_msg" db:"edition_msg"` // 更新说明
|
||||||
|
IsHotBuild int `orm:"type(tinyint)" json:"is_hot_build" db:"is_hot_build"` // 是否热更新
|
||||||
|
IsForce int `orm:"type(tinyint)" json:"is_force" db:"is_force"` // 是否强制更新
|
||||||
|
APKUrl string `orm:"type(varchar);size(255)" json:"apk_url" db:"apk_url"` // apk下载地址
|
||||||
|
HotUrl string `orm:"type(varchar);size(255)" json:"hot_url" db:"hot_url"` // 热更下载地址
|
||||||
|
}
|
||||||
|
|
||||||
|
type AddOrUpdatePrintEdition struct {
|
||||||
|
Id int `json:"id" form:"id"` // 修改填写
|
||||||
|
CreatedAt time.Time `json:"created_at" form:"created_at"` // 修改填写
|
||||||
|
EditionNo string `json:"edition_no" form:"edition_no" binding:"required"` // 版本号
|
||||||
|
EditionMsg string `json:"edition_msg" form:"edition_msg" binding:"required"` // 更新说明
|
||||||
|
IsHotBuild int `json:"is_hot_build" form:"is_hot_build" binding:"required"` // 是否热更新
|
||||||
|
IsForce int `json:"is_force" form:"is_force" binding:"required" ` // 是否强制更新
|
||||||
|
APKUrl string `json:"apk_url" form:"apk_url" binding:"required"` // apk下载地址
|
||||||
|
HotUrl string `json:"hot_url" form:"hot_url" binding:"required"` // 热更下载地址
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeletePrintEdition struct {
|
||||||
|
Id int `json:"id" form:"id" binding:"required"`
|
||||||
|
}
|
||||||
30
business/model/print_notice.go
Normal file
30
business/model/print_notice.go
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
// PrintNotice 包含广告和通知消息
|
||||||
|
type PrintNotice struct {
|
||||||
|
ID int `orm:"column(id)" json:"id" db:"id"`
|
||||||
|
CreatedAt time.Time `orm:"type(datetime)" json:"created_at" db:"created_at"` // 创建时间
|
||||||
|
UpdatedAt time.Time `orm:"type(datetime)" json:"updated_at" db:"updated_at"` // 更新时间
|
||||||
|
NoticeType int `orm:"type(int)" json:"notice_type" db:"notice_type"` // 类型(1-广告/2-通知)
|
||||||
|
Msg string `orm:"type(varchar);size(255)" json:"msg" db:"msg"` // 内容(广告就是图片,通知消息就是文字)
|
||||||
|
Link string `orm:"type(varchar);size(255)" json:"link" db:"link"` // 跳转地址
|
||||||
|
}
|
||||||
|
|
||||||
|
type AddOrUpdatePrintNotice struct {
|
||||||
|
Id int `json:"id" form:"id"`
|
||||||
|
NoticeType int `json:"notice_type" form:"notice_type" binding:"required"`
|
||||||
|
Msg string `json:"msg" form:"msg" binding:"required"`
|
||||||
|
Link string `json:"link" form:"link" binding:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeletePrintNotice struct {
|
||||||
|
Id int `json:"id" form:"id" binding:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type QueryPrintNotice struct {
|
||||||
|
NoticeType int `json:"notice_type" form:"notice_type" binding:"required"`
|
||||||
|
PageSize int `json:"page_size" form:"page_size" binding:"required"`
|
||||||
|
PageNumber int `json:"page_number" form:"page_number" binding:"required"`
|
||||||
|
}
|
||||||
@@ -7,19 +7,20 @@ import (
|
|||||||
|
|
||||||
// PrintSetting 打印机设置
|
// PrintSetting 打印机设置
|
||||||
type PrintSetting struct {
|
type PrintSetting struct {
|
||||||
ID int `orm:"column(id)" json:"id" db:"id"`
|
ID int `orm:"column(id)" json:"id" db:"id"`
|
||||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||||
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
||||||
DeletedAt time.Time `json:"deleted_at" db:"deleted_at"`
|
DeletedAt time.Time `json:"deleted_at" db:"deleted_at"`
|
||||||
PrintNo string `orm:"type(varchar);size(32)" json:"print_no" db:"print_no"` // 打印机编号
|
PrintNo string `orm:"type(varchar);size(32)" json:"print_no" db:"print_no"` // 打印机编号
|
||||||
CallNameSetting int `orm:"type(int);size(4);default(64)" json:"call_name_setting" db:"call_name_setting"` // 称谓设置 [64-默认老板]
|
CallNameSetting int `orm:"type(int);size(4);default(64)" json:"call_name_setting" db:"call_name_setting"` // 称谓设置 [64-默认老板]
|
||||||
SystemVoice int `orm:"type(tinyint);size(2);default(1)" json:"system_voice" db:"system_voice"` // 平台语音开关[1打开]
|
BusinessOffLineVoice int `orm:"type(tinyint);size(2);default(1)" json:"business_off_line_voice" db:"business_off_line_voice"` // 店铺离线语音[1打开]
|
||||||
|
BalanceNotEnoughVoice int `orm:"type(tinyint);size(2);default(1)" json:"balance_not_enough_voice" db:"balance_not_enough_voice"` // 余额不足语音提示[1打开]
|
||||||
|
EveryDayGreetVoice int `orm:"type(tinyint);size(2);default(1)" json:"every_day_greet_voice" db:"every_day_greet_voice"` // 每日招呼语音[1打开]
|
||||||
|
BusinessPrintNum int `orm:"type(int);size(4);default(1)" json:"business_print_num" db:"business_print_num"` // 商家侧订单打印次数
|
||||||
|
CustomerPrintNum int `orm:"type(int);size(4);default(1)" json:"customer_print_num" json:"customer_print_num"` // 用户侧订单打印次数
|
||||||
|
|
||||||
PrintVoiceSetting string `orm:"type(varchar);size(512)" json:"print_voice_setting" db:"print_voice_setting"` // 打印机提示语音设置
|
VoiceSetting string `orm:"type(varchar);size(1024)" json:"voice_setting" db:"voice_setting"` // 语音设置
|
||||||
OrderVoiceSetting string `orm:"type(varchar);size(512)" json:"order_voice_setting" db:"order_voice_setting"` // 订单提示设置
|
PrintSetting string `orm:"type(varchar);size(1024)" json:"print_setting" db:"print_setting"` // 打印设置
|
||||||
RiderVoiceSetting string `orm:"type(varchar);size(512)" json:"rider_voice_setting" db:"rider_voice_setting"` // 骑手动态提示设置
|
|
||||||
CustomerVoiceSetting string `orm:"type(varchar);size(512)" json:"customer_voice_setting" db:"customer_voice_setting"` // 客户收货提示设置
|
|
||||||
PickingSetting string `orm:"type(varchar);size(512)" json:"picking_setting" db:"picking_setting"` // 拣货语音设置
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *PrintSetting) TableUnique() [][]string {
|
func (v *PrintSetting) TableUnique() [][]string {
|
||||||
@@ -29,117 +30,82 @@ func (v *PrintSetting) TableUnique() [][]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PrintSettingObj struct {
|
type PrintSettingObj struct {
|
||||||
ID int
|
ID int `json:"id" db:"id"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
||||||
DeletedAt time.Time
|
DeletedAt time.Time `json:"deleted_at" db:"deleted_at"`
|
||||||
PrintNo string // 打印机编号
|
PrintNo string `json:"print_no" db:"print_no"` // 打印机编号
|
||||||
CallNameSetting int // 称谓设置 [64-默认老板]
|
CallNameSetting int `json:"call_name_setting" db:"call_name_setting"` // 称谓设置 [64-默认老板]
|
||||||
SystemVoice int // 平台语音开关[1打开]
|
BusinessOffLineVoice int `json:"business_off_line_voice" db:"business_off_line_voice"` // 店铺离线语音[1打开]
|
||||||
PrintVoiceSetting *PrintVoice // 打印机提示语音设置
|
BalanceNotEnoughVoice int `json:"balance_not_enough_voice" db:"balance_not_enough_voice"` // 余额不足语音提示[1打开]
|
||||||
OrderVoiceSetting *OrderVoice // 订单提示设置
|
EveryDayGreetVoice int `json:"every_day_greet_voice" db:"every_day_greet_voice"` // 每日招呼语音[1打开]
|
||||||
RiderVoiceSetting *RiderVoice // 骑手动态提示设置
|
BusinessPrintNum int `json:"business_print_num" db:"business_print_num"` // 商家侧订单打印次数
|
||||||
CustomerVoiceSetting *CustomerReceivingGoods // 客户收货提示设置
|
CustomerPrintNum int `json:"customer_print_num" json:"customer_print_num"` // 用户侧订单打印次数
|
||||||
PickingSetting *ShopPickingVoice // 拣货语音设置
|
|
||||||
|
VoiceSetting *VoiceSettingDetail `json:"voice_setting" db:"voice_setting"` // 语音设置
|
||||||
|
PrintSetting *PrintSettingDetail `json:"print_setting" db:"print_setting"` // 打印设置
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrintVoice 打印机提示语音设置
|
// VoiceSettingDetail 语音设置
|
||||||
type PrintVoice struct {
|
type VoiceSettingDetail struct {
|
||||||
TimeVoice int `json:"time_voice"` // 平台语音开关[1打开]
|
WaitOrderVoice int `json:"wait_order_voice"` // 待接单语音[1打开]
|
||||||
PaperShortageVoice int `json:"paper_shortage_voice"` // 缺纸语音开关[1打开]
|
RiderTakeOrderVoice int `json:"rider_take_order_voice"` // 骑手接单语音[1打开]
|
||||||
DisconnectVoice int `json:"disconnect_voice"` // 打印机断开连接提示[1打开]
|
ApplyUserOrderCancelVoice int `json:"apply_user_order_cancel_voice"` // 用户申请取消订单语音提示[1打开]
|
||||||
LoseAuthorization int `json:"lose_authorization"` // 失去授权语音提示[1打开]
|
ApplyRefundOrderVoice int `json:"apply_refund_order_voice"` // 用户申请退款提示语音[1打开]
|
||||||
|
ApplyRefundGoodsVoice int `json:"apply_refund_goods_voice"` // 用户申请退货提示语音[1打开]
|
||||||
|
RefundGoodsVoice int `json:"refund_goods_voice"` // 订单已经取消语音[1打开]
|
||||||
|
ConfirmGoodsVoice int `json:"confirm_goods_voice"` // 确认接单语音[1打开]
|
||||||
|
SuccessGoodsVoice int `json:"success_goods_voice"` // 订单完成语音[1打开]
|
||||||
|
ConsultingPrint int `json:"consulting_print"` // 客户进店咨询打印[1打开]
|
||||||
|
ReminderVoice int `json:"reminder_voice"` // 客户催单语音[1打开]
|
||||||
|
CustomerRejectionVoice int `json:"customer_rejection_voice"` // 客户拒收语音[1打开]
|
||||||
|
CusterRefundVoice int `json:"custer_refund_voice"` // 客服(平台)退款语音[1打开]
|
||||||
|
LoseAuthorization int `json:"lose_authorization"` // 失去授权语音提示[1打开]
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderVoice 订单提示设置
|
// PrintSettingDetail 打印设置
|
||||||
type OrderVoice struct {
|
type PrintSettingDetail struct {
|
||||||
PrintOrder int `json:"print_order"` // 打印订单[1打开]必须
|
UserOrderCancel int `json:"user_order_cancel"` // 用户取消订单打印[1打开]
|
||||||
OrderNotice int `json:"order_notice"` // 订单通知[1打开]必须
|
RefundOrder int `json:"refund_order"` // 订单退款打印[1打开]
|
||||||
UserOrderCancel int `json:"user_order_cancel"` // 用户取消订单打印[1打开]
|
BusinessOrderCancel int `json:"business_order_cancel"` // 商家取消打印[1打开]
|
||||||
UserOrderCancelVoice int `json:"user_order_cancel_voice"` // 用户取消订单订单语音提示[1打开]
|
RiderTakeOrder int `json:"rider_take_order"` // 骑手接单打印[1打开]
|
||||||
RefundOrder int `json:"refund_order"` // 退款打印[1打开]
|
CusterRefundPrint int `json:"custer_refund_print"` // 客服退款打印[1打开]
|
||||||
RefundOrderVoice int `json:"refund_order_voice"` // 退款提示语音[1打开]
|
|
||||||
BusinessOrderCancel int `json:"business_order_cancel"` // 取消订单[1打开]
|
|
||||||
BusinessOrderCancelVoice int `json:"business_order_cancel_voice"` // 取消订单语音提示[1打开]
|
|
||||||
}
|
|
||||||
|
|
||||||
// RiderVoice 骑手动态语音提示
|
|
||||||
type RiderVoice struct {
|
|
||||||
RiderTakeOrder int `json:"rider_take_order"` // 骑手接单打印[1打开]
|
|
||||||
RiderTakeOrderVoice int `json:"rider_take_order_voice"` // 骑手接单语音[1打开]
|
|
||||||
RiderServiceVoice int `json:"rider_service_voice"` // 骑手送达语音[1打开]
|
|
||||||
RiderReminderVoice int `json:"rider_reminder_voice"` // 骑手催单语音[1打开]
|
|
||||||
}
|
|
||||||
|
|
||||||
// CustomerReceivingGoods 客户收货语音提示
|
|
||||||
type CustomerReceivingGoods struct {
|
|
||||||
CustomerRejectionPrint int `json:"customer_rejection_print"` // 客户拒收打印[1打开]
|
|
||||||
CustomerRejectionVoice int `json:"customer_rejection_voice"` // 客户拒收语音[1打开]
|
|
||||||
CustcareRefundPrint int `json:"custcare_refund_print"` // 客服退款打印[1打开]
|
|
||||||
CustcareRefundVoice int `json:"custcare_refund_voice"` // 客服退款语音[1打开]
|
|
||||||
ConsultingPrint int `json:"consulting_print"` // 进店咨询打印[1打开]
|
|
||||||
ConsultingVoice int `json:"consulting_voice"` // 进店咨询语音[1打开]
|
|
||||||
}
|
|
||||||
|
|
||||||
// ShopPickingVoice 店铺拣货语音提示
|
|
||||||
type ShopPickingVoice struct {
|
|
||||||
BusinessOffLine int `json:"business_off_line"` // 店铺离线打印[1打开]
|
|
||||||
BusinessOffLineVoice int `json:"business_off_line_voice"` // 店铺离线语音[1打开]
|
|
||||||
WaitOrderPrint int `json:"wait_order_print"` // 待接单打印[1打开]
|
WaitOrderPrint int `json:"wait_order_print"` // 待接单打印[1打开]
|
||||||
WaitOrderVoice int `json:"wait_order_voice"` // 待接单语音[1打开]
|
ApplyUserCancelOrder int `json:"apply_user_cancel_order"` // 用户申请取消订单打印[1打开]
|
||||||
WaitPickingPrint int `json:"wait_picking_print"` // 待拣货单打印[1打开]
|
ApplyUserRefund int `json:"apply_user_refund"` // 申请部分退款打印[1打开]
|
||||||
WaitPickingVoice int `json:"wait_picking_voice"` // 待拣货语音[1打开]
|
OrderCancelSuccess int `json:"order_cancel_success"` // 取消成功打印[1打开]
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnMarshalString2Json 将字符串设置转换为对象设置
|
// UnMarshalString2Json 将字符串设置转换为对象设置
|
||||||
func UnMarshalString2Json(param *PrintSetting) (*PrintSettingObj, error) {
|
func UnMarshalString2Json(param *PrintSetting) (*PrintSettingObj, error) {
|
||||||
var (
|
var (
|
||||||
printVoiceSetting = &PrintVoice{}
|
printSetting = &PrintSettingDetail{}
|
||||||
orderVoiceSetting = &OrderVoice{}
|
voiceSetting = &VoiceSettingDetail{}
|
||||||
riderVoiceSetting = &RiderVoice{}
|
|
||||||
customerVoiceSetting = &CustomerReceivingGoods{}
|
|
||||||
pickingSetting = &ShopPickingVoice{}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
result := &PrintSettingObj{
|
result := &PrintSettingObj{
|
||||||
ID: param.ID,
|
ID: param.ID,
|
||||||
CreatedAt: param.CreatedAt,
|
CreatedAt: param.CreatedAt,
|
||||||
UpdatedAt: param.UpdatedAt,
|
UpdatedAt: param.UpdatedAt,
|
||||||
DeletedAt: param.DeletedAt,
|
DeletedAt: param.DeletedAt,
|
||||||
PrintNo: param.PrintNo,
|
PrintNo: param.PrintNo,
|
||||||
CallNameSetting: param.CallNameSetting,
|
CallNameSetting: param.CallNameSetting,
|
||||||
SystemVoice: param.SystemVoice,
|
BusinessOffLineVoice: param.BusinessOffLineVoice,
|
||||||
PrintVoiceSetting: nil,
|
BalanceNotEnoughVoice: param.BalanceNotEnoughVoice,
|
||||||
OrderVoiceSetting: nil,
|
EveryDayGreetVoice: param.EveryDayGreetVoice,
|
||||||
RiderVoiceSetting: nil,
|
BusinessPrintNum: param.BusinessPrintNum,
|
||||||
CustomerVoiceSetting: nil,
|
CustomerPrintNum: param.CustomerPrintNum,
|
||||||
PickingSetting: nil,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(param.PrintVoiceSetting), &printVoiceSetting); err != nil {
|
if err := json.Unmarshal([]byte(param.VoiceSetting), voiceSetting); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
result.PrintVoiceSetting = printVoiceSetting
|
result.VoiceSetting = voiceSetting
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(param.OrderVoiceSetting), &orderVoiceSetting); err != nil {
|
if err := json.Unmarshal([]byte(param.PrintSetting), printSetting); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
result.OrderVoiceSetting = orderVoiceSetting
|
result.PrintSetting = printSetting
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(param.RiderVoiceSetting), &riderVoiceSetting); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
result.RiderVoiceSetting = riderVoiceSetting
|
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(param.CustomerVoiceSetting), &customerVoiceSetting); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
result.CustomerVoiceSetting = customerVoiceSetting
|
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(param.PickingSetting), &pickingSetting); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
result.PickingSetting = pickingSetting
|
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ func Init() {
|
|||||||
orm.RegisterModel(&model.PrintBillRecord{})
|
orm.RegisterModel(&model.PrintBillRecord{})
|
||||||
orm.RegisterModel(&model.PrintBindStore{})
|
orm.RegisterModel(&model.PrintBindStore{})
|
||||||
orm.RegisterModel(&model.PrintActivation{})
|
orm.RegisterModel(&model.PrintActivation{})
|
||||||
|
orm.RegisterModel(&model.PrintEdition{})
|
||||||
|
orm.RegisterModel(&model.PrintNotice{})
|
||||||
// create table
|
// create table
|
||||||
orm.RunSyncdb("default", false, true)
|
orm.RunSyncdb("default", false, true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user