dc67d3d0
“wangming”
feat: 优化统计接口和会员信息接口
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
# 修改开单信息接口调用说明
## 接口信息
- **接口地址**: `PUT /api/Extend/lqkdkdjlb/UpdateBillingInfo`
- **请求方式**: `PUT`
- **Content-Type**: `application/json`
- **需要认证**: 是(需要在Header中携带Authorization token)
## 请求参数
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| id | string | 是 | 开单记录ID |
| scwj | List<FileControlsModel> | 否 | 上传文件列表(不传则不更新) |
| F_FIleUrl | string | 否 | 方案其他文件URL(不传则不更新) |
| Bz | string | 否 | 备注(不传则不更新) |
| Jj | string | 否 | 简介(不传则不更新) |
**注意**: 至少需要提供一个要更新的字段(scwj、F_FIleUrl、Bz或Jj)
## 响应格式
### 成功响应 (200)
```json
{
"code": 200,
"msg": "更新成功",
"data": {
"id": "开单记录ID",
"updatedFields": ["Bz", "Jj"]
}
}
```
### 错误响应
```json
{
"code": 400,
"msg": "错误信息",
"data": null
}
```
## 调用示例
### JavaScript/Axios 示例
```javascript
import axios from 'axios';
// 更新备注和简介
const updateBillingInfo = async (billingId, remark, description) => {
try {
const token = localStorage.getItem('token'); // 从本地存储获取token
const response = await axios.put(
'/api/Extend/lqkdkdjlb/UpdateBillingInfo',
{
id: billingId,
Bz: remark, // 备注
Jj: description // 简介
},
{
headers: {
'Authorization': token,
'Content-Type': 'application/json'
}
}
);
if (response.data.code === 200) {
console.log('更新成功', response.data.data);
return response.data;
} else {
console.error('更新失败', response.data.msg);
throw new Error(response.data.msg);
}
} catch (error) {
console.error('请求失败', error);
throw error;
}
};
// 使用示例
updateBillingInfo('759263766553560325', '这是备注信息', '这是简介信息');
```
### 只更新备注
```javascript
const updateRemark = async (billingId, remark) => {
const response = await axios.put(
'/api/Extend/lqkdkdjlb/UpdateBillingInfo',
{
id: billingId,
Bz: remark
},
{
headers: {
'Authorization': localStorage.getItem('token'),
'Content-Type': 'application/json'
}
}
);
return response.data;
};
```
### 只更新简介
```javascript
const updateDescription = async (billingId, description) => {
const response = await axios.put(
'/api/Extend/lqkdkdjlb/UpdateBillingInfo',
{
id: billingId,
Jj: description
},
{
headers: {
'Authorization': localStorage.getItem('token'),
'Content-Type': 'application/json'
}
}
);
return response.data;
};
```
### 同时更新文件、备注和简介
```javascript
const updateAll = async (billingId, files, remark, description, fileUrl) => {
const response = await axios.put(
'/api/Extend/lqkdkdjlb/UpdateBillingInfo',
{
id: billingId,
scwj: files, // 文件列表
F_FIleUrl: fileUrl, // 方案其他文件URL
Bz: remark, // 备注
Jj: description // 简介
},
{
headers: {
'Authorization': localStorage.getItem('token'),
'Content-Type': 'application/json'
}
}
);
return response.data;
};
```
### cURL 示例
```bash
# 更新备注和简介
curl -X PUT "http://localhost:2011/api/Extend/lqkdkdjlb/UpdateBillingInfo" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "759263766553560325",
"Bz": "这是备注信息",
"Jj": "这是简介信息"
}'
# 只更新备注
curl -X PUT "http://localhost:2011/api/Extend/lqkdkdjlb/UpdateBillingInfo" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "759263766553560325",
"Bz": "这是备注信息"
}'
# 只更新简介
curl -X PUT "http://localhost:2011/api/Extend/lqkdkdjlb/UpdateBillingInfo" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "759263766553560325",
"Jj": "这是简介信息"
}'
```
## 注意事项
1. **服务重启**: 修改代码后需要重启后端服务才能生效
2. **Token获取**: 需要先调用登录接口获取token
3. **字段可选**: 所有字段都是可选的,只需要传入要更新的字段即可
4. **至少一个字段**: 必须至少提供一个要更新的字段,否则会返回错误
## 错误码说明
- `200`: 更新成功
- `400`: 参数错误或开单记录不存在
- `500`: 服务器错误
|