|
@@ -17,6 +17,7 @@ import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.exception.ServiceException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.company.cache.ICompanyCacheService;
|
|
|
+import com.fs.config.cloud.CloudHostProper;
|
|
|
import com.fs.erp.domain.ErpGoods;
|
|
|
import com.fs.erp.service.IErpGoodsService;
|
|
|
import com.fs.his.config.FsSysConfig;
|
|
@@ -94,6 +95,9 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
@Autowired
|
|
|
private MedicalMallConfig medicalMallConfig;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CloudHostProper cloudHostProper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询商品
|
|
|
*
|
|
@@ -334,34 +338,37 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
product.setStoreId(param.getStoreId());
|
|
|
product.setIsDrug(param.getIsDrug().toString());
|
|
|
//校验店铺资质信息
|
|
|
- //获取店铺
|
|
|
- FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId());
|
|
|
- if(store == null || 1 != store.getStatus()){
|
|
|
- return R.error("店铺不存在或未启用");
|
|
|
- }else{
|
|
|
- //验证资质
|
|
|
- switch (product.getProductType()){
|
|
|
- case 1://非处方
|
|
|
- break;
|
|
|
- case 2://处方
|
|
|
- if("".equals(store.getDrugLicense()) || LocalDate.now().isBefore(store.getDrugLicenseExpiryEnd())){
|
|
|
- return R.error("店铺药品资质为空或已过期,请完善后再添加");
|
|
|
- }
|
|
|
- break;
|
|
|
- case 3://食品
|
|
|
- if("".equals(store.getFoodLicense()) || LocalDate.now().isBefore(store.getFoodLicenseExpiryEnd())){
|
|
|
- return R.error("店铺食品资质为空或已过期,请完善后再添加");
|
|
|
- }
|
|
|
- break;
|
|
|
- case 4://器械
|
|
|
- if("".equals(store.getMedicalDevice3()) || LocalDate.now().isBefore(store.getMedicalDevice3ExpiryEnd())){
|
|
|
- return R.error("店铺器械资质为空或已过期,请完善后再添加");
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- return R.error("商品类型错误");
|
|
|
+ if(!("益善缘".equals(cloudHostProper.getCompanyName()))){
|
|
|
+ //获取店铺
|
|
|
+ FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId());
|
|
|
+ if(store == null || 1 != store.getStatus()){
|
|
|
+ return R.error("店铺不存在或未启用");
|
|
|
+ }else{
|
|
|
+ //验证资质
|
|
|
+ switch (product.getProductType()){
|
|
|
+ case 1://非处方
|
|
|
+ break;
|
|
|
+ case 2://处方
|
|
|
+ if("".equals(store.getDrugLicense()) || LocalDate.now().isBefore(store.getDrugLicenseExpiryEnd())){
|
|
|
+ return R.error("店铺药品资质为空或已过期,请完善后再添加");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3://食品
|
|
|
+ if("".equals(store.getFoodLicense()) || LocalDate.now().isBefore(store.getFoodLicenseExpiryEnd())){
|
|
|
+ return R.error("店铺食品资质为空或已过期,请完善后再添加");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4://器械
|
|
|
+ if("".equals(store.getMedicalDevice3()) || LocalDate.now().isBefore(store.getMedicalDevice3ExpiryEnd())){
|
|
|
+ return R.error("店铺器械资质为空或已过期,请完善后再添加");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return R.error("商品类型错误");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if(param.getProductId() != null && param.getProductId() > 0){
|
|
|
//对已上架的商品进行修改需要重新审核
|
|
|
if(1 == product.getIsShow() && "1".equals(product.getIsAudit())){
|