Browse Source

Merge remote-tracking branch 'origin/ScrmStores' into ScrmStores

Guos 9 hours ago
parent
commit
863bc3c599

+ 1 - 0
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductCategoryScrmController.java

@@ -34,6 +34,7 @@ public class FsStoreProductCategoryScrmController extends BaseController
     @GetMapping("/list")
     public AjaxResult list(FsStoreProductCategoryScrm fsStoreProductCategory)
     {
+        fsStoreProductCategory.setIsDrug(1);
         List<FsStoreProductCategoryScrm> list = fsStoreProductCategoryService.selectFsStoreProductCategoryList(fsStoreProductCategory);
         return AjaxResult.success(list);
     }

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

@@ -237,4 +237,7 @@ public interface FsDoctorMapper
      * @return
      */
     Boolean isIdNumberInShop(@Param("idCard") String idCard,@Param("storeId") Long storeId);
+
+    @Select("SELECT * FROM fs_doctor WHERE store_id=#{storeId} and sign_url IS NOT NULL and doctor_type = 2 and  `status`=1 and is_audit=1  ORDER BY RAND() LIMIT 1; ")
+    FsDoctor doctorInfoByStoreId(@Param("storeId") Long storeId);
 }

+ 14 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java

@@ -511,5 +511,19 @@ public class FsStoreScrm extends BaseEntity {
      **/
     private String drugScopeHasFrozen;
 
+    /**
+     * 网销报告
+     * **/
+    private String reportUrl;
+
+    /**
+     * 备案
+     * **/
+    private String filingUrl;
+
+    /**
+     *权限状态(0登录查看权限、1一审通过、2、2审通过(看所有))
+     * **/
+    private Long permStatus;
 
 }

+ 5 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreScrmMapper.java

@@ -219,5 +219,9 @@ public interface FsStoreScrmMapper
      */
     FsStoreScrm selectFsStoreByStoreSeq(@Param("storeSeq") String storeSeq);
 
-
+    /**
+     * 校验权限
+     * **/
+    @Select("select count(*) from  fs_store_scrm where  store_id = #{storeId} and perm_status = 2")
+    Integer checkStorePerm(@Param("storeId") Long storeId);
 }

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreScrmInfoParam.java

@@ -292,4 +292,13 @@ public class FsStoreScrmInfoParam extends BaseEntity
      **/
     private String drugScopeHasFrozen;
 
+    /**
+     * 网销报告
+     * **/
+    private String reportUrl;
+
+    /**
+     * 备案
+     * **/
+    private String filingUrl;
 }

+ 7 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java

@@ -145,4 +145,11 @@ public interface IFsStoreScrmService
      * @param checkLicenseVO
      */
     ContainsResult checkLicense(CheckLicenseVO checkLicenseVO);
+
+    /**
+     * 校验店铺权限
+     * @param storeId 店铺id
+     * @return R
+     * **/
+    R checkStorePerm(Long storeId);
 }

+ 23 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java

@@ -8,6 +8,8 @@ import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.txocr.ContainsResult;
 import com.fs.common.utils.txocr.TxOcrClient;
+import com.fs.his.domain.FsDoctor;
+import com.fs.his.mapper.FsDoctorMapper;
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.utils.StoreMD5PasswordEncoder;
@@ -68,6 +70,8 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
     @Autowired
     private ApplicationEventPublisher applicationEventPublisher;
 
