yjwang 3 dagar sedan
förälder
incheckning
65d346ab0a
33 ändrade filer med 573 tillägg och 144 borttagningar
  1. 2 1
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductScrmController.java
  2. 10 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreScrmController.java
  3. 1 9
      fs-admin/src/main/java/com/fs/hisStore/facade/impl/FsStore580FacadeServiceImpl.java
  4. 14 7
      fs-admin/src/main/java/com/fs/web/controller/system/SysUserController.java
  5. 1 0
      fs-common/src/main/java/com/fs/common/enums/BusinessType.java
  6. 5 3
      fs-service/src/main/java/com/fs/his/mapper/FsDoctorMapper.java
  7. 8 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreProductMapper.java
  8. 2 0
      fs-service/src/main/java/com/fs/his/param/FsDoctorParam.java
  9. 5 0
      fs-service/src/main/java/com/fs/his/service/IFsDoctorService.java
  10. 2 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java
  11. 5 0
      fs-service/src/main/java/com/fs/his/service/impl/FsDoctorServiceImpl.java
  12. 5 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java
  13. 80 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java
  14. 6 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java
  15. 6 1
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java
  16. 1 1
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreScrmMapper.java
  17. 53 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java
  18. 2 1
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java
  19. 2 2
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java
  20. 65 13
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java
  21. 2 2
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java
  22. 7 0
      fs-service/src/main/java/com/fs/hospital580/mapper/Hospital580PrescriptionScrmMapper.java
  23. 5 1
      fs-service/src/main/java/com/fs/hospital580/service/Hospital580PrescriptionScrmService.java
  24. 6 0
      fs-service/src/main/java/com/fs/hospital580/service/impl/Hospital580PrescriptionScrmServiceImpl.java
  25. 2 0
      fs-service/src/main/java/com/fs/hospital580/vo/PrescriptionAdminQueryVo.java
  26. 8 0
      fs-service/src/main/resources/mapper/his/FsDoctorMapper.xml
  27. 150 12
      fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml
  28. 25 68
      fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml
  29. 13 22
      fs-service/src/main/resources/mapper/hospital580/Hospital580PrescriptionScrmMapper.xml
  30. 9 0
      fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreProductScrmController.java
  31. 2 1
      fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreScrmController.java
  32. 59 0
      fs-store/src/main/java/com/fs/store/controller/store/FsStoreProductController.java
  33. 10 0
      fs-user-app/src/main/java/com/fs/app/controller/store/StoreScrmController.java

+ 2 - 1
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductScrmController.java

@@ -254,6 +254,7 @@ public class FsStoreProductScrmController extends BaseController {
         return R.ok("操作完成");
     }
 
