|
@@ -40,6 +40,8 @@ import com.fs.hisStore.dto.FsStoreProductScrmInfoDTO;
|
|
|
import com.fs.hisStore.mapper.*;
|
|
import com.fs.hisStore.mapper.*;
|
|
|
import com.fs.hisStore.param.FsStoreCartCountParam;
|
|
import com.fs.hisStore.param.FsStoreCartCountParam;
|
|
|
import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
|
|
import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
|
|
|
|
|
+import com.fs.hisStore.service.categoryVal.AbstractHandler;
|
|
|
|
|
+import com.fs.hisStore.service.categoryVal.ProductCategoryCheckFactory;
|
|
|
import com.fs.hisStore.util.ForbiddenDrugListManager;
|
|
import com.fs.hisStore.util.ForbiddenDrugListManager;
|
|
|
import com.fs.hisStore.utils.StoreAuditLogUtil;
|
|
import com.fs.hisStore.utils.StoreAuditLogUtil;
|
|
|
import com.fs.hisStore.util.BusinessScopeProductTypeUtil;
|
|
import com.fs.hisStore.util.BusinessScopeProductTypeUtil;
|
|
@@ -488,19 +490,6 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
product.setBusinessLink(param.getBusinessLink());
|
|
product.setBusinessLink(param.getBusinessLink());
|
|
|
product.setCreateTime(new Date());
|
|
product.setCreateTime(new Date());
|
|
|
|
|
|
|
|
- // 根据经营范围校验商品类型
|
|
|
|
|
-// if (store != null && com.fs.common.utils.StringUtils.isNotEmpty(store.getSelectableProductTypes())) {
|
|
|
|
|
-// String productTypeName = getProductTypeName(product.getCateId());
|
|
|
|
|
-// if (com.fs.common.utils.StringUtils.isNotEmpty(productTypeName)) {
|
|
|
|
|
-// // 直接使用工具类方法校验
|
|
|
|
|
-// //boolean isAllowed = BusinessScopeProductTypeUtil.isProductTypeAllowed(store.getSelectableProductTypes(), productTypeName);
|
|
|
|
|
-// boolean isAllowed = validateShopBusinessScope(store.getBusinessScope(), productTypeName);
|
|
|
|
|
-// if (!isAllowed) {
|
|
|
|
|
-// return R.error("该商品类型[" + productTypeName + "]不在店铺经营范围允许的商品类型内,请联系管理员核实经营范围");
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
//判断是否是纯正堂非药品商品不审核
|
|
//判断是否是纯正堂非药品商品不审核
|
|
|
if(CZT.equals(cloudHostProper.getCompanyName()) || param.getIsDrug() != 1){
|
|
if(CZT.equals(cloudHostProper.getCompanyName()) || param.getIsDrug() != 1){
|
|
|
product.setIsAudit("1");
|
|
product.setIsAudit("1");
|
|
@@ -571,57 +560,6 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 校验店铺添加药品是否含有祥光资质
|
|
|
|
|
- * @param businessScope
|
|
|
|
|
- * @param productTypeName
|
|
|
|
|
- * @return
|
|
|
|
|
- */
|
|
|
|
|
- public Boolean validateShopBusinessScope(String businessScope, String productTypeName) {
|
|
|
|
|
- Set<String> judgmentSet = new HashSet<>();
|
|
|
|
|
- Boolean res = Boolean.FALSE;
|
|
|
|
|
- switch (productTypeName) {
|
|
|
|
|
- case "中成药":
|
|
|
|
|
- judgmentSet.add("中成药");
|
|
|
|
|
- break;
|
|
|
|
|
- case "处方药":
|
|
|
|
|
- judgmentSet.add("处方药");
|
|
|
|
|
- judgmentSet.add("化学药制剂");
|
|
|
|
|
- break;
|
|
|
|
|
- case "中药饮片":
|
|
|
|
|
- judgmentSet.add("中药饮片");
|
|
|
|
|
- break;
|
|
|
|
|
- case "保健食品":
|
|
|
|
|
- judgmentSet.add("保健食品销售");
|
|
|
|
|
- break;
|
|
|
|
|
- case "I类器械":
|
|
|
|
|
- judgmentSet.add("第一类医疗器械销售");
|
|
|
|
|
- break;
|
|
|
|
|
- case "II类器械":
|
|
|
|
|
- judgmentSet.add("第二类医疗器械销售");
|
|
|
|
|
- break;
|
|
|
|
|
- case "III类器械":
|
|
|
|
|
- judgmentSet.add("第三类医疗器械经营");
|
|
|
|
|
- break;
|
|
|
|
|
- case "甲类非处方":
|
|
|
|
|
- judgmentSet.add("化学药制剂");
|
|
|
|
|
- judgmentSet.add("甲类非处方药");
|
|
|
|
|
- break;
|
|
|
|
|
- case "乙类非处方":
|
|
|
|
|
- judgmentSet.add("化学药制剂");
|
|
|
|
|
- judgmentSet.add("乙类非处方药");
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(null != judgmentSet && !judgmentSet.isEmpty()){
|
|
|
|
|
- for(String item:judgmentSet){
|
|
|
|
|
- res = businessScope.contains(item);
|
|
|
|
|
- if(res) break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return res;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values,Long storeId){
|
|
private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values,Long storeId){
|
|
|
//清空attr
|
|
//清空attr
|
|
|
fsStoreProductAttrMapper.clear(productId);
|
|
fsStoreProductAttrMapper.clear(productId);
|
|
@@ -1495,7 +1433,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 判断该药店的经营许可证是否允许上架该商品
|
|
|
|
|
|
|
+ * 判断该药店的经营许可证是否允许上架该商品(店铺和总后端都用到了)
|
|
|
* @param storeId 店铺Id
|
|
* @param storeId 店铺Id
|
|
|
* @param cateId 分类id
|
|
* @param cateId 分类id
|
|
|
*/
|
|
*/
|
|
@@ -1505,34 +1443,15 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
FsStoreProductCategoryScrm fsStoreProductCategoryScrm = fsStoreProductCategoryService.selectFsStoreProductCategoryById(cateId);
|
|
FsStoreProductCategoryScrm fsStoreProductCategoryScrm = fsStoreProductCategoryService.selectFsStoreProductCategoryById(cateId);
|
|
|
String cateName = fsStoreProductCategoryScrm.getCateName();//分类名称
|
|
String cateName = fsStoreProductCategoryScrm.getCateName();//分类名称
|
|
|
//拿到分类名称,直接调用之前店铺编辑和新增接口中调用识别存到识别表的结果。
|
|
//拿到分类名称,直接调用之前店铺编辑和新增接口中调用识别存到识别表的结果。
|
|
|
- //通过店铺id获取上传的药品经营许可证。
|
|
|
|
|
- FsStoreScrm fsStoreScrm = fsStoreScrmService.selectFsStoreByStoreId(storeId);
|
|
|
|
|
- String drugLicenseUrl = fsStoreScrm.getDrugLicense();
|
|
|
|
|
- FsStoreScrmOcr fsStoreScrmOcr = fsStoreScrmOcrMapper.selectByIdAndUrl(storeId, drugLicenseUrl, null);
|
|
|
|
|
- //没有搜索到就调用一次识别
|
|
|
|
|
- ContainsResult result = new ContainsResult();
|
|
|
|
|
- result.setKeywords(cateName);
|
|
|
|
|
-
|
|
|
|
|
- if(ObjectUtil.isEmpty(fsStoreScrmOcr)){
|
|
|
|
|
- String ocrResult = TxOcrClient.ExtractDocBasic(drugLicenseUrl);
|
|
|
|
|
- if(null != ocrResult){
|
|
|
|
|
- boolean equalsR = ocrResult.contains(cateName);
|
|
|
|
|
- result.setFlag(equalsR);
|
|
|
|
|
- result.setMessage(equalsR?"识别成功,包含所属!":"对比失败,不包含你所选类目");
|
|
|
|
|
- result.setBusinessStr(ocrResult);
|
|
|
|
|
- }else{
|
|
|
|
|
- result.setFlag(false);
|
|
|
|
|
- result.setMessage("请上传正确药品经营许可证!");
|
|
|
|
|
- }
|
|
|
|
|
- }else{
|
|
|
|
|
- result.setBusinessStr(fsStoreScrmOcr.getDrugLicenseTxt());
|
|
|
|
|
- boolean equalsR = fsStoreScrmOcr.getDrugLicenseTxt().contains(cateName);
|
|
|
|
|
- result.setFlag(equalsR);
|
|
|
|
|
- result.setMessage(equalsR?"识别成功,包含所属!":"对比失败,不包含你所选类目");
|
|
|
|
|
- return result;
|
|
|
|
|
|
|
+ //这里需要区别一下,什么情况下需要识别营业执照,什么情况下识别经营许可证,什么情况下两个都需要,甚至包含食品的证
|
|
|
|
|
+ //新增分类校验就去 categoryVal 包下面去新加
|
|
|
|
|
+ try{
|
|
|
|
|
+ AbstractHandler invokeStrategy = ProductCategoryCheckFactory.getInvokeStrategy(String.valueOf(cateId));
|
|
|
|
|
+ return invokeStrategy.check(cateName, storeId);
|
|
|
|
|
+ }catch (NullPointerException e){
|
|
|
|
|
+ AbstractHandler invokeStrategy = ProductCategoryCheckFactory.getInvokeStrategy(String.valueOf("1101165230"));
|
|
|
|
|
+ return invokeStrategy.check(cateName, storeId);
|
|
|
}
|
|
}
|
|
|
- //调用对比,看经营范围是否包含这个类别
|
|
|
|
|
- return result;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|