|
|
|
@ -399,7 +399,31 @@ func (s *orderService) PostToZking(orderNo string) (*zking.Result, error) {
|
|
|
|
|
return result, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *orderService) ZkingClaim(claim model.Claim) (*zking.Result, error) {
|
|
|
|
|
func (s *orderService) SaveClaim(param suixing.ClaimParam) (*model.Claim, error) {
|
|
|
|
|
fileList, err := json.Marshal(param.Data.FileList)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
claim := model.Claim{}
|
|
|
|
|
claim.PolicyNo = param.Data.PolicyNo
|
|
|
|
|
claim.BankName = param.Data.BankName
|
|
|
|
|
claim.AccountName = param.Data.AccountName
|
|
|
|
|
claim.ContactName = param.Data.ContactName
|
|
|
|
|
claim.ContactPhone = param.Data.ContactPhone
|
|
|
|
|
claim.FileList = string(fileList)
|
|
|
|
|
claim.BankCardNum = param.Data.BankCardNum
|
|
|
|
|
claim.BackPremium = param.Data.BackPremium
|
|
|
|
|
claim.Reason = param.Data.Reason
|
|
|
|
|
|
|
|
|
|
err = global.DB.Save(&claim).Error
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return &claim, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *orderService) ZkingClaim(claim *model.Claim) (*zking.Result, error) {
|
|
|
|
|
var fileList []map[string]string
|
|
|
|
|
err := json.Unmarshal([]byte(claim.FileList), &fileList)
|
|
|
|
|
if err != nil {
|
|
|
|
@ -435,7 +459,7 @@ func (s *orderService) ZkingClaim(claim model.Claim) (*zking.Result, error) {
|
|
|
|
|
return result, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *orderService) saveRevoke(param suixing.RevokeParam) (*model.Revoke, error) {
|
|
|
|
|
func (s *orderService) SaveRevoke(param suixing.RevokeParam) (*model.Revoke, error) {
|
|
|
|
|
fileList, err := json.Marshal(param.Data.FileList)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
@ -459,7 +483,7 @@ func (s *orderService) saveRevoke(param suixing.RevokeParam) (*model.Revoke, err
|
|
|
|
|
return &revoke, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *orderService) ZkingRevoke(revoke model.Revoke) (*zking.Result, error) {
|
|
|
|
|
func (s *orderService) ZkingRevoke(revoke *model.Revoke) (*zking.Result, error) {
|
|
|
|
|
var fileList []map[string]string
|
|
|
|
|
err := json.Unmarshal([]byte(revoke.FileList), &fileList)
|
|
|
|
|
if err != nil {
|
|
|
|
@ -495,30 +519,6 @@ func (s *orderService) ZkingRevoke(revoke model.Revoke) (*zking.Result, error) {
|
|
|
|
|
return result, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *orderService) SaveClaim(param suixing.ClaimParam) (*model.Claim, error) {
|
|
|
|
|
fileList, err := json.Marshal(param.Data.FileList)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
claim := model.Claim{}
|
|
|
|
|
claim.PolicyNo = param.Data.PolicyNo
|
|
|
|
|
claim.BankName = param.Data.BankName
|
|
|
|
|
claim.AccountName = param.Data.AccountName
|
|
|
|
|
claim.ContactName = param.Data.ContactName
|
|
|
|
|
claim.ContactPhone = param.Data.ContactPhone
|
|
|
|
|
claim.FileList = string(fileList)
|
|
|
|
|
claim.BankCardNum = param.Data.BankCardNum
|
|
|
|
|
claim.BackPremium = param.Data.BackPremium
|
|
|
|
|
claim.Reason = param.Data.Reason
|
|
|
|
|
|
|
|
|
|
err = global.DB.Save(&claim).Error
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return &claim, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *orderService) GetOrderResultByToken(token string) (*model.OrderResult, error) {
|
|
|
|
|
order := model.Order{}
|
|
|
|
|
err := global.DB.
|
|
|
|
|