+    @Log(title = "总后台商品协议过期提醒", businessType = BusinessType.OTHERe)
     /**
      * 商品资质信息提示
      *
@@ -261,7 +262,7 @@ public class FsStoreProductScrmController extends BaseController {
      */
     @GetMapping("/productNoticeInfo")
     public R getProductNoticeInfo() {
-        List<String> productNoticeInfo = fsStoreProductService.getProductNoticeInfo();
+        List<String> productNoticeInfo = fsStoreProductService.getProductNoticeInfo(null);
         if (!CollectionUtils.isEmpty(productNoticeInfo)) {
             return R.ok().put("code", 200).put("data", productNoticeInfo);
         }

+ 10 - 0
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreScrmController.java

@@ -8,6 +8,8 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.param.FsDoctorParam;
+import com.fs.his.service.IFsDoctorService;
 import com.fs.hisStore.domain.FsStoreScrm;
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.hisStore.service.IFsStoreScrmService;
@@ -35,6 +37,9 @@ public class FsStoreScrmController extends BaseController
     @Autowired
     private StoreAuditLogUtil storeAuditLogUtil;
 
+    @Autowired
+    private IFsDoctorService fsDoctorService;
+
     /**
      * 查询店铺管理列表
      */
@@ -82,6 +87,11 @@ public class FsStoreScrmController extends BaseController
     public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
     {
         FsStoreScrm fsStore = fsStoreService.selectFsStoreByStoreId(storeId);
+        //获取店铺下绑定的药师职业证书
+        FsDoctorParam param=new FsDoctorParam();
+        param.setStoreId(fsStore.getStoreId());
+        param.setDoctorType(2);
+        fsStore.setDoctorList(fsDoctorService.getDoctorInfoByStoreId(param));
 //        fsStore.setPhone(ParseUtils.parsePhone(fsStore.getPhone()));
         return AjaxResult.success(fsStore);
     }

+ 1 - 9
fs-admin/src/main/java/com/fs/hisStore/facade/impl/FsStore580FacadeServiceImpl.java

@@ -56,15 +56,7 @@ public class FsStore580FacadeServiceImpl implements FsStore580FacadeService {
 
     @Override
     public List<Hospital580PrescriptionScrmEntity> list(PrescriptionAdminQueryVo vo) {
-        return prescriptionScrmService.list(new LambdaQueryWrapper<Hospital580PrescriptionScrmEntity>()
-                .like(ObjectUtil.isNotEmpty(vo.getHospitalName()), Hospital580PrescriptionScrmEntity::getHospitalName, vo.getHospitalName())
-                .like(ObjectUtil.isNotEmpty(vo.getStoreName()), Hospital580PrescriptionScrmEntity::getStoreName, vo.getStoreName())
-                .like(ObjectUtil.isNotEmpty(vo.getUserFamilyName()), Hospital580PrescriptionScrmEntity::getUserFamilyName, vo.getUserFamilyName())
-                .eq(ObjectUtil.isNotEmpty(vo.getUserFamilyPhone()), Hospital580PrescriptionScrmEntity::getUserFamilyPhone, vo.getUserFamilyPhone())
-                .eq(ObjectUtil.isNotEmpty(vo.getAuditStatus()), Hospital580PrescriptionScrmEntity::getAuditStatus, vo.getAuditStatus())
-                .le(ObjectUtil.isNotEmpty(vo.getEndTime()), Hospital580PrescriptionScrmEntity::getCreatedTime, vo.getEndTime())
-                .ge(ObjectUtil.isNotEmpty(vo.getBeginTime()), Hospital580PrescriptionScrmEntity::getCreatedTime, vo.getBeginTime())
-                .orderByDesc(Hospital580PrescriptionScrmEntity::getCreatedTime));
+        return prescriptionScrmService.getPrescriptionList(vo);
 
     }
 

+ 14 - 7
fs-admin/src/main/java/com/fs/web/controller/system/SysUserController.java

@@ -290,17 +290,24 @@ public class SysUserController extends BaseController
         return R.ok().put("code",0);
     }
 
+    @Log(title = "总后台:商家证件即将过期或已过期提醒", businessType = BusinessType.OTHER)
     @GetMapping("/storeRecommendNotice")
     public R storeRecommendNotice(){
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         //判断是否有权限
-        if(userService.checkUserAuthority(loginUser.getUserId())){
-            //有权限则进入判断是否协议过期
-            List<String> storeList=storeScrmService.queryValidStoreQualifications();
-            if(!storeList.isEmpty()){
-                //拼接提示语句
-                return R.ok().put("code",200).put("data",storeList);
-            }
+//        if(userService.checkUserAuthority(loginUser.getUserId())){
+//            //有权限则进入判断是否协议过期
+//            List<String> storeList=storeScrmService.queryValidStoreQualifications();
+//            if(!storeList.isEmpty()){
+//                //拼接提示语句
+//                return R.ok().put("code",200).put("data",storeList);
+//            }
+//        }
+        //有权限则进入判断是否协议过期
+        List<String> storeList=storeScrmService.queryValidStoreQualifications();
+        if(!storeList.isEmpty()){
+            //拼接提示语句
+            return R.ok().put("code",200).put("data",storeList);
         }
         return R.ok().put("code",0);
     }

+ 1 - 0
fs-common/src/main/java/com/fs/common/enums/BusinessType.java

@@ -61,6 +61,7 @@ public enum BusinessType
      * 审核
      * */
     AUDIT,
+    OTHERe,
     /**
      * 同步数据
      * */

+ 5 - 3
fs-service/src/main/java/com/fs/his/mapper/FsDoctorMapper.java

@@ -3,15 +3,12 @@ package com.fs.his.mapper;
 import java.util.List;
 import java.util.Map;
 
-import com.fs.common.core.domain.R;
 import com.fs.his.domain.FsDoctor;
 import com.fs.his.param.FsDoctorListUParam;
 import com.fs.his.param.FsDoctorParam;
 import com.fs.his.vo.*;
-import io.swagger.models.auth.In;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
-import org.springframework.security.core.parameters.P;
 
 /**
  * 医生管理Mapper接口
@@ -224,4 +221,9 @@ public interface FsDoctorMapper
     @Select("SELECT * FROM fs_doctor WHERE store_id=#{storeId} and doctor_type = 2 and  `status`=1 and is_audit=1 and sign_url is not null ORDER BY RAND() LIMIT 1; ")
     FsDoctor findByStoreId(@Param("storeId") Long storeId);
     String selectDoctorNameByIds(@Param("doctorIds") String doctorIds);
+
+    /**
+     *
+     * **/
+    List<FsDoctorVO> getDoctorInfoByStoreId(@Param("param") FsDoctorParam param);
 }

+ 8 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreProductMapper.java

@@ -265,4 +265,12 @@ public interface FsStoreProductMapper {
      * @return List<FsStoreProduct>
      * **/
     List<FsStoreProduct> getStoreProductInProductIds(@Param("productIds") List<Long> productIds);
+
+    @Update({"<script> " +
+            "UPDATE fs_store_product_scrm SET is_show = 0 WHERE product_id IN " +
+            "<foreach item='item' index='index' collection='productIds' open='(' separator=',' close=')'>" +
+            "#{item}" +
+            "</foreach>" +
+            "</script>"})
+    int updateFsStoreProductIsShowBatch(@Param("productIds") Long[] productIds);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/param/FsDoctorParam.java

@@ -188,4 +188,6 @@ public class FsDoctorParam {
     private Integer isPrescribeDoctor;
 
     private Long   prescribeDoctorId;
+
+    private Long storeId;
 }

+ 5 - 0
fs-service/src/main/java/com/fs/his/service/IFsDoctorService.java

@@ -122,4 +122,9 @@ public interface IFsDoctorService
      * @return
      */
     FsDoctor findByStoreId(Long storeId);
+
+    /**
+     * 根据门店id查询药师信息
+     * **/
+    List<FsDoctorVO> getDoctorInfoByStoreId(FsDoctorParam param);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java

@@ -104,4 +104,6 @@ public interface IFsStoreProductService
      * @return List<FsStoreProduct>
      * **/
     List<FsStoreProduct> getStoreProductInProductIds(List<Long> productIds);
+
+    void updateFsStoreProductIsShowBatch(Long[] productIds);
 }

+ 5 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsDoctorServiceImpl.java

@@ -556,4 +556,9 @@ public class FsDoctorServiceImpl implements IFsDoctorService
         return fsDoctorMapper.findByStoreId(storeId);
     }
 
+    @Override
+    public List<FsDoctorVO> getDoctorInfoByStoreId(FsDoctorParam param) {
+        return fsDoctorMapper.getDoctorInfoByStoreId(param);
+    }
+
 }

+ 5 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java

@@ -871,4 +871,9 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
     public List<FsStoreProduct> getStoreProductInProductIds(List<Long> productIds) {
         return fsStoreProductMapper.getStoreProductInProductIds(productIds);
     }
+
+    @Override
+    public void updateFsStoreProductIsShowBatch(Long[] productIds) {
+        fsStoreProductMapper.updateFsStoreProductIsShowBatch(productIds);
+    }
 }

+ 80 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java

@@ -463,4 +463,84 @@ public class FsStoreProductScrm extends BaseEntity {
      */
     private  LocalDate  qualificationCertificateEnd;
 
+
+    /**
+     * 营业执照
+     **/
+    private String business;
+
+    /**
+     * 营业执照有效期开始
+     **/
+    private LocalDate businessStart;
+
+    /**
+     * 营业执照有效期结束
+     **/
+    private LocalDate businessEnd;
+
+    /**
+     * 生产许可证件
+     **/
+    private String license;
+
+    /**
+     * 生产许可证件有效期开始
+     **/
+    private LocalDate licenseStart;
+
+    /**
+     * 生产许可证件有效期结束
+     **/
+    private LocalDate licenseEnd;
+
+    /**
+     * 生产注册证书
+     **/
+    private String certificate;
+
+    /**
+     * 注册证书有效期开始
+     **/
+    private LocalDate certificateStart;
+
+    /**
+     * 注册证书有效期结束
+     **/
+    private LocalDate certificateEnd;
+
+    /**
+     * 商品备案证书
+     **/
+    private String voucher;
+
+    /**
+     * 备案证书有效期开始
+     **/
+    private LocalDate voucherStart;
+
+    /**
+     * 备案证书有效期结束
+     **/
+    private LocalDate voucherEnd;
+
+    /**
+     * GMP认证
+     **/
+    private String gmpAuth;
+
+    /**
+     * GMP认证有效期开始
+     **/
+    private LocalDate gmpAuthStart;
+
+    /**
+     * GMP认证有效期结束
+     **/
+    private LocalDate gmpAuthEnd;
+
+    /**
+     * 非首营链接
+     * **/
+    private String businessLink;
 }

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java

