| | |
| | | |
| | | // check params |
| | | func checkServiceContractParams(serviceContract request.ServiceContract) (errCode int, result model.ServiceContract) { |
| | | if serviceContract.SignTime == "" { |
| | | return ecode.InvalidParams, result |
| | | } |
| | | |
| | | if serviceContract.Number == "" { |
| | | return ecode.InvalidParams, result |
| | | } |
| | | |
| | | if serviceContract.MemberId <= 0 { |
| | | return ecode.InvalidParams, result |
| | | } |
| | | //if serviceContract.SignTime == "" { |
| | | // return ecode.InvalidParams, result |
| | | //} |
| | | // |
| | | //if serviceContract.Number == "" { |
| | | // return ecode.InvalidParams, result |
| | | //} |
| | | // |
| | | //if serviceContract.MemberId <= 0 { |
| | | // return ecode.InvalidParams, result |
| | | //} |
| | | |
| | | t, err := checkTimeFormat(serviceContract.SignTime) |
| | | if err != nil { |
| | |
| | | result.ContactId = serviceContract.ContactId |
| | | result.SaleChanceId = serviceContract.SaleChanceId |
| | | result.QuotationId = serviceContract.QuotationId |
| | | result.TypeId = serviceContract.TypeId |
| | | result.StatusId = serviceContract.StatusId |
| | | result.ServiceContractTypeId = serviceContract.TypeId |
| | | result.ServiceContractStatusId = serviceContract.StatusId |
| | | result.ServiceTimes = serviceContract.ServiceTimes |
| | | result.Terms = serviceContract.Terms |
| | | result.Products = serviceContract.Products |