# 正式环境版本更新步骤

1. 老版本下线

    ```sh
    # 部署路径 192.168.70.125:/data1/acl
    sh stop.sh
    # 备份旧版本
    mv aclTousu.jar aclTousu.jar.bk
    ```

2. 备份数据库文件

    ```sql
    -- 备份
    create table sqmdb_rpt.acl_area_0805 as select *from sqmdb_rpt.acl_area;
    create table sqmdb_rpt.acl_city_0805 as select* from sqmdb_rpt.acl_city;
    create table sqmdb_rpt.acl_district_0805 as select *from sqmdb_rpt.acl_district;
    create table sqmdb_rpt.acl_role_0805 as select* from sqmdb_rpt.acl_role;
    create table sqmdb_rpt.acl_user_0805 as select *from sqmdb_rpt.acl_user;
    create table sqmdb_rpt.acl_user_role_0805 as select* from sqmdb_rpt.acl_user_role;
    create table sqmdb_rpt.acl_user_role_city_0805 as select * from sqmdb_rpt.acl_user_role_city;

    -- 如需回退操作（将正式表命名为back结尾的，然后将备份表改为正式表名）执行如下
    alter table sqmdb_rpt.acl_area rename to acl_area_back;
    alter table sqmdb_rpt.acl_city rename to acl_city_back;
    alter table sqmdb_rpt.acl_district rename to acl_district_back;
    alter table sqmdb_rpt.acl_role rename to acl_role_back;
    alter table sqmdb_rpt.acl_user rename to acl_user_back;
    alter table sqmdb_rpt.acl_user_role rename to acl_user_role_back;
    alter table sqmdb_rpt.acl_user_role_city rename to acl_user_role_city_back;

    alter table sqmdb_rpt.acl_area_0805 rename to acl_area;
    alter table sqmdb_rpt.acl_city_0805 rename to acl_city;
    alter table sqmdb_rpt.acl_district_0805 rename to acl_district;
    alter table sqmdb_rpt.acl_role_0805 rename to acl_role;
    alter table sqmdb_rpt.acl_user_0805 rename to acl_user;
    alter table sqmdb_rpt.acl_user_role_0805 rename to acl_user_role;
    alter table sqmdb_rpt.acl_user_role_city_0805 rename to acl_user_role_city;
    ```

3. 更新数据库文件

4. 上传并启动新的jar包和配置文件（注意检查配置文件环境配置）

    ```sh
    # 启动
    sh run.sh
    ```

5. 完成测试

## 接口测试

### 鉴权接口

- 黑点库

```http
POST http://133.96.94.176:12128/api/verification
Content-Type: application/json

{
  "token": "test_token_hengshui",
  "fromSystem": "test",
  "system": "heidianku"
}
```

- 流程

```http
POST http://133.96.94.176:12128/api/verification
Content-Type: application/json

{
  "token": "test_token_hengshui2",
  "fromSystem": "test",
  "system": "liucheng"
}
```

- 大屏

```http
POST http://133.96.94.176:12128/api/verification
Content-Type: application/json

{
  "token": "test_token_hengshui",
  "fromSystem": "test",
  "system": "daping"
}
```

- 投诉分析

```http
POST http://133.96.94.176:12128/api/verification
Content-Type: application/json

{
  "token": "test_token_hengshui",
  "fromSystem": "test",
  "system": "fenxi"
}
```

- 投诉预测

```http
POST http://133.96.94.176:12128/api/verification
Content-Type: application/json

{
"token": "test_token_hengshui",
"fromSystem": "test",
"system": "yuce"
}
```

### 提供给流程系统的接口

- 角色列表接口

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "findRoleList",
  "userName": "王"
}
```

- 用户列表接口

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "findToPage"
}
```

- 根据登录账号获取用户

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "getByLoginId",
  "loginId": "test_handan"
}
```

- 根据用户ID获取用户接口

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "get",
  "userId": "33"
}
```

- 根据用户id获取角色id列表

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "findRoleIdByUserId",
  "userId": "33"
}
```

- 根据角色id获取用户id列表

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "findUserIdByRoleId",
  "roleId": "3"
}
```

- 多条件搜索用户

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "findAuthorizedUser",
  "userId": "33"
}
```

- 根据用户查找角色+城市信息

```http
POST http://133.96.94.176:12128/rest/flow/api
Content-Type: application/json

{
  "callType": "getRoleCityByUserId",
  "userId": "13"
}
```

- 用户树形结构接口

```http
POST http://133.96.94.176:12128/rest/flow/api/userTree
Content-Type: application/json

{
  "city": 130200,
  "role": [6],
  "user": []
}
```

## 入口测试

[大屏界面-DCN访问](http://133.96.94.108:12011?token=test_token_abc&fromSystem=test)

[中屏--河北联通智慧网络运营平台](https://133.96.90.208/index)
[大屏--网络数据运营平台](http://133.96.90.210:8089/login)

wangyl5740 / Yunwang@2022