@@ -3,11 +3,13 @@ package com.fs.hisStore.domain;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import com.fs.his.vo.FsDoctorVO;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.util.List;
 
 /**
  * 店铺管理对象 fs_store
@@ -424,5 +426,9 @@ public class FsStoreScrm extends BaseEntity {
      */
     private String settlementAgreementCode;
 
+    /**
+     * 绑定的药剂师
+     * **/
+    private List<FsDoctorVO> doctorList;
 
 }

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

@@ -338,6 +338,10 @@ public interface FsStoreProductScrmMapper
             "<if test = 'maps.isShow != null    '> " +
             "and p.is_show =#{maps.isShow} " +
             "</if>" +
+            // 单个店铺ID条件
+            "<if test='maps.storeId != null and maps.storeId != \"\"'> " +
+            "and p.store_id = #{maps.storeId} " +
+            "</if> " +
             " order by p.product_id desc "+
             "</script>"})
     List<FsStoreProductListVO> selectFsStoreProductBarCodeListVO(@Param("maps") FsStoreProductScrm fsStoreProduct);
@@ -599,7 +603,8 @@ public interface FsStoreProductScrmMapper
 
     /**
      * 获取商品资质提示信息
+     * @param storeId 店铺id
      * @return
      */
-    List<String> getProductNoticeInfo();
+    List<String> getProductNoticeInfo(@Param("storeId") Long storeId);
 }

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

@@ -187,5 +187,5 @@ public interface FsStoreScrmMapper
      * 获取店铺资质即将到期提示数据
      * @return list
      * **/
-    List<String>  queryValidStoreLastInfo(@Param("account") String account );
+    List<String>  queryValidStoreLastInfo(@Param("storeId") Long storeId );
 }

+ 53 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java

@@ -292,5 +292,58 @@ public class FsStoreProductAddEditParam implements Serializable
      */
     private  String  qualificationCertificateEnd;
 
+    /**
+     * 营业执照
+     * **/
+    private String business;
+
+    /**
+     * 有效期
+     * **/
+    private List<String> businessExpire;
+
+    /**
+     * 生成许可证件
+     * **/
+    private String license;
 
+    /**
+     * 生成许可证件有效期
+     * **/
+    private List<String> licenseExpire;
+
+    /**
+     * 生成注册证书
+     * **/
+    private String certificate;
+
+    /**
+     * 证书有效期
+     * **/
+    private List<String> certificateExpire;
+
+    /**
+     * 商品备案证书
+     * **/
+    private String voucher;
+
+    /**
+     * 备案日期
+     * **/
+    private List<String> voucherExpire;
+
+    /**
+     *GMP认证
+     * **/
+    private String gmpAuth;
+
+    /**
+     * GMP认证有效期
+     * **/
+    private List<String> gmpAuthExpire;
+
+    /**
+     * 非首营链接
+     * **/
+    private String businessLink;
 }

+ 2 - 1
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java

@@ -157,7 +157,8 @@ public interface IFsStoreProductScrmService
 
     /**
      * 获取商品资质提示信息
+     * @param storeId 店铺id
      * @return R
      * **/
-    List<String> getProductNoticeInfo();
+    List<String> getProductNoticeInfo(Long storeId);
 }

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java

@@ -125,8 +125,8 @@ public interface IFsStoreScrmService
 
     /**
      * 获取店铺资质即将到期提示数据
-     * @param account
+     * @param storeId
      * @return
      */
-    List<String> queryValidStoreLastInfo(String account);
+    List<String> queryValidStoreLastInfo(Long storeId);
 }

+ 65 - 13
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -3,6 +3,7 @@ package com.fs.hisStore.service.impl;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -396,12 +397,44 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         product.setIsDrug(param.getIsDrug().toString());
         product.setInstructionManual(param.getInstructionManual());
 
+        List<String> businessExpire = param.getBusinessExpire();
+        if (businessExpire != null && businessExpire.size() >= 2) {
+            product.setBusinessStart(parseLocalDate(businessExpire.get(0)));
+            product.setBusinessEnd(parseLocalDate(businessExpire.get(1)));
+        }
+
+        List<String> licenseExpire = param.getLicenseExpire();
+        if (licenseExpire != null && licenseExpire.size() >= 2) {
+            product.setLicenseStart(parseLocalDate(licenseExpire.get(0)));
+            product.setLicenseEnd(parseLocalDate(licenseExpire.get(1)));
+        }
+
+        List<String> certificateExpire = param.getCertificateExpire();
+        if (certificateExpire != null && certificateExpire.size() >= 2) {
+            product.setCertificateStart(parseLocalDate(certificateExpire.get(0)));
+            product.setCertificateEnd(parseLocalDate(certificateExpire.get(1)));
+        }
+
+        List<String> voucherExpire = param.getVoucherExpire();
+        if (voucherExpire != null && voucherExpire.size() >= 2) {
+            product.setVoucherStart(parseLocalDate(voucherExpire.get(0)));
+            product.setVoucherEnd(parseLocalDate(voucherExpire.get(1)));
+        }
+
+        List<String> gmpAuthExpire = param.getGmpAuthExpire();
+        if (gmpAuthExpire != null && gmpAuthExpire.size() >= 2) {
+            product.setGmpAuthStart(parseLocalDate(gmpAuthExpire.get(0)));
+            product.setGmpAuthEnd(parseLocalDate(gmpAuthExpire.get(1)));
+        }
+
         //获取商品编码
         if(!param.getValues().isEmpty()){
             if(param.getValues().get(0).getBarCode() != null){
                 product.setBarCode(param.getValues().get(0).getBarCode());
             }
         }
+
+        product.setBusinessLink(param.getBusinessLink());
         //校验店铺资质信息
         //获取店铺
         FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId());
@@ -432,17 +465,17 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             }
             
             // 根据经营范围校验商品类型
