Skip to content

Commit

Permalink
alert msg when error occured
Browse files Browse the repository at this point in the history
  • Loading branch information
wangfei committed Apr 4, 2020
1 parent 88aa401 commit b5978d9
Show file tree
Hide file tree
Showing 6 changed files with 2,062 additions and 3,314 deletions.
51 changes: 24 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

## 介绍
该系统为[loonflow](https://github.com/blackholll/loonflow)第三方调用程序,可以理解为OA或运维工单系统
该系统为[loonflow](https://github.com/blackholll/loonflow)第三方调用程序,可以理解为OA、运维系统、客服系统、请假申请系统
本系统使用Vue.js + Django开发,前端展示由loonflow配置决定,可以说前端是全动态,只需要配置好loonflow即可。如果您有使用上的问题可以加入我们:QQ(558788490)。

## 展示
Expand All @@ -14,47 +14,38 @@
> ![detail-ticket](https://github.com/youshutong2080/shutongFlow/blob/master/docs/images/detail-ticket.png)

## 进度

#### 完成申请说明富文本编辑器 2018-06-08 23:22:00
- 新增附件和图片上传接口;
- 配置UEditor正常使用;
- 重新优化交互体验;

#### 待办
- 前端展示附件及图片;
- 配置ldap实例同步脚本;

## 提示:
- 建议重新拉取代码,并重新配置数据库及服务;

## 部署
shutongflow当前定位还是作为loonflow调用方的demo(只实现了调用方简单功能),所以暂时只给出开发环境启动方式。如果你基于shutongflow做了二次开发。
相信你已经知道如何生成环境部署shutongflow

### shutongFlow
```bash
# 按照loonflow的文档启动loonflow

## 这里使用conda作为虚拟环境,如果你使用virtualenv只是激活命令不一样;
Webb@MacBookPro ~/Developer/Python/loonflow/loonflow$ source activate loonflow
(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/loonflow$ pip install -r apps/requirements.txt

# 初始化数据库
(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/loonflow$ mysql -uroot
Webb@MacBookPro ~/Developer$ mysql -uroot
> create database shutongflow default charset utf8;
> create database loonflownew default charset utf8;
> grant all privileges on shutongflow.* to [email protected] identified by '123456';
> grant all privileges on loonflownew.* to [email protected] identified by '123456';

(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/loonflow$ python manage.py makemigrations
(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/loonflow$ python manage.py migrate

(shutongflow) Webb@MacBookPro ~/Developer/Python/loonflow/shutongFlow/apps$ python manage.py makemigrations
(shutongflow) Webb@MacBookPro ~/Developer/Python/loonflow/shutongFlow/apps$ python manage.py migrate

## 导入第三方数据(这里主要是用户数据)
(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/shutongFlow$ mysql -uroot shutongflow < shutongflow.sql
## 导入loonflow数据(配置数据及用户数据)
(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/shutongFlow$ mysql -uroot loonflownew < loonflownew.sql
## 导入shutongflow的初始数据
(shutongflow) Webb@MacBookPro ~/Developer/Python/loonflow/shutongFlow$ mysql -uroot shutongflow < shutongflow.sql

## 修改shutongflow中的配置
Webb@MacBookPro ~/Developer/Python/loonflow/loonflow/apps/apps/$ vim settings.py
修改loonflow的信息
WORKFLOWBACKENDURL = "http://127.0.0.1:6060" # loonflow的启动地址及端口
WORKFLOWTOKEN = "8cd585da-3cc6-11e8-9946-784f437daad6" # loonflow管理后台中"用户及权限"-"调用权限"中记录的token
WORKFLOWAPP="ops" # loonflow管理后台中"用户及权限"-"调用权限"中记录的应用名

## 启动shutongFlow和loonflow
(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/loonflow$ python manage.py runserver 0.0.0.0:6060 # 启动loonflow
## 启动shutongFlow
(loonflow) Webb@MacBookPro ~/Developer/Python/loonflow/loonflow$ python manage.py runserver 0.0.0.0:6060 # 启动loonflow
(shutongflow) Webb@MacBookPro ~/Developer/Python/loonflow/shutongFlow/apps$ python manage.py runserver 0.0.0.0:6062 # 启动shutongflow

## 启动vue
Expand All @@ -80,3 +71,9 @@ shutongFlow中所有普通用户

管理员为
'admin': `yxuqtr`

## 注意
使用shutongflow中用户创建工单前先检查改用户是否在loonflow中存在。以下情况会有问题:
1. 所选的工作流工单创建后的状态的处理人类型是创建人tl,而创建人在loonflow中不存在。因为loonflow在创建或处理
工单会在loonflow的用户记录找到这个用户,然后找到这个用户的所在部门,再找到这个部门的审批人或者leader

18 changes: 9 additions & 9 deletions apps/service/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get(self, request, format='json'):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)


Expand All @@ -53,7 +53,7 @@ def retrieve(self, request, pk=None):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)


Expand All @@ -72,7 +72,7 @@ def create(self, request):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)


Expand All @@ -99,7 +99,7 @@ def list(self, request, format='json'):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)

def retrieve(self, request, pk=None):
Expand All @@ -113,7 +113,7 @@ def retrieve(self, request, pk=None):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)

def partial_update(self, request, pk=None):
Expand All @@ -128,7 +128,7 @@ def partial_update(self, request, pk=None):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)


Expand All @@ -148,7 +148,7 @@ def retrieve(self, request, pk=None):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)


Expand All @@ -167,7 +167,7 @@ def retrieve(self, request, pk=None):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)


Expand All @@ -186,7 +186,7 @@ def retrieve(self, request, pk=None):
return Response({'code': resp['code'], 'data': resp['data'], 'msg': resp['msg']},
status=status_resp)
else:
status_resp = status.HTTP_400_BAD_REQUEST
status_resp = status.HTTP_200_OK
return Response({'code': resp['code'], 'data': None, 'msg': resp['msg']}, status=status_resp)


Expand Down
2 changes: 1 addition & 1 deletion fronted/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Build Setup

``` bash
# install dependencies
# install dependencies. 注意npm版本需要5.6.0以上
npm install

# serve with hot reload at localhost:8080
Expand Down
Loading

0 comments on commit b5978d9

Please sign in to comment.