From 4502f650f4816e55b5c7bf751ffce3aa0dce72dd Mon Sep 17 00:00:00 2001
From: zqy <2522236926@qq.com>
Date: 星期二, 14 十月 2025 18:13:07 +0800
Subject: [PATCH] 找回密码功能
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateController.java | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 108 insertions(+), 3 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateController.java
index 8ba1b4a..c47200f 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZCertificateController.java
@@ -1,9 +1,23 @@
package com.ruoyi.web.controller.zhang;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.domain.ZCertificate;
+import com.ruoyi.service.ZCertificateService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.bind.annotation.RestController;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+import java.util.List;
/**
* <p>
@@ -13,9 +27,100 @@
* @author ojq
* @since 2023-03-14
*/
+@Slf4j
@RestController
@RequestMapping("/zCertificate")
-public class ZCertificateController {
+public class ZCertificateController extends BaseController {
+
+ @Autowired
+ private ZCertificateService zCertificateService;
+
+ @GetMapping("/all")
+ public AjaxResult listAll(){
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+ List<ZCertificate> zCertificates = zCertificateService.selectExperienceList(userId);
+ return AjaxResult.success(zCertificates);
+ }
+
+ @GetMapping("/type")
+ public AjaxResult listType(){
+ return zCertificateService.listType();
+ }
+
+
+ /**
+ * 瀵煎嚭鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰曞垪琛�
+ */
+// @PreAuthorize("@ss.hasPermi('system:property:export')")
+ @Log(title = "鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰�", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, ZCertificate zCertificate)
+ {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ List<ZCertificate> list = zCertificateService.selectExperienceList(userId);
+ log.info("瀵煎嚭璁板綍涓�:{}",list);
+ ExcelUtil<ZCertificate> util = new ExcelUtil<>(ZCertificate.class);
+ util.exportExcel(response, list, "鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰曟暟鎹�");
+ }
+//
+
+ /**
+ * 瀵煎叆鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰曞垪琛�
+ */
+ @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.IMPORT)
+ @PostMapping("/importData")
+ public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception
+ {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+
+ boolean flag=zCertificateService.importExcel(file,userId);
+ if(flag){
+ return AjaxResult.success("瀵煎叆鏁版嵁鎴愬姛");
+ }
+ return AjaxResult.error("瀵煎叆鏁版嵁澶辫触");
+ }
+
+
+
+ /**
+ * 鏂板鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰�
+ */
+// @PreAuthorize("@ss.hasPermi('system:property:add')")
+ @Log(title = "鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰�", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody ZCertificate zCertificate)
+ {
+ SysUser user = SecurityUtils.getLoginUser().getUser();
+ Long userId = user.getUserId();
+ zCertificate.setUserId(userId);
+ return toAjax(zCertificateService.save(zCertificate));
+ }
+
+ /**
+ * 淇敼鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰�
+ */
+// @PreAuthorize("@ss.hasPermi('system:property:edit')")
+ @Log(title = "鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰�", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody ZCertificate zCertificate)
+ {
+ return toAjax(zCertificateService.updateById(zCertificate));
+ }
+//
+ /**
+ * 鎵归噺鍒犻櫎鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰�
+ */
+// @PreAuthorize("@ss.hasPermi('system:property:remove')")
+ @Log(title = "鎸佹湁鍑哄叆澧冭瘉浠舵儏鍐佃褰�", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(zCertificateService.removeByIds(Arrays.asList(ids)));
+ }
}
--
Gitblit v1.9.1