-            if (com.fs.common.utils.StringUtils.isNotEmpty(store.getSelectableProductTypes())) {
-                String productTypeName = getProductTypeName(product.getProductType());
-                if (com.fs.common.utils.StringUtils.isNotEmpty(productTypeName)) {
-                    // 直接使用工具类方法校验
-                    boolean isAllowed = BusinessScopeProductTypeUtil.isProductTypeAllowed(
-                            store.getSelectableProductTypes(), productTypeName);
-                    if (!isAllowed) {
-                        return R.error("该商品类型[" + productTypeName + "]不在店铺经营范围允许的商品类型内,请联系管理员核实经营范围");
-                    }
-                }
-            }
+//            if (com.fs.common.utils.StringUtils.isNotEmpty(store.getSelectableProductTypes())) {
+//                String productTypeName = getProductTypeName(product.getProductType());
+//                if (com.fs.common.utils.StringUtils.isNotEmpty(productTypeName)) {
+//                    // 直接使用工具类方法校验
+//                    boolean isAllowed = BusinessScopeProductTypeUtil.isProductTypeAllowed(
+//                            store.getSelectableProductTypes(), productTypeName);
+//                    if (!isAllowed) {
+//                        return R.error("该商品类型[" + productTypeName + "]不在店铺经营范围允许的商品类型内,请联系管理员核实经营范围");
+//                    }
+//                }
+//            }
         }
 
         if("纯正堂".equals(cloudHostProper.getCompanyName())){
@@ -1287,8 +1320,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     }
 
     @Override
-    public List<String> getProductNoticeInfo() {
-        return fsStoreProductMapper.getProductNoticeInfo();
+    public List<String> getProductNoticeInfo(Long storeId) {
+        return fsStoreProductMapper.getProductNoticeInfo(storeId);
     }
 
     @Override
@@ -1340,4 +1373,23 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                 return "";
         }
     }
+
+    /**
+     * 将字符串日期(yyyy-MM-dd)转换为 LocalDate
+     * @param dateStr 日期字符串(如 "2023-01-01")
+     * @return LocalDate 实例,转换失败返回 null
+     */
+    private LocalDate parseLocalDate(String dateStr) {
+        if (dateStr == null || dateStr.trim().isEmpty()) {
+            return null;
+        }
+        try {
+            // 假设前端传递的日期格式为 yyyy-MM-dd,可根据实际情况调整
+            return LocalDate.parse(dateStr, DateTimeFormatter.ISO_LOCAL_DATE);
+        } catch (Exception e) {
+            // 日志记录转换失败的异常(可选)
+            // log.error("日期转换失败: {}", dateStr, e);
+            return null;
+        }
+    }
 }

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java

@@ -482,8 +482,8 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
     }
 
     @Override
-    public List<String> queryValidStoreLastInfo(String account) {
-        return fsStoreMapper.queryValidStoreLastInfo(account);
+    public List<String> queryValidStoreLastInfo(Long storeId) {
+        return fsStoreMapper.queryValidStoreLastInfo(storeId);
     }
 
     /**

+ 7 - 0
fs-service/src/main/java/com/fs/hospital580/mapper/Hospital580PrescriptionScrmMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fs.his.param.FsPrescribeListDParam;
 import com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity;
+import com.fs.hospital580.vo.PrescriptionAdminQueryVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -32,4 +33,10 @@ public interface Hospital580PrescriptionScrmMapper extends BaseMapper<Hospital58
      * @param page 分页
      * **/
     IPage<Hospital580PrescriptionScrmEntity>  getPrescription(Page<Hospital580PrescriptionScrmEntity> page,@Param("query") FsPrescribeListDParam param);
+
+    /**
+     * 查询
+     * @param param 数据
+     * **/
+    List<Hospital580PrescriptionScrmEntity>  getPrescriptionList(@Param("query") PrescriptionAdminQueryVo param);
 }

+ 5 - 1
fs-service/src/main/java/com/fs/hospital580/service/Hospital580PrescriptionScrmService.java

@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.his.param.FsPrescribeListDParam;
 import com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity;
+import com.fs.hospital580.vo.PrescriptionAdminQueryVo;
+
+import java.util.List;
 
-import javax.validation.constraints.NotNull;
 
 /**
  * <p>
@@ -29,4 +31,6 @@ public interface Hospital580PrescriptionScrmService extends IService<Hospital580
      * @param param 参数
      * **/
     IPage<Hospital580PrescriptionScrmEntity> getPrescription(FsPrescribeListDParam param);
+
+    List<Hospital580PrescriptionScrmEntity> getPrescriptionList(PrescriptionAdminQueryVo param);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/hospital580/service/impl/Hospital580PrescriptionScrmServiceImpl.java

@@ -9,6 +9,7 @@ import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity;
 import com.fs.hospital580.mapper.Hospital580PrescriptionScrmMapper;
 import com.fs.hospital580.service.Hospital580PrescriptionScrmService;
+import com.fs.hospital580.vo.PrescriptionAdminQueryVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -55,4 +56,9 @@ public class Hospital580PrescriptionScrmServiceImpl extends ServiceImpl<Hospital
         Page<Hospital580PrescriptionScrmEntity> page = new Page<>(param.getPageNum(), param.getPageSize());
         return baseMapper.getPrescription(page,param);
     }
+
+    @Override
+    public List<Hospital580PrescriptionScrmEntity> getPrescriptionList(PrescriptionAdminQueryVo param) {
+        return baseMapper.getPrescriptionList(param);
+    }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/hospital580/vo/PrescriptionAdminQueryVo.java

@@ -22,4 +22,6 @@ public class PrescriptionAdminQueryVo extends PageRequest {
     private String endTime;
     @ApiModelProperty("处方审核状态:1为待审核,2为审核通过,3为审核不通过")
     private Byte auditStatus;
+
+    private String orderCode;
 }

+ 8 - 0
fs-service/src/main/resources/mapper/his/FsDoctorMapper.xml

@@ -382,4 +382,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{doctorId}
         </foreach>
     </delete>
+
+    <select id="getDoctorInfoByStoreId" resultType="com.fs.his.vo.FsDoctorVO">
+        select   doctor_id,
+                 doctor_name,
+                 practise_images,
+                 practise_code
+                 from  fs_doctor where  store_id=#{param.storeId} and doctor_type=#{param.doctorType} and status=1
+    </select>
 </mapper>

+ 150 - 12
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -69,6 +69,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isAudit" column="is_audit"/>
         <result property="storeId" column="store_id"/>
         <result property="instructionManual" column="instruction_manual"/>
+        <result property="business" column="business"/>
+        <result property="businessStart" column="business_start"/>
+        <result property="businessEnd" column="business_end"/>
+        <result property="license" column="license"/>
+        <result property="licenseStart" column="license_start"/>
+        <result property="licenseEnd" column="license_end"/>
+        <result property="certificate" column="certificate"/>
+        <result property="certificateStart" column="certificate_start"/>
+        <result property="certificateEnd" column="certificate_end"/>
+        <result property="voucher" column="voucher"/>
+        <result property="voucherStart" column="voucher_start"/>
+        <result property="voucherEnd" column="voucher_end"/>
+        <result property="gmpAuth" column="gmp_auth"/>
+        <result property="gmpAuthStart" column="gmp_auth_start"/>
+        <result property="gmpAuthEnd" column="gmp_auth_end"/>
+        <result property="businessLink" column="business_link"/>
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
@@ -79,7 +95,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                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,
-               adverse_reactions,contraindications,precautions,is_audit,store_id,instruction_manual,review_audit,qualification_certificate,qualification_certificate_start,qualification_certificate_end
+               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,
+               certificate, certificate_start, certificate_end,
+               voucher, voucher_start, voucher_end,
+               gmp_auth, gmp_auth_start, gmp_auth_end,business_link
                from fs_store_product_scrm
     </sql>
 
