场所出入登记

pg_adapter
dshclm 8 months ago
parent b9df9c72e1
commit f466bb840d

@ -122,20 +122,13 @@ public class TdPlaceController extends BaseController {
* *
* @return com.ruoyi.common.core.domain.AjaxResult * @return com.ruoyi.common.core.domain.AjaxResult
*/ */
// @PostMapping("/getList")
// @ResponseBody
// public AjaxResult getList() {
// return AjaxResult.success(placeManager.selectList());
// }
@PostMapping("/getList") @PostMapping("/getList")
@ResponseBody @ResponseBody
public AjaxResult getList(@RequestParam(value = "id", required = false) Long id) { public AjaxResult getList(@RequestParam(value = "placeId", required = false) Long placeId) {
if (id == null) { if (placeId == null) {
// 如果 id 为空,则查询所有数据
return AjaxResult.success(placeManager.selectList()); return AjaxResult.success(placeManager.selectList());
} else { } else {
// 否则,根据 id 查询单条数据 TdPlace place = placeManager.selectById(placeId);
TdPlace place = placeManager.selectById(id);
if (place != null) { if (place != null) {
return AjaxResult.success(place); return AjaxResult.success(place);
} else { } else {

@ -55,7 +55,6 @@
method: 'POST', method: 'POST',
dataType: 'json' dataType: 'json'
}).done(function(data) { }).done(function(data) {
// 假设返回的数据格式为 { data: [{ id: 1, placeName: '...'}, ...] }
data.data.forEach(function(item) { data.data.forEach(function(item) {
placeCache[item.id] = item.placeName; placeCache[item.id] = item.placeName;
}); });

Loading…
Cancel
Save