|
@@ -0,0 +1,94 @@
|
|
|
+package com.huaxu.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.huaxu.common.EasyExcelUtil;
|
|
|
+import com.huaxu.dto.OperateLogDto;
|
|
|
+import com.huaxu.entity.UserRegister;
|
|
|
+import com.huaxu.model.AjaxMessage;
|
|
|
+import com.huaxu.model.Pagination;
|
|
|
+import com.huaxu.model.ResultStatus;
|
|
|
+import com.huaxu.service.UserRegisterService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 用户注册(UserRegister)控制层
|
|
|
+ *
|
|
|
+ * @author yjy
|
|
|
+ * @since 2020-10-29
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/userRegister")
|
|
|
+@Api(tags = "注册申请")
|
|
|
+public class UserRegisterController {
|
|
|
+ /**
|
|
|
+ * 服务对象
|
|
|
+ */
|
|
|
+ @Autowired
|
|
|
+ private UserRegisterService userRegisterService;
|
|
|
+ @Value("${UMIS.sys_excel_path}")
|
|
|
+ private String baseDir;
|
|
|
+ /**
|
|
|
+ * 新增一条数据
|
|
|
+ *
|
|
|
+ * @param userRegister 实体类
|
|
|
+ * @return Response对象
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "insert", method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "插入注册申请")
|
|
|
+ public AjaxMessage<Integer> insert(@ApiParam(value = "注册申请信息", required = true) @RequestBody UserRegister userRegister) {
|
|
|
+ int result = userRegisterService.insert(userRegister);
|
|
|
+
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除多条数据
|
|
|
+ *
|
|
|
+ * @param ids 主键,以逗号隔开
|
|
|
+ * @return Response对象
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "delete", method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "删除注册申请")
|
|
|
+ public AjaxMessage<Integer> delete(@ApiParam(value = "注册ids", required = true) @RequestParam Long[] ids) {
|
|
|
+ int result = userRegisterService.deleteById(ids);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询
|
|
|
+ *
|
|
|
+ * @param pageNum 偏移
|
|
|
+ * @param pageSize 条数
|
|
|
+ * @return Response对象
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "selectPage", method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "查询用户注册申请列表")
|
|
|
+ public AjaxMessage<Pagination<UserRegister>> selectPage(Integer pageNum, Integer pageSize,@ApiParam(value = "查询关键字", required = false) String keyWords) {
|
|
|
+ UserRegister userRegister = new UserRegister();
|
|
|
+ userRegister.setUsername(keyWords);
|
|
|
+ userRegister.setPhone(keyWords);
|
|
|
+ IPage<UserRegister> iPage = new Page<>(pageNum, pageSize);
|
|
|
+ iPage = userRegisterService.selectPage(userRegister, iPage);
|
|
|
+ Pagination<UserRegister> pages = new Pagination<>(iPage);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/exportExcel", method = RequestMethod.POST)
|
|
|
+ @ApiOperation(value = "注册申请列表导出")
|
|
|
+ public AjaxMessage<String> exportExcel(@ApiParam(value = "注册ids", required = true) @RequestParam Long[] ids) {
|
|
|
+ List<UserRegister> result = userRegisterService.selectListByIds(ids);
|
|
|
+ String filePath = EasyExcelUtil.excelWrite(baseDir, UserRegister.class, "注册申请列表", result);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK, filePath);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|