@@ -261,6 +282,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="qualificationCertificate != null and qualificationCertificate != ''">qualification_certificate ,</if>
             <if test="qualificationCertificateStart != null">qualification_certificate_start ,</if>
             <if test="qualificationCertificateEnd != null">qualification_certificate_end ,</if>
+            <if test="business != null and business != ''">business ,</if>
+            <if test="businessStart != null">business_start ,</if>
+            <if test="businessEnd != null">business_end ,</if>
+            <if test="license != null and license != ''">license ,</if>
+            <if test="licenseStart != null">license_start ,</if>
+            <if test="licenseEnd != null">license_end ,</if>
+            <if test="certificate != null and certificate != ''">certificate ,</if>
+            <if test="certificateStart != null">certificate_start ,</if>
+            <if test="certificateEnd != null">certificate_end ,</if>
+            <if test="voucher != null and voucher != ''">voucher ,</if>
+            <if test="voucherStart != null">voucher_start ,</if>
+            <if test="voucherEnd != null">voucher_end ,</if>
+            <if test="gmpAuth != null and gmpAuth != ''">gmp_auth ,</if>
+            <if test="gmpAuthStart != null">gmp_auth_start ,</if>
+            <if test="gmpAuthEnd != null">gmp_auth_end ,</if>
+            <if test="businessLink != null">business_link ,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
@@ -330,6 +367,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="qualificationCertificate != null and qualificationCertificate != ''">#{qualificationCertificate} ,</if>
             <if test="qualificationCertificateStart != null">#{qualificationCertificateStart} ,</if>
             <if test="qualificationCertificateEnd != null ">#{qualificationCertificateEnd} ,</if>
+            <if test="business != null and business != ''">#{business} ,</if>
+            <if test="businessStart != null">#{businessStart} ,</if>
+            <if test="businessEnd != null">#{businessEnd} ,</if>
+            <if test="license != null and license != ''">#{license} ,</if>
+            <if test="licenseStart != null">#{licenseStart} ,</if>
+            <if test="licenseEnd != null">#{licenseEnd} ,</if>
+            <if test="certificate != null and certificate != ''">#{certificate} ,</if>
+            <if test="certificateStart != null">#{certificateStart} ,</if>
+            <if test="certificateEnd != null">#{certificateEnd} ,</if>
+            <if test="voucher != null and voucher != ''">#{voucher} ,</if>
+            <if test="voucherStart != null">#{voucherStart} ,</if>
+            <if test="voucherEnd != null">#{voucherEnd} ,</if>
+            <if test="gmpAuth != null and gmpAuth != ''">#{gmpAuth} ,</if>
+            <if test="gmpAuthStart != null">#{gmpAuthStart} ,</if>
+            <if test="gmpAuthEnd != null">#{gmpAuthEnd} ,</if>
+            <if test="businessLink != null">#{businessLink} ,</if>
          </trim>
     </insert>
 
@@ -403,6 +456,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="qualificationCertificate != null and qualificationCertificate != ''">qualification_certificate = #{qualificationCertificate} ,</if>
             <if test="qualificationCertificateStart != null ">qualification_certificate_start = #{qualificationCertificateStart} ,</if>
             <if test="qualificationCertificateEnd != null ">qualification_certificate_end = #{qualificationCertificateEnd} ,</if>
+            <if test="business != null and business != ''">business = #{business} ,</if>
+            <if test="businessStart != null">business_start = #{businessStart} ,</if>
+            <if test="businessEnd != null">business_end = #{businessEnd} ,</if>
+            <if test="license != null and license != ''">license = #{license} ,</if>
+            <if test="licenseStart != null">license_start = #{licenseStart} ,</if>
+            <if test="licenseEnd != null">license_end = #{licenseEnd} ,</if>
+            <if test="certificate != null and certificate != ''">certificate = #{certificate} ,</if>
+            <if test="certificateStart != null">certificate_start = #{certificateStart} ,</if>
+            <if test="certificateEnd != null">certificate_end = #{certificateEnd} ,</if>
+            <if test="voucher != null and voucher != ''">voucher = #{voucher} ,</if>
+            <if test="voucherStart != null">voucher_start = #{voucherStart} ,</if>
+            <if test="voucherEnd != null">voucher_end = #{voucherEnd} ,</if>
+            <if test="gmpAuth != null and gmpAuth != ''">gmp_auth = #{gmpAuth} ,</if>
+            <if test="gmpAuthStart != null">gmp_auth_start = #{gmpAuthStart} ,</if>
+            <if test="gmpAuthEnd != null">gmp_auth_end = #{gmpAuthEnd} ,</if>
+            <if test="businessLink != null">business_link = #{businessLink} ,</if>
         </trim>
         where product_id = #{productId}
     </update>
@@ -602,18 +671,87 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="getProductNoticeInfo" resultType="java.lang.String">
         SELECT
-        CONCAT(
-        product_name,
-        '商品的',
-        CASE
-        WHEN qualification_certificate_end &lt; CURDATE() THEN '首营资质已过期'
-        ELSE '首营资质即将15天内过期'
-        END
-        ) AS status_text
+            CONCAT(
+                    product_name,
+                    '商品的',
+                    '生产企业营业执照',
+                    CASE
+                        WHEN business_end &lt; CURDATE() THEN '已过期'
+                        ELSE '即将15天内过期'
+                        END
+                ) AS status_text
         FROM fs_store_product_scrm
