Giter Site home page Giter Site logo

lanyulei / ferry Goto Github PK

View Code? Open in Web Editor NEW
6.0K 6.0K 1.1K 6.47 MB

本系统是集工单统计、任务钩子、权限管理、灵活配置流程与模版等等于一身的开源工单系统,当然也可以称之为工作流引擎。 致力于减少跨部门之间的沟通,自动任务的执行,提升工作效率与工作质量,减少不必要的工作量与人为出错率。

License: MIT License

Makefile 0.01% Go 1.97% PLpgSQL 0.82% HTML 0.14% Shell 0.06% Python 0.01% Dockerfile 0.01% JavaScript 96.99%

ferry's Introduction

ferry's People

Contributors

acdiost avatar chenhaohu avatar fanliangbin320 avatar forgethub avatar gakkiyomi avatar kagurazakanyaa avatar lanyulei avatar liouxiao avatar mhxw avatar mizhexiaoxiao avatar mr-changk avatar niujinkai avatar qknow-w avatar sp3c73r2038 avatar wumanho avatar xiaolei-shuai avatar zixiliuyue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ferry's Issues

多次调用AuthCheckRole导致效率慢

Describe the bug

原因:
RegisterBaseRouter 和 RegisterPageRouter 方法没有使用 v1.Group(“XXX”)的方法,而后面的.Use(middleware.AuthCheckRole()) 作用于全局对象。

例如:
访问 /dept/:deptId 这个接口,会调用3次AuthCheckRole()这个方法,这3次分别是由以下方法添加进去的。
RegisterBaseRouter 1次全局
RegisterPageRouter 1次全局
RegisterDeptRouter 1次局部

测试方法:在AuthCheckRole 中增加一个Trace 以便打印方法进出的时间,我们会明显看到调用3次的日志

//权限检查中间件
func AuthCheckRole() gin.HandlerFunc {
return func(c *gin.Context) {
defer Trace("AuthCheckRole")()
data, _ := c.Get("JWT_PAYLOAD")

Trace方法如下
func Trace(msg string) func() {
start := time.Now()
fmt.Printf("enter %s\n", msg)
return func() {
fmt.Printf("exit %s (%s)\n", msg, time.Since(start))
}
}

Feature:模板基础字段中提供密码插件

背景

  • 在工单的实际使用过程中,工单中可能会有部分字段属于个人私有信息,不应当对外暴露

思路

  1. 在工单的模板管理->编辑模板->基础字段中增加密码插件
  2. 在提交申请后,工单的查询和审批界面不应当显示具体的私有信息
  3. 在Python或者Shell后端执行的脚本能够获取到具体的私有信息

切换用户登录时报告404错误

复现步骤:
1、使用admin用户登录后,修改接口权限,保存并退出登录
2、使用普通用户登录(Ldap身份认证),报告404错误
3、然后点“Back to Home”,就直接登录了
4、再次点击退出登录,然后再次登录就正常了

希望加入工时统计

期望加入工时统计功能,这样可以查看每个月每个员工都处理了多少工单,用了多少工时。考核员工工作量

安装完成后,配置好流程试用创建新工单时提交报错

/api/v1/work-order/create

192.168.100.223:56151是我路由器的地址,不知道为什么会连到这个端口和ip

2020/11/02 15:58:52 http: panic serving 192.168.100.223:56151: interface conversion: interface {} is nil, not string
goroutine 59 [running]:
net/http.(*conn).serve.func1(0xc002fdfb80)
/usr/local/go/src/net/http/server.go:1801 +0x147
panic(0x14b3e00, 0xc000c98750)
/usr/local/go/src/runtime/panic.go:975 +0x47a
ferry/middleware.CustomError.func1(0xc002ff89c0)
/home/www/ferry/middleware/customerror.go:44 +0x5d3
panic(0x14b3e00, 0xc000c98750)
/usr/local/go/src/runtime/panic.go:969 +0x1b9
ferry/pkg/service.CreateWorkOrder(0xc002ff89c0, 0x140bec0, 0x192d0e0)
/home/www/ferry/pkg/service/createWorkOrder.go:106 +0x3f5f
ferry/apis/process.AddWorkOrder(0xc002ff89c0)
/home/www/ferry/apis/process/workOrder.go:60 +0x6a
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.AuthCheckRole.func1(0xc002ff89c0)
/home/www/ferry/middleware/permission.go:28 +0x67b
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/pkg/jwtauth.(*GinJWTMiddleware).middlewareImpl(0xc0006c2900, 0xc002ff89c0)
/home/www/ferry/pkg/jwtauth/jwtauth.go:406 +0x2de
ferry/pkg/jwtauth.(*GinJWTMiddleware).MiddlewareFunc.func1(0xc002ff89c0)
/home/www/ferry/pkg/jwtauth/jwtauth.go:369 +0x34
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.AuthCheckRole.func1(0xc002ff89c0)
/home/www/ferry/middleware/permission.go:28 +0x67b
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/pkg/jwtauth.(*GinJWTMiddleware).middlewareImpl(0xc0006c2900, 0xc002ff89c0)
/home/www/ferry/pkg/jwtauth/jwtauth.go:406 +0x2de
ferry/pkg/jwtauth.(*GinJWTMiddleware).MiddlewareFunc.func1(0xc002ff89c0)
/home/www/ferry/pkg/jwtauth/jwtauth.go:369 +0x34
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.AuthCheckRole.func1(0xc002ff89c0)
/home/www/ferry/middleware/permission.go:28 +0x67b
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/pkg/jwtauth.(*GinJWTMiddleware).middlewareImpl(0xc0006c2900, 0xc002ff89c0)
/home/www/ferry/pkg/jwtauth/jwtauth.go:406 +0x2de
ferry/pkg/jwtauth.(*GinJWTMiddleware).MiddlewareFunc.func1(0xc002ff89c0)
/home/www/ferry/pkg/jwtauth/jwtauth.go:369 +0x34
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.RequestId.func1(0xc002ff89c0)
/home/www/ferry/middleware/requestid.go:24 +0x1eb
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.Options(0xc002ff89c0)
/home/www/ferry/middleware/header.go:23 +0x3d
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.NoCache(0xc002ff89c0)
/home/www/ferry/middleware/header.go:15 +0x16a
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.CustomError(0xc002ff89c0)
/home/www/ferry/middleware/customerror.go:48 +0x4e
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
ferry/middleware.LoggerToFile.func1(0xc002ff89c0)
/home/www/ferry/middleware/logger.go:18 +0x6b
github.com/gin-gonic/gin.(*Context).Next(0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 +0x3b
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000160280, 0xc002ff89c0)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:403 +0x685
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000160280, 0x1979980, 0xc003686700, 0xc000404100)
/root/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:364 +0x14d
net/http.serverHandler.ServeHTTP(0xc0002582a0, 0x1979980, 0xc003686700, 0xc000404100)
/usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc002fdfb80, 0x197ebc0, 0xc0036801c0)
/usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2969 +0x36c

