소스 검색

修改描述,增加只按照身份证号判断,一个身份证只能入驻到一家店。

Guos 1 일 전
부모
커밋
e99d288fa5

+ 8 - 7
README.md

@@ -5,13 +5,14 @@
 
 #### 软件模块说明
 
-| 模块名称         | 模块描述         | 对应前端项目                  |
-|--------------|--------------|-------------------------|
-| fs-admin     | 总后台服务        | ylrz_his_scrm_adminUI   |
-| fs-company   | 销售端          | ylrz_his_scrm_companyUI |
-| fs-user-app  | 微信小程序端       | 对应某个微信小程序(前端蒲瑶清楚)       |
-| fs-framework | 主要依赖包,核心包    | /                       |
-| fs-service   | 所有的链接配置文件都在里面 | /                       |
+| 模块名称          | 模块描述          | 对应前端项目                            |
+|---------------|---------------|-----------------------------------|
+| fs-admin      | 总后台服务         | ylrz_his_scrm_adminUI             |
+| fs-company    | 销售端           | ylrz_his_scrm_companyUI           |
+| fs-user-app   | 微信小程序端        | 对应某个微信小程序(前端蒲瑶清楚)                 |
+| fs-doctor-app | 医生端后台         | ylrz_his_scrm_doctor (yjb-doctor) |
+| fs-framework  | 主要依赖包,核心包     | /                                 |
+| fs-service    | 所有的链接配置文件都在里面 | /                                 |
 
 
 #### 分支说明

+ 8 - 0
fs-service/src/main/java/com/fs/his/mapper/FsDoctorMapper.java

@@ -229,4 +229,12 @@ public interface FsDoctorMapper
     List<FsDoctorVO> getDoctorInfoByStoreId(@Param("param") FsDoctorParam param);
 
     Boolean idCardExists(String idCard, Long userId);
+
+    /**
+     * 身份证是否在这家店已经存在
+     * @param idCard
+     * @param storeId
+     * @return
+     */
+    Boolean isIdNumberInShop(@Param("idCard") String idCard,@Param("storeId") Long storeId);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/IFsDoctorService.java

@@ -136,4 +136,11 @@ public interface IFsDoctorService
      */
     Boolean idCardExistsByUserId(String idCard, Long userId);
 
+    /**
+     * 身份证是否在这家店已经存在
+     * @param idCard
+     * @param storeId
+     * @return
+     */
+    Boolean isIdNumberInShop(String idCard, Long storeId);
 }

+ 11 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsDoctorServiceImpl.java

@@ -567,4 +567,15 @@ public class FsDoctorServiceImpl implements IFsDoctorService
         return fsDoctorMapper.idCardExists(idCard, userId);
     }
 
+    /**
+     * 身份证是否在这家店已经存在
+     * @param idCard
+     * @param storeId
+     * @return
+     */
+    @Override
+    public Boolean isIdNumberInShop(String idCard, Long storeId) {
+        return fsDoctorMapper.isIdNumberInShop(idCard, storeId);
+    }
+
 }

+ 8 - 0
fs-service/src/main/resources/mapper/his/FsDoctorMapper.xml

@@ -395,4 +395,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="idCardExists" resultType="java.lang.Boolean">
         select 1 from fs_doctor where id_card = #{idCard}
     </select>
+
+    <select id="isIdNumberInShop" resultType="java.lang.Boolean">
+        SELECT count(doctor_id)
+        FROM fs_doctor
+        WHERE id_card =  #{idCard}
+          AND store_id = #{storeId}
+            LIMIT 1
+    </select>
 </mapper>

+ 19 - 11
fs-user-app/src/main/java/com/fs/app/controller/UserController.java

@@ -246,16 +246,6 @@ public class UserController extends  AppBaseController {
         if(0 != idCardVerificationResponse.getResult()){
             throw new CustomException(idCardVerificationResponse.getDescription());
         }
-        FsDoctor doctor= doctorService.selectFsDoctorByUserId(Long.parseLong(getUserId()));
-        if(doctor!=null){
-            if(doctor.getIsAudit().equals(0)){
-                return R.error(String.format("您已提交申请: %s,等待审核...",doctor.getDoctorName()));
-            }
-            else if(doctor.getIsAudit().equals(1)){
-                return R.error(String.format("您已提交过申请 提交信息: %s",doctor.getDoctorName()));
-            }
-        }
-
         if(param.getDoctorType().equals(1)){//医生
             if(param.getHospitalId() == null){
                 return R.error("请选择,所属医院");
@@ -274,10 +264,28 @@ public class UserController extends  AppBaseController {
                 return R.error("药剂师,绑定店铺审核状态还未通过");
             }else if(!fsStoreScrm.getStatus().equals(1)){
                 return R.error("药剂师,绑定店铺状态未启用!");
+            }else{
+                Boolean idNumberInShop = doctorService.isIdNumberInShop(param.getIdCard(), param.getStoreId());
+                if(idNumberInShop){
+                    return R.error("该药剂师已在当前店铺存在");
+                }
             }
             param.setStoreName(fsStoreScrm.getStoreName());
         }
-        doctor=new FsDoctor();
+
+        //一个用户可以提交多个申请
+//        FsDoctor doctor= doctorService.selectFsDoctorByUserId(Long.parseLong(getUserId()));
+//        if(doctor!=null){
+//            if(doctor.getIsAudit().equals(0)){
+//                return R.error(String.format("您已提交申请: %s,等待审核...",doctor.getDoctorName()));
+//            }
+//            else if(doctor.getIsAudit().equals(1)){
+//                return R.error(String.format("您已提交过申请 提交信息: %s",doctor.getDoctorName()));
+//            }
+//        }
+
+
+        FsDoctor doctor=new FsDoctor();
         BeanUtils.copyProperties(param,doctor);
         doctor.setUserId(Long.parseLong(getUserId()));
         doctor.setIsAudit(0);