-        WHERE qualification_certificate IS NOT NULL
-        AND qualification_certificate_end IS NOT NULL
-        AND qualification_certificate_end &lt;= DATE_ADD(CURDATE(), INTERVAL 15 DAY);
+        WHERE business_end IS NOT NULL
+          AND business_end &lt;= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
+        <if test="storeId != null">AND store_id = #{storeId}</if>
+
+        UNION ALL
+
+        SELECT
+            CONCAT(
+                    product_name,
+                    '商品的',
+                    '生产企业的生产许可证/备案凭证',
+                    CASE
+                        WHEN license_end &lt; CURDATE() THEN '已过期'
+                        ELSE '即将15天内过期'
+                        END
+                ) AS status_text
+        FROM fs_store_product_scrm
+        WHERE license_end IS NOT NULL
+          AND license_end &lt;= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
+        <if test="storeId != null">AND store_id = #{storeId}</if>
+
+        UNION ALL
+
+        SELECT
+            CONCAT(
+                    product_name,
+                    '商品的',
+                    '商品注册证/备案凭证',
+                    CASE
+                        WHEN certificate_end &lt; CURDATE() THEN '已过期'
+                        ELSE '即将15天内过期'
+                        END
+                ) AS status_text
+        FROM fs_store_product_scrm
+        WHERE certificate_end IS NOT NULL
+          AND certificate_end &lt;= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
+        <if test="storeId != null">AND store_id = #{storeId}</if>
+
+        UNION ALL
+
+        SELECT
+            CONCAT(
+                    product_name,
+                    '商品的',
+                    '备案证书有效期',
+                    CASE
+                        WHEN voucher_end &lt; CURDATE() THEN '已过期'
+                        ELSE '即将15天内过期'
+                        END
+                ) AS status_text
+        FROM fs_store_product_scrm
+        WHERE voucher_end IS NOT NULL
+          AND voucher_end &lt;= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
+        <if test="storeId != null">AND store_id = #{storeId}</if>
+
+        UNION ALL
+
+        SELECT
+            CONCAT(
+                    product_name,
+                    '商品的',
+                    'GMP认证有效期',
+                    CASE
+                        WHEN gmp_auth_end &lt; CURDATE() THEN '已过期'
+                        ELSE '即将15天内过期'
+                        END
+                ) AS status_text
+        FROM fs_store_product_scrm
+        WHERE  gmp_auth_end IS NOT NULL
+          AND gmp_auth_end &lt;= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
+        <if test="storeId != null">AND store_id = #{storeId}</if>
     </select>
 
 </mapper>

+ 25 - 68
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -550,77 +550,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             CONCAT(
                     store_name,
                     '的',
-                    CASE
-                        WHEN business_license IS NOT NULL AND business_license_expire_end IS NOT NULL AND business_license_expire_end &lt; CURDATE()
-                            THEN '营业执照已过期,需要商家更新;'
-                        WHEN business_license IS NOT NULL AND business_license_expire_end IS NOT NULL AND DATEDIFF(business_license_expire_end, CURDATE()) &lt;= 15
-                            THEN '营业执照即将15天内过期;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN drug_license IS NOT NULL AND drug_license_expiry_end IS NOT NULL AND drug_license_expiry_end &lt; CURDATE()
-                            THEN '药品经营许可证已过期,需要商家更新;'
-                        WHEN drug_license IS NOT NULL AND drug_license_expiry_end IS NOT NULL AND DATEDIFF(drug_license_expiry_end, CURDATE()) &lt;= 15
-                            THEN '药品经营许可证即将15天内过期;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN medical_device1 IS NOT NULL AND medical_device1_expiry_end IS NOT NULL AND medical_device1_expiry_end &lt; CURDATE()
-                            THEN '一类器械生产备案已到期,需要商家更新;'
-                        WHEN medical_device1 IS NOT NULL AND medical_device1_expiry_end IS NOT NULL AND DATEDIFF(medical_device1_expiry_end, CURDATE()) &lt;= 15
-                            THEN '一类器械生产备案即将15天内过期;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND medical_device2_expiry_end &lt; CURDATE()
-                            THEN '二类器械生产备案已到期,需要商家更新;'
-                        WHEN medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND DATEDIFF(medical_device2_expiry_end, CURDATE()) &lt;= 15
-                            THEN '二类器械生产备案即将15天内过期;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND medical_device3_expiry_end &lt; CURDATE()
-                            THEN '三类器械生产备案已到期,需要商家更新;'
-                        WHEN medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND DATEDIFF(medical_device3_expiry_end, CURDATE()) &lt;= 15
-                            THEN '三类器械生产备案即将15天内过期;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN food_license IS NOT NULL AND food_license_expiry_end IS NOT NULL AND food_license_expiry_end &lt; CURDATE()
-                            THEN '食品经营许可证已到期,需要商家更新;'
-                        WHEN food_license IS NOT NULL AND food_license_expiry_end IS NOT NULL AND DATEDIFF(food_license_expiry_end, CURDATE()) &lt;= 15
-                            THEN '食品经营许可证即将15天内过期;'
-                        ELSE ''
-                        END,
-                    CASE
-                        WHEN medical_license IS NOT NULL AND medical_license_expiry_end IS NOT NULL AND medical_license_expiry_end &lt; CURDATE()
-                            THEN '医疗机构执业许可证已到期,需要商家更新;'
-                        WHEN medical_license IS NOT NULL AND medical_license_expiry_end IS NOT NULL AND DATEDIFF(medical_license_expiry_end, CURDATE()) &lt;= 15
-                            THEN '医疗机构执业许可证即将15天内过期;'
-                        ELSE ''
-                        END
-            ) AS warning_message
+                    CASE WHEN business_license IS NOT NULL AND business_license_expire_end IS NOT NULL AND business_license_expire_end &lt; CURDATE() THEN '营业执照已过期,需要商家更新;' ELSE '' END,
+                    CASE WHEN business_license IS NOT NULL AND business_license_expire_end IS NOT NULL AND business_license_expire_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY) THEN '营业执照15天内过期;' ELSE '' END,
+                    CASE WHEN drug_license IS NOT NULL AND drug_license_expiry_end IS NOT NULL AND drug_license_expiry_end &lt; CURDATE() THEN '药品经营许可证已过期,需要商家更新' ELSE '' END,
+                    CASE WHEN drug_license IS NOT NULL AND drug_license_expiry_end IS NOT NULL AND drug_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY) THEN '药品经营许可证15天内过期;' ELSE '' END,
+                    CASE WHEN medical_device1 IS NOT NULL AND medical_device1_expiry_end IS NOT NULL AND medical_device1_expiry_end &lt; CURDATE() THEN '一类器械生产备案已过期,需要商家更新;' ELSE '' END,
+                    CASE WHEN medical_device1 IS NOT NULL AND medical_device1_expiry_end IS NOT NULL AND medical_device1_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY) THEN '一类器械生产备案15天内过期;' ELSE '' END,
+                    CASE WHEN medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND medical_device2_expiry_end &lt; CURDATE() THEN '二类医疗器械备案已过期,需要商家更新;' ELSE '' END,
+                    CASE WHEN medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND medical_device2_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY) THEN '二类医疗器械备案15天内过期;' ELSE '' END,
+                    CASE WHEN medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND medical_device3_expiry_end &lt; CURDATE() THEN '三类器械经营许可证已过期,需要商家更新;' ELSE '' END,
+                    CASE WHEN medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND medical_device3_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY) THEN '三类器械经营许可证15天内过期;' ELSE '' END,
+                    CASE WHEN food_license IS NOT NULL AND food_license_expiry_end IS NOT NULL AND food_license_expiry_end &lt; CURDATE() THEN '食品经营许可证已过期,需要商家更新;' ELSE '' END,
+                    CASE WHEN food_license IS NOT NULL AND food_license_expiry_end IS NOT NULL AND food_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY) THEN '食品经营许可证15天内过期;' ELSE '' END,
+                    CASE WHEN medical_license IS NOT NULL AND medical_license_expiry_end IS NOT NULL AND medical_license_expiry_end &lt; CURDATE() THEN '医疗机构执业许可证已过期,需要商家更新;' ELSE '' END,
+                    CASE WHEN medical_license IS NOT NULL AND medical_license_expiry_end IS NOT NULL AND medical_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY) THEN '医疗机构执业许可证15天内过期;' ELSE '' END
+                ) AS warning_message
+
         FROM fs_store_scrm
         WHERE STATUS = 1
