|
@@ -23,12 +23,13 @@ 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)
|
|
|
rand.Seed(time.Now().Unix())
|
|
|
solgan.InvoMemo = solgan.Swno
|
|
|
- solgan.OrderCode=solgan.Swno
|
|
|
+ solgan.OrderCode = solgan.Swno
|
|
|
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)
|
|
|
}
|
|
@@ -43,21 +44,25 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
|
|
|
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"
|
|
|
+ /*url := entity.Url + "?build_invoice"
|
|
|
util.Loger.Println("流水号:", solgan.Swno, "开具发票:数据", solgan)
|
|
|
bytesData, _ := json.Marshal(solgan)
|
|
|
reader := bytes.NewReader(bytesData)
|
|
|
request, _ := http.NewRequest("POST", url, reader)
|
|
|
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
|
client := http.Client{}
|
|
|
- resp, err := client.Do(request)
|
|
|
- if (err != nil) {
|
|
|
- util.Loger.Println("开票服有问题",err)
|
|
|
+ resp, err := client.Do(request)*/
|
|
|
+ //不成功时
|
|
|
+ var err error
|
|
|
+ err = nil
|
|
|
+ //正常
|
|
|
+ //if (err != nil) {
|
|
|
+ if (err == nil) {
|
|
|
+ util.Loger.Println("开票服有问题", err)
|
|
|
if isLoop == 0 {
|
|
|
arr := strings.Split(entity.WarningEmail, ",")
|
|
|
for _, value := range arr {
|
|
|
- util.SendPdf(value, true, solgan.OrderCode,"发票开具时服务出现问题")
|
|
|
+ util.SendPdf(value, true, solgan.Swno, "发票开具时服务出现问题")
|
|
|
}
|
|
|
solgan.ResType = resType
|
|
|
solgan.IsRed = isRed
|
|
@@ -70,18 +75,24 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
|
|
|
data1["path"] = ""
|
|
|
return "剑鱼标讯订开票服务预警", 3, data1
|
|
|
}
|
|
|
- respBytes, err := ioutil.ReadAll(resp.Body)
|
|
|
- fmt.Sprint(err)
|
|
|
+ /*respBytes, err := ioutil.ReadAll(resp.Body)
|
|
|
+ fmt.Sprint(err)
|
|
|
+ data := make(map[string]interface{})
|
|
|
+ if err := json.Unmarshal([]byte(respBytes), &data); err == nil {
|
|
|
+ fmt.Println(solgan.Swno, "开票返回值:", data)
|
|
|
+ }*/
|
|
|
+ //开具成功
|
|
|
data := make(map[string]interface{})
|
|
|
- if err := json.Unmarshal([]byte(respBytes), &data); err == nil {
|
|
|
- fmt.Println(solgan.Swno, "开票返回值:", data)
|
|
|
- }
|
|
|
+ data["returnCode"] = "0000"
|
|
|
+
|
|
|
+ //开具失败
|
|
|
+ //data["returnCode"]="100"
|
|
|
|
|
|
util.Loger.Println("流水号:", solgan.Swno, "开具发票:结果", data)
|
|
|
//开票正常时
|
|
|
//data["returnCode"] = entity.LineUpCode
|
|
|
if (data["returnCode"] == entity.LineUpCode || data["returnCode"] == entity.SealCode || data["returnCode"] == entity.SuccessCode) {
|
|
|
- pdfData, code, msg := u.InvoiceDownload(solgan.Swno, solgan.SaleTax, isRed, 0, 0, solgan.Changed, resType,solgan.OrderCode)
|
|
|
+ pdfData, code, msg := u.InvoiceDownload(solgan.Swno, solgan.SaleTax, isRed, 0, 0, solgan.Changed, resType, solgan.OrderCode)
|
|
|
if (fmt.Sprint(code) == entity.SuccessCode) {
|
|
|
data1 := make(map[string]interface{})
|
|
|
data1["fpdm"] = pdfData["fpdm"]
|
|
@@ -100,27 +111,36 @@ func (u *InvoiceService) InvoiceAdd(solgan *entity.Invoice, resType string, isLo
|
|
|
} else {
|
|
|
arr := strings.Split(entity.WarningEmail, ",")
|
|
|
for _, value := range arr {
|
|
|
- util.SendPdf(value, true, solgan.Swno ,"发票开具时出现问题")
|
|
|
+ util.SendPdf(value, true, solgan.Swno, "发票开具时出现问题")
|
|
|
}
|
|
|
return fmt.Sprintln(data["returnMsg"]), 1, data
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 发票下载
|
|
|
-func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed string, isLoop int, isfeedback int, changed string, resType string,orderCode string) (map[string]interface{}, int, string) {
|
|
|
- url := entity.Url + "?get_invoice"
|
|
|
+func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed string, isLoop int, isfeedback int, changed string, resType string, orderCode string) (map[string]interface{}, int, string) {
|
|
|
+
|
|
|
song := make(map[string]interface{})
|
|
|
song["swno"] = swno
|
|
|
song["saleTax"] = saleTax
|
|
|
bytesData, _ := json.Marshal(song)
|
|
|
fmt.Println("json", string(bytesData))
|
|
|
- reader := bytes.NewReader(bytesData)
|
|
|
- request, err := http.NewRequest("POST", url, reader)
|
|
|
- fmt.Println(err)
|
|
|
- request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
|
- client := http.Client{}
|
|
|
- resp, err := client.Do(request)
|
|
|
+ /*
|
|
|
+ url := entity.Url + "?get_invoice"
|
|
|
+ reader := bytes.NewReader(bytesData)
|
|
|
+ request, err := http.NewRequest("POST", url, reader)
|
|
|
+ fmt.Println(err)
|
|
|
+ request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
|
+ client := http.Client{}
|
|
|
+ resp, err := client.Do(request)*/
|
|
|
+
|
|
|
+ //不成功时
|
|
|
+ var err error
|
|
|
+ err = nil
|
|
|
+ //正常
|
|
|
if (err != nil) {
|
|
|
+
|
|
|
+ //if (err == nil) {
|
|
|
data1 := make(map[string]interface{})
|
|
|
data1["fpdm"] = ""
|
|
|
data1["fphm"] = ""
|
|
@@ -129,7 +149,7 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
|
|
|
if isLoop == 0 {
|
|
|
arr := strings.Split(entity.WarningEmail, ",")
|
|
|
for _, value := range arr {
|
|
|
- util.SendPdf(value, true, orderCode,"发票下载时服务出现问题")
|
|
|
+ util.SendPdf(value, true, swno, "发票下载时服务出现问题")
|
|
|
}
|
|
|
solgan := entity.Invoice{
|
|
|
Swno: swno,
|
|
@@ -142,12 +162,24 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
|
|
|
}
|
|
|
return data1, 1, "剑鱼标讯订开票服务预警"
|
|
|
}
|
|
|
- respBytes, err := ioutil.ReadAll(resp.Body)
|
|
|
+ //正常
|
|
|
+ /*respBytes, err := ioutil.ReadAll(resp.Body)
|
|
|
var dat *entity.GetInvoice
|
|
|
util.Loger.Println("发票下载:", "流水号:", swno, "结果:", respBytes)
|
|
|
if err := json.Unmarshal([]byte(respBytes), &dat); err == nil {
|
|
|
fmt.Println(swno, "发票下载返回值:", dat)
|
|
|
- }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ //异常
|
|
|
+ dat := entity.GetInvoice{}
|
|
|
+ dat.ReturnMsg.MsgCode = "0000"
|
|
|
+
|
|
|
+ //排队中
|
|
|
+ //dat.ReturnMsg.MsgCode="1089"
|
|
|
+
|
|
|
+ //失败
|
|
|
+ //dat.ReturnMsg.MsgCode = "1000"
|
|
|
+
|
|
|
util.Loger.Println("发票下载:", "流水号:", swno, "结果:", dat)
|
|
|
//dat.ReturnMsg.MsgCode = entity.LineUpCode
|
|
|
if (dat.ReturnMsg.MsgCode == entity.SuccessCode) {
|
|
@@ -157,22 +189,26 @@ func (u *InvoiceService) InvoiceDownload(swno string, saleTax string, isRed stri
|
|
|
} else {
|
|
|
swno1 = swno
|
|
|
}
|
|
|
+ fmt.Println(swno1)
|
|
|
pdfData := make(map[string]interface{})
|
|
|
- path := util.ImgHandle(dat.FpMsgs[0].PdfContent, swno, saleTax, swno1)
|
|
|
+ //path := util.ImgHandle(dat.FpMsgs[0].PdfContent, swno, saleTax, swno1)
|
|
|
+ path := "/c/v/c/v"
|
|
|
pdfData["path"] = path
|
|
|
- pdfData["fpdm"] = dat.FpMsgs[0].Fpdm
|
|
|
- pdfData["fphm"] = dat.FpMsgs[0].Fphm
|
|
|
+ /* pdfData["fpdm"] = dat.FpMsgs[0].Fpdm
|
|
|
+ pdfData["fphm"] = dat.FpMsgs[0].Fphm*/
|
|
|
+ pdfData["fpdm"] = "Fpdm"
|
|
|
+ pdfData["fphm"] = "Fphm"
|
|
|
pdfData["swno"] = swno
|
|
|
return pdfData, 0, dat.ReturnMsg.Msg
|
|
|
} else if (dat.ReturnMsg.MsgCode == entity.LineUpCode || dat.ReturnMsg.MsgCode == entity.SealCode) {
|
|
|
if isLoop == 0 {
|
|
|
- u.Timer(swno, saleTax, isRed, isfeedback, changed, resType,orderCode)
|
|
|
+ u.Timer(swno, saleTax, isRed, isfeedback, changed, resType, orderCode)
|
|
|
}
|
|
|
return nil, 2, dat.ReturnMsg.Msg
|
|
|
} else {
|
|
|
arr := strings.Split(entity.WarningEmail, ",")
|
|
|
for _, value := range arr {
|
|
|
- util.SendPdf(value, true, swno,"发票下载时出现问题,"+dat.ReturnMsg.Msg)
|
|
|
+ util.SendPdf(value, true, swno, "发票下载时出现问题,"+dat.ReturnMsg.Msg)
|
|
|
}
|
|
|
return nil, 1, dat.ReturnMsg.Msg
|
|
|
}
|
|
@@ -203,7 +239,7 @@ func (u *InvoiceService) InvoiceSee(swno string, saleTax string, model string) (
|
|
|
|
|
|
// 退票
|
|
|
//noinspection ALL
|
|
|
-func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string,orderCode string, resType string, changed string, isLoop int,solgan *entity.Invoice) (string, int, interface{}) {
|
|
|
+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") {
|
|
@@ -212,13 +248,13 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string,orderCode str
|
|
|
song := make(map[string]interface{})
|
|
|
song["fpdm"] = fpdm
|
|
|
song["fphm"] = fphm
|
|
|
- solgan.Yfphm= fphm
|
|
|
- solgan.Yfpdm= fpdm
|
|
|
- solgan.IsRed= "true"
|
|
|
- solgan.Changed= changed
|
|
|
- solgan.ResType= resType
|
|
|
- solgan.Model= model
|
|
|
- solgan.OrderCode=orderCode
|
|
|
+ solgan.Yfphm = fphm
|
|
|
+ solgan.Yfpdm = fpdm
|
|
|
+ solgan.IsRed = "true"
|
|
|
+ solgan.Changed = changed
|
|
|
+ solgan.ResType = resType
|
|
|
+ solgan.Model = model
|
|
|
+ solgan.OrderCode = orderCode
|
|
|
bytesData, _ := json.Marshal(song)
|
|
|
fmt.Println("json", string(bytesData))
|
|
|
reader := bytes.NewReader(bytesData)
|
|
@@ -233,11 +269,10 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string,orderCode str
|
|
|
data1["fphm"] = ""
|
|
|
data1["swno"] = ""
|
|
|
data1["path"] = ""
|
|
|
-
|
|
|
if isLoop == 0 {
|
|
|
arr := strings.Split(entity.WarningEmail, ",")
|
|
|
for _, value := range arr {
|
|
|
- util.SendPdf(value, true,solgan.OrderCode,"发票退票时服务出现问题")
|
|
|
+ util.SendPdf(value, true, solgan.Swno, "发票退票时服务出现问题")
|
|
|
}
|
|
|
u.OpeningTimer(solgan)
|
|
|
}
|
|
@@ -256,7 +291,7 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string,orderCode str
|
|
|
util.Loger.Println("冲红:", "发票单号:", fpdm, "发票号码:", fphm, "结果:", data)
|
|
|
//data["returnCode"] = entity.LineUpCode
|
|
|
if (data["returnCode"] == entity.LineUpCode || data["returnCode"] == entity.SealCode || data["returnCode"] == entity.SuccessCode) {
|
|
|
- pdfData, code, msg := u.InvoiceDownload(data["redSwno"].(string), data["saleTax"].(string), "true", int(0), int(0), changed, resType,orderCode)
|
|
|
+ pdfData, code, msg := u.InvoiceDownload(data["redSwno"].(string), data["saleTax"].(string), "true", int(0), int(0), changed, resType, orderCode)
|
|
|
if (fmt.Sprint(code) == "0") {
|
|
|
data1 := map[string]interface{}{
|
|
|
"fpdm": pdfData["fpdm"],
|
|
@@ -285,8 +320,8 @@ func (u *InvoiceService) InvoiceRedSubmit(fpdm string, fphm string,orderCode str
|
|
|
//noinspection ALL
|
|
|
func (u *InvoiceService) InvoiceReplace(solgan *entity.Invoice, resType string) (string, int, interface{}) {
|
|
|
solgan.Model = "2"
|
|
|
- solgan.OrderCode=solgan.Swno
|
|
|
- msg, code1, dataMap := invoiceService.InvoiceRedSubmit(solgan.Yfpdm, solgan.Yfphm, solgan.Swno,resType, solgan.Changed, 0,solgan)
|
|
|
+ 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) {
|
|
|
return msg, code1, dataMap
|
|
@@ -312,14 +347,14 @@ func (u *InvoiceService) InvoiceReplace(solgan *entity.Invoice, resType string)
|
|
|
_rdsVal["chpath"] = _dataMap["path"]
|
|
|
}
|
|
|
if (code1 == 3) {
|
|
|
- code=2
|
|
|
+ code = 2
|
|
|
}
|
|
|
return msg, code, _rdsVal
|
|
|
|
|
|
}
|
|
|
|
|
|
//排队中签章失败定时任务
|
|
|
-func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeedback int, changed string, resType string,orderCode 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) {
|
|
@@ -365,13 +400,15 @@ func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeed
|
|
|
swnoMap["creatTime"] = _rdsVal["creatTime"]
|
|
|
swnoMap["orderCode"] = orderCode
|
|
|
numb, _ := strconv.Atoi(fmt.Sprint(_rdsVal["Frequency"]))
|
|
|
+ fmt.Println("循环:", numb, "----", entity.Frequency)
|
|
|
fmt.Sprint("numb", "执行次数")
|
|
|
if numb == entity.Frequency {
|
|
|
arr := strings.Split(entity.WarningEmail, ",")
|
|
|
for _, value := range arr {
|
|
|
- util.SendPdf(value, false,orderCode,"排队中签章失败定时任务出现问题")
|
|
|
+ util.SendPdf(value, false, swno, "排队中签章失败定时任务出现问题")
|
|
|
}
|
|
|
numb++
|
|
|
+ util.Callback(swno, saleTax, "", "", "", changed, isRed, resType, "true", "", orderCode)
|
|
|
}
|
|
|
util.Loger.Println("第:", numb, "次执行", "流水号:", swno)
|
|
|
numb++
|
|
@@ -379,15 +416,14 @@ func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeed
|
|
|
redis.PutKV("fp_"+swno, swnoMap)
|
|
|
creatTime, _ := strconv.ParseInt(fmt.Sprint(_rdsVal["creatTime"]), 10, 64)
|
|
|
fmt.Println(creatTime - time.Now().Unix())
|
|
|
-
|
|
|
}
|
|
|
- pdfData, numb, _ := u.InvoiceDownload(swno, saleTax, isRed, 1, 0, changed, resType,orderCode)
|
|
|
+ pdfData, code, _ := u.InvoiceDownload(swno, saleTax, isRed, 1, 0, changed, resType, orderCode)
|
|
|
fmt.Println(pdfData)
|
|
|
- if (numb == 0) {
|
|
|
+ if (code == 0) {
|
|
|
util.Loger.Println("定时开票成功:", "流水号:", swno)
|
|
|
if (isfeedback == 0) {
|
|
|
//修改发票中状态
|
|
|
- dat := util.Callback(swno, saleTax, pdfData["fpdm"].(string), pdfData["fphm"].(string), pdfData["path"].(string), changed, isRed, resType, "","3",orderCode)
|
|
|
+ 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) {
|
|
@@ -400,8 +436,8 @@ func (u *InvoiceService) Timer(swno string, saleTax string, isRed string, isfeed
|
|
|
c.Stop()
|
|
|
}
|
|
|
} else {
|
|
|
- util.Callback(swno, saleTax,"", "", "", changed, isRed, resType, "true","",orderCode)
|
|
|
- c.Stop()
|
|
|
+ //util.Callback(swno, saleTax, "", "", "", changed, isRed, resType, "true", "", orderCode)
|
|
|
+ //c.Stop()
|
|
|
}
|
|
|
})
|
|
|
c.Start()
|
|
@@ -455,7 +491,7 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
|
|
|
redis.PutKV("xx_"+swno, solgan)
|
|
|
} 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)
|
|
|
+ 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" {
|
|
|
redis.Del(core.GetConfiguration().Redis.Modules, "xx_"+solgan.Yfphm)
|
|
|
util.Loger.Println("删除:", "发票号码:", solgan.Yfphm)
|
|
@@ -466,7 +502,7 @@ func (u *InvoiceService) OpeningTimer(solgan *entity.Invoice) {
|
|
|
c.Stop()
|
|
|
} else {
|
|
|
fmt.Println(numb)
|
|
|
- util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true",solgan.Model,solgan.OrderCode)
|
|
|
+ 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" {
|
|
|
redis.Del(core.GetConfiguration().Redis.Modules, "xx_"+solgan.Yfphm)
|
|
|
util.Loger.Println("删除1:", "发票号码:", solgan.Yfphm)
|
|
@@ -482,49 +518,49 @@ 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)
|
|
|
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)
|
|
|
+ util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true", solgan.Model, solgan.OrderCode)
|
|
|
c.Stop()
|
|
|
}
|
|
|
//单独冲红失败
|
|
|
case "1":
|
|
|
- _, code, _ := u.InvoiceRedSubmit(solgan.Yfpdm, solgan.Yfphm, solgan.OrderCode,solgan.ResType, solgan.Changed, 1,solgan)
|
|
|
- if (code ==0) {
|
|
|
+ _, code, _ := u.InvoiceRedSubmit(solgan.Yfpdm, solgan.Yfphm, solgan.OrderCode, solgan.ResType, solgan.Changed, 1, solgan)
|
|
|
+ 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)
|
|
|
redis.Del(core.GetConfiguration().Redis.Modules, "xx_"+solgan.Yfphm)
|
|
|
- util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true",solgan.Model,solgan.OrderCode)
|
|
|
+ util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true", solgan.Model, solgan.OrderCode)
|
|
|
c.Stop()
|
|
|
}
|
|
|
//冲红开具
|
|
|
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) {
|
|
|
+ _, code, _ := u.InvoiceRedSubmit(solgan.Yfpdm, solgan.Yfphm, solgan.OrderCode, solgan.ResType, solgan.Changed, 1, solgan)
|
|
|
+ fmt.Println("code", code)
|
|
|
+ if (code == 2 || code == 0) {
|
|
|
solgan.Model = "0"
|
|
|
- if(code==0){
|
|
|
+ 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)
|
|
|
redis.Del(core.GetConfiguration().Redis.Modules, "xx_"+solgan.Yfphm)
|
|
|
- util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true",solgan.Model,solgan.OrderCode)
|
|
|
+ util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true", solgan.Model, solgan.OrderCode)
|
|
|
c.Stop()
|
|
|
}
|
|
|
case "3":
|
|
|
- _, code, _ := u.InvoiceDownload(solgan.Swno, solgan.SaleTax, solgan.IsRed, 1, 0, solgan.Changed, solgan.ResType,solgan.OrderCode)
|
|
|
- if (code ==0) {
|
|
|
+ _, code, _ := u.InvoiceDownload(solgan.Swno, solgan.SaleTax, solgan.IsRed, 1, 0, solgan.Changed, solgan.ResType, solgan.OrderCode)
|
|
|
+ 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)
|
|
|
+ util.Callback(solgan.Swno, solgan.SaleTax, solgan.Yfpdm, solgan.Yfphm, "", solgan.Changed, solgan.IsRed, solgan.ResType, "true", solgan.Model, solgan.OrderCode)
|
|
|
c.Stop()
|
|
|
}
|
|
|
}
|