From 0ee9cf0938174798af956fc6ae301ef149fd8b6a Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: 星期二, 10 十二月 2024 14:17:39 +0800
Subject: [PATCH] 修改业务逻辑

---
 expert-admin/src/main/resources/application.yml                                          |    2 +-
 expert-system/src/main/java/com/gkhy/system/service/impl/SysExpertInfoServiceImpl.java   |    6 +++---
 expert-system/src/main/java/com/gkhy/system/mapper/SysExpertInfoMapper.java              |    2 ++
 expert-system/src/main/java/com/gkhy/system/domain/vo/request/SysExpertSearchReqDto.java |   11 +++++++----
 expert-system/src/main/resources/mapper/system/SysExpertInfoMapper.xml                   |    6 +++++-
 5 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/expert-admin/src/main/resources/application.yml b/expert-admin/src/main/resources/application.yml
index 810a2d4..be98b19 100644
--- a/expert-admin/src/main/resources/application.yml
+++ b/expert-admin/src/main/resources/application.yml
@@ -54,7 +54,7 @@
   servlet:
     multipart:
       # 单个文件大小
-      max-file-size: 50MB
+      max-file-size: 20MB
       # 设置总上传的文件大小
       max-request-size: 100MB
   # 服务模块
diff --git a/expert-system/src/main/java/com/gkhy/system/domain/vo/request/SysExpertSearchReqDto.java b/expert-system/src/main/java/com/gkhy/system/domain/vo/request/SysExpertSearchReqDto.java
index 5a3145f..9905bbd 100644
--- a/expert-system/src/main/java/com/gkhy/system/domain/vo/request/SysExpertSearchReqDto.java
+++ b/expert-system/src/main/java/com/gkhy/system/domain/vo/request/SysExpertSearchReqDto.java
@@ -6,7 +6,6 @@
 import org.hibernate.validator.constraints.Length;
 
 import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Pattern;
 import java.io.Serializable;
 
@@ -29,7 +28,11 @@
     @ApiModelProperty("身份证号码")
     private String idCard;
 
-    @NotNull(message ="业务处室不能为空" )
-    @ApiModelProperty("业务处室")
-    private Long deptId;
+//    @NotNull(message ="业务处室不能为空" )
+//    @ApiModelProperty("业务处室")
+//    private Long deptId;
+
+    @NotBlank(message ="专业领域不能为空" )
+    @ApiModelProperty("专业领域")
+    private String domain;
 }
diff --git a/expert-system/src/main/java/com/gkhy/system/mapper/SysExpertInfoMapper.java b/expert-system/src/main/java/com/gkhy/system/mapper/SysExpertInfoMapper.java
index 6e748e0..1ab6555 100644
--- a/expert-system/src/main/java/com/gkhy/system/mapper/SysExpertInfoMapper.java
+++ b/expert-system/src/main/java/com/gkhy/system/mapper/SysExpertInfoMapper.java
@@ -36,6 +36,8 @@
      */
     SysExpertInfo checkIdcardUnique(@Param("idCard") String idCard,@Param("deptId") Long deptId);
 
+    SysExpertInfo checkIdCardDomainUnique(@Param("phone") String phone,@Param("idCard") String idCard,@Param("domain") String domain);
+
     /**
      * 批量删除专家信息
      * @param expertIds
diff --git a/expert-system/src/main/java/com/gkhy/system/service/impl/SysExpertInfoServiceImpl.java b/expert-system/src/main/java/com/gkhy/system/service/impl/SysExpertInfoServiceImpl.java
index 5c602d5..7a0f675 100644
--- a/expert-system/src/main/java/com/gkhy/system/service/impl/SysExpertInfoServiceImpl.java
+++ b/expert-system/src/main/java/com/gkhy/system/service/impl/SysExpertInfoServiceImpl.java
@@ -40,7 +40,7 @@
 
     @Override
     public int addExpertInfo(SysExpertInfo expertInfo) {
-        if(!checkIdCardUnique(new SysExpertInfo().setIdCard(expertInfo.getIdCard()))){
+        if(!checkIdCardUnique(expertInfo)){
             throw new ServiceException("该业务处室申请数据已存在");
         }
         if(StringUtils.isEmpty(expertInfo.getPersonalOpinionKey()) && StringUtils.isEmpty(expertInfo.getRecommendUnitOpinionKey())){
@@ -57,7 +57,7 @@
     @Override
     public int modExpertInfo(SysExpertInfo expertInfo) {
         if(!checkIdCardUnique(expertInfo)){
-            throw new ServiceException("该业务处室申请数据已存在");
+            throw new ServiceException("该业务处室专业领域申请数据已存在");
         }
         checkHavePer(expertInfo.getId());
         expertInfo.setUpdateBy(SecurityUtils.getUsername());
@@ -154,7 +154,7 @@
 
     public boolean checkIdCardUnique(SysExpertInfo expertInfo){
         Long expertId = expertInfo.getId()==null? -1L : expertInfo.getId();
-        SysExpertInfo info = baseMapper.checkIdcardUnique(expertInfo.getIdCard(),expertInfo.getDeptId());
+        SysExpertInfo info = baseMapper.checkIdCardDomainUnique(expertInfo.getPhone(),expertInfo.getIdCard(),expertInfo.getDomain());
         if (info!=null && info.getId().longValue() != expertId.longValue())
         {
             return false;
diff --git a/expert-system/src/main/resources/mapper/system/SysExpertInfoMapper.xml b/expert-system/src/main/resources/mapper/system/SysExpertInfoMapper.xml
index fa96982..00a1709 100644
--- a/expert-system/src/main/resources/mapper/system/SysExpertInfoMapper.xml
+++ b/expert-system/src/main/resources/mapper/system/SysExpertInfoMapper.xml
@@ -128,6 +128,10 @@
         select id,name from sys_expert_info where id_card=#{idCard} and dept_id = #{deptId} and del_flag=0 limit 1
     </select>
 
+    <select id="checkIdCardDomainUnique" resultType="com.gkhy.system.domain.SysExpertInfo">
+        select id,name from sys_expert_info where id_card=#{idCard} and domain=#{domain} and phone = #{phone} and del_flag=0 limit 1
+    </select>
+
     <select id="getExpertInfoById" resultType="com.gkhy.system.domain.SysExpertInfo">
         <include refid="selectExpertInfoVo"/>
         where id=#{expertId}
@@ -139,7 +143,7 @@
                a.update_time updateTime,a.state,b.classify_name bigClassifyName,a.id,a.domain
         from sys_expert_info a
         left join sys_expert_classify b on a.big_classify = b.id
-        where a.id_card=#{idCard} and a.dept_id = #{deptId} and a.phone = #{phone} and a.del_flag=0 limit 1
+        where a.id_card=#{idCard} and a.domain=#{domain} and a.phone = #{phone} and a.del_flag=0 limit 1
     </select>
 
     <select id="getExpertRound" parameterType="com.gkhy.system.domain.vo.request.SysExpertInfoRoundReq"

--
Gitblit v1.9.2