-          AND account = #{account}
+          and store_id = #{storeId}
           AND (
-            -- 已过期的条件
-            (business_license IS NOT NULL AND business_license_expire_end IS NOT NULL AND business_license_expire_end &lt; CURDATE())
-                OR (drug_license IS NOT NULL AND drug_license_expiry_end IS NOT NULL AND drug_license_expiry_end &lt; CURDATE())
-                OR (medical_device1 IS NOT NULL AND medical_device1_expiry_end IS NOT NULL AND medical_device1_expiry_end &lt; CURDATE())
-                OR (medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND medical_device2_expiry_end &lt; CURDATE())
-                OR (medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND medical_device3_expiry_end &lt; CURDATE())
-                OR (food_license IS NOT NULL AND food_license_expiry_end IS NOT NULL AND food_license_expiry_end &lt; CURDATE())
-                OR (medical_license IS NOT NULL AND medical_license_expiry_end IS NOT NULL AND medical_license_expiry_end &lt; CURDATE())
-                -- 15天内到期的条件
-                OR (business_license IS NOT NULL AND business_license_expire_end IS NOT NULL AND DATEDIFF(business_license_expire_end, CURDATE()) &lt;= 15)
-                OR (drug_license IS NOT NULL AND drug_license_expiry_end IS NOT NULL AND DATEDIFF(drug_license_expiry_end, CURDATE()) &lt;= 15)
-                OR (medical_device1 IS NOT NULL AND medical_device1_expiry_end IS NOT NULL AND DATEDIFF(medical_device1_expiry_end, CURDATE()) &lt;= 15)
-                OR (medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND DATEDIFF(medical_device2_expiry_end, CURDATE()) &lt;= 15)
-                OR (medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND DATEDIFF(medical_device3_expiry_end, CURDATE()) &lt;= 15)
-                OR (food_license IS NOT NULL AND food_license_expiry_end IS NOT NULL AND DATEDIFF(food_license_expiry_end, CURDATE()) &lt;= 15)
-                OR (medical_license IS NOT NULL AND medical_license_expiry_end IS NOT NULL AND DATEDIFF(medical_license_expiry_end, CURDATE()) &lt;= 15)
+                (business_license IS NOT NULL AND business_license_expire_end IS NOT NULL AND (business_license_expire_end &lt; CURDATE() OR business_license_expire_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY)))
+                OR (drug_license IS NOT NULL AND drug_license_expiry_end IS NOT NULL AND (drug_license_expiry_end &lt; CURDATE() OR drug_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY)))
+                OR (medical_device1 IS NOT NULL AND medical_device1_expiry_end IS NOT NULL AND (medical_device1_expiry_end &lt; CURDATE() OR medical_device1_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY)))
+                OR (medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND (medical_device2_expiry_end &lt; CURDATE() OR medical_device2_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY)))
+                OR (medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND (medical_device3_expiry_end &lt; CURDATE() OR medical_device3_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY)))
+                OR (food_license IS NOT NULL AND food_license_expiry_end IS NOT NULL AND (food_license_expiry_end &lt; CURDATE() OR food_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY)))
+                OR (medical_license IS NOT NULL AND medical_license_expiry_end IS NOT NULL AND (medical_license_expiry_end &lt; CURDATE() OR medical_license_expiry_end BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 15 DAY)))
             )
-        HAVING warning_message != ''
+        HAVING warning_message != '';
     </select>
 </mapper>

+ 13 - 22
fs-service/src/main/resources/mapper/hospital580/Hospital580PrescriptionScrmMapper.xml

@@ -64,7 +64,8 @@
           AND sos.`status` = 0
     </select>
 
-    <select id="getPrescription" resultType="com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity">
+
+    <select id="getPrescriptionList" resultType="com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity">
         SELECT
         hps.*,
         sos.order_code AS orderCode
@@ -73,33 +74,23 @@
         LEFT JOIN fs_store_order_scrm sos ON sos.id = hps.store_order_id
         WHERE
         1=1
