Explorar el Código

Merge branch 'dev1.4' into master

liumiaomiao hace 3 años
padre
commit
5f875adc35
Se han modificado 5 ficheros con 42 adiciones y 180 borrados
  1. 2 0
      README.md
  2. 1 0
      invoice/src/config.json
  3. 0 142
      invoice/src/entity/Invoice.go
  4. 5 5
      invoice/src/main.go
  5. 34 33
      invoice/src/service/InvoiceService.go

+ 2 - 0
README.md

@@ -0,0 +1,2 @@
+v1.4
+开发票手机号为必填项

+ 1 - 0
invoice/src/config.json

@@ -7,6 +7,7 @@
     "SMTPPort" : 465,
     "SuccessCode": "0000",
     "LineUpCode": "1089",
+    "WaitCode": "20",
     "SealCode":"4002",
     "TimingCron":"0/10 * * * * ?",
     "OpenTimingCron":"0/30 * * * * ?",

+ 0 - 142
invoice/src/entity/Invoice.go

@@ -1,142 +0,0 @@
-package entity
-
-type Invoice struct {
-	Numb              int       `json:"numb"`              //次数
-	OrderCode string  `json:"orderCode"` //订单编号
-	ResType           string    `json:"resType"`           //
-	IsRed             string    `json:"isRed"`             //
-	Model             string    `json:"model"`             //
-	Changed           string    `json:"changed"`           //类型0开票1换开
-	Swno              string    `json:"swno"`              //流水号
-	SaleTax           string    `json:"saleTax"`           //销方税号
-	Store             string    `json:"store"`             //门店
-	CustName          string    `json:"custName"`          //购方名称
-	CustTaxNo         string    `json:"custTaxNo"`         //购方税号
-	CustAddr          string    `json:"custAddr"`          //购方地址
-	CustTelephone     string    `json:"custTelephone"`     //购货方手机号
-	CustPhone         string    `json:"custPhone"`         //购方固定电话
-	CustEmail         string    `json:"custEmail"`         //购方邮箱
-	CustBankAccount   string    `json:"custBankAccount"`   //开户行+账号
-	CustType          string    `json:"custType"`          //购货方企业类型01:企业02:机关执业单位03:个人04:其他
-	InvoMemo          string    `json:"invoMemo"`          //备注
-	InvType           string    `json:"invType"`           //发票类型 专用票(0)、普通票(2)、电子票(3)目前字段只能为3
-	BillDate          string    `json:"billDate"`          //单据日期
-	Thdh              string    `json:"thdh"`              //退货单号
-	BillType          string    `json:"billType"`          //开票类型1:正票2:红票
-	OilIdentification string    `json:"oilIdentification"` //成品油标识0:代表普通电子发票,1:代表成品油电子发票
-	SpecialRedFlag    string    `json:"specialRedFlag"`    //特殊冲红标志0:正常冲红(电子发票)1:特殊冲红(冲红纸质等)
-	OperationCode     string    `json:"operationCode"`     //操作代码10:正票正常开具11:正票错票重开20:退货折让红票21:错票重开红票22:换票冲红(全冲红电子发票,开具纸质发票)
-	Verified          string    `json:"verified"`          //是否加密校验0-不进行加密校验1-进行加密校验
-	SecretKey         string    `json:"secretKey"`         //校验码Verified为1时,必选填此项生成规则:base64[md5(销方税号|流水号|私钥|总金额)
-	Kpy               string    `json:"kpy"`               //开票员
-	Sky               string    `json:"sky"`               //收款员
-	Fhr               string    `json:"fhr"`               //复核人
-	Yfpdm             string    `json:"yfpdm"`             //原发票代码
-	Yfphm             string    `json:"yfphm"`             //原发票号码
-	Chyy              string    `json:"chyy"`              //冲红原因
-	Spare1            string    `json:"spare1"`            //备用1
-	Spare2            string    `json:"spare2"`            //备用2
-	Spare3            string    `json:"spare3"`            //备用3
-	Spare4            string    `json:"spare4"`            //备用4
-	Spare5            string    `json:"spare5"`            //备用5
-	Orders            []*Orders `json:"orders"`
-}
-type Orders struct {
-	BillNo string   `json:"billNo"` //订单号
-	Items  []*Items `json:"items"`
-}
-type Items struct {
-	Name        string `json:"name"`        //商品名称
-	Code        string `json:"code"`        //商品编号(税收分类编码)
-	LineType    string `json:"lineType"`    //发票行性质 0:正常行1:折扣行2:被折扣行
-	Spec        string `json:"spec"`        //规格型号
-	Unit        string `json:"unit"`        //计量单位
-	TaxRate     string `json:"taxRate"`     //税率
-	Quantity    string `json:"quantity"`    //数量
-	TaxPrice    string `json:"taxPrice"`    //单价
-	TotalAmount string `json:"totalAmount"` //含税金额
-	Yhzcnr      string `json:"yhzcnr"`      //税收优惠政策标志
-	Yhzcbs      string `json:"yhzcbs"`      //享受税收优惠政策内容
-	Lslbs       string `json:"lslbs"`       //零税率标识
-	Zxbm        string `json:"zxbm"`        //自行编码
-	Kce         string `json:"kce"`         //扣除额
-	ItemSpare1  string `json:"itemSpare1"`  //明细备用1
-	ItemSpare2  string `json:"itemSpare2"`  //明细备用2
-	ItemSpare3  string `json:"itemSpare3"`  //明细备用3
-	ItemSpare4  string `json:"itemSpare4"`  //明细备用4
-	ItemSpare5  string `json:"itemSpare5"`  //明细备用5
-}
-
-type GetInvoice struct {
-	FpMsgs    []*FpMsgs `json:"fpMsgs"`    //明细备用5
-	ReturnMsg ReturnMsg `json:"returnMsg"` //明细备用5
-	Swno      string    `json:"Swno"`      //流水号
-}
-type FpMsgs struct {
-	Fpdm       string `json:"fpdm"`       //发票代码
-	Fphm       string `json:"fphm"`       //发票号码
-	Hjbhsje    string `json:"hjbhsje"`    //合计不含税金额
-	Kphjse     string `json:"kphjse"`     //开票合计税额
-	Kprq       string `json:"kprq"`       //开票日期
-	PdfContent string `json:"pdfContent"` //pdf文件
-	Pdf_url    string `json:"pdf_url"`    //pdf下载地址
-	PdfMd5     string `json:"pdfMd5"`     //Md5码
-}
-type ReturnMsg struct {
-	Msg     string `json:"msg"`     //返回值
-	MsgCode string `json:"msgCode"` //返回代码
-}
-type RedSubmitJson struct {
-	Fpdm string `json:"fpdm"` //发票代码
-	Fphm string `json:"fphm"` //发票号码
-	OrderCode string  `json:"orderCode"` //订单编号
-}
-
-// MailboxConf 邮箱配置
-type MailboxConf struct {
-	// 邮件标题
-	Title string
-	// 邮件内容
-	Body string
-	// 收件人列表
-	RecipientList []string
-	// 发件人账号
-	Sender string
-	// 发件人密码,QQ邮箱这里配置授权码
-	SPassword string
-	// SMTP 服务器地址, QQ邮箱是smtp.qq.com
-	SMTPAddr string
-	// SMTP端口 QQ邮箱是25
-	SMTPPort int
-}
-
-var SuccessCode string
-var LineUpCode string
-var TimingCron string
-var OpenTimingCron string
-
-var Url string
-var SealCode string
-var PdfUrl string
-
-var Title string
-var Body string
-var Sender string
-var SPassword string
-var SMTPAddr string
-var SMTPPort int
-
-var SaleTax string
-var InvType string
-var BillType string
-var SpecialRedFlag string
-var OperationCode string
-var Verified string
-var Kpr string
-var JyUrl string
-var Frequency int
-var OpenFrequency int
-var WarningEmail string
-var Fhr string
-var Sky string
-var WarningTime int64

