WH01243 4 éve
szülő
commit
2247b6451c
1 módosított fájl, 5 hozzáadás és 12 törlés
  1. 5 12
      invoice/src/service/InvoiceService.go

+ 5 - 12
invoice/src/service/InvoiceService.go

@@ -23,7 +23,6 @@ type InvoiceService struct{}
 var (
 	invoiceService = InvoiceService{}
 )
-
 // 发票开具
 func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLoop int, isRed string) (string, int, interface{}) {
 	util.Loger.Println("流水号:", solgan.Swno)
@@ -42,10 +41,8 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
 	solgan.Verified = entity.Verified
 	solgan.Fhr = entity.Fhr
 	solgan.Sky = entity.Sky
-
 	now := time.Now()
 	solgan.BillDate = now.Format("2006-01-02 15:04:05")
-
 	url := entity.Url + "?build_invoice"
 	//url := "http://218.249.166.2:8113/eisp-zk/jsonToBillEntityController.do"+ "?build_invoice"
 	util.Loger.Println("流水号:", solgan.Swno, "开具发票:数据", solgan)
@@ -101,6 +98,10 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
 			return msg, code, data1
 		}
 	} else {
+		arr := strings.Split(entity.WarningEmail, ",")
+		for _, value := range arr {
+			util.SendPdf(value, true, solgan.Swno ,"发票开具时出现问题")
+		}
 		return fmt.Sprintln(data["returnMsg"]), 1, data
 	}
 }
@@ -137,7 +138,6 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
 				Changed: changed,
 				ResType: resType,
 			}
-
 			u.OpeningTimer(&solgan)
 		}
 		return data1, 1, "剑鱼标讯订开票服务预警"
@@ -172,7 +172,7 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
 	} else {
 		arr := strings.Split(entity.WarningEmail, ",")
 		for _, value := range arr {
-			util.SendPdf(value, true, swno,"发票下载时出现问题")
+			util.SendPdf(value, true, swno,"发票下载时出现问题,"+dat.ReturnMsg.Msg)
 		}
 		return nil, 1, dat.ReturnMsg.Msg
 	}
@@ -189,7 +189,6 @@ func (u *InvoiceService) InvoiceSee(swno string, saleTax string, model string) (
 	}
 	fool := util.Exists("./static/res/" + saleTax + "/" + swno + "/" + swno1 + ".pdf")
 	msg := "发票地址"
-
 	if fool {
 		pdfData := make(map[string]interface{})
 		pdfData["path"] = entity.PdfUrl + "/static/res/" + saleTax + "/" + swno + "/" + swno1 + ".pdf"
@@ -197,7 +196,6 @@ func (u *InvoiceService) InvoiceSee(swno string, saleTax string, model string) (
 		pdfData["fphm"] = ""
 
 	} else {
-
 		return 1, "path", msg
 	}
 	return 0, "", msg
@@ -222,7 +220,6 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string,orderCode str
 	solgan.Model=  model
 	solgan.OrderCode=orderCode
 	bytesData, _ := json.Marshal(song)
-
 	fmt.Println("json", string(bytesData))
 	reader := bytes.NewReader(bytesData)
 	request, err := http.NewRequest("POST", url, reader)
@@ -423,7 +420,6 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 		} else {
 			redis.PutKV("xx_"+solgan.Swno, solgan)
 		}
-
 	}
 	c := cron.New()
 	spec := entity.OpenTimingCron
@@ -514,7 +510,6 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 				if(code==0){
 					u.OpeningTimer(solgan)
 				}
-
 				//_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)
@@ -531,8 +526,6 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
 				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 (numb == 0) {