-        <if test="query.doctorId != null">
-            AND hps.audit_apothecary_id = #{query.doctorId}
-        </if>
-        <if test="query.status != null and query.status == 1">
-            AND hps.audit_status = 1
-        </if>
-        <if test="query.doctorDrugId != null">
-            AND hps.doctor_drug_id = #{query.doctorDrugId}
-        </if>
-        <if test="query.type != null">
-            AND hps.type = #{query.type}
-        </if>
-        <if test="query.patientName != null and query.patientName != ''">
-            AND hps.patient_name LIKE CONCAT('%', #{query.patientName}, '%')
+        <if test="query.hospitalName != null and query.hospitalName != ''">
+            AND hps.hospital_name LIKE CONCAT('%', #{query.hospitalName}, '%')
         </if>
         <if test="query.orderCode != null and query.orderCode != ''">
             AND sos.order_code LIKE CONCAT('%', #{query.orderCode}, '%')
         </if>
-        <if test="query.prescribeCode != null and query.prescribeCode != ''">
-            AND hps.prescribe_code = #{query.prescribeCode}
+        <if test="query.storeName != null and query.storeName != ''">
+            AND hps.store_name LIKE CONCAT('%', #{query.storeName}, '%')
         </if>
-
-        <if test="query.prescribeType != null">
-            AND hps.prescribe_type = #{query.prescribeType}
+        <if test="query.userFamilyName != null and query.userFamilyName != ''">
+            AND hps.user_family_name LIKE CONCAT('%', #{query.userFamilyName}, '%')
+        </if>
+        <if test="query.userFamilyPhone != null and query.userFamilyPhone != ''">
+            AND hps.user_family_phone = #{query.userFamilyPhone}
         </if>
-        <if test="query.companyUserId != null">
-            AND hps.company_user_id = #{query.companyUserId}
+        <if test="query.auditStatus != null">
+            AND hps.audit_status = #{query.auditStatus}
         </if>
         <if test="query.beginTime != null and query.beginTime != ''">
             AND hps.create_time >= #{query.beginTime}

+ 9 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreProductScrmController.java

@@ -6,7 +6,9 @@ import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.framework.service.TokenServiceScrm;
 import com.fs.his.param.FsStoreProductListSParam;
 import com.fs.his.vo.FsStoreProductExcelVO;
 import com.fs.his.vo.FsStoreProductListSVO;
@@ -14,6 +16,7 @@ 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.param.FsStoreProductAddEditParam;
 import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
@@ -44,6 +47,10 @@ public class FsStoreProductScrmController extends BaseController
     private IFsStoreProductScrmService fsStoreProductService;
     @Autowired
     private IFsStoreProductAttrScrmService attrService;
+
+    @Autowired
+    private TokenServiceScrm tokenService;
+
     /**
  * 查询商品列表
  */
@@ -53,6 +60,8 @@ 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{

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

@@ -172,6 +172,7 @@ public class FsStoreScrmController extends BaseController {
     /**
      * 商家店铺资质提示信息
      */
+    @Log(title = "商家端:商家证件即将过期或已过期提醒", businessType = BusinessType.OTHER)
     @GetMapping("/queryValidStoreLastInfo")
     public R queryValidStoreLastInfo() {
         StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
@@ -182,7 +183,7 @@ public class FsStoreScrmController extends BaseController {
                 if (account == null && account.isEmpty()) {
                     throw new BaseException("请先完善店铺账户信息");
                 }
-                List<String> list = fsStoreService.queryValidStoreLastInfo(account);
+                List<String> list = fsStoreService.queryValidStoreLastInfo(loginUser.getFsStore().getStoreId());
                 if (!Collections.isEmpty(list)) {
                     return R.ok().put("code", 200).put("data", list);
                 }

+ 59 - 0
fs-store/src/main/java/com/fs/store/controller/store/FsStoreProductController.java

@@ -1,8 +1,14 @@
 package com.fs.store.controller.store;
 
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.service.TokenServiceScrm;
 import com.fs.his.param.FsStoreProductListSParam;
 import com.fs.his.vo.FsStoreProductExcelVO;
 import com.fs.his.vo.FsStoreProductListSVO;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hospital580.service.Hospital580ScrmService;
 import com.fs.store.utils.UserUtil;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
@@ -24,6 +30,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -43,6 +50,16 @@ public class FsStoreProductController extends BaseController
     private IFsStoreProductService fsStoreProductService;
     @Autowired
     private IFsStoreProductAttrService attrService;
+
+    @Autowired
+    private Hospital580ScrmService fsStoreHospital580ScrmService;
+
+    @Autowired
+    private IFsStoreProductScrmService storeProductScrmService;
+
+    @Autowired
+    private TokenServiceScrm tokenService;
+
     /**
  * 查询商品列表
  */
@@ -185,4 +202,46 @@ public TableDataInfo list(FsStoreProductListSParam fsStoreProduct)
         return fsStoreProductService.addOrEdit(fsStoreProduct);
     }
 
+    /**
+     * 同步商品到580商城
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:sync')")
+    @Log(title = "同步商品到580医院", businessType = BusinessType.DELETE, isStoreLog = true,
+            logParamExpression = "#p0.length>1?new String[]{'商品','同步商品到580医院'}: new String[]{'商品','同步商品到580医院'}")
+    @PostMapping("/sync580/{productIds}")
+    public R sync(@PathVariable Long[] productIds) {
+        fsStoreHospital580ScrmService.SynDrugToHospital580(productIds);
+        return R.ok("同步成功");
+    }
+
+    /**
+     * 同步商品到580商城
+     */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:update')")
+    @Log(title = "批量下架商品", businessType = BusinessType.DELETE, isStoreLog = true,
+            logParamExpression = "#p0.length>1?new String[]{'商品','下架'}: new String[]{'商品','下架'}")
+    @PostMapping("/updateFsStoreProductIsShowBatch/{productIds}")
+    public R updateFsStoreProductIsShowBatch(@PathVariable Long[] productIds) {
+        if (productIds.length > 0) {
+            storeProductScrmService.updateFsStoreProductIsShowBatch(productIds);
+        }
+        return R.ok("操作完成");
+    }
+
+    @Log(title = "店铺端台商品协议过期提醒", businessType = BusinessType.OTHERe)
+    /**
+     * 商品资质信息提示
+     *
+     * @return
+     */
+    @GetMapping("/productNoticeInfo")
+    public R getProductNoticeInfo() {
+        StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+
+        List<String> productNoticeInfo = storeProductScrmService.getProductNoticeInfo(loginUser.getFsStore().getStoreId());
+        if (!CollectionUtils.isEmpty(productNoticeInfo)) {
+            return R.ok().put("code", 200).put("data", productNoticeInfo);
+        }
+        return R.ok().put("code", 0);
+    }
 }

+ 10 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/StoreScrmController.java

@@ -10,7 +10,9 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.his.param.FsDoctorParam;
 import com.fs.his.param.FsStoreAuditParam;
+import com.fs.his.service.IFsDoctorService;
 import com.fs.hisStore.domain.FsStoreScrm;
 import com.fs.hisStore.service.IFsStoreScrmService;
 import com.fs.hisStore.utils.StoreAuditLogUtil;
@@ -39,6 +41,8 @@ public class StoreScrmController extends BaseController
     @Autowired
     private StoreAuditLogUtil storeAuditLogUtil;
 
+    @Autowired
+    private IFsDoctorService fsDoctorService;
 
     /**
      * 查询店铺管理列表
@@ -62,6 +66,12 @@ public class StoreScrmController extends BaseController
     public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
     {
         FsStoreScrm fsStore = fsStoreService.selectFsStoreByStoreId(storeId);
+
+        //获取店铺下绑定的药师职业证书
+        FsDoctorParam param=new FsDoctorParam();
+        param.setStoreId(fsStore.getStoreId());
+        param.setDoctorType(2);
+        fsStore.setDoctorList(fsDoctorService.getDoctorInfoByStoreId(param));
         if(fsStore != null && fsStore.getPhone() != null)
             fsStore.setPhone(ParseUtils.parsePhone(fsStore.getPhone()));
         return AjaxResult.success(fsStore);