Parcourir la source

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

吴树波 il y a 15 heures
Parent
commit
baa92d8f6f

+ 3 - 2
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="manufacturer" column="manufacturer"/>
         <result property="manufacturerAddress" column="manufacturer_address"/>
         <result property="indications" column="indications"/>
+        <result property="ingredient" column="ingredient"/>
         <result property="dosage" column="dosage"/>
         <result property="adverseReactions" column="adverse_reactions"/>
         <result property="contraindications" column="contraindications"/>
@@ -99,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral,
                integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,
                is_display,tui_cate_id,company_ids,is_drug,drug_image,drug_reg_cert_no,common_name,dosage_form,
-               unit_price,batch_number,mah,mah_address,manufacturer,manufacturer_address,indications,dosage,
+               unit_price,batch_number,mah,mah_address,manufacturer,manufacturer_address,indications,ingredient,dosage,
                adverse_reactions,contraindications,precautions,is_audit,store_id,instruction_manual,review_audit,qualification_certificate,qualification_certificate_start,qualification_certificate_end,
                business, business_start, business_end,
                license, license_start, license_end,
@@ -117,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                p.is_del, p.give_integral, p.cost, p.is_good, p.browse, p.code_path, p.temp_id, p.spec_type, p.is_integral,
                p.integral, p.product_type, p.prescribe_code, p.prescribe_spec, p.prescribe_factory, p.prescribe_name,
                p.is_display,p.tui_cate_id,p.company_ids,p.is_drug,p.drug_image,p.drug_reg_cert_no,p.common_name,p.dosage_form,
-               p.unit_price,p.batch_number,p.mah,p.mah_address,p.manufacturer,p.manufacturer_address,p.indications,p.dosage,
+               p.unit_price,p.batch_number,p.mah,p.mah_address,p.manufacturer,p.manufacturer_address,p.indications,p.ingredient,p.dosage,
                p.adverse_reactions,p.contraindications,p.precautions,p.is_audit,p.store_id,
                p.is_business_permanent,p.is_license_permanent,p.is_certificate_permanent,p.is_gmp_auth_permanent
         from fs_store_product_scrm p

+ 48 - 21
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreProductScrmController.java

@@ -1,5 +1,6 @@
 package com.fs.hisStore.controller.store;
 
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
@@ -13,10 +14,7 @@ import com.fs.his.param.FsStoreProductListSParam;
 import com.fs.his.vo.FsStoreProductExcelVO;
 import com.fs.his.vo.FsStoreProductListSVO;
 import com.fs.his.vo.OptionsVO;
-import com.fs.hisStore.domain.FsStoreProductAttrScrm;
-import com.fs.hisStore.domain.FsStoreProductRuleScrm;
-import com.fs.hisStore.domain.FsStoreProductScrm;
-import com.fs.hisStore.domain.StoreLoginUserScrm;
+import com.fs.hisStore.domain.*;
 import com.fs.hisStore.param.FsStoreProductAddEditParam;
 import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