+    @Autowired
+    private FsDoctorMapper doctorMapper;
 
     /**
      * 查询店铺管理
@@ -341,6 +345,15 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
             updateStore.setQualificationUpdateTime(LocalDate.now());
         }
         updateStore.setStatus(1);
+        if(((fsStoreScrm.getPermStatus() == null || fsStoreScrm.getPermStatus() != 2) && updateStore.getIsAudit() == 1)){
+            updateStore.setPermStatus(fsStoreScrm.getPermStatus() == null || fsStoreScrm.getPermStatus() == 0 ? 1L : 2L);
+            if(updateStore.getPermStatus() == 2L){//二审核
+                //验证是否上传网销报告、备案、入驻药师
+                if(fsStoreScrm.getReportUrl() == null || fsStoreScrm.getFilingUrl() == null || doctorMapper.doctorInfoByStoreId(fsStore.getStoreId()) == null){
+                    updateStore.setPermStatus(fsStoreScrm.getPermStatus() == null? 0L:fsStoreScrm.getPermStatus());
+                }
+            }
+        }
         fsStoreMapper.updateFsStore(updateStore);
         //更新日志
         storeAuditLogUtil.addAudit(fsStore.getStoreId(), fsStore.getReason(), fsStore.getAttachImage());
@@ -527,6 +540,16 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
         }
     }
 
+    @Override
+    public R checkStorePerm(Long storeId) {
+        boolean check = true;
+        Integer checkInt = fsStoreMapper.checkStorePerm(storeId);
+        if(checkInt == null || checkInt == 0){
+            check = false;
+        }
+        return R.ok().put("data",check);
+    }
+
     /**
      * 获取两个对象的所有差异字段(基于旧对象的所有字段,以新对象字段值为准进行对比)
      * 只要新旧值不同就视为差异

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreDetailsScrmVo.java

@@ -311,4 +311,13 @@ public class FsStoreDetailsScrmVo extends BaseEntity
      **/
     private String drugScopeHasFrozen;
 
+    /**
+     * 网销报告
+     * **/
+    private String reportUrl;
+
+    /**
+     * 备案
+     * **/
+    private String filingUrl;
 }

+ 13 - 45
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -91,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="drugLicenseBusinessScope" column="drug_license_business_scope" />
         <result property="foodLicenseBusinessScope" column="food_license_business_scope" />
         <result property="drugScopeHasFrozen" column="drug_scope_has_frozen" />
+        <result property="reportUrl" column="report_url" />
+        <result property="filingUrl" column="filing_url" />
+        <result property="permStatus" column="perm_status" />
     </resultMap>
 
     <sql id="selectFsStoreVo">
@@ -110,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                is_drug_license_permanent,is_medical_device2_expiry_permanent,is_medical_device3_expiry_permanent,is_food_license_expiry_permanent,is_medical_license_expiry_permanent,
                title_Name_one,title_Name_two,title_Name_three,settlement_agreement_file_name,quality_assurance_agreement_fileName,other_special_qualification_fileName,
                is_effective_permanent1,is_effective_permanent2,is_effective_permanent3,medical_device2_business_scope,medical_device3_business_scope,drug_license_business_scope
-            ,food_license_business_scope,drug_scope_has_frozen
+            ,food_license_business_scope,drug_scope_has_frozen,report_url,filing_url,perm_status
         from fs_store_scrm
     </sql>
 
@@ -235,6 +238,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="drugLicenseBusinessScope !=null ">drug_license_business_scope, </if>
             <if test="foodLicenseBusinessScope !=null ">food_license_business_scope, </if>
             <if test="drugScopeHasFrozen !=null ">drug_scope_has_frozen, </if>
+            <if test="reportUrl !=null ">report_url, </if>
+            <if test="filingUrl !=null ">filing_url, </if>
+            <if test="permStatus !=null ">report_url, </if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="cityIds != null">#{cityIds},</if>
@@ -334,6 +340,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="drugLicenseBusinessScope !=null ">#{drugLicenseBusinessScope}, </if>
             <if test="foodLicenseBusinessScope !=null ">#{foodLicenseBusinessScope}, </if>
             <if test="drugScopeHasFrozen !=null ">#{drugScopeHasFrozen}, </if>
+            <if test="reportUrl !=null ">#{reportUrl}, </if>
+            <if test="filingUrl !=null ">#{filingUrl}, </if>
+            <if test="permStatus !=null ">#{permStatus}, </if>
         </trim>
     </insert>
 
@@ -435,6 +444,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="drugLicenseBusinessScope !=null ">drug_license_business_scope = #{drugLicenseBusinessScope} , </if>
             <if test="foodLicenseBusinessScope !=null ">food_license_business_scope = #{foodLicenseBusinessScope} , </if>
             <if test="drugScopeHasFrozen !=null ">drug_scope_has_frozen = #{drugScopeHasFrozen}, </if>