+ 5 - 5
invoice/src/main.go

@@ -49,9 +49,9 @@ func Init() {
 	entity.LineUpCode = fmt.Sprint(Config["LineUpCode"])
 	entity.TimingCron = fmt.Sprint(Config["TimingCron"])
 	entity.OpenTimingCron = fmt.Sprint(Config["OpenTimingCron"])
-
 	entity.Url = fmt.Sprint(Config["Url"])
 	entity.SealCode = fmt.Sprint(Config["SealCode"])
+	entity.WaitCode = fmt.Sprint(Config["WaitCode"])
 	entity.PdfUrl = fmt.Sprint(Config["PdfUrl"])
 	entity.SaleTax = fmt.Sprint(Config["SaleTax"])
 	entity.InvType = fmt.Sprint(Config["InvType"])
@@ -64,15 +64,15 @@ func Init() {
 	entity.Frequency = utils.SafeConvert2Int(Config["Frequency"])
 	entity.OpenFrequency = utils.SafeConvert2Int(Config["OpenFrequency"])
 	entity.WarningEmail = fmt.Sprint(Config["WarningEmail"])
-	entity.Fhr=fmt.Sprint(Config["Fhr"])
-	entity.Sky=fmt.Sprint(Config["Sky"])
+	entity.Fhr = fmt.Sprint(Config["Fhr"])
+	entity.Sky = fmt.Sprint(Config["Sky"])
 	keys := redis.GetKeys(core.GetConfiguration().Redis.Modules, "fp_*")
 	invoiceService := service.InvoiceService{}
 	for numb, _ := range keys {
 		valueInface := redis.Get(core.GetConfiguration().Redis.Modules, string(keys[numb].([]byte)))
 		_rdsVal := valueInface.(map[string]interface{})
 		isfeedback, _ := strconv.Atoi(fmt.Sprint(_rdsVal["isfeedback"]))
-		invoiceService.Timer(_rdsVal["swno"].(string), _rdsVal["saleTax"].(string), fmt.Sprint(_rdsVal["isRed"]), isfeedback, _rdsVal["changed"].(string), fmt.Sprint(_rdsVal["resType"]),fmt.Sprint(_rdsVal["orderCode"]))
+		invoiceService.Timer(_rdsVal["swno"].(string), _rdsVal["saleTax"].(string), fmt.Sprint(_rdsVal["isRed"]), isfeedback, _rdsVal["changed"].(string), fmt.Sprint(_rdsVal["resType"]), fmt.Sprint(_rdsVal["orderCode"]))
 	}
 
 	keyss := redis.GetKeys(core.GetConfiguration().Redis.Modules, "xx_*")
@@ -83,7 +83,7 @@ func Init() {
 		swnoMap := valueInface.(map[string]interface{})
 
 		mapstructure.Decode(valueInface, &invoice)
-		if swnoMap["model"]=="0" || swnoMap["model"]=="3"  {
+		if swnoMap["model"] == "0" || swnoMap["model"] == "3" {
 			orderarr := swnoMap["orders"].([]interface{})
 			var orderlist []*entity.Orders
 			for _, value := range orderarr {

+ 34 - 33
invoice/src/service/InvoiceService.go

@@ -34,6 +34,7 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
 	if isLoop == 0 {
 		solgan.Swno = strings.Replace(fmt.Sprintln(solgan.Swno+fmt.Sprintf("%06v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(1000000))), "\n", "", -1)
 	}
+	solgan.CustTelephone = solgan.Phone
 	solgan.SaleTax = entity.SaleTax
 	solgan.InvType = entity.InvType
 	solgan.BillType = entity.BillType
@@ -57,7 +58,7 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
 	//var err error
 	//err = nil
 	//正常
-	if (err != nil) {
+	if err != nil {
 		//if (err == nil) {
 		util.Loger.Println("开票服有问题", err)
 		if isLoop == 0 {
@@ -90,7 +91,7 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
 	util.Loger.Println("流水号:", solgan.Swno, "开具发票:结果", data)
 	//开票正常时
 	//data["returnCode"] = entity.LineUpCode
-	if (data["returnCode"] == entity.LineUpCode || data["returnCode"] == entity.SealCode || data["returnCode"] == entity.SuccessCode) {
+	if data["returnCode"] == entity.LineUpCode || data["returnCode"] == entity.SealCode || data["returnCode"] == entity.SuccessCode || data["returnCode"] == entity.WaitCode {
 		pdfData, code, msg := u.InvoiceDownload(solgan.Swno, solgan.SaleTax, isRed, 0, 0, solgan.Changed, resType, solgan.OrderCode)
 		data1 := make(map[string]interface{})
 		data1["fpdm"] = pdfData["fpdm"]
@@ -128,7 +129,7 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
 	//err = nil
 	//正常
 	//if (err != nil) {
-	if (err != nil) {
+	if err != nil {
 		data1 := make(map[string]interface{})
 		data1["fpdm"] = ""
 		data1["fphm"] = ""
@@ -169,9 +170,9 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
 	//dat.ReturnMsg.MsgCode = "1000"
 	util.Loger.Println("发票下载:", "流水号:", swno, "结果:", dat)
 	//dat.ReturnMsg.MsgCode = entity.LineUpCode
-	if (dat.ReturnMsg.MsgCode == entity.SuccessCode) {
+	if dat.ReturnMsg.MsgCode == entity.SuccessCode {
 		var swno1 string
-		if (isRed == "true") {
+		if isRed == "true" {
 			swno1 = swno[4:len(swno)]
 		} else {
 			swno1 = swno
@@ -187,7 +188,7 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
 		pdfData["fphm"] = "Fphm"*/
 		pdfData["swno"] = swno
 		return pdfData, 0, dat.ReturnMsg.Msg
-	} else if (dat.ReturnMsg.MsgCode == entity.LineUpCode || dat.ReturnMsg.MsgCode == entity.SealCode) {
+	} else if dat.ReturnMsg.MsgCode == entity.LineUpCode || dat.ReturnMsg.MsgCode == entity.SealCode || dat.ReturnMsg.MsgCode == entity.WaitCode {
 		if isLoop == 0 {
 			u.Timer(swno, saleTax, isRed, isfeedback, changed, resType, orderCode)
 		}
@@ -203,7 +204,7 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
 //noinspection ALL
 func (u *InvoiceService) InvoiceSee(swno string, saleTax string, model string) (int, interface{}, string) {
 	var swno1 string
-	if (model == "true") {
+	if model == "true" {
 		swno1 = "RED_" + swno
 	} else {
 		swno1 = swno
@@ -227,7 +228,7 @@ func (u *InvoiceService) InvoiceSee(swno string, saleTax string, model string) (
 func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string, orderCode string, resType string, changed string, isLoop int, solgan *entity.Invoice) (string, int, interface{}) {
 	url := entity.Url + "?redSubmitEInvoiceInfo"
 	model := "1"
-	if (changed == "1") {
+	if changed == "1" {
 		model = "2"
 	}
 	song := make(map[string]interface{})
@@ -248,7 +249,7 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string, orderCode st
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
 	client := http.Client{}
 	resp, err := client.Do(request)
-	if (err != nil) {
+	if err != nil {
 		data1 := make(map[string]interface{})
 		data1["fpdm"] = ""
 		data1["fphm"] = ""
@@ -259,7 +260,7 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string, orderCode st
 			util.SendPdf(arr, true, solgan.Swno, "发票退票时服务出现问题")
 			u.OpeningTimer(solgan)
 		}
-		if (model == "2") {
+		if model == "2" {
 			return "剑鱼标讯订开票服务预警", 3, data1
 		} else {
 			return "剑鱼标讯订开票服务预警", 2, data1
@@ -273,9 +274,9 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string, orderCode st
 	}
 	util.Loger.Println("冲红:", "发票单号:", fpdm, "发票号码:", fphm, "结果:", data)
 	//data["returnCode"] = entity.LineUpCode
-	if (data["returnCode"] == entity.LineUpCode || data["returnCode"] == entity.SealCode || data["returnCode"] == entity.SuccessCode) {
+	if data["returnCode"] == entity.LineUpCode || data["returnCode"] == entity.SealCode || data["returnCode"] == entity.SuccessCode || data["returnCode"] == entity.WaitCode {
 		pdfData, code, msg := u.InvoiceDownload(data["redSwno"].(string), data["saleTax"].(string), "true", int(0), int(0), changed, resType, orderCode)
-		if (fmt.Sprint(code) == "0") {
+		if fmt.Sprint(code) == "0" {
 			data1 := map[string]interface{}{
 				"fpdm": pdfData["fpdm"],
 				"fphm": pdfData["fphm"],
@@ -292,7 +293,7 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string, orderCode st
 			}
 			return msg, code, data1
 		}
-	} else if (data["returnCode"] == "3002") {
+	} else if data["returnCode"] == "3002" {
 		return "已经冲红", 4, data
 	} else {
 		return fmt.Sprintln(data["returnMsg"]), 1, data
@@ -306,10 +307,10 @@ func (u *InvoiceService) InvoiceReplace(solgan *entity.Invoice, resType string)
 	solgan.OrderCode = solgan.Swno
 	msg, code1, dataMap := invoiceService.InvoiceRedSubmit(solgan.Yfpdm, solgan.Yfphm, solgan.Swno, resType, solgan.Changed, 0, solgan)
 	util.Loger.Println("换票:", "发票单号:", solgan.Yfpdm, "发票号码:", solgan.Yfphm)
-	if (code1 == 1) {
+	if code1 == 1 {
 		return msg, code1, dataMap
 	}
-	if (code1 == 3) {
+	if code1 == 3 {
 		return msg, 2, dataMap
 	}
 	solgan.Yfphm = ""
@@ -318,7 +319,7 @@ func (u *InvoiceService) InvoiceReplace(solgan *entity.Invoice, resType string)
 	msg, code, datamap := u.InvoiceAdd(solgan, resType, 0, "false")
 	_rdsVal := datamap.(map[string]interface{})
 	_dataMap := dataMap.(map[string]interface{})
-	if (code1 == 4) {
+	if code1 == 4 {
 		_rdsVal["chcode"] = 0
 		_rdsVal["isch"] = true
 	} else {
@@ -329,7 +330,7 @@ func (u *InvoiceService) InvoiceReplace(solgan *entity.Invoice, resType string)
 		_rdsVal["chswno"] = _dataMap["swno"]
 		_rdsVal["chpath"] = _dataMap["path"]
 	}
-	if (code1 == 3) {
+	if code1 == 3 {
 		code = 2
 	}
 	return msg, code, _rdsVal
@@ -340,7 +341,7 @@ func (u *InvoiceService) InvoiceReplace(solgan *entity.Invoice, resType string)
 func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeedback int, changed string, resType string, orderCode string) {
 	util.Loger.Print("定时任务重启", swno, saleTax, isRed, isfeedback, changed, resType)
 	valueInface := redis.Get(core.GetConfiguration().Redis.Modules, "fp_"+swno)
-	if (valueInface == nil) {
+	if valueInface == nil {
 		swnoMap := make(map[string]interface{}, 0)
 		swnoMap["swno"] = swno
 		swnoMap["saleTax"] = saleTax
@@ -360,7 +361,7 @@ func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeed
 		util.Loger.Println("定时任务开始:", "流水号:", swno)
 		valueInface := redis.Get(core.GetConfiguration().Redis.Modules, "fp_"+swno)
 		swnoMap := make(map[string]interface{}, 0)
-		if (valueInface == nil) {
+		if valueInface == nil {
 			swnoMap["swno"] = swno
 			swnoMap["saleTax"] = saleTax
 			swnoMap["isfeedback"] = isfeedback
@@ -400,14 +401,14 @@ func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeed
 		}
 		pdfData, code, _ := u.InvoiceDownload(swno, saleTax, isRed, 1, 0, changed, resType, orderCode)
 		fmt.Println(pdfData)
-		if (code == 0) {
+		if code == 0 {
 			util.Loger.Println("定时开票成功:", "流水号:", swno)
-			if (isfeedback == 0) {
+			if isfeedback == 0 {
 				//修改发票中状态
 				dat := util.Callback(swno, saleTax, pdfData["fpdm"].(string), pdfData["fphm"].(string), pdfData["path"].(string), changed, isRed, resType, "", "3", orderCode)
 				util.Loger.Println("下载成功更改发票结果:", "流水号:", swno, dat)
-				util.Loger.Println("下载成功定时任务结束:", "流水号:", swno, )
-				if (dat) {
+				util.Loger.Println("下载成功定时任务结束:", "流水号:", swno)
+				if dat {
 					redis.Del(core.GetConfiguration().Redis.Modules, "fp_"+swno)
 					util.Loger.Println("删除:", "流水号:", "fp_"+swno)
 					c.Stop()
@@ -416,7 +417,7 @@ func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeed
 				redis.Del(core.GetConfiguration().Redis.Modules, "fp_"+swno)
 				c.Stop()
 			}
-		} else if (code == 1) {
+		} else if code == 1 {
 			redis.Del(core.GetConfiguration().Redis.Modules, "fp_"+swno)
 			fmt.Println("")
 			util.Callback(swno, saleTax, "", "", "", changed, isRed, resType, "true", "", orderCode)
@@ -432,7 +433,7 @@ func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeed
 func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 	util.Loger.Println("发票开具服务有问题")
 	valueInface := redis.Get(core.GetConfiguration().Redis.Modules, "xx_"+solgan.Swno)
-	if (valueInface == nil) {
+	if valueInface == nil {
 		solgan.Numb = 0
 		if solgan.Model == "1" || solgan.Model == "2" {
 			redis.PutKV("xx_"+solgan.Yfphm, solgan)
@@ -453,7 +454,7 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 			swno = solgan.Swno
 		}
 		valueInface := redis.Get(core.GetConfiguration().Redis.Modules, "xx_"+swno)
-		if (valueInface == nil) {
+		if valueInface == nil {
 			solgan.Numb = 0
 			if solgan.Model == "1" || solgan.Model == "2" {
 				redis.PutKV("xx_"+solgan.Yfphm, solgan)
@@ -473,7 +474,7 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 				numb++
 				solgan.Numb = numb
 				redis.PutKV("xx_"+swno, solgan)
-			} else if (numb == entity.OpenFrequency) {
+			} else if numb == entity.OpenFrequency {
 				fmt.Println(numb)
 				util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true", solgan.Model, solgan.OrderCode)
 				if solgan.Model == "1" || solgan.Model == "2" {
@@ -502,7 +503,7 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 		//重新开具
 		case "0":
 			_, code, _ := u.InvoiceAdd(solgan, solgan.ResType, 1, "false")
-			if (code == 0) {
+			if code == 0 {
 				//_rdsVal := datamap.(map[string]interface{})
 				//util.Callback(solgan.Swno, solgan.SaleTax, "", "", _rdsVal["path"].(string), solgan.Changed, "false", solgan.ResType, "true")
 				util.Loger.Println("删除:", "流水号:", "xx_"+solgan.Swno)
@@ -513,7 +514,7 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 			//单独冲红失败
 		case "1":
 			_, code, _ := u.InvoiceRedSubmit(solgan.Yfpdm, solgan.Yfphm, solgan.OrderCode, solgan.ResType, solgan.Changed, 1, solgan)
-			if (code == 0) {
+			if code == 0 {
 				//_rdsVal := datamap.(map[string]interface{})
 				//util.Callback(solgan.Swno, solgan.SaleTax, datamap, "", _rdsVal["path"].(string), solgan.Changed, "false", solgan.ResType, "true")
 				util.Loger.Println("删除:", "发票号码:", "xx_"+solgan.Yfphm)
@@ -525,9 +526,9 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 		case "2":
 			_, code, _ := u.InvoiceRedSubmit(solgan.Yfpdm, solgan.Yfphm, solgan.OrderCode, solgan.ResType, solgan.Changed, 1, solgan)
 			fmt.Println("code", code)
-			if (code == 2 || code == 0) {
+			if code == 2 || code == 0 {
 				solgan.Model = "0"
-				if (code == 0) {
+				if code == 0 {
 					u.OpeningTimer(solgan)
 				}
 				//_rdsVal := datamap.(map[string]interface{})
@@ -539,14 +540,14 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 			}
 		case "3":
 			_, code, _ := u.InvoiceDownload(solgan.Swno, solgan.SaleTax, solgan.IsRed, 1, 0, solgan.Changed, solgan.ResType, solgan.OrderCode)
-			if (code == 0) {
+			if code == 0 {
 				//_rdsVal := datamap.(map[string]interface{})
 				//util.Callback(solgan.Swno, solgan.SaleTax, datamap, "", _rdsVal["path"].(string), solgan.Changed, "false", solgan.ResType, "true")
 				util.Loger.Println("删除:", "流水号:", "xx_"+solgan.Swno)
 				redis.Del(core.GetConfiguration().Redis.Modules, "xx_"+solgan.Swno)
 				util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true", solgan.Model, solgan.OrderCode)
 				c.Stop()
-			} else if (code == 1) {
+			} else if code == 1 {
 				redis.Del(core.GetConfiguration().Redis.Modules, "xx_"+solgan.Swno)
 				util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true", solgan.Model, solgan.OrderCode)
 				c.Stop()