|
|
@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 排水分区基础数据管理
|
|
|
@@ -98,4 +99,18 @@ public class DrainagePartitionController {
|
|
|
boolean deleted = service.removeBatchWithCheck(ids);
|
|
|
return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
|
|
|
}
|
|
|
+
|
|
|
+ @Anonymous
|
|
|
+ @PostMapping("/bindEquipment")
|
|
|
+ @ApiOperation(value = "绑定设备到排水分区")
|
|
|
+ public AjaxResult bindEquipment(@RequestBody Map<String, Object> params) {
|
|
|
+ String partitionId = (String) params.get("partitionId");
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ List<String> equipmentIds = (List<String>) params.get("equipmentIds");
|
|
|
+ if (partitionId == null || equipmentIds == null || equipmentIds.isEmpty()) {
|
|
|
+ return AjaxResult.error("参数不完整");
|
|
|
+ }
|
|
|
+ boolean success = service.bindEquipment(partitionId, equipmentIds);
|
|
|
+ return success ? AjaxResult.success() : AjaxResult.error("绑定失败");
|
|
|
+ }
|
|
|
}
|