|
@@ -0,0 +1,106 @@
|
|
|
|
+package org.dromara.controller.residentInfo;
|
|
|
|
+
|
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
|
+import jakarta.validation.constraints.NotNull;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.dromara.common.core.domain.R;
|
|
|
|
+import org.dromara.common.core.validate.AddGroup;
|
|
|
|
+import org.dromara.common.core.validate.EditGroup;
|
|
|
|
+import org.dromara.common.excel.utils.ExcelUtil;
|
|
|
|
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
|
+import org.dromara.common.log.annotation.Log;
|
|
|
|
+import org.dromara.common.log.enums.BusinessType;
|
|
|
|
+import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
+import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
+import org.dromara.common.web.core.BaseController;
|
|
|
|
+import org.dromara.domain.residentInfo.bo.ResidentInfoBo;
|
|
|
|
+import org.dromara.domain.residentInfo.vo.ResidentInfoVo;
|
|
|
|
+import org.dromara.service.IResidentInfoService;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 居住人员信息,存储居住人员的详细信息
|
|
|
|
+ *
|
|
|
|
+ * @author boman
|
|
|
|
+ * @date 2025-04-11
|
|
|
|
+ */
|
|
|
|
+@Validated
|
|
|
|
+@RequiredArgsConstructor
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/wuYe/residentInfo")
|
|
|
|
+public class ResidentInfoController extends BaseController {
|
|
|
|
+
|
|
|
|
+ private final IResidentInfoService residentInfoService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询居住人员信息,存储居住人员的详细信息列表
|
|
|
|
+ */
|
|
|
|
+ @SaCheckPermission("wuYe:residentInfo:list")
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public TableDataInfo<ResidentInfoVo> list(ResidentInfoBo bo, PageQuery pageQuery) {
|
|
|
|
+ return residentInfoService.queryPageList(bo, pageQuery);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出居住人员信息,存储居住人员的详细信息列表
|
|
|
|
+ */
|
|
|
|
+ @SaCheckPermission("wuYe:residentInfo:export")
|
|
|
|
+ @Log(title = "居住人员信息,存储居住人员的详细信息", businessType = BusinessType.EXPORT)
|
|
|
|
+ @PostMapping("/export")
|
|
|
|
+ public void export(ResidentInfoBo bo, HttpServletResponse response) {
|
|
|
|
+ List<ResidentInfoVo> list = residentInfoService.queryList(bo);
|
|
|
|
+ ExcelUtil.exportExcel(list, "居住人员信息,存储居住人员的详细信息", ResidentInfoVo.class, response);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取居住人员信息,存储居住人员的详细信息详细信息
|
|
|
|
+ *
|
|
|
|
+ * @param residentId 主键
|
|
|
|
+ */
|
|
|
|
+ @SaCheckPermission("wuYe:residentInfo:query")
|
|
|
|
+ @GetMapping("/{residentId}")
|
|
|
|
+ public R<ResidentInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
+ @PathVariable Long residentId) {
|
|
|
|
+ return R.ok(residentInfoService.queryById(residentId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增居住人员信息,存储居住人员的详细信息
|
|
|
|
+ */
|
|
|
|
+ @SaCheckPermission("wuYe:residentInfo:add")
|
|
|
|
+ @Log(title = "居住人员信息,存储居住人员的详细信息", businessType = BusinessType.INSERT)
|
|
|
|
+ @RepeatSubmit()
|
|
|
|
+ @PostMapping()
|
|
|
|
+ public R<Void> add(@Validated(AddGroup.class) @RequestBody ResidentInfoBo bo) {
|
|
|
|
+ return toAjax(residentInfoService.insertByBo(bo));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改居住人员信息,存储居住人员的详细信息
|
|
|
|
+ */
|
|
|
|
+ @SaCheckPermission("wuYe:residentInfo:edit")
|
|
|
|
+ @Log(title = "居住人员信息,存储居住人员的详细信息", businessType = BusinessType.UPDATE)
|
|
|
|
+ @RepeatSubmit()
|
|
|
|
+ @PostMapping("/put")
|
|
|
|
+ public R<Void> edit(@Validated(EditGroup.class) @RequestBody ResidentInfoBo bo) {
|
|
|
|
+ return toAjax(residentInfoService.updateByBo(bo));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除居住人员信息,存储居住人员的详细信息
|
|
|
|
+ *
|
|
|
|
+ * @param residentIds 主键串
|
|
|
|
+ */
|
|
|
|
+ @SaCheckPermission("wuYe:residentInfo:remove")
|
|
|
|
+ @Log(title = "居住人员信息,存储居住人员的详细信息", businessType = BusinessType.DELETE)
|
|
|
|
+ @GetMapping("/delete/{residentIds}")
|
|
|
|
+ public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
+ @PathVariable Long[] residentIds) {
|
|
|
|
+ return toAjax(residentInfoService.deleteWithValidByIds(List.of(residentIds), true));
|
|
|
|
+ }
|
|
|
|
+}
|