From ace3af57e7fa29e9808dedaba5b21a5c964a060c Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期三, 12 八月 2026 09:54:01 +0800
Subject: [PATCH] 增加专家的身份证重复判断
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java | 39 +++++++++++++++++++++++++++++++--------
1 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java
index bf682ac..30d25e9 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceExternalpersonController.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.domain.BaseOnlyvalue;
+import com.ruoyi.project.domain.ServiceDonatebaseinfo;
import com.ruoyi.project.service.IBaseOnlyvalueService;
import com.ruoyi.web.controller.common.OnlyValueCommon;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -50,9 +51,10 @@
/**
* 鏌ヨ澶栧洿鍗曚綅浜哄憳鍒楄〃
*/
- //@PreAuthorize("@ss.hasPermi('project:externalperson:list')")
+ //// @PreAuthorize("@ss.hasPermi('project:externalperson:list')")
@GetMapping("/list")
public TableDataInfo list(ServiceExternalperson serviceExternalperson) {
+ logger.info("璇㈠鍥村崟浣嶄汉鍛樺垪琛ㄧ殑鍏ュ弬涓� 锛歿}", serviceExternalperson);
startPage();
List<ServiceExternalperson> list = serviceExternalpersonService.queryList(serviceExternalperson);
return getDataTable(list);
@@ -61,7 +63,7 @@
/**
* 瀵煎嚭澶栧洿鍗曚綅浜哄憳鍒楄〃
*/
- //@PreAuthorize("@ss.hasPermi('project:externalperson:export')")
+ //// @PreAuthorize("@ss.hasPermi('project:externalperson:export')")
@Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ServiceExternalperson serviceExternalperson) {
@@ -73,7 +75,7 @@
/**
* 鑾峰彇澶栧洿鍗曚綅浜哄憳璇︾粏淇℃伅
*/
- //@PreAuthorize("@ss.hasPermi('project:externalperson:query')")
+ //// @PreAuthorize("@ss.hasPermi('project:externalperson:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(serviceExternalpersonService.getById(id));
@@ -82,23 +84,39 @@
/**
* 鏂板澶栧洿鍗曚綅浜哄憳
*/
- //@PreAuthorize("@ss.hasPermi('project:externalperson:add')")
+ //// @PreAuthorize("@ss.hasPermi('project:externalperson:add')")
@Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.INSERT)
- @PostMapping
+ @PostMapping("/add")
@RepeatSubmit
public AjaxResult add(@RequestBody ServiceExternalperson serviceExternalperson) {
+ //鏍¢獙浜哄憳绫诲瀷銆佽韩浠借瘉
+ String usertype = serviceExternalperson.getUsertype();
+
+ if (usertype == null || usertype.isEmpty())
+ {
+ return AjaxResult.error("鏂板浜哄憳闇�瑕佺‘瀹氫汉鍛樼被鍨�!");
+ }
+ if (!"org".equals(usertype)){
+ String idcardno = serviceExternalperson.getIdcardno();
+ List<ServiceExternalperson> existpsersons = serviceExternalpersonService.getInfoByIDCardNo(idcardno);
+ if (existpsersons.size() > 0) {
+ return AjaxResult.error("鏂板浜哄憳韬唤璇�" + idcardno + "宸插瓨鍦�,浜哄憳淇℃伅涓嶈兘閲嶅娣诲姞!");
+ }
+ }
+
if (StringUtils.isEmpty(serviceExternalperson.getUserno())) {
String zj = onlyValueCommon.addOnlyValue("zj");
String formattedNumber = String.format("%05d", zj);
serviceExternalperson.setUserno(formattedNumber);
}
- return toAjax(serviceExternalpersonService.save(serviceExternalperson));
+ boolean save1 = serviceExternalpersonService.save(serviceExternalperson);
+ return AjaxResult.success(serviceExternalperson);
}
/**
* 淇敼澶栧洿鍗曚綅浜哄憳
*/
- //@PreAuthorize("@ss.hasPermi('project:externalperson:edit')")
+ //// @PreAuthorize("@ss.hasPermi('project:externalperson:edit')")
@Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.UPDATE)
@PostMapping("/editZJInfo")
@RepeatSubmit
@@ -109,7 +127,7 @@
/**
* 鍒犻櫎澶栧洿鍗曚綅浜哄憳
*/
- //@PreAuthorize("@ss.hasPermi('project:externalperson:remove')")
+ //// @PreAuthorize("@ss.hasPermi('project:externalperson:remove')")
@Log(title = "澶栧洿鍗曚綅浜哄憳", businessType = BusinessType.DELETE)
@GetMapping("/remove/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
@@ -125,4 +143,9 @@
public AjaxResult getInfoByUserNo(@PathVariable("userno") String userno) {
return AjaxResult.success(serviceExternalpersonService.getInfoByUserNo(userno));
}
+
+ @GetMapping(value = "/getInfoByIDCardNo/{idcardno}")
+ public AjaxResult getInfoByIDCardNo(@PathVariable("idcardno") String idcardno) {
+ return AjaxResult.success(serviceExternalpersonService.getInfoByIDCardNo(idcardno));
+ }
}
--
Gitblit v1.9.3