瀏覽代碼

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

Guos 2 天之前
父節點
當前提交
834eb558e8

+ 12 - 5
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -359,18 +359,25 @@ public class FsUserCourseVideoController extends AppBaseController {
     @ApiOperation("获取登录小程id值")
     @GetMapping("/getLoginMiniAppId/{appId}")
     public ResponseResult getLoginMiniAppId(@PathVariable String appId){
+        if(appId == null){
+            return ResponseResult.fail(500,"操作失败APPID不能为空!");
+        }
+
+        //判断配置的appid是否为芳华惠选appid 如果配置了直接返回芳华惠选的appid
+        if(appId.equals(FANG_HUA_APP_ID)){
+            return ResponseResult.ok(appId);
+        }
+
         String json = configService.selectConfigByKey("course.config");
         if(null == json || com.hc.openapi.tool.util.StringUtils.isBlank(json)){
             ResponseResult.fail(500,"请先配置课程系统参数");
         }
+
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
-        //判断配置的appid是否为芳华惠选appid 如果配置了直接返回芳华惠选的appid
         if(null != config && StringUtils.isNotBlank(config.getLoginMiniAppId())){
-            String loginMiniAppId = config.getLoginMiniAppId();
-            if(FANG_HUA_APP_ID.equals(loginMiniAppId)){
-                return ResponseResult.ok(FANG_HUA_APP_ID);
-            }
+            return ResponseResult.ok(config.getLoginMiniAppId());
         }
+
         return ResponseResult.ok(appId);
     }
 

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

@@ -178,7 +178,7 @@ public interface FsStoreProductScrmMapper
         "from fs_store_product_scrm p " +
         "left join fs_store_product_category_scrm pc " +
         "on p.cate_id = pc.cate_id " +
-        "INNER JOIN fs_store_scrm ss " +
+        "left JOIN fs_store_scrm ss " +
         "on ss.store_id = p.store_id " +
         "left join ( " +
         "select product_id, push_status " +

+ 40 - 35
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -302,8 +302,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                 item.setCompanyName(String.join(",",companyNameList));
             }
             //店铺名称
-            if(StringUtils.isNotEmpty(item.getStoreId()))
-                item.setStoreName(fsStoreScrmService.selectFsStoreByStoreId(Long.parseLong(item.getStoreId())).getStoreName());
+//            if(StringUtils.isNotEmpty(item.getStoreId()))
+//                item.setStoreName(fsStoreScrmService.selectFsStoreByStoreId(Long.parseLong(item.getStoreId())).getStoreName());
         }
 
         return fsStoreProductListVOS;
