| | |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.Faq.Id = params.Id |
| | | |
| | | errCode := service.NewFaqService().UpdateFaq(¶ms.Faq) |
| | | if errCode != ecode.OK { |
| | |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.FaultType.Id = params.Id |
| | | |
| | | errCode := service.NewFaultTypeService().UpdateFaultType(¶ms.FaultType) |
| | | if errCode != ecode.OK { |
| | |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.PriorityLevel.Id = params.Id |
| | | |
| | | errCode := service.NewPriorityLevelService().UpdatePriorityLevel(¶ms.PriorityLevel) |
| | | if errCode != ecode.OK { |
| | |
| | | type ServiceTypeApi struct{} |
| | | |
| | | // Add |
| | | // @Tags 服务类型管理 |
| | | // @Summary 添加服务类型 |
| | | // @Tags 服务方式管理 |
| | | // @Summary 添加服务方式 |
| | | // @Produce application/json |
| | | // @Param object body request.AddServiceType true "查询参数" |
| | | // @Success 200 {object} contextx.Response{} |
| | |
| | | } |
| | | |
| | | // Delete |
| | | // @Tags 服务类型管理 |
| | | // @Summary 删除服务类型 |
| | | // @Tags 服务方式管理 |
| | | // @Summary 删除服务方式 |
| | | // @Produce application/json |
| | | // @Param id path int true "查询参数" |
| | | // @Success 200 {object} contextx.Response{} |
| | |
| | | } |
| | | |
| | | // Update |
| | | // @Tags 服务类型管理 |
| | | // @Summary 更新服务类型 |
| | | // @Tags 服务方式管理 |
| | | // @Summary 更新服务方式 |
| | | // @Produce application/json |
| | | // @Param object body request.UpdateServiceType true "查询参数" |
| | | // @Success 200 {object} contextx.Response{} |
| | |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.ServiceType.Id = params.Id |
| | | |
| | | errCode := service.NewServiceTypeService().UpdateServiceType(¶ms.ServiceType) |
| | | if errCode != ecode.OK { |
| | |
| | | } |
| | | |
| | | // List |
| | | // @Tags 服务类型管理 |
| | | // @Summary 获取服务类型列表 |
| | | // @Tags 服务方式管理 |
| | | // @Summary 获取服务方式列表 |
| | | // @Produce application/json |
| | | // @Success 200 {object} response.ListResponse{data=[]model.ServiceType} |
| | | // @Router /api/serviceType/list [get] |
| | |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.Severity.Id = params.Id |
| | | |
| | | errCode := service.NewSeverityService().UpdateSeverity(¶ms.Severity) |
| | | if errCode != ecode.OK { |
| | |
| | | if !ok { |
| | | return |
| | | } |
| | | if params.Id == 0 { |
| | | ctx.Fail(ecode.ParamsErr) |
| | | } |
| | | params.TimeSpent.Id = params.Id |
| | | |
| | | errCode := service.NewTimeSpentService().UpdateTimeSpent(¶ms.TimeSpent) |
| | | if errCode != ecode.OK { |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "添加服务类型", |
| | | "summary": "添加服务方式", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "删除服务类型", |
| | | "summary": "删除服务方式", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "获取服务类型列表", |
| | | "summary": "获取服务方式列表", |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "更新服务类型", |
| | | "summary": "更新服务方式", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "description": "上门地址", |
| | | "type": "string" |
| | | }, |
| | | "appointment_time": { |
| | | "appointmentTime": { |
| | | "description": "预约上门时间", |
| | | "type": "string" |
| | | }, |
| | | "car_fare": { |
| | | "carFare": { |
| | | "description": "交通费", |
| | | "type": "number" |
| | | }, |
| | | "charge_amount": { |
| | | "chargeAmount": { |
| | | "description": "收费金额", |
| | | "type": "number" |
| | | }, |
| | |
| | | "contact": { |
| | | "$ref": "#/definitions/model.Contact" |
| | | }, |
| | | "contact_id": { |
| | | "contactId": { |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expect_time": { |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | | }, |
| | | "faq": { |
| | | "$ref": "#/definitions/model.Faq" |
| | | }, |
| | | "id": { |
| | | "faqId": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "order": { |
| | | "$ref": "#/definitions/model.OrderManage" |
| | | "faultType": { |
| | | "$ref": "#/definitions/model.FaultType" |
| | | }, |
| | | "faultTypeId": { |
| | | "description": "故障类别id", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "orderId": { |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "orderManage": { |
| | | "$ref": "#/definitions/model.OrderManage" |
| | | }, |
| | | "priorityLevel": { |
| | | "$ref": "#/definitions/model.PriorityLevel" |
| | | }, |
| | | "priority_level_id": { |
| | | "description": "优先级别", |
| | | "priorityLevelId": { |
| | | "description": "优先级别id", |
| | | "type": "integer" |
| | | }, |
| | | "problem_desc": { |
| | | "problemDesc": { |
| | | "description": "问题描述", |
| | | "type": "string" |
| | | }, |
| | | "problem_id": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "product": { |
| | | "$ref": "#/definitions/model.Product" |
| | |
| | | "description": "产品id", |
| | | "type": "integer" |
| | | }, |
| | | "real_time": { |
| | | "realTime": { |
| | | "description": "实际处理时间", |
| | | "type": "string" |
| | | }, |
| | |
| | | "$ref": "#/definitions/model.ServiceType" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式", |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | | }, |
| | | "severity": { |
| | |
| | | "description": "解决方法", |
| | | "type": "string" |
| | | }, |
| | | "solution_remark": { |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | |
| | | "description": "主题", |
| | | "type": "string" |
| | | }, |
| | | "time_spent_id": { |
| | | "timeSpent": { |
| | | "$ref": "#/definitions/model.TimeSpent" |
| | | }, |
| | | "timeSpentId": { |
| | | "description": "花费时间", |
| | | "type": "integer" |
| | | } |
| | |
| | | "description": "上门地址", |
| | | "type": "string" |
| | | }, |
| | | "appointment_time": { |
| | | "appointmentTime": { |
| | | "description": "预约上门时间", |
| | | "type": "string" |
| | | }, |
| | | "car_fare": { |
| | | "carFare": { |
| | | "description": "交通费", |
| | | "type": "number" |
| | | }, |
| | | "charge_amount": { |
| | | "chargeAmount": { |
| | | "description": "收费金额", |
| | | "type": "number" |
| | | }, |
| | |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "contact_id": { |
| | | "contactId": { |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expect_time": { |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | | }, |
| | | "faqId": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "faultTypeId": { |
| | | "description": "故障类别id", |
| | | "type": "integer" |
| | | }, |
| | | "orderId": { |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "priority_level_id": { |
| | | "description": "优先级别", |
| | | "priorityLevelId": { |
| | | "description": "优先级别id", |
| | | "type": "integer" |
| | | }, |
| | | "problem_desc": { |
| | | "problemDesc": { |
| | | "description": "问题描述", |
| | | "type": "string" |
| | | }, |
| | | "problem_id": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "integer" |
| | | }, |
| | | "real_time": { |
| | | "realTime": { |
| | | "description": "实际处理时间", |
| | | "type": "string" |
| | | }, |
| | |
| | | "type": "string" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式", |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | | }, |
| | | "severity": { |
| | | "description": "严重程度", |
| | | "description": "严重程度id", |
| | | "type": "integer" |
| | | }, |
| | | "solution": { |
| | | "description": "解决方法", |
| | | "type": "string" |
| | | }, |
| | | "solution_remark": { |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | |
| | | "description": "主题", |
| | | "type": "string" |
| | | }, |
| | | "time_spent_id": { |
| | | "timeSpentId": { |
| | | "description": "花费时间", |
| | | "type": "integer" |
| | | } |
| | |
| | | "description": "上门地址", |
| | | "type": "string" |
| | | }, |
| | | "appointment_time": { |
| | | "appointmentTime": { |
| | | "description": "预约上门时间", |
| | | "type": "string" |
| | | }, |
| | | "car_fare": { |
| | | "carFare": { |
| | | "description": "交通费", |
| | | "type": "number" |
| | | }, |
| | | "charge_amount": { |
| | | "chargeAmount": { |
| | | "description": "收费金额", |
| | | "type": "number" |
| | | }, |
| | |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "contact_id": { |
| | | "contactId": { |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expect_time": { |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | | }, |
| | | "faqId": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "faultTypeId": { |
| | | "description": "故障类别id", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "priority_level_id": { |
| | | "description": "优先级别", |
| | | "priorityLevelId": { |
| | | "description": "优先级别id", |
| | | "type": "integer" |
| | | }, |
| | | "problem_desc": { |
| | | "problemDesc": { |
| | | "description": "问题描述", |
| | | "type": "string" |
| | | }, |
| | | "problem_id": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "integer" |
| | | }, |
| | | "real_time": { |
| | | "realTime": { |
| | | "description": "实际处理时间", |
| | | "type": "string" |
| | | }, |
| | |
| | | "type": "string" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式", |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | | }, |
| | | "severity": { |
| | | "description": "严重程度", |
| | | "description": "严重程度id", |
| | | "type": "integer" |
| | | }, |
| | | "solution": { |
| | | "description": "解决方法", |
| | | "type": "string" |
| | | }, |
| | | "solution_remark": { |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | |
| | | "description": "主题", |
| | | "type": "string" |
| | | }, |
| | | "time_spent_id": { |
| | | "timeSpentId": { |
| | | "description": "花费时间", |
| | | "type": "integer" |
| | | } |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "添加服务类型", |
| | | "summary": "添加服务方式", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "删除服务类型", |
| | | "summary": "删除服务方式", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "获取服务类型列表", |
| | | "summary": "获取服务方式列表", |
| | | "responses": { |
| | | "200": { |
| | | "description": "OK", |
| | |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "服务类型管理" |
| | | "服务方式管理" |
| | | ], |
| | | "summary": "更新服务类型", |
| | | "summary": "更新服务方式", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "description": "上门地址", |
| | | "type": "string" |
| | | }, |
| | | "appointment_time": { |
| | | "appointmentTime": { |
| | | "description": "预约上门时间", |
| | | "type": "string" |
| | | }, |
| | | "car_fare": { |
| | | "carFare": { |
| | | "description": "交通费", |
| | | "type": "number" |
| | | }, |
| | | "charge_amount": { |
| | | "chargeAmount": { |
| | | "description": "收费金额", |
| | | "type": "number" |
| | | }, |
| | |
| | | "contact": { |
| | | "$ref": "#/definitions/model.Contact" |
| | | }, |
| | | "contact_id": { |
| | | "contactId": { |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expect_time": { |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | | }, |
| | | "faq": { |
| | | "$ref": "#/definitions/model.Faq" |
| | | }, |
| | | "id": { |
| | | "faqId": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "order": { |
| | | "$ref": "#/definitions/model.OrderManage" |
| | | "faultType": { |
| | | "$ref": "#/definitions/model.FaultType" |
| | | }, |
| | | "faultTypeId": { |
| | | "description": "故障类别id", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "orderId": { |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "orderManage": { |
| | | "$ref": "#/definitions/model.OrderManage" |
| | | }, |
| | | "priorityLevel": { |
| | | "$ref": "#/definitions/model.PriorityLevel" |
| | | }, |
| | | "priority_level_id": { |
| | | "description": "优先级别", |
| | | "priorityLevelId": { |
| | | "description": "优先级别id", |
| | | "type": "integer" |
| | | }, |
| | | "problem_desc": { |
| | | "problemDesc": { |
| | | "description": "问题描述", |
| | | "type": "string" |
| | | }, |
| | | "problem_id": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "product": { |
| | | "$ref": "#/definitions/model.Product" |
| | |
| | | "description": "产品id", |
| | | "type": "integer" |
| | | }, |
| | | "real_time": { |
| | | "realTime": { |
| | | "description": "实际处理时间", |
| | | "type": "string" |
| | | }, |
| | |
| | | "$ref": "#/definitions/model.ServiceType" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式", |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | | }, |
| | | "severity": { |
| | |
| | | "description": "解决方法", |
| | | "type": "string" |
| | | }, |
| | | "solution_remark": { |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | |
| | | "description": "主题", |
| | | "type": "string" |
| | | }, |
| | | "time_spent_id": { |
| | | "timeSpent": { |
| | | "$ref": "#/definitions/model.TimeSpent" |
| | | }, |
| | | "timeSpentId": { |
| | | "description": "花费时间", |
| | | "type": "integer" |
| | | } |
| | |
| | | "description": "上门地址", |
| | | "type": "string" |
| | | }, |
| | | "appointment_time": { |
| | | "appointmentTime": { |
| | | "description": "预约上门时间", |
| | | "type": "string" |
| | | }, |
| | | "car_fare": { |
| | | "carFare": { |
| | | "description": "交通费", |
| | | "type": "number" |
| | | }, |
| | | "charge_amount": { |
| | | "chargeAmount": { |
| | | "description": "收费金额", |
| | | "type": "number" |
| | | }, |
| | |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "contact_id": { |
| | | "contactId": { |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expect_time": { |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | | }, |
| | | "faqId": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "faultTypeId": { |
| | | "description": "故障类别id", |
| | | "type": "integer" |
| | | }, |
| | | "orderId": { |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "priority_level_id": { |
| | | "description": "优先级别", |
| | | "priorityLevelId": { |
| | | "description": "优先级别id", |
| | | "type": "integer" |
| | | }, |
| | | "problem_desc": { |
| | | "problemDesc": { |
| | | "description": "问题描述", |
| | | "type": "string" |
| | | }, |
| | | "problem_id": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "integer" |
| | | }, |
| | | "real_time": { |
| | | "realTime": { |
| | | "description": "实际处理时间", |
| | | "type": "string" |
| | | }, |
| | |
| | | "type": "string" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式", |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | | }, |
| | | "severity": { |
| | | "description": "严重程度", |
| | | "description": "严重程度id", |
| | | "type": "integer" |
| | | }, |
| | | "solution": { |
| | | "description": "解决方法", |
| | | "type": "string" |
| | | }, |
| | | "solution_remark": { |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | |
| | | "description": "主题", |
| | | "type": "string" |
| | | }, |
| | | "time_spent_id": { |
| | | "timeSpentId": { |
| | | "description": "花费时间", |
| | | "type": "integer" |
| | | } |
| | |
| | | "description": "上门地址", |
| | | "type": "string" |
| | | }, |
| | | "appointment_time": { |
| | | "appointmentTime": { |
| | | "description": "预约上门时间", |
| | | "type": "string" |
| | | }, |
| | | "car_fare": { |
| | | "carFare": { |
| | | "description": "交通费", |
| | | "type": "number" |
| | | }, |
| | | "charge_amount": { |
| | | "chargeAmount": { |
| | | "description": "收费金额", |
| | | "type": "number" |
| | | }, |
| | |
| | | "description": "客户id", |
| | | "type": "integer" |
| | | }, |
| | | "contact_id": { |
| | | "contactId": { |
| | | "description": "联系人id", |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "合同id", |
| | | "type": "integer" |
| | | }, |
| | | "expect_time": { |
| | | "expectTime": { |
| | | "description": "希望处理时间", |
| | | "type": "string" |
| | | }, |
| | | "faqId": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "faultTypeId": { |
| | | "description": "故障类别id", |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | |
| | | "description": "销售订单id", |
| | | "type": "integer" |
| | | }, |
| | | "priority_level_id": { |
| | | "description": "优先级别", |
| | | "priorityLevelId": { |
| | | "description": "优先级别id", |
| | | "type": "integer" |
| | | }, |
| | | "problem_desc": { |
| | | "problemDesc": { |
| | | "description": "问题描述", |
| | | "type": "string" |
| | | }, |
| | | "problem_id": { |
| | | "description": "常见问题id", |
| | | "type": "integer" |
| | | }, |
| | | "productId": { |
| | | "description": "产品id", |
| | | "type": "integer" |
| | | }, |
| | | "real_time": { |
| | | "realTime": { |
| | | "description": "实际处理时间", |
| | | "type": "string" |
| | | }, |
| | |
| | | "type": "string" |
| | | }, |
| | | "serviceTypeId": { |
| | | "description": "服务方式", |
| | | "description": "服务方式id", |
| | | "type": "integer" |
| | | }, |
| | | "severity": { |
| | | "description": "严重程度", |
| | | "description": "严重程度id", |
| | | "type": "integer" |
| | | }, |
| | | "solution": { |
| | | "description": "解决方法", |
| | | "type": "string" |
| | | }, |
| | | "solution_remark": { |
| | | "solutionRemark": { |
| | | "description": "内部备注", |
| | | "type": "string" |
| | | }, |
| | |
| | | "description": "主题", |
| | | "type": "string" |
| | | }, |
| | | "time_spent_id": { |
| | | "timeSpentId": { |
| | | "description": "花费时间", |
| | | "type": "integer" |
| | | } |
| | |
| | | address: |
| | | description: 上门地址 |
| | | type: string |
| | | appointment_time: |
| | | appointmentTime: |
| | | description: 预约上门时间 |
| | | type: string |
| | | car_fare: |
| | | carFare: |
| | | description: 交通费 |
| | | type: number |
| | | charge_amount: |
| | | chargeAmount: |
| | | description: 收费金额 |
| | | type: number |
| | | client: |
| | |
| | | type: integer |
| | | contact: |
| | | $ref: '#/definitions/model.Contact' |
| | | contact_id: |
| | | contactId: |
| | | description: 联系人id |
| | | type: integer |
| | | contract: |
| | |
| | | contractId: |
| | | description: 合同id |
| | | type: integer |
| | | expect_time: |
| | | expectTime: |
| | | description: 希望处理时间 |
| | | type: string |
| | | faq: |
| | | $ref: '#/definitions/model.Faq' |
| | | faqId: |
| | | description: 常见问题id |
| | | type: integer |
| | | faultType: |
| | | $ref: '#/definitions/model.FaultType' |
| | | faultTypeId: |
| | | description: 故障类别id |
| | | type: integer |
| | | id: |
| | | type: integer |
| | | order: |
| | | $ref: '#/definitions/model.OrderManage' |
| | | orderId: |
| | | description: 销售订单id |
| | | type: integer |
| | | priority_level_id: |
| | | description: 优先级别 |
| | | type: integer |
| | | orderManage: |
| | | $ref: '#/definitions/model.OrderManage' |
| | | priorityLevel: |
| | | $ref: '#/definitions/model.PriorityLevel' |
| | | problem_desc: |
| | | priorityLevelId: |
| | | description: 优先级别id |
| | | type: integer |
| | | problemDesc: |
| | | description: 问题描述 |
| | | type: string |
| | | problem_id: |
| | | description: 常见问题id |
| | | type: integer |
| | | product: |
| | | $ref: '#/definitions/model.Product' |
| | | productId: |
| | | description: 产品id |
| | | type: integer |
| | | real_time: |
| | | realTime: |
| | | description: 实际处理时间 |
| | | type: string |
| | | remark: |
| | |
| | | serviceType: |
| | | $ref: '#/definitions/model.ServiceType' |
| | | serviceTypeId: |
| | | description: 服务方式 |
| | | description: 服务方式id |
| | | type: integer |
| | | severity: |
| | | $ref: '#/definitions/model.Severity' |
| | | solution: |
| | | description: 解决方法 |
| | | type: string |
| | | solution_remark: |
| | | solutionRemark: |
| | | description: 内部备注 |
| | | type: string |
| | | status: |
| | |
| | | subject: |
| | | description: 主题 |
| | | type: string |
| | | time_spent_id: |
| | | timeSpent: |
| | | $ref: '#/definitions/model.TimeSpent' |
| | | timeSpentId: |
| | | description: 花费时间 |
| | | type: integer |
| | | type: object |
| | |
| | | address: |
| | | description: 上门地址 |
| | | type: string |
| | | appointment_time: |
| | | appointmentTime: |
| | | description: 预约上门时间 |
| | | type: string |
| | | car_fare: |
| | | carFare: |
| | | description: 交通费 |
| | | type: number |
| | | charge_amount: |
| | | chargeAmount: |
| | | description: 收费金额 |
| | | type: number |
| | | clientId: |
| | | description: 客户id |
| | | type: integer |
| | | contact_id: |
| | | contactId: |
| | | description: 联系人id |
| | | type: integer |
| | | contractId: |
| | | description: 合同id |
| | | type: integer |
| | | expect_time: |
| | | expectTime: |
| | | description: 希望处理时间 |
| | | type: string |
| | | faqId: |
| | | description: 常见问题id |
| | | type: integer |
| | | faultTypeId: |
| | | description: 故障类别id |
| | | type: integer |
| | | orderId: |
| | | description: 销售订单id |
| | | type: integer |
| | | priority_level_id: |
| | | description: 优先级别 |
| | | priorityLevelId: |
| | | description: 优先级别id |
| | | type: integer |
| | | problem_desc: |
| | | problemDesc: |
| | | description: 问题描述 |
| | | type: string |
| | | problem_id: |
| | | description: 常见问题id |
| | | type: integer |
| | | productId: |
| | | description: 产品id |
| | | type: integer |
| | | real_time: |
| | | realTime: |
| | | description: 实际处理时间 |
| | | type: string |
| | | remark: |
| | |
| | | description: 服务单编号 |
| | | type: string |
| | | serviceTypeId: |
| | | description: 服务方式 |
| | | description: 服务方式id |
| | | type: integer |
| | | severity: |
| | | description: 严重程度 |
| | | description: 严重程度id |
| | | type: integer |
| | | solution: |
| | | description: 解决方法 |
| | | type: string |
| | | solution_remark: |
| | | solutionRemark: |
| | | description: 内部备注 |
| | | type: string |
| | | status: |
| | |
| | | subject: |
| | | description: 主题 |
| | | type: string |
| | | time_spent_id: |
| | | timeSpentId: |
| | | description: 花费时间 |
| | | type: integer |
| | | type: object |
| | |
| | | address: |
| | | description: 上门地址 |
| | | type: string |
| | | appointment_time: |
| | | appointmentTime: |
| | | description: 预约上门时间 |
| | | type: string |
| | | car_fare: |
| | | carFare: |
| | | description: 交通费 |
| | | type: number |
| | | charge_amount: |
| | | chargeAmount: |
| | | description: 收费金额 |
| | | type: number |
| | | clientId: |
| | | description: 客户id |
| | | type: integer |
| | | contact_id: |
| | | contactId: |
| | | description: 联系人id |
| | | type: integer |
| | | contractId: |
| | | description: 合同id |
| | | type: integer |
| | | expect_time: |
| | | expectTime: |
| | | description: 希望处理时间 |
| | | type: string |
| | | faqId: |
| | | description: 常见问题id |
| | | type: integer |
| | | faultTypeId: |
| | | description: 故障类别id |
| | | type: integer |
| | | id: |
| | | type: integer |
| | | orderId: |
| | | description: 销售订单id |
| | | type: integer |
| | | priority_level_id: |
| | | description: 优先级别 |
| | | priorityLevelId: |
| | | description: 优先级别id |
| | | type: integer |
| | | problem_desc: |
| | | problemDesc: |
| | | description: 问题描述 |
| | | type: string |
| | | problem_id: |
| | | description: 常见问题id |
| | | type: integer |
| | | productId: |
| | | description: 产品id |
| | | type: integer |
| | | real_time: |
| | | realTime: |
| | | description: 实际处理时间 |
| | | type: string |
| | | remark: |
| | |
| | | description: 服务单编号 |
| | | type: string |
| | | serviceTypeId: |
| | | description: 服务方式 |
| | | description: 服务方式id |
| | | type: integer |
| | | severity: |
| | | description: 严重程度 |
| | | description: 严重程度id |
| | | type: integer |
| | | solution: |
| | | description: 解决方法 |
| | | type: string |
| | | solution_remark: |
| | | solutionRemark: |
| | | description: 内部备注 |
| | | type: string |
| | | status: |
| | |
| | | subject: |
| | | description: 主题 |
| | | type: string |
| | | time_spent_id: |
| | | timeSpentId: |
| | | description: 花费时间 |
| | | type: integer |
| | | type: object |
| | |
| | | description: OK |
| | | schema: |
| | | $ref: '#/definitions/contextx.Response' |
| | | summary: 添加服务类型 |
| | | summary: 添加服务方式 |
| | | tags: |
| | | - 服务类型管理 |
| | | - 服务方式管理 |
| | | /api/serviceType/delete/{id}: |
| | | delete: |
| | | parameters: |
| | |
| | | description: OK |
| | | schema: |
| | | $ref: '#/definitions/contextx.Response' |
| | | summary: 删除服务类型 |
| | | summary: 删除服务方式 |
| | | tags: |
| | | - 服务类型管理 |
| | | - 服务方式管理 |
| | | /api/serviceType/list: |
| | | get: |
| | | produces: |
| | |
| | | $ref: '#/definitions/model.ServiceType' |
| | | type: array |
| | | type: object |
| | | summary: 获取服务类型列表 |
| | | summary: 获取服务方式列表 |
| | | tags: |
| | | - 服务类型管理 |
| | | - 服务方式管理 |
| | | /api/serviceType/update: |
| | | put: |
| | | parameters: |
| | |
| | | description: OK |
| | | schema: |
| | | $ref: '#/definitions/contextx.Response' |
| | | summary: 更新服务类型 |
| | | summary: 更新服务方式 |
| | | tags: |
| | | - 服务类型管理 |
| | | - 服务方式管理 |
| | | /api/severity/add: |
| | | post: |
| | | parameters: |
| | |
| | | // Faq 常见问题 |
| | | Faq struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // FaqSearch 常见问题搜索条件 |
| | | FaqSearch struct { |
| | | Faq |
| | | Orm *gorm.DB |
| | | QueryClass constvar.FaqQueryClass |
| | | KeywordType constvar.FaqKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.FaqQueryClass |
| | | KeywordType constvar.FaqKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | err := db.Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | | // InitDefaultData 初始化数据 |
| | | func (slf *FaqSearch) InitDefaultData() error { |
| | | var ( |
| | | db = slf.Orm.Table(slf.TableName()) |
| | | total int64 = 0 |
| | | ) |
| | | if err := db.Count(&total).Error; err != nil { |
| | | return err |
| | | } |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*Faq{} |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // FaultType 故障类别 |
| | | FaultType struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // FaultTypeSearch 故障类别搜索条件 |
| | | FaultTypeSearch struct { |
| | | FaultType |
| | | Orm *gorm.DB |
| | | QueryClass constvar.FaultTypeQueryClass |
| | | KeywordType constvar.FaultTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.FaultTypeQueryClass |
| | | KeywordType constvar.FaultTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | err := db.Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | | // InitDefaultData 初始化数据 |
| | | func (slf *FaultTypeSearch) InitDefaultData() error { |
| | | var ( |
| | | db = slf.Orm.Table(slf.TableName()) |
| | | total int64 = 0 |
| | | ) |
| | | if err := db.Count(&total).Error; err != nil { |
| | | return err |
| | | } |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*FaultType{} |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // PriorityLevel 优先级别 |
| | | PriorityLevel struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // PriorityLevelSearch 优先级别搜索条件 |
| | | PriorityLevelSearch struct { |
| | | PriorityLevel |
| | | Orm *gorm.DB |
| | | QueryClass constvar.PriorityLevelQueryClass |
| | | KeywordType constvar.PriorityLevelKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.PriorityLevelQueryClass |
| | | KeywordType constvar.PriorityLevelKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*PriorityLevel{ |
| | | {Name: "低"}, |
| | | {Name: "一般"}, |
| | | {Name: "高"}, |
| | | {Name: "紧急"}, |
| | | } |
| | | records := []*PriorityLevel{} |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | ) |
| | | |
| | | type AddServiceOrder struct { |
| | | ServiceNumber string `gorm:"service_number" json:"serviceNumber"` // 服务单编号 |
| | | ClientId int `gorm:"client_id" json:"clientId"` // 客户id |
| | | ContractId int `gorm:"contract_id" json:"contractId"` // 合同id |
| | | OrderId int `gorm:"order_id" json:"orderId"` // 销售订单id |
| | | Subject string `gorm:"subject" json:"subject"` // 主题 |
| | | ProductId int `gorm:"product_id" json:"productId"` // 产品id |
| | | ServiceTypeId int `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式 |
| | | ServiceManId int `gorm:"service_man_id" json:"serviceManId"` // 服务人员 |
| | | ContactId int `gorm:"linkman_id" json:"contact_id"` // 联系人id |
| | | Address string `gorm:"address" json:"address"` // 上门地址 |
| | | PriorityLevelId int `gorm:"priority_level_id" json:"priority_level_id"` // 优先级别 |
| | | AppointmentTime string `gorm:"appointment_time" json:"appointment_time"` // 预约上门时间 |
| | | SaleChanceId int `gorm:"sale_leads" json:"saleChanceId"` // 销售机会id |
| | | SeverityId int `gorm:"severity_id" json:"severity"` // 严重程度 |
| | | Status int `gorm:"status" json:"status"` // 处理状态 |
| | | ExpectTime string `gorm:"expect_time" json:"expect_time"` // 希望处理时间 |
| | | RealTime string `gorm:"real_time" json:"real_time"` // 实际处理时间 |
| | | CarFare float64 `gorm:"car_fare" json:"car_fare"` // 交通费 |
| | | ChargeAmount float64 `gorm:"charge_amount" json:"charge_amount"` // 收费金额 |
| | | TimeSpentId int `gorm:"time_spent_id" json:"time_spent_id"` // 花费时间 |
| | | FaqId int `gorm:"problem_id" json:"problem_id"` // 常见问题id |
| | | ProblemDesc string `gorm:"problem_desc" json:"problem_desc"` // 问题描述 |
| | | Solution string `gorm:"solution" json:"solution"` // 解决方法 |
| | | SolutionRemark string `gorm:"solution_remark" json:"solution_remark"` // 内部备注 |
| | | Remark string `gorm:"remark" json:"remark"` // 备注 |
| | | ServiceNumber string `gorm:"service_number" json:"serviceNumber"` // 服务单编号 |
| | | ClientId int `gorm:"client_id" json:"clientId"` // 客户id |
| | | ContractId int `gorm:"contract_id" json:"contractId"` // 合同id |
| | | OrderId int `gorm:"order_id" json:"orderId"` // 销售订单id |
| | | Subject string `gorm:"subject" json:"subject"` // 主题 |
| | | ProductId int `gorm:"product_id" json:"productId"` // 产品id |
| | | ServiceTypeId int `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式id |
| | | ServiceManId int `gorm:"service_man_id" json:"serviceManId"` // 服务人员 |
| | | ContactId int `gorm:"linkman_id" json:"contactId"` // 联系人id |
| | | Address string `gorm:"address" json:"address"` // 上门地址 |
| | | PriorityLevelId int `gorm:"priority_level_id" json:"priorityLevelId"` // 优先级别id |
| | | AppointmentTime string `gorm:"appointment_time" json:"appointmentTime"` // 预约上门时间 |
| | | SaleChanceId int `gorm:"sale_leads" json:"saleChanceId"` // 销售机会id |
| | | FaultTypeId int `gorm:"severity_id" json:"faultTypeId"` // 故障类别id |
| | | SeverityId int `gorm:"severity_id" json:"severity"` // 严重程度id |
| | | Status int `gorm:"status" json:"status"` // 处理状态 |
| | | ExpectTime string `gorm:"expect_time" json:"expectTime"` // 希望处理时间 |
| | | RealTime string `gorm:"real_time" json:"realTime"` // 实际处理时间 |
| | | CarFare float64 `gorm:"car_fare" json:"carFare"` // 交通费 |
| | | ChargeAmount float64 `gorm:"charge_amount" json:"chargeAmount"` // 收费金额 |
| | | TimeSpentId int `gorm:"time_spent_id" json:"timeSpentId"` // 花费时间 |
| | | FaqId int `gorm:"problem_id" json:"faqId"` // 常见问题id |
| | | ProblemDesc string `gorm:"problem_desc" json:"problemDesc"` // 问题描述 |
| | | Solution string `gorm:"solution" json:"solution"` // 解决方法 |
| | | SolutionRemark string `gorm:"solution_remark" json:"solutionRemark"` // 内部备注 |
| | | Remark string `gorm:"remark" json:"remark"` // 备注 |
| | | } |
| | | |
| | | type UpdateServiceOrder struct { |
| | |
| | | Subject string `gorm:"subject" json:"subject"` // 主题 |
| | | ProductId int `gorm:"product_id" json:"productId"` // 产品id |
| | | Product Product `gorm:"foreignKey:ProductId"` |
| | | ServiceTypeId int `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式 |
| | | ServiceTypeId int `gorm:"service_type_id" json:"serviceTypeId"` // 服务方式id |
| | | ServiceType ServiceType `gorm:"foreignKey:ServiceTypeId"` |
| | | ServiceManId int `gorm:"service_man_id" json:"serviceManId"` // 服务人员 |
| | | ContactId int `gorm:"linkman_id" json:"contact_id"` // 联系人id |
| | | ContactId int `gorm:"linkman_id" json:"contactId"` // 联系人id |
| | | Contact Contact `gorm:"foreignKey:ContactId"` |
| | | Address string `gorm:"address" json:"address"` // 上门地址 |
| | | PriorityLevelId int `gorm:"priority_level_id" json:"priority_level_id"` // 优先级别 |
| | | Address string `gorm:"address" json:"address"` // 上门地址 |
| | | PriorityLevelId int `gorm:"priority_level_id" json:"priorityLevelId"` // 优先级别id |
| | | PriorityLevel PriorityLevel `gorm:"foreignKey:PriorityLevelId"` |
| | | AppointmentTime string `gorm:"appointment_time" json:"appointment_time"` // 预约上门时间 |
| | | SaleChanceId int `gorm:"sale_leads" json:"saleChanceId"` // 销售机会id |
| | | SaleChance SaleChance `gorm:"foreignKey:SaleChanceId"` |
| | | SeverityId int `gorm:"severity_id" json:"severity"` // 严重程度 |
| | | Severity Severity `gorm:"foreignKey:SeverityId"` |
| | | Status int `gorm:"status" json:"status"` // 处理状态 |
| | | ExpectTime string `gorm:"expect_time" json:"expect_time"` // 希望处理时间 |
| | | RealTime string `gorm:"real_time" json:"real_time"` // 实际处理时间 |
| | | CarFare float64 `gorm:"car_fare" json:"car_fare"` // 交通费 |
| | | ChargeAmount float64 `gorm:"charge_amount" json:"charge_amount"` // 收费金额 |
| | | TimeSpentId int `gorm:"time_spent_id" json:"time_spent_id"` // 花费时间 |
| | | FaqId int `gorm:"problem_id" json:"problem_id"` // 常见问题id |
| | | Faq Faq `gorm:"foreignKey:FaqId"` |
| | | ProblemDesc string `gorm:"problem_desc" json:"problem_desc"` // 问题描述 |
| | | Solution string `gorm:"solution" json:"solution"` // 解决方法 |
| | | SolutionRemark string `gorm:"solution_remark" json:"solution_remark"` // 内部备注 |
| | | Remark string `gorm:"remark" json:"remark"` // 备注 |
| | | AppointmentTime string `gorm:"appointment_time" json:"appointmentTime"` // 预约上门时间 |
| | | SaleChanceId int `gorm:"sale_leads" json:"saleChanceId"` // 销售机会id |
| | | |
| | | SaleChance SaleChance `gorm:"foreignKey:SaleChanceId"` |
| | | FaultTypeId int `gorm:"severity_id" json:"faultTypeId"` // 故障类别id |
| | | FaultType FaultType `gorm:"foreignKey:FaultTypeId"` |
| | | SeverityId int `gorm:"severity_id" json:"severity"` // 严重程度id |
| | | Severity Severity `gorm:"foreignKey:SeverityId"` |
| | | Status int `gorm:"status" json:"status"` // 处理状态 |
| | | ExpectTime string `gorm:"expect_time" json:"expectTime"` // 希望处理时间 |
| | | RealTime string `gorm:"real_time" json:"realTime"` // 实际处理时间 |
| | | CarFare float64 `gorm:"car_fare" json:"carFare"` // 交通费 |
| | | ChargeAmount float64 `gorm:"charge_amount" json:"chargeAmount"` // 收费金额 |
| | | TimeSpentId int `gorm:"time_spent_id" json:"timeSpentId"` // 花费时间 |
| | | TimeSpent TimeSpent `gorm:"foreignKey:TimeSpentId"` |
| | | FaqId int `gorm:"problem_id" json:"faqId"` // 常见问题id |
| | | Faq Faq `gorm:"foreignKey:FaqId"` |
| | | ProblemDesc string `gorm:"problem_desc" json:"problemDesc"` // 问题描述 |
| | | Solution string `gorm:"solution" json:"solution"` // 解决方法 |
| | | SolutionRemark string `gorm:"solution_remark" json:"solutionRemark"` // 内部备注 |
| | | Remark string `gorm:"remark" json:"remark"` // 备注 |
| | | } |
| | | |
| | | // ServiceOrderSearch 服务单搜索条件 |
| | |
| | | ) |
| | | |
| | | type ( |
| | | // ServiceType 服务类型 |
| | | // ServiceType 服务方式 |
| | | ServiceType struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // ServiceTypeSearch 服务类型搜索条件 |
| | | // ServiceTypeSearch 服务方式搜索条件 |
| | | ServiceTypeSearch struct { |
| | | ServiceType |
| | | Orm *gorm.DB |
| | | QueryClass constvar.ServiceTypeQueryClass |
| | | KeywordType constvar.ServiceTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.ServiceTypeQueryClass |
| | | KeywordType constvar.ServiceTypeKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*ServiceType{ |
| | | {Name: "电话"}, |
| | | {Name: "远程"}, |
| | | {Name: "送修"}, |
| | | {Name: "上门"}, |
| | | {Name: "其他"}, |
| | | } |
| | | records := []*ServiceType{} |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // Severity 严重程度 |
| | | Severity struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // SeveritySearch 严重程度搜索条件 |
| | | SeveritySearch struct { |
| | | Severity |
| | | Orm *gorm.DB |
| | | QueryClass constvar.SeverityQueryClass |
| | | KeywordType constvar.SeverityKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.SeverityQueryClass |
| | | KeywordType constvar.SeverityKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*Severity{ |
| | | {Name: "轻"}, |
| | | {Name: "严重"}, |
| | | {Name: "较严重"}, |
| | | {Name: "特严重"}, |
| | | } |
| | | records := []*Severity{} |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | // TimeSpent 花费时间 |
| | | TimeSpent struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // TimeSpentSearch 花费时间搜索条件 |
| | | TimeSpentSearch struct { |
| | | TimeSpent |
| | | Orm *gorm.DB |
| | | QueryClass constvar.TimeSpentQueryClass |
| | | KeywordType constvar.TimeSpentKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.TimeSpentQueryClass |
| | | KeywordType constvar.TimeSpentKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*TimeSpent{ |
| | | {Name: "1小时"}, |
| | | {Name: "2小时"}, |
| | | {Name: "0.5个工作日"}, |
| | | {Name: "1个工作日"}, |
| | | {Name: "2个工作日"}, |
| | | {Name: "2个工作日以上"}, |
| | | } |
| | | records := []*TimeSpent{} |
| | | return slf.CreateBatch(records) |
| | | } |
| | |
| | | ServiceTypeRouter := router.Group("serviceType") |
| | | ServiceTypeApi := v1.ServiceTypeApi{} |
| | | { |
| | | ServiceTypeRouter.POST("add", ServiceTypeApi.Add) // 添加服务类型 |
| | | ServiceTypeRouter.DELETE("delete/:id", ServiceTypeApi.Delete) // 删除服务类型 |
| | | ServiceTypeRouter.PUT("update", ServiceTypeApi.Update) // 更新服务类型 |
| | | ServiceTypeRouter.GET("list", ServiceTypeApi.List) // 获取服务类型列表 |
| | | ServiceTypeRouter.POST("add", ServiceTypeApi.Add) // 添加服务方式 |
| | | ServiceTypeRouter.DELETE("delete/:id", ServiceTypeApi.Delete) // 删除服务方式 |
| | | ServiceTypeRouter.PUT("update", ServiceTypeApi.Update) // 更新服务方式 |
| | | ServiceTypeRouter.GET("list", ServiceTypeApi.List) // 获取服务方式列表 |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | func (FaqService) UpdateFaq(faq *model.Faq) int { |
| | | err := model.NewFaqSearch().Save(faq) |
| | | err := model.NewFaqSearch().SetId(faq.Id).Save(faq) |
| | | if err != nil { |
| | | return ecode.DBErr |
| | | } |
| | |
| | | } |
| | | |
| | | func (FaultTypeService) UpdateFaultType(faultType *model.FaultType) int { |
| | | err := model.NewFaultTypeSearch().Save(faultType) |
| | | err := model.NewFaultTypeSearch().SetId(faultType.Id).Save(faultType) |
| | | if err != nil { |
| | | return ecode.DBErr |
| | | } |
| | |
| | | } |
| | | |
| | | func (PriorityLevelService) UpdatePriorityLevel(priorityLevel *model.PriorityLevel) int { |
| | | err := model.NewPriorityLevelSearch().Save(priorityLevel) |
| | | err := model.NewPriorityLevelSearch().SetId(priorityLevel.Id).Save(priorityLevel) |
| | | if err != nil { |
| | | return ecode.DBErr |
| | | } |
| | |
| | | } |
| | | |
| | | func (ServiceOrderService) UpdateServiceOrder(serviceOrder *model.ServiceOrder) int { |
| | | err := model.NewServiceOrderSearch().Save(serviceOrder) |
| | | err := model.NewServiceOrderSearch().SetId(serviceOrder.Id).Save(serviceOrder) |
| | | if err != nil { |
| | | return ecode.DBErr |
| | | } |
| | |
| | | } |
| | | |
| | | func (ServiceTypeService) UpdateServiceType(serviceType *model.ServiceType) int { |
| | | err := model.NewServiceTypeSearch().Save(serviceType) |
| | | err := model.NewServiceTypeSearch().SetId(serviceType.Id).Save(serviceType) |
| | | if err != nil { |
| | | return ecode.DBErr |
| | | } |
| | |
| | | } |
| | | |
| | | func (SeverityService) UpdateSeverity(severity *model.Severity) int { |
| | | err := model.NewSeveritySearch().Save(severity) |
| | | err := model.NewSeveritySearch().SetId(severity.Id).Save(severity) |
| | | if err != nil { |
| | | return ecode.DBErr |
| | | } |
| | |
| | | } |
| | | |
| | | func (TimeSpentService) UpdateTimeSpent(timeSpent *model.TimeSpent) int { |
| | | err := model.NewTimeSpentSearch().Save(timeSpent) |
| | | err := model.NewTimeSpentSearch().SetId(timeSpent.Id).Save(timeSpent) |
| | | if err != nil { |
| | | return ecode.DBErr |
| | | } |