|
@@ -1,6 +1,7 @@
|
|
|
package com.fs.hisStore.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -86,6 +87,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
|
|
|
@Autowired
|
|
|
private StoreAuditLogUtil storeAuditLogUtil;
|
|
|
+ @Autowired
|
|
|
+ private FsStoreScrmServiceImpl fsStoreScrmService;
|
|
|
|
|
|
/**
|
|
|
* 查询商品
|
|
@@ -319,6 +322,35 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
product.setStock(Long.parseLong(countDto.getStock().toString()));
|
|
|
product.setCompanyIds(param.getCompanyIds());
|
|
|
product.setVideo(param.getVideo());
|
|
|
+ //校验店铺资质信息
|
|
|
+ //获取店铺
|
|
|
+ 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(LocalDate.parse(store.getDrugLicenseExpiryEnd()))){
|
|
|
+ return R.error("店铺药品资质为空或已过期,请完善后再添加");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3://食品
|
|
|
+ if("".equals(store.getFoodLicense()) || LocalDate.now().isBefore(LocalDate.parse(store.getFoodLicenseExpiryEnd()))){
|
|
|
+ return R.error("店铺食品资质为空或已过期,请完善后再添加");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4://器械
|
|
|
+ if("".equals(store.getMedicalDevice3()) || LocalDate.now().isBefore(LocalDate.parse(store.getMedicalDevice3ExpiryEnd()))){
|
|
|
+ return R.error("店铺器械资质为空或已过期,请完善后再添加");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return R.error("商品类型错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
if(param.getProductId() != null){
|
|
|
//对已上架的商品进行修改需要重新审核
|
|
|
if(1 == product.getIsShow() && "1".equals(product.getIsAudit())){
|