---
# System prepended metadata

title: 問題回報

---

# 問題回報

測試客服Header
```
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3NjYxZTU4NS0zNWRjLTQ3ODctYmFhYy1lMmMzZDM2NzQzMTkiLCJqdGkiOiJkMWYxY2I0Yy0yZTE0LTQwZmUtODdmNy05ZWVjMjU4ZmQ5MGMiLCJyb2xlcyI6WyJBZG1pbiIsIlVzZXJzIl0sIm5iZiI6MTY4MTU3NjM2MiwiZXhwIjoxNzEzMTk4NzYyLCJpYXQiOjE2ODE1NzYzNjIsImlzcyI6ImlDaGF0LkFkbWluQXBpIn0.jJrXOk6eS5iIHXJtKakuP4LVT7gLsjlXQ3OU0pkQorI
```

## a














<hr/>

## 05-06 以前

## ~~1~~
- [x] 已解決
- 當使用者發送了第一筆訊息, 客服的工單頁面沒有顯示新工單

```json
{"uid":"d3395914-cb2f-4972-afa8-fba847fbb988","name":"體驗一下","roomId":"c6500509-c668-4f32-95ba-c833afa241b4"}
```
ANS: Chat正確參數
```json
"roomId": string
"senderId": string
"name" : string
"roleId": 0:顧客, 1:客服人員
"message": string
"messageType": "text" / "file" / "command"
'commandType": "chat" / "like" / "complete" / "cancel"
```
<mark>二次確認</mark>
OK!
## ~~2~~
- [x] 已解決
- API /api/v1/chat/recently 404錯誤
Request URL: http://220.134.67.237:8080/api/v1/chat/recently
Request Method: POST
Status Code: 404 Not Found
Remote Address: 220.134.67.237:8080
Referrer Policy: strict-origin-when-cross-origin

**ANS: 正確API Url: POST /api/v1/chatroom/recently**

<mark>二次確認</mark>
- [x] 已解決