@@ -430,35 +430,39 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Override
     @Transactional
     public R addOrEdit(FsStoreProductAddEditParam param) {
+        FsStoreScrm store = null;
+        Long storeId = null;
+        //判断是否药品
+        if(param.getIsDrug() == 1){
+            //店铺判断
+            storeId = param.getStoreId();
+            store = fsStoreScrmService.selectFsStoreByStoreId(storeId);
+            if (store == null || 1 != store.getStatus()) {
+                return R.error("店铺不存在或未启用");
+            }
 
-        //店铺判断
-        Long storeId = param.getStoreId();
-        FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(storeId);
-        if (store == null || 1 != store.getStatus()) {
-            return R.error("店铺不存在或未启用");
-        }
-
-        //验证资质
-        switch (param.getProductType()) {
-            case 1://非处方
-                break;
-            case 2://处方
-                if (store.getIsDrugLicensePermanent() == 0 && StringUtils.isEmpty(store.getDrugLicense()) || "".equals(store.getDrugLicense()) && (store.getDrugLicenseExpiryEnd() == null ||  LocalDate.now().isAfter(store.getDrugLicenseExpiryEnd()))) {
-                    return R.error("店铺药品资质为空或已过期,请完善后再添加");
-                }
-                break;
-            case 3://食品
-                if (store.getIsFoodLicenseExpiryPermanent() == 0 && StringUtils.isEmpty(store.getFoodLicense()) || "".equals(store.getFoodLicense()) && (store.getFoodLicenseExpiryEnd() == null ||  LocalDate.now().isAfter(store.getFoodLicenseExpiryEnd()))) {
-                    return R.error("店铺食品资质为空或已过期,请完善后再添加");
-                }
-                break;
-            case 4://器械
-                if (store.getIsMedicalDevice3ExpiryPermanent() == 0 && StringUtils.isEmpty(store.getMedicalDevice3()) || "".equals(store.getMedicalDevice3()) && (store.getMedicalDevice3ExpiryEnd() == null ||  LocalDate.now().isAfter(store.getMedicalDevice3ExpiryEnd()))) {
-                    return R.error("店铺器械资质为空或已过期,请完善后再添加");
-                }
-                break;
-            default:
-                return R.error("商品类型错误");
+            //验证资质
+            switch (param.getProductType()) {
+                case 1://非处方
+                    break;
+                case 2://处方
+                    if (store.getIsDrugLicensePermanent() == 0 && StringUtils.isEmpty(store.getDrugLicense()) || "".equals(store.getDrugLicense()) && (store.getDrugLicenseExpiryEnd() == null ||  LocalDate.now().isAfter(store.getDrugLicenseExpiryEnd()))) {
+                        return R.error("店铺药品资质为空或已过期,请完善后再添加");
+                    }
+                    break;
+                case 3://食品
+                    if (store.getIsFoodLicenseExpiryPermanent() == 0 && StringUtils.isEmpty(store.getFoodLicense()) || "".equals(store.getFoodLicense()) && (store.getFoodLicenseExpiryEnd() == null ||  LocalDate.now().isAfter(store.getFoodLicenseExpiryEnd()))) {
+                        return R.error("店铺食品资质为空或已过期,请完善后再添加");
+                    }
+                    break;
+                case 4://器械
+                    if (store.getIsMedicalDevice3ExpiryPermanent() == 0 && StringUtils.isEmpty(store.getMedicalDevice3()) || "".equals(store.getMedicalDevice3()) && (store.getMedicalDevice3ExpiryEnd() == null ||  LocalDate.now().isAfter(store.getMedicalDevice3ExpiryEnd()))) {
+                        return R.error("店铺器械资质为空或已过期,请完善后再添加");
+                    }
+                    break;
+                default:
+                    return R.error("商品类型错误");
+            }
         }
 
         //基础信息
@@ -471,9 +475,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         populateDateRanges(product, param);
         setDefaultBarcodeIfAvailable(product, param);
         product.setBusinessLink(param.getBusinessLink());
+        product.setCreateTime(new Date());
 
         // 根据经营范围校验商品类型
-        if (com.fs.common.utils.StringUtils.isNotEmpty(store.getSelectableProductTypes())) {
+        if (store != null && com.fs.common.utils.StringUtils.isNotEmpty(store.getSelectableProductTypes())) {
             String productTypeName = getProductTypeName(product.getCateId());
             if (com.fs.common.utils.StringUtils.isNotEmpty(productTypeName)) {
                 // 直接使用工具类方法校验
@@ -485,8 +490,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             }
         }
 
-        //判断是否是纯正堂
-        if(CZT.equals(cloudHostProper.getCompanyName())){
+        //判断是否是纯正堂非药品商品不审核
+        if(CZT.equals(cloudHostProper.getCompanyName()) || param.getIsDrug() != 1){
             product.setIsAudit("1");
         }
 
@@ -502,7 +507,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             FsStoreProductScrm oldFsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(product.getProductId());
             Boolean isAudit = configUtil.generateConfigByKey("medicalMall.func.switch").getBoolean("isAudit");
             try {
-                if (isAudit != null && isAudit) {
+                if (isAudit != null && isAudit && param.getIsDrug() != 1) {
                     if (oldFsStoreProduct.getIsAudit() != null && "1".equals(oldFsStoreProduct.getIsAudit())) {
                         Map<String, Object> diff = getDiff(oldFsStoreProduct, product);
                         Set<String> diff_columns = diff.keySet();
@@ -536,7 +541,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             fsStoreProductMapper.insertFsStoreProduct(product);
         }
         storeAuditLogUtil.addOperLog(product.getProductId());
-        handleProductAttributes(param, product, storeId); //统一调用handleProductAttributes
+        handleProductAttributes(param, product, storeId);
         return R.ok();
     }