commit
c6f135eb65
@ -585,3 +585,42 @@ func UrgeWorkOrder(c *gin.Context) {
|
||||
|
||||
app.OK(c, "", "")
|
||||
}
|
||||
|
||||
// 主动处理
|
||||
func ActiveOrder(c *gin.Context) {
|
||||
var (
|
||||
workOrderId string
|
||||
err error
|
||||
stateValue []struct {
|
||||
ID string `json:"id"`
|
||||
Label string `json:"label"`
|
||||
ProcessMethod string `json:"process_method"`
|
||||
Processor []int `json:"processor"`
|
||||
}
|
||||
stateValueByte []byte
|
||||
)
|
||||
|
||||
workOrderId = c.Param("id")
|
||||
|
||||
err = c.ShouldBind(&stateValue)
|
||||
if err != nil {
|
||||
app.Error(c, -1, err, "")
|
||||
return
|
||||
}
|
||||
|
||||
stateValueByte, err = json.Marshal(stateValue)
|
||||
if err != nil {
|
||||
app.Error(c, -1, fmt.Errorf("转byte失败,%v", err.Error()), "")
|
||||
return
|
||||
}
|
||||
|
||||
err = orm.Eloquent.Model(&process.WorkOrderInfo{}).
|
||||
Where("id = ?", workOrderId).
|
||||
Update("state", stateValueByte).Error
|
||||
if err != nil {
|
||||
app.Error(c, -1, fmt.Errorf("接单失败,%v", err.Error()), "")
|
||||
return
|
||||
}
|
||||
|
||||
app.OK(c, "", "接单成功,请及时处理")
|
||||
}
|
||||
|
@ -277,6 +277,8 @@ INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `title`, `icon`, `path`, `paths`,
|
||||
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `title`, `icon`, `path`, `paths`, `menu_type`, `action`, `permission`, `parent_id`, `no_cache`, `breadcrumb`, `component`, `sort`, `visible`, `create_by`, `update_by`, `is_frame`, `create_time`, `update_time`, `delete_time`) VALUES (357, '', '保存LDAP配置', '', '', '/0/2/352/357', 'F', '', 'system:settings:index:ldap', 352, '0', '', '', 0, '0', '1', '', 1, '2020-08-19 13:29:08', '2020-08-19 13:29:08', NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `title`, `icon`, `path`, `paths`, `menu_type`, `action`, `permission`, `parent_id`, `no_cache`, `breadcrumb`, `component`, `sort`, `visible`, `create_by`, `update_by`, `is_frame`, `create_time`, `update_time`, `delete_time`) VALUES (358, '', '清空登录日志', '', '/api/v1/loginlog', '/0/63/280/214/358', 'A', 'DELETE', '', 214, '0', '', '', 0, '1', '1', '', 1, '2020-08-27 10:00:11', '2020-08-27 10:00:11', NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `title`, `icon`, `path`, `paths`, `menu_type`, `action`, `permission`, `parent_id`, `no_cache`, `breadcrumb`, `component`, `sort`, `visible`, `create_by`, `update_by`, `is_frame`, `create_time`, `update_time`, `delete_time`) VALUES (359, '', '清空登录日志', '', '', '/0/2/212/359', 'F', 'DELETE', 'system:sysloginlog:clean', 212, '0', '', '', 0, '0', '1', '', 1, '2020-08-27 10:01:12', '2020-08-27 10:01:12', NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `title`, `icon`, `path`, `paths`, `menu_type`, `action`, `permission`, `parent_id`, `no_cache`, `breadcrumb`, `component`, `sort`, `visible`, `create_by`, `update_by`, `is_frame`, `create_time`, `update_time`, `delete_time`) VALUES (360, '', '主动接单', 'bug', '/api/v1/work-order/active-order/:id', '/0/63/281/326/360', 'A', 'PUT', '', 326, '0', '', '', 0, '1', '1', '1', 1, '2020-09-01 19:02:01', '2020-09-01 19:02:10', NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `title`, `icon`, `path`, `paths`, `menu_type`, `action`, `permission`, `parent_id`, `no_cache`, `breadcrumb`, `component`, `sort`, `visible`, `create_by`, `update_by`, `is_frame`, `create_time`, `update_time`, `delete_time`) VALUES (361, '', '主动接单', '', '', '/0/268/329/361', 'F', '', 'process:list:handle:active', 329, '0', '', '', 0, '0', '1', '', 1, '2020-09-01 19:03:52', '2020-09-01 19:03:52', NULL);
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
|
@ -22,5 +22,6 @@ func RegisterWorkOrderRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMidd
|
||||
workOrderRouter.GET("/unity", process.UnityWorkOrder)
|
||||
workOrderRouter.POST("/inversion", process.InversionWorkOrder)
|
||||
workOrderRouter.GET("/urge", process.UrgeWorkOrder)
|
||||
workOrderRouter.PUT("/active-order/:id", process.ActiveOrder)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user