用guestId = "1898e6b0-cb41-4084-bdfa-0580c5cd6bf6"
可查到以下資料
![](https://i.imgur.com/v6CM5Mz.png)


api可通 但資料都是空的！
```json
{
    "roomId": "f4a0e54a-1d6b-4153-a0c2-987c441e28a4",
    "employee": {
        "employeeId": null,
        "employeeName": null,
        "avatar": null
    },
    "last": {
        "name": null,
        "roleId": 0,
        "avatar": null,
        "messageType": null,
        "commandType": null,
        "messageId": 0,
        "message": null,
        "messageTime": "0001-01-01T00:00:00"
    }
}
```


## ~~3~~
- [x] 已解決

~~發送command參數錯誤~~

**ANS: 目前已無此問題, 應該在04/16下午測試時已解決**

<mark>二次確認</mark>
OK

## ~~4~~
- [x] 已解決

請確認 取得工單統計 邏輯 [連結](https://hackmd.io/Sj6rV--0RK-evJcG4COMmQ?view#%E5%8F%96%E5%BE%97%E5%B7%A5%E5%96%AE%E7%B5%B1%E8%A8%88)

GET /api/v1/workorder/status
- roleId=1
  - 待處理的工單數顯示所有的
  - 處理中的工單數顯示自己承接的
  - 處理完成工單數(24H)顯示自己完成的
- roleId=2 看到所有的統計

<mark>二次確認</mark>
OK

## ~~5~~
- [x] 已解決
請確認 所有工單清單 邏輯 [連結](https://hackmd.io/Sj6rV--0RK-evJcG4COMmQ?view#%E6%89%80%E6%9C%89%E5%B7%A5%E5%96%AE%E6%B8%85%E5%96%AE)

POST /api/v1/workorder/list

## ~~6~~
- [x] 已解決

~~SingalR Readed 錯誤~~
```json
{
    "roomId": "06493647-d418-48b0-9ffd-f3e36f79621b",
    "senderId": "7661e585-35dc-4787-baac-e2c3d3674319",
    "roleId": 1
}
```

ANS: 少了messageId參數
- [x] 已解決

<mark>二次確認</mark>
OK



## ~~7~~
- [x] 已解決
/api/v1/workorder/status
回傳資訊不對
```json
{
    "unprocess": 0,
    "processing": 2,
    "finished": 0
}
```
<mark>二次確認</mark>
OK!
```json
// 客服人員資訊
{"id":"7661e585-35dc-4787-baac-e2c3d3674319","roleId":1,"name":"阿夫","dept":"客服部","organize":"阿夫公司","uid":"7661e585-35dc-4787-baac-e2c3d3674319","jwt":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3NjYxZTU4NS0zNWRjLTQ3ODctYmFhYy1lMmMzZDM2NzQzMTkiLCJqdGkiOiI5MzJjOTZhYy0yYTQxLTRlNDUtOGUxYy1kODFlYmRjMmQ1ZjMiLCJyb2xlcyI6WyJBZG1pbiIsIlVzZXJzIl0sIm5iZiI6MTY4MTU3MzcxNSwiZXhwIjoxNzEzMTk2MTE1LCJpYXQiOjE2ODE1NzM3MTUsImlzcyI6ImlDaGF0LkFkbWluQXBpIn0.sFCb01f5w4tfH-6AFRNo3gCEuwp2gjIfXqdIAcfRYxs","tokenExpiredDate":"2024-04-15T23:48:35.6970575+08:00"}}
```

## ~~8~~
- [x] 已解決
SignalR 下結束對話 Command 失敗

```json
{
    "roomId": "1ff64424-fa03-478b-b606-a4e4ed7d931b",
    "senderId": "7661e585-35dc-4787-baac-e2c3d3674319",
    "name": "阿夫",
    "roleId": 1,
    "avatar": "https://mir-s3-cdn-cf.behance.net/project_modules/max_632/ce54bf11889067.562541ef7cde4.png",
    "messageType": "command",
    "commandType": "complete"
}
```
- 錯誤訊息
<p style="color: red">Error: An unexpected error occurred invoking 'Chat' on the server. DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.</p>


<mark>二次確認</mark>
OK!
## ~~8-1~~
- [x] 已解決
- 結束對話後 POST /api/v1/chatroom/end , mylist依舊會顯示該聊天室
```json
{
     "roomId": "1ff64424-fa03-478b-b606-a4e4ed7d931b"
}
```

**ANS: 應該是End Api沒有呼叫成功, 呼叫成功Status會被改為2, mylist就不會出現**
![](https://i.imgur.com/4vyHiDG.png)

<mark>二次確認</mark>
OK!


## ~~9~~
- [x] 已解決
工單清單取得錯誤
/api/v1/workorder/list

```json
{
    "state": 1,
    "guestName": ""
}
```
<p style="color: red">
fetch-wrapper.js?t=1681638142660:20          POST http://220.134.67.237:8080/api/v1/workorder/list net::ERR_FAILED 500 (Internal Server Error)
</p>

<mark>二次確認</mark>
OK!

## 10
- [x] 已解決
註冊後不能登入
POST http://220.134.67.237:8080/api/v1/enterprise/authenticate
```json
{
    "account": "admin1@test.com",
    "password": "123456"
}
```
<p style="color: red">
POST http://220.134.67.237:8080/api/v1/enterprise/authenticate net::ERR_FAILED 500 (Internal Server Error)
</p>

<mark>二次確認</mark>
500 Error

ANS: 因為這個帳號是之前註冊的, 所以帳戶角色表格沒有對應資料所以報錯, 我已經手動補資料, 沒問題了

![](https://i.imgur.com/XUPnN84.png)


## 11
- [x] 已解決
<p style="color: red">
POST http://220.134.67.237:8080/api/v1/workorder/tagpriority net::ERR_ABORTED 405 (Method Not Allowed)
</p>

```json
{
    "workOrderId": 12,
    "tag": "",
    "priority": 2
}
```

## 12
- [x] 已解決

發送過的command /getMessages無法查看歷史紀錄


## 13
- [x] 已解決
不小心塞了一筆訊息guestName是null的 造成server端 取工單會報錯誤
<p style="color: red">
GET http://220.134.67.237:8080/api/v1/workorder/unassignment net::ERR_FAILED 500 (Internal Server Error)
    
</p>


## 14
- [x] 已解決
 /api/v1/guest/list 
 回傳是空的
 
 ANS: 因為沒有註冊顧客帳號, 所以顧客資料表示空的, 已經提供註冊顧客帳號API - POST /api/v1/guest/register, API同步到Spec文件, 目前客服帳號7661e585-35dc-4787-baac-e2c3d3674319, 有三筆資料
 
 ## 15
 - [x] 已解決
 ChatReceive 少了senderId
 
 ANS: 已補上
 
 ## 16
  - [x] 已解決
 /api/v1/employee/dept
 回傳的employeeId是否有誤？
 ```json
// Response
 {
    "employeeId": 1,
    "employeeName": "阿夫",
    "deptId": 1,
    "avatar": "",
    "isOnline": true,
    "lastOnlineTime": "2023-04-22T14:57:39.74"
}
```
ANS: 已修正

  - [x] 已解決
/api/v1/employee/chatroomlist

```json
{
    "employeeId": "1",
    "startDate": "2023-04-14T16:00:00.000Z",
    "endDate": "2023-04-21T16:00:00.000Z"
}
```

 回傳值是空的
 ```json
// Response
[]
```

ANS: employeeId要傳guid
以下查詢有資料回傳
{
  "employeeId": "7661e585-35dc-4787-baac-e2c3d3674319",
  "startDate": "2023-04-14T16:21:05.000Z",
  "endDate": "2023-04-21T16:21:05.000Z"
}


## 17
  - [ ] 已解決
  
POST http://220.134.67.237:8080/api/dept/employee
無法將員工移出部門

```json
{
  "deptId": 0,
  "employeeIds": [
    "2c2343e6-b552-45be-9e6b-7ddbda3f4b73"
  ]
}

// 回傳
{
  "status": "failed",
  "message": "部門不存在, 修改部門人員失敗"
}
```