@@ -47,6 +45,7 @@ public class FsStoreProductScrmController extends BaseController
 {
     @Autowired
     private IFsStoreProductScrmService fsStoreProductService;
+
     @Autowired
     private IFsStoreProductAttrScrmService attrService;
 
@@ -56,32 +55,60 @@ public class FsStoreProductScrmController extends BaseController
     @Autowired
     private StoreAuditLogUtil storeAuditLogUtil;
 
+
     /**
- * 查询商品列表
- */
+     * 商品关键字检查
+     * 只要商品关键字在数据库中存在,就不允许添加商品。
+     * @param keyWords
+     * @return
+     */
+    @Log(title = "商品管理", businessType = BusinessType.AUDIT, isStoreLog = true, logParam = {"商品", "商品关键字检查"})
+    @GetMapping("/selectForbiddenKeywords/{keyWords}")
+    public R selectForbiddenKeywords(@PathVariable("keyWords")String keyWords) {
+        if(org.apache.commons.lang3.StringUtils.isEmpty(keyWords))return R.ok().put("data", true);
+        List<ForbiddenOnlineMedicine> list = fsStoreProductService.selectForbiddenKeywords(keyWords);
+        if(CollectionUtils.isEmpty(list)){
+            return R.ok().put("data", true);
+        }else{
+            return R.ok().put("data", false).put("msg", list.get(0).getModule());
+        }
+    }
 
-@GetMapping("/list")
-public TableDataInfo list(FsStoreProductScrm fsStoreProduct)
-{
-    startPage();
-    List<FsStoreProductListVO> list;
-    StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-    fsStoreProduct.setStoreId(loginUser.getFsStore().getStoreId());
-    if(StringUtils.isNullOrEmpty(fsStoreProduct.getBarCode())){
-        list = fsStoreProductService.selectFsStoreProductListVO(fsStoreProduct);
-    }else{
-        list = fsStoreProductService.selectFsStoreProductBarCodeListVO(fsStoreProduct);
-    }
-    return getDataTable(list);
-}
+    /**
+     * 判断该药店的经营许可证是否允许上架该商品
+     * @param fsStoreProduct
+     */
+    @Log(title = "商品管理", businessType = BusinessType.AUDIT, isStoreLog = true, logParam = {"商品", "判断该药店的经营许可证是否允许上架该商品"})
+    @PostMapping("/checkStoreDrugLicense")
+    public R checkStoreDrugLicense(@RequestBody FsStoreProductAddEditParam fsStoreProduct) {
+        StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreProduct.setStoreId(loginUser.getFsStore().getStoreId());
+        return R.ok().put("data", fsStoreProductService.checkStoreDrugLicense(fsStoreProduct.getStoreId(), fsStoreProduct.getCateId()));
+    }
 
 
+    /**
+     * 查询商品列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(FsStoreProductScrm fsStoreProduct)
+    {
+        startPage();
+        List<FsStoreProductListVO> list;
+        StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsStoreProduct.setStoreId(loginUser.getFsStore().getStoreId());
+        if(StringUtils.isNullOrEmpty(fsStoreProduct.getBarCode())){
+            list = fsStoreProductService.selectFsStoreProductListVO(fsStoreProduct);
+        }else{
+            list = fsStoreProductService.selectFsStoreProductBarCodeListVO(fsStoreProduct);
+        }
+        return getDataTable(list);
+    }
 
 
     /**
      * 导出商品列表
      */
-
     @Log(title = "商品", businessType = BusinessType.EXPORT,isStoreLog = true,logParam = {"商品","导出商品信息"})
     @GetMapping("/export")
     public AjaxResult export(FsStoreProductScrm fsStoreProduct)

+ 12 - 1
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreScrmController.java

@@ -9,6 +9,7 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.utils.txocr.TxOcrClient;
 import com.fs.framework.service.TokenServiceScrm;
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.hisStore.domain.FsStoreScrm;
@@ -32,8 +33,10 @@ import java.util.List;
 @RestController
 @RequestMapping("/store/store/store")
 public class FsStoreScrmController extends BaseController {
+
     @Autowired
     private IFsStoreScrmService fsStoreService;
+
     @Autowired
     private TokenServiceScrm tokenService;
 
@@ -41,9 +44,17 @@ public class FsStoreScrmController extends BaseController {
     private StoreAuditLogUtil storeAuditLogUtil;
 
     /**
-     * 查询店铺管理列表
+     * 新增或修改时候校验上传的营业执照是否包含药品零售
      */
+    @Log(title = "店铺管理", businessType = BusinessType.AUDIT, logParam = {"店铺","校验营业执照是否包含药品零售"},isStoreLog = true)
+    @GetMapping("/businessLicenseCheck")
+    public R businessLicenseCheck(String imageUrl){
+        return R.ok().put("data", TxOcrClient.isContains(imageUrl, null));
+    }
 
+    /**
+     * 查询店铺管理列表
+     */
     @GetMapping("/list")
     public TableDataInfo list(FsStoreScrm fsStore) {
         startPage();