|
|
@ -58,17 +58,15 @@ func Create(c *gin.Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func UploadSignedFile(c *gin.Context) {
|
|
|
|
func UploadSignedFile(c *gin.Context) {
|
|
|
|
data := map[string]interface{}{}
|
|
|
|
|
|
|
|
result := map[string]interface{}{
|
|
|
|
result := map[string]interface{}{
|
|
|
|
"code": 200,
|
|
|
|
"status": "1",
|
|
|
|
"msg": "成功",
|
|
|
|
"msg": "成功",
|
|
|
|
"data": data,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
param := signer.UploadParam{}
|
|
|
|
param := signer.UploadParam{}
|
|
|
|
err := c.ShouldBind(¶m)
|
|
|
|
err := c.ShouldBind(¶m)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
result["code"] = 201
|
|
|
|
result["status"] = "0"
|
|
|
|
result["msg"] = "参数异常"
|
|
|
|
result["msg"] = "参数异常"
|
|
|
|
c.JSON(200, result)
|
|
|
|
c.JSON(200, result)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -77,7 +75,7 @@ func UploadSignedFile(c *gin.Context) {
|
|
|
|
params := map[string]interface{}{}
|
|
|
|
params := map[string]interface{}{}
|
|
|
|
err = json.Unmarshal([]byte(param.Params), ¶ms)
|
|
|
|
err = json.Unmarshal([]byte(param.Params), ¶ms)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
result["code"] = 201
|
|
|
|
result["status"] = "0"
|
|
|
|
result["msg"] = "params解析异常"
|
|
|
|
result["msg"] = "params解析异常"
|
|
|
|
c.JSON(200, result)
|
|
|
|
c.JSON(200, result)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -85,7 +83,7 @@ func UploadSignedFile(c *gin.Context) {
|
|
|
|
token := params["token"].(string)
|
|
|
|
token := params["token"].(string)
|
|
|
|
order, err := service.OrderService.GetOrderByToken(token)
|
|
|
|
order, err := service.OrderService.GetOrderByToken(token)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
result["code"] = 201
|
|
|
|
result["status"] = "0"
|
|
|
|
result["msg"] = err.Error()
|
|
|
|
result["msg"] = err.Error()
|
|
|
|
c.JSON(200, result)
|
|
|
|
c.JSON(200, result)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -93,7 +91,7 @@ func UploadSignedFile(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
signFileUrl, err := service.OrderService.UploadPdf("pdf", c)
|
|
|
|
signFileUrl, err := service.OrderService.UploadPdf("pdf", c)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
result["code"] = 201
|
|
|
|
result["status"] = "0"
|
|
|
|
result["msg"] = err.Error()
|
|
|
|
result["msg"] = err.Error()
|
|
|
|
c.JSON(200, result)
|
|
|
|
c.JSON(200, result)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -104,14 +102,14 @@ func UploadSignedFile(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
res, err := service.OrderService.PostToZking(order.OrderSn)
|
|
|
|
res, err := service.OrderService.PostToZking(order.OrderSn)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
result["code"] = 201
|
|
|
|
result["status"] = "0"
|
|
|
|
result["msg"] = "文件保存失败:" + err.Error()
|
|
|
|
result["msg"] = "文件保存失败:" + err.Error()
|
|
|
|
c.JSON(200, result)
|
|
|
|
c.JSON(200, result)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if res.Code != "200" {
|
|
|
|
if res.Code != "200" {
|
|
|
|
result["code"] = 202
|
|
|
|
result["status"] = "0"
|
|
|
|
result["msg"] = res.Code
|
|
|
|
result["msg"] = res.Code
|
|
|
|
c.JSON(200, result)
|
|
|
|
c.JSON(200, result)
|
|
|
|
return
|
|
|
|
return
|
|
|
|