Sfoglia il codice sorgente

代码提交-需要去存在新增接口,需提交才能切换分支

yjwang 4 giorni fa
parent
commit
e18df95d2f

+ 27 - 3
fs-doctor-app/src/main/java/com/fs/app/controller/DoctorController.java

@@ -19,16 +19,20 @@ import com.fs.his.param.FsDoctorDoExtractParam;
 import com.fs.his.param.FsDoctorExtractEditParam;
 import com.fs.his.param.FsDoctorExtractListSParam;
 import com.fs.his.service.*;
+import com.fs.his.utils.CityTreeUtil;
+import com.fs.his.vo.CityVO;
 import com.fs.his.vo.FsDoctorBillListSVO;
 import com.fs.his.vo.FsDoctorExtractListSVO;
+import com.fs.hisStore.domain.FsStoreScrm;
+import com.fs.hisStore.service.IFsStoreScrmService;
 import com.fs.im.config.IMConfig;
 import com.fs.im.service.OpenIMService;
-import com.fs.im.service.OpenIMService;
 import com.fs.sms.service.SmsService;
 import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.util.StringUtil;
+import com.google.common.collect.Lists;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -69,6 +73,10 @@ public class DoctorController extends  AppBaseController {
     private OpenIMService openIMService;
     @Autowired
     private SmsService smsService;
+
+    @Autowired
+    private IFsStoreScrmService fsStoreScrmService;
+
     @ApiOperation("登录")
     @PostMapping("/login")
     public R login(@Validated  @RequestBody DoctorLoginParam param) {
@@ -247,12 +255,13 @@ public class DoctorController extends  AppBaseController {
     public R getDoctorInfo(HttpServletRequest request){
         try {
             FsDoctor doctor=doctorService.selectFsDoctorByDoctorId(Long.parseLong(getDoctorId()));
-            FsHospital hospital=hospitalService.selectFsHospitalByHospitalId(doctor.getHospitalId());
+            FsStoreScrm storeScrm = fsStoreScrmService.selectFsStoreByStoreId(doctor.getStoreId());
+//            FsHospital hospital=hospitalService.selectFsHospitalByHospitalId(doctor.getHospitalId());
             FsDepartment department=departmentService.selectFsDepartmentByDeptId(doctor.getDeptId());
 
             Map<String,Object> map=new HashMap<>();
             map.put("doctor",doctor);
-            map.put("hospital",hospital);
+            map.put("storeName",storeScrm.getStoreName());
             map.put("department",department);
             return R.ok(map);
         } catch (Exception e){
@@ -453,5 +462,20 @@ public class DoctorController extends  AppBaseController {
         return smsService.sendTSms(doctor.getMobile(),code+"");
     }
 
+    @Login
+    @ApiOperation("修改信息")
+    @PostMapping("/editDoctorInfo")
+    public R editDoctorInfo(@RequestBody FsDoctor doctor){
+        if(doctor.getDoctorId() == null){
+            return R.error("操作失败,关键信息不能为空!");
+        }
+        FsDoctor doctorInfo=doctorService.selectFsDoctorByDoctorId(doctor.getDoctorId());
+        if(doctorInfo == null){
+            return R.error("操作失败,信息不存在!");
+        }
+        doctor.setIsAudit(0);
+        doctorService.updateFsDoctor(doctor);
+        return R.ok("修改成功");
+    }
 
 }

+ 18 - 18
fs-doctor-app/src/main/java/com/fs/app/controller/StoreController.java

@@ -2,34 +2,19 @@ package com.fs.app.controller;
 
 
 import com.fs.app.annotation.Login;
-import com.fs.app.param.SignParam;
-import com.fs.app.utils.CityTreeUtil;
-import com.fs.app.utils.JwtUtils;
-import com.fs.app.vo.CityVO;
-import com.fs.common.config.FSConfig;
-import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
-import com.fs.common.exception.file.OssException;
-import com.fs.his.domain.FsAppVersion;
 import com.fs.his.domain.FsCity;
-import com.fs.his.domain.FsDoctor;
 import com.fs.his.domain.FsStore;
-import com.fs.his.service.IFsAppVersionService;
 import com.fs.his.service.IFsCityService;
 import com.fs.his.service.IFsDoctorService;
 import com.fs.his.service.IFsStoreService;
-import com.fs.system.oss.CloudStorageService;
-import com.fs.system.oss.OSSFactory;
-import com.fs.system.service.ISysDictDataService;
-import com.fs.system.vo.DictVO;
+import com.fs.his.utils.CityTreeUtil;
+import com.fs.his.vo.CityVO;
 import com.google.common.collect.Lists;
-import com.tencentyun.TLSSigAPIv2;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -43,6 +28,8 @@ public class StoreController extends  AppBaseController {
 	private IFsStoreService storeService;
 	@Autowired
 	private IFsDoctorService doctorService;
+	@Autowired
+	private IFsCityService fsCityService;
 
 	@Login
 	@ApiOperation("获取店铺数据")
@@ -57,5 +44,18 @@ public class StoreController extends  AppBaseController {
 
 	}
 
-
+	@ApiOperation("获取城市数据")
+	@GetMapping("/getCitys")
+	public R getCitys(){
+		List<FsCity> list=fsCityService.selectFsCity();
+		List<com.fs.his.vo.CityVO> cityVOS = Lists.newArrayList();
+		for (FsCity city : list){
+			com.fs.his.vo.CityVO cityVO = new CityVO();
+			cityVO.setValue(Long.parseLong(city.getCityId()));
+			cityVO.setLabel(city.getCityName());
+			cityVO.setPid(Long.parseLong(city.getParentId()));
+			cityVOS.add(cityVO);
+		}
+		return R.ok().put("data", CityTreeUtil.list2TreeConverter(cityVOS, 0));
+	}
 }

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

@@ -194,6 +194,11 @@ public class FsStoreScrm extends BaseEntity {
      */
     private String businessScope;
 
+    /**
+     * 可选商品类型列表
+     */
+    private String selectableProductTypes;
+
     /**
      * 营业执照图片
      */

+ 3 - 3
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -172,12 +172,12 @@ public interface FsStoreProductScrmMapper
 //            "</script>"})
 @Select({"<script> " +
         "select " +
-        "DISTINCT p.*,pc.cate_name, fs_store.store_name,hs.push_status " +
+        "DISTINCT p.*,pc.cate_name, ss.store_name,hs.push_status " +
         "from fs_store_product_scrm p " +
         "left join fs_store_product_category_scrm pc " +
         "on p.cate_id = pc.cate_id " +
-        "left join fs_store " +
-        "on fs_store.store_id = p.store_id " +
+        "INNER JOIN fs_store_scrm ss " +
+        "on ss.store_id = p.store_id " +
         "left join ( " +
         "select product_id, push_status " +
         "from ( " +

+ 37 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -33,6 +33,7 @@ import com.fs.hisStore.domain.*;
 import com.fs.hisStore.mapper.*;
 import com.fs.hisStore.param.FsStoreCartCountParam;
 import com.fs.hisStore.utils.StoreAuditLogUtil;
+import com.fs.hisStore.util.BusinessScopeProductTypeUtil;
 import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.dto.ProductArrtDTO;
 import com.fs.hisStore.dto.ProductAttrCountDto;
@@ -429,6 +430,19 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                 default:
                     return R.error("商品类型错误");
             }
+            
+            // 根据经营范围校验商品类型
+            if (com.fs.common.utils.StringUtils.isNotEmpty(store.getSelectableProductTypes())) {
+                String productTypeName = getProductTypeName(product.getProductType());
+                if (com.fs.common.utils.StringUtils.isNotEmpty(productTypeName)) {
+                    // 直接使用工具类方法校验
+                    boolean isAllowed = BusinessScopeProductTypeUtil.isProductTypeAllowed(
+                            store.getSelectableProductTypes(), productTypeName);
+                    if (!isAllowed) {
+                        return R.error("该商品类型[" + productTypeName + "]不在店铺经营范围允许的商品类型内,请联系管理员核实经营范围");
+                    }
+                }
+            }
         }
 
         if("纯正堂".equals(cloudHostProper.getCompanyName())){
@@ -1303,4 +1317,27 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     public void updateFsStoreProductIsShowBatch(Long[] productIds) {
         fsStoreProductMapper.updateFsStoreProductIsShowBatch(productIds);
     }
+    
+    /**
+     * 将商品类型ID转换为商品类型名称
+     * @param productType 商品类型ID:1=非处方 2=处方 3=食品 4=器械
+     * @return 商品类型名称
+     */
+    private String getProductTypeName(Integer productType) {
+        if (productType == null) {
+            return "";
+        }
+        switch (productType) {
+            case 1:
+                return "乙类非处方药";
+            case 2:
+                return "处方药";
+            case 3:
+                return "保健食品";
+            case 4:
+                return "III类医疗器械";
+            default:
+                return "";
+        }
+    }
 }

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

@@ -16,6 +16,7 @@ import com.fs.hisStore.mapper.FsStoreScrmMapper;
 import com.fs.hisStore.param.FsStoreScrmInfoParam;
 import com.fs.hisStore.service.IFsStoreScrmService;
 import com.fs.hisStore.utils.StoreAuditLogUtil;
+import com.fs.hisStore.util.BusinessScopeProductTypeUtil;
 import com.fs.hisStore.vo.FsStoreDetailsScrmVo;
 import com.fs.hisStore.vo.FsStoreRecommendListVO;
 import com.fs.hisStore.vo.FsStoreScrmVO;
@@ -305,6 +306,17 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
         FsStoreScrm updateStore = new FsStoreScrm();
         updateStore.setStoreId(fsStore.getStoreId());
         updateStore.setIsAudit(fsStore.getIsAudit());
+        
+        // 审核通过时,根据经营范围自动设置可选商品类型
+        if (fsStore.getIsAudit() != null && fsStore.getIsAudit() == 1) {
+            if (StringUtils.isNotEmpty(fsStoreScrm.getBusinessScope())) {
+                String selectableProductTypes = BusinessScopeProductTypeUtil.determineProductTypes(fsStoreScrm.getBusinessScope());
+                updateStore.setSelectableProductTypes(selectableProductTypes);
+                log.info("店铺[{}]审核通过,根据经营范围[{}]自动设置可选商品类型:{}", 
+                        fsStore.getStoreId(), fsStoreScrm.getBusinessScope(), selectableProductTypes);
+            }
+        }
+        
         if (fsStoreScrm.getStatus() == 0) {
             LocalDate today = LocalDate.now(ZoneId.of("Asia/Shanghai"));
             if (fsStoreScrm.getBusinessLicenseExpireEnd().isAfter(today) && fsStoreScrm.getDrugLicenseExpiryEnd().isAfter(today)

+ 262 - 0
fs-service/src/main/java/com/fs/hisStore/util/BusinessScopeProductTypeUtil.java

@@ -0,0 +1,262 @@
+package com.fs.hisStore.util;
+
+import com.fs.common.utils.StringUtils;
+import lombok.Data;
+
+import java.util.*;
+
+/**
+ * 经营范围商品类型工具类
+ * 根据店铺经营范围关键字判定可选商品类型及所需资质证书
+ *
+ * @author fs
+ * @date 2025-11-01
+ */
+public class BusinessScopeProductTypeUtil {
+
+    /**
+     * 商品类型常量
+     */
+    public static class ProductType {
+        public static final String CHINESE_MEDICINE = "中成药";
+        public static final String PRESCRIPTION_DRUG = "处方药";
+        public static final String CHINESE_MEDICINE_TABLET = "中药饮片";
+        public static final String HEALTH_PRODUCT = "保健食品";
+        public static final String MEDICAL_DEVICE_1 = "I类医疗器械";
+        public static final String MEDICAL_DEVICE_2 = "II类医疗器械";
+        public static final String MEDICAL_DEVICE_3 = "III类医疗器械";
+        public static final String OTC_A = "甲类非处方药";
+        public static final String OTC_B = "乙类非处方药";
+    }
+
+    /**
+     * 所需资质证书类型
+     */
+    public static class CertificateType {
+        public static final String BUSINESS_LICENSE = "营业执照";
+        public static final String DRUG_LICENSE = "药品经营许可证";
+        public static final String FOOD_LICENSE = "食品经营许可证";
+        public static final String MEDICAL_DEVICE_1_CERT = "第一类医疗器械备案凭证";
+        public static final String MEDICAL_DEVICE_2_CERT = "第二类医疗器械备案凭证";
+        public static final String MEDICAL_DEVICE_3_CERT = "第三类医疗器械注册证";
+        public static final String HEALTH_FOOD_CERT = "保健食品销售资质";
+    }
+
+    /**
+     * 商品类型配置信息
+     */
+    @Data
+    public static class ProductTypeConfig {
+        private String productType;           // 商品类型
+        private List<String> keywords;        // 经营范围关键字
+        private List<String> requiredCerts;   // 所需资质证书
+
+        public ProductTypeConfig(String productType, List<String> keywords, List<String> requiredCerts) {
+            this.productType = productType;
+            this.keywords = keywords;
+            this.requiredCerts = requiredCerts;
+        }
+    }
+
+    /**
+     * 商品类型配置列表
+     * 根据表格配置:类目 -> 判定关键字 -> 所需资质证书
+     */
+    private static final List<ProductTypeConfig> PRODUCT_TYPE_CONFIGS = new ArrayList<>();
+
+    static {
+        // 中成药:判定=中成药,需要=药品经营许可证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.CHINESE_MEDICINE,
+                Arrays.asList("中成药"),
+                Arrays.asList(CertificateType.DRUG_LICENSE, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // 处方药:判定=处方药/化学药制剂,需要=药品经营许可证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.PRESCRIPTION_DRUG,
+                Arrays.asList("处方药", "化学药制剂"),
+                Arrays.asList(CertificateType.DRUG_LICENSE, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // 中药饮片:判定=中药饮片,需要=药品经营许可证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.CHINESE_MEDICINE_TABLET,
+                Arrays.asList("中药饮片"),
+                Arrays.asList(CertificateType.DRUG_LICENSE, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // 保健食品:判定=保健食品销售,需要=保健食品销售+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.HEALTH_PRODUCT,
+                Arrays.asList("保健食品销售", "保健食品", "保健品"),
+                Arrays.asList(CertificateType.HEALTH_FOOD_CERT, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // I类医疗器械:判定=第一类医疗器械销售,需要=第一类医疗器械备案凭证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.MEDICAL_DEVICE_1,
+                Arrays.asList("第一类医疗器械销售", "一类医疗器械", "I类医疗器械", "1类医疗器械"),
+                Arrays.asList(CertificateType.MEDICAL_DEVICE_1_CERT, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // II类医疗器械:判定=第二类医疗器械销售,需要=第二类医疗器械备案凭证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.MEDICAL_DEVICE_2,
+                Arrays.asList("第二类医疗器械销售", "二类医疗器械", "II类医疗器械", "2类医疗器械"),
+                Arrays.asList(CertificateType.MEDICAL_DEVICE_2_CERT, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // III类医疗器械:判定=第三类医疗器械经营,需要=第三类医疗器械注册证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.MEDICAL_DEVICE_3,
+                Arrays.asList("第三类医疗器械经营", "三类医疗器械", "III类医疗器械", "3类医疗器械"),
+                Arrays.asList(CertificateType.MEDICAL_DEVICE_3_CERT, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // 甲类非处方药:判定=甲类非处方药/化学药制剂,需要=药品经营许可证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.OTC_A,
+                Arrays.asList("甲类非处方药", "甲类非处方", "甲类非处方药/化学药制剂"),
+                Arrays.asList(CertificateType.DRUG_LICENSE, CertificateType.BUSINESS_LICENSE)
+        ));
+
+        // 乙类非处方药:判定=乙类非处方药/化学药制剂,需要=药品经营许可证+营业执照
+        PRODUCT_TYPE_CONFIGS.add(new ProductTypeConfig(
+                ProductType.OTC_B,
+                Arrays.asList("乙类非处方药", "乙类非处方", "乙类非处方药/化学药制剂"),
+                Arrays.asList(CertificateType.DRUG_LICENSE, CertificateType.BUSINESS_LICENSE)
+        ));
+    }
+
+    /**
+     * 根据经营范围判定可选商品类型
+     *
+     * @param businessScope 经营范围
+     * @return 可选商品类型列表,以逗号分隔的字符串
+     */
+    public static String determineProductTypes(String businessScope) {
+        if (StringUtils.isEmpty(businessScope)) {
+            return "";
+        }
+
+        Set<String> productTypes = new LinkedHashSet<>();
+
+        // 遍历所有配置,检查经营范围是否包含关键字
+        for (ProductTypeConfig config : PRODUCT_TYPE_CONFIGS) {
+            for (String keyword : config.getKeywords()) {
+                if (businessScope.contains(keyword)) {
+                    productTypes.add(config.getProductType());
+                    break; // 找到一个关键字即可,跳出内层循环
+                }
+            }
+        }
+
+        // 将商品类型集合转换为逗号分隔的字符串
+        return String.join(",", productTypes);
+    }
+
+    /**
+     * 根据经营范围判定所需的资质证书
+     *
+     * @param businessScope 经营范围
+     * @return 所需资质证书列表,以逗号分隔的字符串
+     */
+    public static String determineRequiredCertificates(String businessScope) {
+        if (StringUtils.isEmpty(businessScope)) {
+            return "";
+        }
+
+        Set<String> certificates = new LinkedHashSet<>();
+        // 营业执照是必需的
+        certificates.add(CertificateType.BUSINESS_LICENSE);
+
+        // 遍历所有配置,收集所需资质证书
+        for (ProductTypeConfig config : PRODUCT_TYPE_CONFIGS) {
+            for (String keyword : config.getKeywords()) {
+                if (businessScope.contains(keyword)) {
+                    certificates.addAll(config.getRequiredCerts());
+                    break;
+                }
+            }
+        }
+
+        return String.join(",", certificates);
+    }
+
+    /**
+     * 根据商品类型获取所需的资质证书
+     *
+     * @param productType 商品类型
+     * @return 所需资质证书列表
+     */
+    public static List<String> getRequiredCertificatesByProductType(String productType) {
+        if (StringUtils.isEmpty(productType)) {
+            return new ArrayList<>();
+        }
+
+        for (ProductTypeConfig config : PRODUCT_TYPE_CONFIGS) {
+            if (config.getProductType().equals(productType)) {
+                return new ArrayList<>(config.getRequiredCerts());
+            }
+        }
+
+        return new ArrayList<>();
+    }
+
+    /**
+     * 将逗号分隔的字符串转换为商品类型列表
+     *
+     * @param selectableProductTypes 逗号分隔的商品类型字符串
+     * @return 商品类型列表
+     */
+    public static List<String> parseProductTypes(String selectableProductTypes) {
+        if (StringUtils.isEmpty(selectableProductTypes)) {
+            return new ArrayList<>();
+        }
+        List<String> result = new ArrayList<>();
+        for (String type : selectableProductTypes.split(",")) {
+            if (StringUtils.isNotEmpty(type)) {
+                result.add(type.trim());
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 检查商品类型是否在允许范围内
+     *
+     * @param selectableProductTypes 店铺可选商品类型
+     * @param productType            待检查的商品类型
+     * @return true-允许 false-不允许
+     */
+    public static boolean isProductTypeAllowed(String selectableProductTypes, String productType) {
+        if (StringUtils.isEmpty(selectableProductTypes) || StringUtils.isEmpty(productType)) {
+            return false;
+        }
+        List<String> allowedTypes = parseProductTypes(selectableProductTypes);
+        return allowedTypes.contains(productType);
+    }
+
+    /**
+     * 获取所有商品类型列表
+     *
+     * @return 商品类型列表
+     */
+    public static List<String> getAllProductTypes() {
+        List<String> types = new ArrayList<>();
+        for (ProductTypeConfig config : PRODUCT_TYPE_CONFIGS) {
+            types.add(config.getProductType());
+        }
+        return types;
+    }
+
+    /**
+     * 获取所有商品类型配置
+     *
+     * @return 商品类型配置列表
+     */
+    public static List<ProductTypeConfig> getAllProductTypeConfigs() {
+        return new ArrayList<>(PRODUCT_TYPE_CONFIGS);
+    }
+}

+ 5 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="legalPersonName"	column="legal_person_name" />
         <result property="unifiedSocialCreditCode"	column="unified_social_credit_code" />
         <result property="businessScope"	column="business_scope" />
+        <result property="selectableProductTypes"	column="selectable_product_types" />
         <result property="businessLicense"	column="business_license" />
         <result property="businessLicenseExpireStart"	column="business_license_expire_start" />
         <result property="businessLicenseExpireEnd"	column="business_license_expire_end" />
@@ -78,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                city_ids, store_name, descs, brokerage_type,logo_url, address, lng, lat, phone, license_images, product_count,
                status, create_time, update_time, sales_count, balance, total_money, is_audit, account, password, shipping_type,
                enterprise_address,legal_person_name,unified_social_credit_code,
-               business_scope,business_license,business_license_expire_start,business_license_expire_end,drug_license,
+               business_scope,selectable_product_types,business_license,business_license_expire_start,business_license_expire_end,drug_license,
                drug_license_expiry_start,drug_license_expiry_end,medical_device1,medical_device1_expiry_start,medical_device1_expiry_end,
                medicalDevice2,medical_device2_expiry_start,medical_device2_expiry_end,medicalDevice3,medical_device3_expiry_start,
                medical_device3_expiry_end,food_license,food_license_expiry_start,food_license_expiry_end,medical_license,
@@ -144,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="legalPersonName !=null">legal_person_name , </if>
             <if test="unifiedSocialCreditCode !=null">unified_social_credit_code , </if>
             <if test="businessScope !=null">business_scope , </if>
+            <if test="selectableProductTypes !=null">selectable_product_types , </if>
             <if test="businessLicense !=null">business_license , </if>
             <if test="businessLicenseExpireStart !=null ">business_license_expire_start, </if>
             <if test="businessLicenseExpireEnd !=null ">business_license_expire_end , </if>
@@ -222,6 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="legalPersonName !=null">#{legalPersonName}, </if>
             <if test="unifiedSocialCreditCode !=null">#{unifiedSocialCreditCode}, </if>
             <if test="businessScope !=null">#{businessScope}, </if>
+            <if test="selectableProductTypes !=null">#{selectableProductTypes}, </if>
             <if test="businessLicense !=null">#{businessLicense}, </if>
             <if test="businessLicenseExpireStart !=null ">#{businessLicenseExpireStart}, </if>
             <if test="businessLicenseExpireEnd !=null ">#{businessLicenseExpireEnd}, </if>
@@ -304,6 +307,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="legalPersonName !=null and legalPersonName !=''"> legal_person_name = #{legalPersonName} ,</if>
             <if test="unifiedSocialCreditCode !=null and unifiedSocialCreditCode !=''"> unified_social_credit_code = #{unifiedSocialCreditCode} ,</if>
             <if test="businessScope !=null and businessScope !=''"> business_scope = #{businessScope} ,</if>
+            <if test="selectableProductTypes !=null and selectableProductTypes !=''"> selectable_product_types = #{selectableProductTypes} ,</if>
             <if test="businessLicense !=null and businessLicense !=''"> business_license = #{businessLicense} ,</if>
             <if test="businessLicenseExpireStart !=null "> business_license_expire_start = #{businessLicenseExpireStart} ,</if>
             <if test="businessLicenseExpireEnd !=null "> business_license_expire_end = #{businessLicenseExpireEnd} ,</if>

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

@@ -239,14 +239,14 @@ public class UserController extends  AppBaseController {
     @PostMapping("/registerDoctor")
     public R registerDoctor(@Validated  @RequestBody FsDoctorRegisterParam param, HttpServletRequest request){
         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(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){
@@ -274,7 +274,9 @@ public class UserController extends  AppBaseController {
         doctor.setUserId(Long.parseLong(getUserId()));
         doctor.setIsAudit(0);
         doctor.setPassword(Md5Utils.hash(param.getPassword()));
-        doctor.setStatus(0);
+        doctor.setStatus(1);//默认启用
+        doctor.setPractiseImages(param.getPractiseImages());
+        doctor.setPractiseCode(param.getPractiseCode());
         doctor.setBalance(new BigDecimal(0));
         doctor.setPriceJson("[{\"price\":1.00,\"type\":1},{\"price\":1.00,\"type\":2}]");
         if(doctorService.insertFsDoctor(doctor)>0){

+ 10 - 0
fs-user-app/src/main/java/com/fs/app/param/FsDoctorRegisterParam.java

@@ -103,4 +103,14 @@ public class FsDoctorRegisterParam implements Serializable {
      * 店铺名称
      * **/
     private String storeName;
+
+    /**
+     * 职业证书
+     * **/
+    private String practiseImages;
+
+    /**
+     * 执业证书编号
+     * **/
+    private String practiseCode;
 }