+            <if test="reportUrl !=null ">report_url = #{reportUrl}, </if>
+            <if test="filingUrl !=null ">filing_url = #{filingUrl}, </if>
+            <if test="permStatus !=null ">perm_status = #{permStatus}, </if>
         </trim>
         where store_id = #{storeId}
     </update>
@@ -687,23 +699,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                             AND food_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH)
                             AND is_food_license_expiry_permanent != 1
             THEN '食品经营许可证3个月内过期,请注意更新;'
-                        ELSE ''
-                        END,
-                -- 医疗机构执业许可证
-                    CASE
-                        WHEN medical_license IS NOT NULL
-                            AND medical_license_expiry_end IS NOT NULL
-                            AND medical_license_expiry_end &lt; CURDATE()
-                            AND is_medical_license_expiry_permanent != 1
-            THEN '医疗机构执业许可证已过期,需要商家更新;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN medical_license IS NOT NULL
-                            AND medical_license_expiry_end IS NOT NULL
-                            AND medical_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH)
-                            AND is_medical_license_expiry_permanent != 1
-            THEN '医疗机构执业许可证3个月内过期,请注意更新;'
                         ELSE ''
                         END
                 ) AS warning_message
@@ -735,11 +730,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND food_license_expiry_end IS NOT NULL
                 AND (food_license_expiry_end &lt; CURDATE() OR food_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH))
                 AND is_food_license_expiry_permanent != 1)
-                -- 医疗机构执业许可证
-                OR (medical_license IS NOT NULL
-                AND medical_license_expiry_end IS NOT NULL
-                AND (medical_license_expiry_end &lt; CURDATE() OR medical_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH))
-                AND is_medical_license_expiry_permanent != 1)
             )
         HAVING warning_message != '';
     </select>
@@ -848,23 +838,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                             AND food_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH)
                             AND is_food_license_expiry_permanent != 1
             THEN '食品经营许可证3个月内过期,请注意更新;'
-                        ELSE ''
-                        END,
-                -- 医疗机构执业许可证
-                    CASE
-                        WHEN medical_license IS NOT NULL
-                            AND medical_license_expiry_end IS NOT NULL
-                            AND medical_license_expiry_end &lt; CURDATE()
-                            AND is_medical_license_expiry_permanent != 1
-            THEN '医疗机构执业许可证已过期,需要商家更新;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN medical_license IS NOT NULL
-                            AND medical_license_expiry_end IS NOT NULL
-                            AND medical_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH)
-                            AND is_medical_license_expiry_permanent != 1
-            THEN '医疗机构执业许可证3个月内过期,请注意更新;'
                         ELSE ''
                         END
                 ) AS warning_message
@@ -902,11 +875,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND food_license_expiry_end IS NOT NULL
                 AND (food_license_expiry_end &lt; CURDATE() OR food_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH))
                 AND is_food_license_expiry_permanent != 1)
-                -- 医疗机构执业许可证
-                OR (medical_license IS NOT NULL
-                AND medical_license_expiry_end IS NOT NULL
-                AND (medical_license_expiry_end &lt; CURDATE() OR medical_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH))
-                AND is_medical_license_expiry_permanent != 1)
             )
         HAVING warning_message != '';
     </select>

+ 10 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreScrmController.java

@@ -11,6 +11,7 @@ import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.utils.txocr.TxOcrClient;
 import com.fs.framework.service.TokenServiceScrm;
+import com.fs.his.domain.StoreLoginUser;
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.hisStore.domain.FsStoreScrm;
 import com.fs.hisStore.domain.StoreLoginUserScrm;
@@ -232,4 +233,13 @@ public class FsStoreScrmController extends BaseController {
         StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         return fsStoreService.qualificationReminder(loginUser.getFsStore().getStoreId());
     }
+
+    /**
+     * 校验店铺查看页面权限
+     * **/
+    @PostMapping("/checkStorePerm")
+    public R checkStorePerm(){
+        StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        return fsStoreService.checkStorePerm(loginUser.getFsStore().getStoreId());
+    }
 }