搜索方面的建议-和其他一些bug的提交

级联选择器有问题

级联选择器没有设置列表项的地方

image-20200929150358499

image-20200929150232023

紧急需求

所有工单列表支持模糊搜索

希望添加所有工单列表支持模糊搜索和自定义字段搜索包括级联选择项里面的字段进行筛选查询

类似于如图这种

image-20200929150305639

image-20200929150008968

次级需求

首页图表展现页面能自定义字段展示

image-20200929164428224

现在首页显示的是用户提交的工单排名,在实际过程中,这个并不是很需要的,能否自定义字段展示比如某个产品的工单数量。

次级需求

所有工单展示页列表项支持自定义字段显示

希望添加工单展示页列表项除了系统定义的id/标题/当前状态/当前处理人/优先级/创建时间/操作/ 等 还能支持自定义字段展示并可以排序保存。或者提供可定制页面保存。

image-20200929150059817

image-20200929150134531

次次次级需求

图片上传有问题

image
image
1.图片上传有问题
2.创建新的普通用户后,所有用户图片都不能上传。都是以上截图的报错

上传了文件,但是创建者和审批者,都预览不到内容

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
__

执行脚本出错

执行脚本时报错怎么解决?
{"level":"error","ts":"2020-10-07 21:58:50.035036","caller":"worker/tasks.go:19","msg":"task exec failed,fork/exec ./static/scripts/echo_test-4171bc7f4a05-admin.sh: permission deied"}。
谢谢!

我有两个人一起会签,只要有一个同意,这个事情就通过了

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Feature:工单模板向Python脚本传参使用Dict格式

背景

  • 目前模板向Python模板的传参使用的是list格式,Python通过app(*args)方法接受参数,这样会导致代码维护困难,需要严格按照顺序接受参数。如果模板发生修改,在更新相应脚本的过程中容易出错。

思路

  • 模板管理下的编辑模板中的预览提供获取数据功能,是以{"字段名称":参数值}的json格式返回
  • 模板中提供了字段标示的修改功能

考虑将Python的app(*args)变为app(**kwargs)。在设计模板的时候修改字段标示的值。在编写app函数的时候,可以直接通过字段标示设置的变量名获取对应的模板中的参数值,方便不容易出错

文件上传Bug

模板中增加文件上传,但是文件上传后找不到上传的文件,接口使用的还是图片上传地址
image

执行任务脚本问题

1、执行python脚本报错,shell 脚本执行也不需要 -c 参数。修改为下面代码正常运行
task.go :
func executeTaskBase(classify string, scriptPath string) {

command := exec.Command("/bin/bash", scriptPath) //初始化Cmd
if classify == "python" {
	command = exec.Command("python", scriptPath) //初始化Cmd
}

}

2、流程在某个节点处理时调用任务的时候,应该需要获取任务执行状态,如果失败需要手动处理完再进去下个环节

图片上传bug

requestHostList := strings.Split(c.Request.Host, ":")
	if len(requestHostList) > 0 && requestHostList[1] == "80" {
		requestHost = requestHostList[0]
	} else {
		requestHost = c.Request.Host
	}

requestHostList[1]存在越界

查看工单详情,登录跳转问题

未登录情况下,收到工单邮件后,点击连接登录后跳转没携带参数,导致工单查看出错
修改permission.js 中 “next(/login?redirect=${to.fullPath})”,问题修复

建议线上部署时增加前端免nginx的部署方式

目前线上部署的时候,前端代码需要通过部署nginx来代理,这个会增加部署难度和后期线上出问题的可能性。
希望能增加一种ferry+前端代码的直接部署方式,即通过修改gin来实现前端静态资源的直接访问。

上传图片时一直是0%,无法确定是否上传成功

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

点击我的待办,不能获取到内容,只能重新登录

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.