|
@@ -5,8 +5,10 @@ import java.util.Arrays;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.*;
|
|
|
+
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -40,12 +42,22 @@ public class ZUnitController extends BaseController {
|
|
|
private final IZUnitService iZUnitService;
|
|
|
|
|
|
/**
|
|
|
+ * 单元下拉
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getUnitList")
|
|
|
+ public R getUnitList(String areaId, String buildingId) {
|
|
|
+ return R.ok(iZUnitService.getUnitList(areaId, buildingId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询单元管理列表
|
|
|
*/
|
|
|
@SaCheckPermission("zdsz:unit:list")
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo<ZUnitVo> list(ZUnitBo bo, PageQuery pageQuery) {
|
|
|
- return iZUnitService.queryPageList(bo, pageQuery);
|
|
|
+ return iZUnitService.getPageList(bo, pageQuery);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -66,8 +78,7 @@ public class ZUnitController extends BaseController {
|
|
|
*/
|
|
|
@SaCheckPermission("zdsz:unit:query")
|
|
|
@GetMapping("/{id}")
|
|
|
- public R<ZUnitVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
- @PathVariable String id) {
|
|
|
+ public R<ZUnitVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable String id) {
|
|
|
return R.ok(iZUnitService.queryById(id));
|
|
|
}
|
|
|
|
|
@@ -101,8 +112,7 @@ public class ZUnitController extends BaseController {
|
|
|
@SaCheckPermission("zdsz:unit:remove")
|
|
|
@Log(title = "单元管理", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
- public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
- @PathVariable String[] ids) {
|
|
|
+ public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) {
|
|
|
return toAjax(iZUnitService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
|
}
|
|
|
}
|