فهرست منبع

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

zhangqin 4 روز پیش
والد
کامیت
a1fdfabd9e
30فایلهای تغییر یافته به همراه932 افزوده شده و 393 حذف شده
  1. 10 0
      fs-admin/src/main/java/com/fs/his/task/Task.java
  2. 15 0
      fs-admin/src/main/java/com/fs/web/controller/system/SysUserController.java
  3. 4 0
      fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java
  4. 2 0
      fs-service/src/main/java/com/fs/his/service/IFsUserService.java
  5. 1 1
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java
  6. 5 0
      fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java
  7. 195 59
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java
  8. 5 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreScrm.java
  9. 7 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java
  10. 19 4
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java
  11. 13 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreScrmMapper.java
  12. 26 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java
  13. 10 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java
  14. 11 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreScrmService.java
  15. 137 124
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java
  16. 11 2
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreScrmServiceImpl.java
  17. 21 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListVO.java
  18. 4 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductQueryVO.java
  19. 9 1
      fs-service/src/main/java/com/fs/hospital580/mapper/Hospital580PrescriptionScrmMapper.java
  20. 5 0
      fs-service/src/main/java/com/fs/hospital580/service/Hospital580PrescriptionScrmService.java
  21. 34 0
      fs-service/src/main/java/com/fs/hospital580/service/impl/Hospital580PrescriptionScrmServiceImpl.java
  22. 8 5
      fs-service/src/main/resources/application-config-dev-yjb.yml
  23. 5 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml
  24. 73 20
      fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml
  25. 75 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml
  26. 10 0
      fs-service/src/main/resources/mapper/hospital580/Hospital580PrescriptionScrmMapper.xml
  27. 55 34
      fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreScrmController.java
  28. 19 0
      fs-user-app/src/main/java/com/fs/app/controller/store/ProductScrmController.java
  29. 142 142
      fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java
  30. 1 1
      fs-user-app/src/main/resources/application.yml

+ 10 - 0
fs-admin/src/main/java/com/fs/his/task/Task.java

@@ -55,6 +55,7 @@ import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.FsSubOrderResultVO;
 import com.fs.hisStore.service.IFsStoreScrmService;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hospital580.service.Hospital580PrescriptionScrmService;
 import com.fs.im.dto.*;
 import com.fs.im.service.IImService;
 import com.fs.im.service.OpenIMService;
@@ -199,6 +200,9 @@ public class Task {
 
     public static final String SOP_TEMP_VOICE_KEY = "sop:tempVoice";
 
+    @Autowired
+    private Hospital580PrescriptionScrmService prescriptionScrmService;
+
     /**
      * sop任务token消耗统计
      */
@@ -1548,5 +1552,11 @@ public class Task {
         log.info("定时删除行为轨迹记录 {} 条", deleteCount);
     }
 
+    /**
+     * 处方失效定时任务
+     * **/
+    public void prescriptionInvalidTask(){
+        prescriptionScrmService.prescriptionInvalid();
+    }
 
 }

+ 15 - 0
fs-admin/src/main/java/com/fs/web/controller/system/SysUserController.java

@@ -289,4 +289,19 @@ public class SysUserController extends BaseController
         }
         return R.ok().put("code",0);
     }
+
+    @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);
+            }
+        }
+        return R.ok().put("code",0);
+    }
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java

@@ -14,6 +14,7 @@ import com.fs.his.param.FsUserParam;
 import com.fs.his.vo.FsUserVO;
 import com.fs.his.vo.FsUserExportListVO;
 import com.fs.his.vo.OptionsVO;
+import com.fs.hisStore.domain.FsUserScrm;
 import com.fs.hisStore.vo.FsCompanyUserListQueryVO;
 import com.fs.qw.dto.FsUserTransferParamDTO;
 import com.fs.qw.param.QwFsUserParam;
@@ -424,4 +425,7 @@ public interface FsUserMapper
      * 统计用户看课数据(课程观看次数、课程完播次数)
      * */
     ExternalWatchStatsVO countExternalWatchStats(UserStatisticsCommonParam param);
+
+    @Select("select * from fs_user where ma_open_id=#{openid}")
+    FsUser selectFsUserByMaOpenId(String openid);
 }

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

@@ -221,4 +221,6 @@ public interface IFsUserService
     void handleFsUserWx(FsUser user, LoginMaWxParam param, WxMaJscode2SessionResult session);
 
     R removeUser(Long id);
+
+    FsUser selectFsUserByMaOpenId(String openid);
 }

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

@@ -316,7 +316,7 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService {
         headerMap.put("minWidth", 140);
         headerMapList.add(ObjectUtil.clone(headerMap));
 
-        headerMap.put("title", "商品编号");
+        headerMap.put("title", "商品条码");
         headerMap.put("slot", "barCode");
         headerMap.put("align", align);
         headerMap.put("minWidth", 140);

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

@@ -1303,6 +1303,11 @@ public class FsUserServiceImpl implements IFsUserService {
         }
     }
 
+    @Override
+    public FsUser selectFsUserByMaOpenId(String openid) {
+        return fsUserMapper.selectFsUserByMaOpenId(openid);
+    }
+
     @Override
     public R removeUser(Long id) {
         fsUserMapper.removeUser(id);

+ 195 - 59
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java

@@ -1,6 +1,7 @@
 package com.fs.hisStore.domain;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.List;
 
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
@@ -18,173 +19,250 @@ import lombok.EqualsAndHashCode;
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
-public class FsStoreProductScrm extends BaseEntity
-{
+public class FsStoreProductScrm extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 商品id */
+    /**
+     * 商品id
+     */
     private Long productId;
 
-    /** 商品图片 */
+    /**
+     * 商品图片
+     */
     @Excel(name = "商品图片")
     private String image;
 
     @TableField(strategy = FieldStrategy.IGNORED)
     private String video;
 
-    /** 轮播图 */
+    /**
+     * 轮播图
+     */
     @Excel(name = "轮播图")
     private String sliderImage;
 
-    /** 商品名称 */
+    /**
+     * 商品名称
+     */
     @Excel(name = "商品名称")
     private String productName;
 
-    /** 商品简介 */
+    /**
+     * 商品简介
+     */
     @Excel(name = "商品简介")
     private String productInfo;
 
-    /** 关键字 */
+    /**
+     * 关键字
+     */
     @Excel(name = "关键字")
     private String keyword;
 
-    /** 产品条码(一维码) */
+    /**
+     * 产品条码(一维码)
+     */
     @Excel(name = "产品条码", readConverterExp = "一=维码")
     private String barCode;
 
-    /** 分类id */
+    /**
+     * 分类id
+     */
     @Excel(name = "分类id")
     private Long cateId;
 
-    /** 商品价格 */
+    /**
+     * 商品价格
+     */
     @Excel(name = "商品价格")
     private BigDecimal price;
 
-    /** 会员价格 */
+    /**
+     * 会员价格
+     */
     @Excel(name = "会员价格")
     private BigDecimal vipPrice;
 
-    /** 市场价 */
+    /**
+     * 市场价
+     */
     @Excel(name = "市场价")
     private BigDecimal otPrice;
 
     @Excel(name = "市场价")
     private BigDecimal agentPrice;
 
-    /** 邮费 */
+    /**
+     * 邮费
+     */
     @Excel(name = "邮费")
     private BigDecimal postage;
 
-    /** 单位名 */
+    /**
+     * 单位名
+     */
     @Excel(name = "单位名")
     private String unitName;
 
-    /** 排序 */
+    /**
+     * 排序
+     */
     @Excel(name = "排序")
     private Long sort;
 
-    /** 销量 */
+    /**
+     * 销量
+     */
     @Excel(name = "销量")
     private Long sales;
 
-    /** 库存 */
+    /**
+     * 库存
+     */
     @Excel(name = "库存")
     private Long stock;
 
-    /** 状态(0:未上架,1:上架) */
+    /**
+     * 状态(0:未上架,1:上架)
+     */
     @Excel(name = "状态", dictType = "store_product_is_show", readConverterExp = "0=:未上架,1:上架")
     private Integer isShow;
 
-    /** 是否热卖 */
+    /**
+     * 是否热卖
+     */
     @Excel(name = "是否热卖")
     private Integer isHot;
 
-    /** 是否优惠 */
+    /**
+     * 是否优惠
+     */
     @Excel(name = "是否优惠")
     private Integer isBenefit;
 
-    /** 是否精品 */
+    /**
+     * 是否精品
+     */
     @Excel(name = "是否精品")
     private Integer isBest;
 
-    /** 是否新品 */
+    /**
+     * 是否新品
+     */
     @Excel(name = "是否新品")
     private Integer isNew;
 
     @Excel(name = "是否在商品展示")
     private Integer isDisplay;
 
-    /** 产品描述 */
+    /**
+     * 产品描述
+     */
     @Excel(name = "产品描述")
     private String description;
 
-    /** 是否包邮 */
+    /**
+     * 是否包邮
+     */
     @Excel(name = "是否包邮")
     private Integer isPostage;
 
-    /** 是否删除 */
+    /**
+     * 是否删除
+     */
     @Excel(name = "是否删除")
     private Integer isDel;
 
-    /** 获得积分 */
+    /**
+     * 获得积分
+     */
     @Excel(name = "获得积分")
     private BigDecimal giveIntegral;
 
-    /** 成本价 */
+    /**
+     * 成本价
+     */
     @Excel(name = "成本价")
     private BigDecimal cost;
 
-    /** 是否优品推荐 */
+    /**
+     * 是否优品推荐
+     */
     @Excel(name = "是否优品推荐")
     private Integer isGood;
 
-    /** 浏览量 */
+    /**
+     * 浏览量
+     */
     @Excel(name = "浏览量")
     private Long browse;
 
-    /** 产品二维码地址(用户小程序海报) */
+    /**
+     * 产品二维码地址(用户小程序海报)
+     */
     @Excel(name = "产品二维码地址(用户小程序海报)")
     private String codePath;
 
-    /** 运费模板ID */
+    /**
+     * 运费模板ID
+     */
     @Excel(name = "运费模板ID")
     private Integer tempId;
 
-    /** 规格 0单 1多 */
+    /**
+     * 规格 0单 1多
+     */
     @Excel(name = "规格 0单 1多")
     private Integer specType;
 
-    /** 是开启积分兑换 */
+    /**
+     * 是开启积分兑换
+     */
     @Excel(name = "是开启积分兑换")
     private Integer isIntegral;
 
-    /** 需要多少积分兑换 只在开启积分兑换时生效 */
+    /**
+     * 需要多少积分兑换 只在开启积分兑换时生效
+     */
     @Excel(name = "需要多少积分兑换 只在开启积分兑换时生效")
     private Long integral;
 
-    /** 商品类型:1非处方 2处方 */
+    /**
+     * 商品类型:1非处方 2处方
+     */
     @Excel(name = "商品类型:1非处方 2处方", dictType = "store_product_type")
     private Integer productType;
 
-    /** 国药准字 */
+    /**
+     * 国药准字
+     */
     @Excel(name = "国药准字")
     private String prescribeCode;
 
-    /** 规格 */
+    /**
+     * 规格
+     */
     @Excel(name = "规格")
     private String prescribeSpec;
 
-    /** 生产厂家 */
+    /**
+     * 生产厂家
+     */
     @Excel(name = "生产厂家")
     private String prescribeFactory;
 
-    /** 处方名 */
+    /**
+     * 处方名
+     */
     @Excel(name = "处方名")
     private String prescribeName;
 
     private Integer tuiCateId;
 
-    /** 指定企业 */
+    /**
+     * 指定企业
+     */
     private String companyIds;
 
     private Long storeId;
@@ -192,67 +270,99 @@ public class FsStoreProductScrm extends BaseEntity
     @TableField(exist = false)
     private Long[] storeIds;
 
-    /** 药品展示图 */
+    /**
+     * 药品展示图
+     */
     @Excel(name = "药品展示图")
     private String drugImage;
 
-    /** 药品注册证书编号 */
+    /**
+     * 药品注册证书编号
+     */
     @Excel(name = "药品注册证书编号")
     private String drugRegCertNo;
 
-    /** 通用名称 */
+    /**
+     * 通用名称
+     */
     @Excel(name = "通用名称")
     private String commonName;
 
-    /** 剂型 */
+    /**
+     * 剂型
+     */
     @Excel(name = "剂型")
     private String dosageForm;
 
-    /** 单价 */
+    /**
+     * 单价
+     */
     @Excel(name = "单价")
     private String unitPrice;
 
-    /** 批号 */
+    /**
+     * 批号
+     */
     @Excel(name = "批号")
     private String batchNumber;
 
-    /** 上市许可持有人 */
+    /**
+     * 上市许可持有人
+     */
     @Excel(name = "上市许可持有人")
     private String mah;
 
-    /** 上市许可持有人地址 */
+    /**
+     * 上市许可持有人地址
+     */
     @Excel(name = "上市许可持有人地址")
     private String mahAddress;
 
-    /** 生产企业 */
+    /**
+     * 生产企业
+     */
     @Excel(name = "生产企业")
     private String manufacturer;
 
-    /** 生产企业地址 */
+    /**
+     * 生产企业地址
+     */
     @Excel(name = "生产企业地址")
     private String manufacturerAddress;
 
-    /** 功能主治 */
+    /**
+     * 功能主治
+     */
     @Excel(name = "功能主治")
     private String indications;
 
-    /** 用法用量 */
+    /**
+     * 用法用量
+     */
     @Excel(name = "用法用量")
     private String dosage;
 
-    /** 不良反应 */
+    /**
+     * 不良反应
+     */
     @Excel(name = "不良反应")
     private String adverseReactions;
 
-    /** 禁忌 */
+    /**
+     * 禁忌
+     */
     @Excel(name = "禁忌")
     private String contraindications;
 
-    /** 注意事项 */
+    /**
+     * 注意事项
+     */
     @Excel(name = "注意事项")
     private String precautions;
 
-    /** 审核状态(0未审核1审核通过2审核退回) */
+    /**
+     * 审核状态(0未审核1审核通过2审核退回)
+     */
     @Excel(name = "审核状态(0未审核1审核通过2审核退回)")
     private String isAudit;
 
@@ -303,7 +413,9 @@ public class FsStoreProductScrm extends BaseEntity
     private Integer isPrescribe;
 
 
-    /** 品牌 */
+    /**
+     * 品牌
+     */
     @Excel(name = "品牌")
     private String brand;
 
@@ -318,7 +430,7 @@ public class FsStoreProductScrm extends BaseEntity
 
     /**
      * 交易类型
-     * **/
+     **/
     @TableField(exist = false)
     private Integer transactionStatus;
 
@@ -327,4 +439,28 @@ public class FsStoreProductScrm extends BaseEntity
      * **/
     private String complaint;
 
+    /**
+     * 说明书
+     **/
+    private String instructionManual;
+
+    /**
+     * 审核说明(0 首营 1非首映)
+     */
+    private String reviewAudit;
+
+    /**
+     * 首营弹资质上传证明
+     */
+    private String qualificationCertificate;
+
+    /**
+     * 首营弹资质开始时间
+     */
+    private LocalDate  qualificationCertificateStart;
+    /**
+     * 首营弹资质结束时间
+     */
+    private  LocalDate  qualificationCertificateEnd;
+
 }

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

@@ -304,6 +304,11 @@ public class FsStoreScrm extends BaseEntity {
      **/
     private Byte isBusinessLicensePermanent;
 
+    /**
+     * 1类医疗器械是否长期有效(1长期有效、0非长期有效)
+     **/
+    private Byte isMedicalDevice1ExpiryPermanent;
+
     /**
      * 其它资质-入驻协议
      */

+ 7 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java

@@ -1400,4 +1400,11 @@ public interface FsStoreOrderScrmMapper
      */
     @MapKey("orderId")
     Map<Long, Long> batchGetPrescriptionDrugCount(@Param("orderIds") List<Long> orderIds);
+
+    /**
+     * 批量更新订单状态
+     * @param status 状态
+     * @param orderIds 订单数组
+     * **/
+    void batchUpdateOrderStatusById(@Param("orderIds") List<Long> orderIds,@Param("status") String status);
 }

+ 19 - 4
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -8,6 +8,7 @@ import com.fs.his.vo.FsStoreProductListSVO;
 import com.fs.his.vo.OptionsVO;
 import com.fs.hisStore.config.MedicalMallConfig;
 import com.fs.hisStore.domain.FsStoreProductRuleScrm;
+import com.fs.hisStore.param.FsStoreCartCountParam;
 import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.param.FsStoreProductQueryParam;
@@ -231,7 +232,7 @@ public interface FsStoreProductScrmMapper
         "and p.company_ids regexp replace(#{maps.companyIds}, ',', '|') " +
         "</if> " +
         // 单个店铺ID条件
-        "<if test='maps.storeId != null and maps.storeId.trim() != \"\"'> " +
+        "<if test='maps.storeId != null and maps.storeId != \"\"'> " +
         "and p.store_id = #{maps.storeId} " +
         "</if> " +
         // 多个店铺ID条件
@@ -346,10 +347,17 @@ public interface FsStoreProductScrmMapper
     @Select("select * from fs_store_product_scrm where  is_del=0 and is_show=1 order by sort desc limit #{count}")
     List<FsStoreProductListQueryVO> selectFsStoreProductByCateIdQuery(Long cateId);
     @Select({"<script> " +
-            "select p.* from fs_store_product_scrm p  " +
+//            "select p.* from fs_store_product_scrm p  " +
+            "SELECT\n" +
+            "\tCOUNT(*) OVER ( PARTITION BY p.product_name ) AS storeCount,\n" +
+            "\tp1.storeIds,\n" +
+            "\tp.* \n" +
+            "FROM\n" +
+            "\tfs_store_product_scrm p\n" +
+            "\tLEFT JOIN ( SELECT GROUP_CONCAT( DISTINCT fsp1.store_id SEPARATOR ',' ) AS storeIds, fsp1.product_name FROM fs_store_product_scrm fsp1 GROUP BY fsp1.product_name ) p1 ON p1.product_name = p.product_name\n" +
             //新增审核状态及所属店铺审核状态
             "<if test = 'maps.isStores != null and maps.isStores == 1   '>"+
-            "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
+            "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.status = 1 " +
             "</if>" +
             "where p.is_del=0 and p.is_show=1  and p.is_audit = '1' and fs.status = '1'" +
             "<if test = 'maps.productName != null and  maps.productName !=\"\"    '> " +
@@ -401,7 +409,7 @@ public interface FsStoreProductScrmMapper
             "select p.* from fs_store_product_scrm p  " +
             //新增审核状态及所属店铺审核状态
             "<if test='config.isAudit == \"1\" '>" +
-            " inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
+            " inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.status = 1 " +
             "</if>" +
             " where p.is_del=0 and p.is_show=1  " +
             "<if test='config.isAudit == \"1\" '>" +
@@ -582,4 +590,11 @@ public interface FsStoreProductScrmMapper
             "</script>"})
     int updateFsStoreProductIsShowBatch(@Param("productIds") Long[] productIds);
 
+    /**
+     * 校验处方药说明书查看权限
+     * @param param 请求参数
+     * @return int
+     * **/
+    int instructionsViewable(@Param("param") FsStoreCartCountParam param);
+
 }

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

@@ -111,6 +111,13 @@ public interface FsStoreScrmMapper
      * **/
     List<String> queryValidStoreAgreementExpiryTips();
 
+    /**
+     * 获取店铺资质提示数据
+     * @return list
+     * **/
+    List<String>  queryValidStoreQualifications();
+
+
     /**
      * 获取商铺信息
      * @param storeId
@@ -175,4 +182,10 @@ public interface FsStoreScrmMapper
      * 查询商家下的店铺数量
      */
     Integer countStoresByMerchant(@Param("merchantId") String merchantId);
+
+    /**
+     * 获取店铺资质即将到期提示数据
+     * @return list
+     * **/
+    List<String>  queryValidStoreLastInfo(@Param("account") String account );
 }

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

@@ -7,6 +7,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.List;
 
 /**
@@ -267,4 +268,29 @@ public class FsStoreProductAddEditParam implements Serializable
         // 指定企业
     private String companyIds;
 
+    /**
+     * 说明书
+     * **/
+    private String instructionManual;
+
+    /**
+     * 审核说明(0 首营 1非首映)
+     */
+    private String reviewAudit;
+
+    /**
+     * 首营弹资质上传证明
+     */
+    private String qualificationCertificate;
+
+    /**
+     * 首营弹资质开始时间
+     */
+    private String qualificationCertificateStart;
+    /**
+     * 首营弹资质结束时间
+     */
+    private  String  qualificationCertificateEnd;
+
+
 }

+ 10 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java

@@ -11,6 +11,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.param.FsStoreCartCountParam;
 import com.fs.hisStore.vo.*;
 import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.domain.FsStoreProductScrm;
@@ -146,4 +147,13 @@ public interface IFsStoreProductScrmService
     void updateFsStoreProductIsShowBatch(Long[] productIds);
 
     List<FsStoreProductScrm> getStoreProductInProductIds(List<Long> storeProductIds);
+
+    /**
+     * 校验处方药说明书查看权限
+     * @param param 请求参数
+     * @return R
+     * **/
+    R instructionsViewable(FsStoreCartCountParam param);
+
+
 }

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

@@ -53,6 +53,10 @@ public interface IFsStoreScrmService
      */
     public int updateFsStore(FsStoreScrm fsStore);
 
+    /**
+     * 获取店铺资质提示数据
+     */
+    List<String> queryValidStoreQualifications();
     /**
      * 批量删除店铺管理
      *
@@ -118,4 +122,11 @@ public interface IFsStoreScrmService
      * 商铺资质定过期,状态定时任务
      * **/
     public void merchantQualificationExpiryCheck();
+
+    /**
+     * 获取店铺资质即将到期提示数据
+     * @param account
+     * @return
+     */
+    List<String> queryValidStoreLastInfo(String account);
 }

+ 137 - 124
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -31,6 +31,7 @@ import com.fs.his.vo.OptionsVO;
 import com.fs.hisStore.config.MedicalMallConfig;
 import com.fs.hisStore.domain.*;
 import com.fs.hisStore.mapper.*;
+import com.fs.hisStore.param.FsStoreCartCountParam;
 import com.fs.hisStore.utils.StoreAuditLogUtil;
 import com.fs.statis.dto.ModifyMoreDTO;
 import com.fs.hisStore.dto.ProductArrtDTO;
@@ -61,8 +62,7 @@ import org.springframework.transaction.annotation.Transactional;
 @Service
 @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 @Slf4j
-public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
-{
+public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService {
     @Autowired
     private FsStoreProductScrmMapper fsStoreProductMapper;
     @Autowired
@@ -110,8 +110,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      * @return 商品
      */
     @Override
-    public FsStoreProductScrm selectFsStoreProductById(Long productId)
-    {
+    public FsStoreProductScrm selectFsStoreProductById(Long productId) {
         return fsStoreProductMapper.selectFsStoreProductById(productId);
     }
 
@@ -122,8 +121,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      * @return 商品
      */
     @Override
-    public List<FsStoreProductScrm> selectFsStoreProductList(FsStoreProductScrm fsStoreProduct)
-    {
+    public List<FsStoreProductScrm> selectFsStoreProductList(FsStoreProductScrm fsStoreProduct) {
         return fsStoreProductMapper.selectFsStoreProductList(fsStoreProduct);
     }
 
@@ -134,8 +132,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      * @return 结果
      */
     @Override
-    public int insertFsStoreProduct(FsStoreProductScrm fsStoreProduct)
-    {
+    public int insertFsStoreProduct(FsStoreProductScrm fsStoreProduct) {
         fsStoreProduct.setCreateTime(DateUtils.getNowDate());
         fsStoreProductMapper.insertFsStoreProduct(fsStoreProduct);
         storeAuditLogUtil.addOperLog(fsStoreProduct.getProductId());
@@ -149,8 +146,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      * @return 结果
      */
     @Override
-    public int updateFsStoreProduct(FsStoreProductScrm fsStoreProduct)
-    {
+    public int updateFsStoreProduct(FsStoreProductScrm fsStoreProduct) {
         fsStoreProduct.setUpdateTime(DateUtils.getNowDate());
         storeAuditLogUtil.addOperLog(fsStoreProduct.getProductId());
         FsStoreProductScrm oldFsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(fsStoreProduct.getProductId());
@@ -161,7 +157,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     Map<String, Object> diff = getDiff(oldFsStoreProduct, fsStoreProduct);
                     Set<String> diff_columns = diff.keySet();
                     JSONArray productColumns = configUtil.generateConfigByKey("medicalMall.func.switch").getJSONArray("productColumns");
-                    if(com.fs.common.utils.StringUtils.isNotEmpty(productColumns)){
+                    if (com.fs.common.utils.StringUtils.isNotEmpty(productColumns)) {
                         //判断diff_columns是否在productColumns中,不是则将isAudit设置为0
                         for (String column : diff_columns) {
                             if (!productColumns.contains(column)) {
@@ -169,7 +165,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                                 break;
                             }
                         }
-                    }else{
+                    } else {
                         fsStoreProduct.setIsAudit("0");
                     }
                 }
@@ -216,8 +212,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      * @return 结果
      */
     @Override
-    public int deleteFsStoreProductByIds(Long[] productIds)
-    {
+    public int deleteFsStoreProductByIds(Long[] productIds) {
         storeAuditLogUtil.addBatchAuditArray(productIds, "", "");
         return fsStoreProductMapper.deleteFsStoreProductByIds(productIds);
     }
@@ -229,8 +224,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      * @return 结果
      */
     @Override
-    public int deleteFsStoreProductById(Long productId)
-    {
+    public int deleteFsStoreProductById(Long productId) {
         return fsStoreProductMapper.deleteFsStoreProductById(productId);
     }
 
@@ -239,20 +233,20 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         List<FsStoreProductListVO> fsStoreProductListVOS = fsStoreProductMapper.selectFsStoreProductListVO(fsStoreProduct);
 
         for (FsStoreProductListVO item : fsStoreProductListVOS) {
-            if(StringUtils.isNotBlank(item.getCompanyIds())){
+            if (StringUtils.isNotBlank(item.getCompanyIds())) {
                 List<String> companyNameList = new ArrayList<>();
                 String[] split = item.getCompanyIds().split(",");
 
                 for (String companyId : split) {
-                    if(StringUtils.isNotBlank(companyId)) {
+                    if (StringUtils.isNotBlank(companyId)) {
                         String companyName = companyCacheService.selectCompanyNameById(Long.valueOf(companyId));
                         companyNameList.add(companyName);
                     }
                 }
-                item.setCompanyName(String.join(",",companyNameList));
+                item.setCompanyName(String.join(",", companyNameList));
             }
             //店铺名称
-            if(StringUtils.isNotEmpty(item.getStoreId()))
+            if (StringUtils.isNotEmpty(item.getStoreId()))
                 item.setStoreName(fsStoreScrmService.selectFsStoreByStoreId(Long.parseLong(item.getStoreId())).getStoreName());
         }
 
@@ -264,7 +258,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         List<FsStoreProductListVO> fsStoreProductListVOS = fsStoreProductMapper.selectFsStoreProductBarCodeListVO(fsStoreProduct);
 
         for (FsStoreProductListVO item : fsStoreProductListVOS) {
-            if(StringUtils.isNotBlank(item.getCompanyIds())){
+            if (StringUtils.isNotBlank(item.getCompanyIds())) {
                 List<String> companyNameList = new ArrayList<>();
                 String[] split = item.getCompanyIds().split(",");
 
@@ -272,14 +266,14 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     String companyName = companyCacheService.selectCompanyNameById(Long.valueOf(companyId));
                     companyNameList.add(companyName);
                 }
-                item.setCompanyName(String.join(",",companyNameList));
+                item.setCompanyName(String.join(",", companyNameList));
             }
         }
         return fsStoreProductListVOS;
     }
 
     @Override
-    public Map<String, Object> getFormatAttr(Long productId, String jsonStr,Long[] stores) {
+    public Map<String, Object> getFormatAttr(Long productId, String jsonStr, Long[] stores) {
         JSONObject jsonObject = JSON.parseObject(jsonStr);
         Map<String, Object> resultMap = new LinkedHashMap<>(3);
         if (jsonObject == null || jsonObject.get("attrs") == null || jsonObject.getJSONArray("attrs").isEmpty()) {
@@ -345,13 +339,13 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             valueMap.put("brokerageThree", 0);
             valueMap.put("integral", 0);
             if (productId > 0) {
-                FsStoreProductAttrValueScrm attrValueMap=new FsStoreProductAttrValueScrm();
+                FsStoreProductAttrValueScrm attrValueMap = new FsStoreProductAttrValueScrm();
                 attrValueMap.setProductId(productId);
                 attrValueMap.setSku(sku);
                 List<FsStoreProductAttrValueScrm> values = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueList(attrValueMap);
-                if (values != null&&values.size()==1) {
-                    valueMap.put("id",values.get(0).getId());
-                    valueMap.put("sku",values.get(0).getSku());
+                if (values != null && values.size() == 1) {
+                    valueMap.put("id", values.get(0).getId());
+                    valueMap.put("sku", values.get(0).getSku());
                     valueMap.put("image", values.get(0).getImage());
                     valueMap.put("price", values.get(0).getPrice());
                     valueMap.put("cost", values.get(0).getCost());
@@ -380,9 +374,9 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Override
     @Transactional
     public R addOrEdit(FsStoreProductAddEditParam param) {
-        ProductAttrCountDto countDto=computedProductCount(param.getValues());
-        FsStoreProductScrm product=new FsStoreProductScrm();
-        BeanUtils.copyProperties(param,product);
+        ProductAttrCountDto countDto = computedProductCount(param.getValues());
+        FsStoreProductScrm product = new FsStoreProductScrm();
+        BeanUtils.copyProperties(param, product);
         product.setPrice(countDto.getMinPrice());
         product.setOtPrice(countDto.getMinOtPrice());
         product.setCost(countDto.getMinCost());
@@ -393,28 +387,43 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         Long storeId = param.getStoreId();
         product.setStoreId(storeId);
         product.setIsDrug(param.getIsDrug().toString());
+        product.setInstructionManual(param.getInstructionManual());
+        product.setReviewAudit(param.getReviewAudit());
+        product.setQualificationCertificate(param.getQualificationCertificate());
+        if (param.getQualificationCertificateStart() != null) {
+            product.setQualificationCertificateStart(LocalDate.parse(param.getQualificationCertificateStart()));
+        }
+        if (param.getQualificationCertificateEnd() != null) {
+            product.setQualificationCertificateEnd(LocalDate.parse(param.getQualificationCertificateEnd()));
+        }
+        //获取商品编码
+        if (!param.getValues().isEmpty()) {
+            if (param.getValues().get(0).getBarCode() != null) {
+                product.setBarCode(param.getValues().get(0).getBarCode());
+            }
+        }
         //校验店铺资质信息
         //获取店铺
         FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId());
-        if(store == null || 1 != store.getStatus()){
+        if (store == null || 1 != store.getStatus()) {
             return R.error("店铺不存在或未启用");
-        }else{
+        } else {
             //验证资质
-            switch (product.getProductType()){
+            switch (product.getProductType()) {
                 case 1://非处方
                     break;
                 case 2://处方
-                    if(StringUtils.isEmpty(store.getDrugLicense()) || "".equals(store.getDrugLicense()) ||  LocalDate.now().isAfter(store.getDrugLicenseExpiryEnd())){
+                    if (StringUtils.isEmpty(store.getDrugLicense()) || "".equals(store.getDrugLicense()) || LocalDate.now().isAfter(store.getDrugLicenseExpiryEnd())) {
                         return R.error("店铺药品资质为空或已过期,请完善后再添加");
                     }
                     break;
                 case 3://食品
-                    if(StringUtils.isEmpty(store.getFoodLicense()) || "".equals(store.getFoodLicense()) ||  LocalDate.now().isAfter(store.getFoodLicenseExpiryEnd())){
+                    if (StringUtils.isEmpty(store.getFoodLicense()) || "".equals(store.getFoodLicense()) || LocalDate.now().isAfter(store.getFoodLicenseExpiryEnd())) {
                         return R.error("店铺食品资质为空或已过期,请完善后再添加");
                     }
                     break;
                 case 4://器械
-                    if(StringUtils.isEmpty(store.getMedicalDevice3()) || "".equals(store.getMedicalDevice3()) ||  LocalDate.now().isAfter(store.getMedicalDevice3ExpiryEnd())){
+                    if (StringUtils.isEmpty(store.getMedicalDevice3()) || "".equals(store.getMedicalDevice3()) || LocalDate.now().isAfter(store.getMedicalDevice3ExpiryEnd())) {
                         return R.error("店铺器械资质为空或已过期,请完善后再添加");
                     }
                     break;
@@ -423,11 +432,11 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             }
         }
 
-        if("纯正堂".equals(cloudHostProper.getCompanyName())){
+        if ("纯正堂".equals(cloudHostProper.getCompanyName())) {
             product.setIsAudit("1");
         }
 
-        if(param.getProductId() != null && param.getProductId() > 0){
+        if (param.getProductId() != null && param.getProductId() > 0) {
             FsStoreProductScrm oldFsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(product.getProductId());
             Boolean isAudit = configUtil.generateConfigByKey("medicalMall.func.switch").getBoolean("isAudit");
             try {
@@ -436,7 +445,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                         Map<String, Object> diff = getDiff(oldFsStoreProduct, product);
                         Set<String> diff_columns = diff.keySet();
                         JSONArray productColumns = configUtil.generateConfigByKey("medicalMall.func.switch").getJSONArray("productColumns");
-                        if(com.fs.common.utils.StringUtils.isNotEmpty(productColumns)){
+                        if (com.fs.common.utils.StringUtils.isNotEmpty(productColumns)) {
                             //判断diff_columns是否在productColumns中,不是则将isAudit设置为0
                             for (String column : diff_columns) {
                                 if (!productColumns.contains(column)) {
@@ -444,7 +453,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                                     break;
                                 }
                             }
-                        }else{
+                        } else {
                             product.setIsAudit("0");
                         }
                     }
@@ -458,15 +467,14 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                         .value("规格")
                         .detail(ListUtil.toList("默认"))
                         .build();
-                List<ProductArrtDTO> items=new ArrayList<>();
+                List<ProductArrtDTO> items = new ArrayList<>();
                 items.add(fromatDetailDto);
                 param.getValues().get(0).setSku("默认");
-                addProductAttr(product.getProductId(),items,param.getValues(),storeId);
+                addProductAttr(product.getProductId(), items, param.getValues(), storeId);
             } else {
-                addProductAttr(product.getProductId(),param.getItems(),param.getValues(),storeId);
+                addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
             }
-        }
-        else{
+        } else {
             fsStoreProductMapper.insertFsStoreProduct(product);
         }
         storeAuditLogUtil.addOperLog(product.getProductId());
@@ -475,52 +483,52 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     .value("规格")
                     .detail(ListUtil.toList("默认"))
                     .build();
-            List<ProductArrtDTO> items=new ArrayList<>();
+            List<ProductArrtDTO> items = new ArrayList<>();
             items.add(fromatDetailDto);
             param.getValues().get(0).setSku("默认");
-            addProductAttr(product.getProductId(),items,param.getValues(),storeId);
+            addProductAttr(product.getProductId(), items, param.getValues(), storeId);
         } else {
-            addProductAttr(product.getProductId(),param.getItems(),param.getValues(),storeId);
+            addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
         }
         return R.ok();
     }
 
 
-    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
         fsStoreProductAttrMapper.clear(productId);
         //清空values
         //查出商品属性所有ID;
-        List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId);
+        List<FsStoreProductAttrValueScrm> attrValues = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId);
         fsStoreProductAttrValueMapper.deleteFsStoreProductAttrValueByProductId(productId);
         //写入attr
-        for(ProductArrtDTO vo:items){
-            FsStoreProductAttrScrm attr=new FsStoreProductAttrScrm();
+        for (ProductArrtDTO vo : items) {
+            FsStoreProductAttrScrm attr = new FsStoreProductAttrScrm();
             attr.setProductId(productId);
             attr.setAttrName(vo.getValue());
             attr.setAttrValues(StringUtils.join(vo.getDetail(), ","));
             fsStoreProductAttrMapper.insertFsStoreProductAttr(attr);
         }
-        Map<String,Object> map = new LinkedHashMap<>();
-        map.put("attr",items);
+        Map<String, Object> map = new LinkedHashMap<>();
+        map.put("attr", items);
         // map.put("value",values);
 
-        for(FsStoreProductAttrValueScrm val: values){
+        for (FsStoreProductAttrValueScrm val : values) {
             //更新套餐商品属性ID  获取套餐
-            Long id=val.getId();
-            if(val.getDetail()!=null){
+            Long id = val.getId();
+            if (val.getDetail() != null) {
                 List<String> stringList = new ArrayList<>(val.getDetail().values());
                 Collections.sort(stringList);
-                val.setSku(StrUtil.join(",",stringList));
+                val.setSku(StrUtil.join(",", stringList));
             }
             val.setProductId(productId);
             val.setStoreId(storeId);
             fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val);
-            if(attrValues!=null&&attrValues.size()>0){
-                for(FsStoreProductAttrValueScrm attrValue:attrValues){
-                    if(attrValue.getId().equals(id)){
-                        fsStoreProductGroupMapper.updateProducts(attrValue.getId(),val.getId());
-                        fsStoreProductPackageMapper.updateProducts(attrValue.getId(),val.getId());
+            if (attrValues != null && attrValues.size() > 0) {
+                for (FsStoreProductAttrValueScrm attrValue : attrValues) {
+                    if (attrValue.getId().equals(id)) {
+                        fsStoreProductGroupMapper.updateProducts(attrValue.getId(), val.getId());
+                        fsStoreProductPackageMapper.updateProducts(attrValue.getId(), val.getId());
                     }
                 }
             }
@@ -700,9 +708,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     }
 
 
-
     private ProductAttrCountDto computedProductCount(List<FsStoreProductAttrValueScrm> values) {
-        BigDecimal val=new BigDecimal(0);
+        BigDecimal val = new BigDecimal(0);
         //取最小价格
         BigDecimal minPrice = values
                 .stream()
@@ -755,35 +762,34 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     }
 
 
-
     @Override
     public List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(FsStoreProductQueryParam param) {
         SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch");
         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class);
         boolean stores = medicalMallConfig != null && medicalMallConfig.isStores();
-        param.setIsStores(stores?1:0);
+        param.setIsStores(stores ? 1 : 0);
         return fsStoreProductMapper.selectFsStoreProductListQuery(param);
     }
 
     @Override
-    public FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId,String storeId) {
+    public FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId, String storeId) {
         SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch");
         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class);
-        return fsStoreProductMapper.selectFsStoreProductByIdQuery(productId,storeId,medicalMallConfig);
+        return fsStoreProductMapper.selectFsStoreProductByIdQuery(productId, storeId, medicalMallConfig);
     }
 
     @Override
     public void decProductStock(Long productId, Long productAttrValueId, Integer cartNum) {
         //处理属性sku
-        fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId,cartNum);
-        fsStoreProductMapper.decProductAttrStock(productId,cartNum);
+        fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId, cartNum);
+        fsStoreProductMapper.decProductAttrStock(productId, cartNum);
 
     }
 
     @Override
     public void incProductStock(Long num, Long productId, Long productAttrValueId) {
         //处理属性sku
-        if (productAttrValueId!=null) {
+        if (productAttrValueId != null) {
             attrValueService.incProductAttrStock(num, productId, productAttrValueId);
         }
         //先处理商品库存
@@ -815,7 +821,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     public List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count) {
         SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch");
         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class);
-        return fsStoreProductMapper.selectFsStoreProductGoodQuery(count,medicalMallConfig);
+        return fsStoreProductMapper.selectFsStoreProductGoodQuery(count, medicalMallConfig);
     }
 
     @Override
@@ -839,7 +845,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 
     @Override
     public Long selectFsStoreProductCount(int type, Long companyId) {
-        return fsStoreProductMapper.selectFsStoreProductCompanyCount(type,companyId);
+        return fsStoreProductMapper.selectFsStoreProductCompanyCount(type, companyId);
     }
 
     @Override
@@ -861,19 +867,17 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Override
     public String importStoreProduct(List<FsStoreProductExportVO> list, boolean updateSupport) {
         storeAuditLogUtil.generateOperId();
-        if (com.fs.common.utils.StringUtils.isNull(list) || list.size() == 0)
-        {
+        if (com.fs.common.utils.StringUtils.isNull(list) || list.size() == 0) {
             throw new CustomException("导入商品数据不能为空!");
         }
         int successNum = 0;
         int failureNum = 0;
         StringBuilder successMsg = new StringBuilder();
         StringBuilder failureMsg = new StringBuilder();
-        for (FsStoreProductExportVO productVO : list){
-            try
-            {
+        for (FsStoreProductExportVO productVO : list) {
+            try {
                 FsStoreProductScrm product = BeanCopyUtils.copy(productVO, FsStoreProductScrm.class);
-                if (product.getBarCode()==null || product.getBarCode()==""){
+                if (product.getBarCode() == null || product.getBarCode() == "") {
                     throw new CustomException("商品编号为空");
                 }
                 this.insertFsStoreProduct(product);
@@ -881,36 +885,36 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                         .value("规格")
                         .detail(ListUtil.toList("默认"))
                         .build();
-                List<ProductArrtDTO> items=new ArrayList<>();
+                List<ProductArrtDTO> items = new ArrayList<>();
                 items.add(formatDetailDto);
                 FsStoreProductAttrValueScrm p = new FsStoreProductAttrValueScrm();
                 p.setProductId(product.getProductId());
                 p.setSku("默认");
                 p.setStock(product.getStock().intValue());
-                if (product.getStock()==null){
+                if (product.getStock() == null) {
                     p.setStock(0);
                 }
                 p.setSales(product.getSales().intValue());
-                if (product.getSales()==null){
+                if (product.getSales() == null) {
                     p.setStock(0);
                 }
                 p.setPrice(product.getPrice());
-                if (product.getPrice()==null){
+                if (product.getPrice() == null) {
                     p.setPrice(new BigDecimal(0));
                 }
                 p.setImage(product.getImage());
                 p.setCost(product.getCost());
-                if (product.getCost()==null){
+                if (product.getCost() == null) {
                     p.setCost(new BigDecimal(0));
                 }
                 p.setBarCode(product.getBarCode());
                 p.setGroupBarCode(product.getBarCode());
                 p.setOtPrice(product.getOtPrice());
-                if (product.getOtPrice()==null){
+                if (product.getOtPrice() == null) {
                     p.setOtPrice(new BigDecimal(0));
                 }
                 p.setWeight(productVO.getWeight());
-                if (productVO.getWeight()==null){
+                if (productVO.getWeight() == null) {
                     p.setWeight(new BigDecimal(0));
                 }
 
@@ -929,23 +933,18 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                 fsStoreProductAttrMapper.insertFsStoreProductAttr(attr);
                 successNum++;
                 successMsg.append("<br/>" + successNum + "、商品 " + product.getProductName() + " 导入成功");
-            }
-            catch (Exception e)
-            {
+            } catch (Exception e) {
 
                 failureNum++;
-                String msg = "<br/>" + failureNum + "、商品 " + productVO.getProductName()  + " 导入失败:";
+                String msg = "<br/>" + failureNum + "、商品 " + productVO.getProductName() + " 导入失败:";
                 failureMsg.append(msg + e.getMessage());
             }
 
         }
-        if (failureNum > 0)
-        {
+        if (failureNum > 0) {
             failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
             throw new CustomException(failureMsg.toString());
-        }
-        else
-        {
+        } else {
             successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
         }
         return successMsg.toString();
@@ -953,7 +952,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 
     @Override
     public void batchModify(ModifyMoreDTO modifyMoreDTO) {
-        storeAuditLogUtil.addBatchAuditList(modifyMoreDTO.getProductId(),"",null);
+        storeAuditLogUtil.addBatchAuditList(modifyMoreDTO.getProductId(), "", null);
         fsStoreProductMapper.batchModify(modifyMoreDTO);
     }
 
@@ -973,7 +972,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         StringBuilder failureMsg = new StringBuilder();
 
         //存储商品Id
-        List<Long> jstProductIds=new LinkedList<>();
+        List<Long> jstProductIds = new LinkedList<>();
         for (FsStoreProductExcelVO productVO : productList) {
             try {
 
@@ -1067,17 +1066,17 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                 Integer erpOpen = sysConfig.getErpOpen();
                 if (erpOpen == null || erpOpen == 0) {
                     //不作操作
-                } else{
+                } else {
                     //判断erp类型
                     Integer erpType = sysConfig.getErpType();
                     if (erpType == null) {
                         //不作操作
-                    }else if (erpType == 3) {
+                    } else if (erpType == 3) {
                         ErpGoods params = new ErpGoods();
                         params.setStoreProductId(product.getProductId());
                         //瀚智OMS 维护添加商品
                         hzOMSErpGoodsService.addGoodsScrm(params);
-                    }else if(erpType == 5){
+                    } else if (erpType == 5) {
                         jstProductIds.add(product.getProductId());
                     }
                 }
@@ -1090,7 +1089,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         }
 
         //验证聚水潭商品Id
-        if(!jstProductIds.isEmpty()){
+        if (!jstProductIds.isEmpty()) {
             //同步聚水潭商品
             ErpGoods params = new ErpGoods();
             params.setProductIdList(jstProductIds);
@@ -1133,7 +1132,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     @Transactional
     public void batchAudit(ProductAuditDTO auditDTO) {
         fsStoreProductMapper.batchAudit(auditDTO);
-        storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(),auditDTO.getReason(),auditDTO.getAttachImage());
+        storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(), auditDTO.getReason(), auditDTO.getAttachImage());
     }
 
     @Override
@@ -1142,9 +1141,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     }
 
     @Override
-    public List<FsStoreProductActivityListVO> selectFsStoreProductByIdsAudit(String productIds) {SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch");
+    public List<FsStoreProductActivityListVO> selectFsStoreProductByIdsAudit(String productIds) {
+        SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch");
         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class);
-        return fsStoreProductMapper.selectFsStoreProductByIdsAudit(productIds,medicalMallConfig);
+        return fsStoreProductMapper.selectFsStoreProductByIdsAudit(productIds, medicalMallConfig);
     }
 
     @Override
@@ -1152,10 +1152,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     public R bulkCopyFsStoreProductByIds(Long[] productIds) {
         storeAuditLogUtil.addBatchAuditArray(productIds, "", "");
         List<FsStoreProductScrm> list = fsStoreProductMapper.bulkCopyFsStoreProductByIds(productIds);
-        if(list != null && !list.isEmpty()){
+        if (list != null && !list.isEmpty()) {
             for (FsStoreProductScrm product : list) {
                 List<FsStoreProductAttrValueScrm> param = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(product.getProductId());
-                if(!("益善缘".equals(cloudHostProper.getCompanyName()))) {
+                if (!("益善缘".equals(cloudHostProper.getCompanyName()))) {
                     //获取店铺
                     FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId());
                     if (store == null || 1 != store.getStatus()) {
@@ -1196,10 +1196,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                             .value("规格")
                             .detail(ListUtil.toList("默认"))
                             .build();
-                    List<ProductArrtDTO> items=new ArrayList<>();
+                    List<ProductArrtDTO> items = new ArrayList<>();
                     items.add(fromatDetailDto);
                     param.get(0).setSku("默认");
-                    addProductAttr(product.getProductId(),items,param,product.getStoreId());
+                    addProductAttr(product.getProductId(), items, param, product.getStoreId());
                 } else {
                     List<FsStoreProductAttrScrm> items = fsStoreProductAttrMapper.selectFsStoreProductAttrByProductId(product.getProductId());
 
@@ -1207,33 +1207,33 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     fsStoreProductAttrMapper.clear(fsStoreProductId);
                     //清空values
                     //查出商品属性所有ID;
-                    List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(fsStoreProductId);
+                    List<FsStoreProductAttrValueScrm> attrValues = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(fsStoreProductId);
                     fsStoreProductAttrValueMapper.deleteFsStoreProductAttrValueByProductId(fsStoreProductId);
 
                     //写入attr
-                    for(FsStoreProductAttrScrm vo:items){
+                    for (FsStoreProductAttrScrm vo : items) {
                         vo.setProductId(fsStoreProductId);
                         fsStoreProductAttrMapper.insertFsStoreProductAttr(vo);
                     }
-                    Map<String,Object> map = new LinkedHashMap<>();
-                    map.put("attr",items);
+                    Map<String, Object> map = new LinkedHashMap<>();
+                    map.put("attr", items);
                     // map.put("value",values);
 
-                    for(FsStoreProductAttrValueScrm val: param){
+                    for (FsStoreProductAttrValueScrm val : param) {
                         //更新套餐商品属性ID  获取套餐
-                        Long id=val.getId();
-                        if(val.getDetail()!=null){
+                        Long id = val.getId();
+                        if (val.getDetail() != null) {
                             List<String> stringList = new ArrayList<>(val.getDetail().values());
                             Collections.sort(stringList);
-                            val.setSku(StrUtil.join(",",stringList));
+                            val.setSku(StrUtil.join(",", stringList));
                         }
                         val.setProductId(fsStoreProductId);
                         fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val);
-                        if(attrValues!=null && !attrValues.isEmpty()){
-                            for(FsStoreProductAttrValueScrm attrValue:attrValues){
-                                if(attrValue.getId().equals(id)){
-                                    fsStoreProductGroupMapper.updateProducts(attrValue.getId(),val.getId());
-                                    fsStoreProductPackageMapper.updateProducts(attrValue.getId(),val.getId());
+                        if (attrValues != null && !attrValues.isEmpty()) {
+                            for (FsStoreProductAttrValueScrm attrValue : attrValues) {
+                                if (attrValue.getId().equals(id)) {
+                                    fsStoreProductGroupMapper.updateProducts(attrValue.getId(), val.getId());
+                                    fsStoreProductPackageMapper.updateProducts(attrValue.getId(), val.getId());
                                 }
                             }
                         }
@@ -1250,14 +1250,27 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         return fsStoreProductMapper.getStoreProductInProductIds(productIds);
     }
 
+    @Override
+    public R instructionsViewable(FsStoreCartCountParam param) {
+        //判断商品是否存在
+        FsStoreProductScrm productScrm = fsStoreProductMapper.selectFsStoreProductById(param.getProductId());
+        if (productScrm == null || productScrm.getProductType() == null) {
+            return R.error("商品数据不存在,或类型异常!");
+        } else if (productScrm.getProductType() != 2) {
+            return R.ok().put("data", true);
+        }
+        return R.ok().put("data", fsStoreProductMapper.instructionsViewable(param) > 0);
+    }
+
     @Override
     public List<Map<String, String>> getStoreProductColumns() {
-        List<Map<String, String> > list = fsStoreProductMapper.getStoreProductColumns();
+        List<Map<String, String>> list = fsStoreProductMapper.getStoreProductColumns();
         List<Map<String, String>> result = new ArrayList<>();
         for (Map<String, String> column : list) {
             Map<String, String> camelCaseColumn = new HashMap<>();
             String columnName = column.get("colName");
-            String camelCaseName = com.fs.common.utils.StringUtils.toCamelCase(columnName);;
+            String camelCaseName = com.fs.common.utils.StringUtils.toCamelCase(columnName);
+            ;
             camelCaseColumn.put("colName", camelCaseName);
             camelCaseColumn.put("colComment", column.get("colComment"));
             result.add(camelCaseColumn);

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

@@ -119,7 +119,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
         //生成商家id
         String merchantId = generateMerchantId(fsStore.getBusinessCode());
         //生成店铺id
-        String sequence = generateStoreSequence(merchantId,fsStore.getBusinessCode());
+        String sequence = generateStoreSequence(merchantId, fsStore.getBusinessCode());
         fsStore.setMerchantId(merchantId);
         fsStore.setStoreSeq(sequence);
         fsStoreMapper.insertFsStore(fsStore);
@@ -152,7 +152,6 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
     }
 
 
-
     /**
      * 生成店铺序号:年月日 + 当天第几家店
      * 格式:202510180001
@@ -231,6 +230,11 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
         return fsStoreMapper.updateFsStore(fsStore);
     }
 
+    @Override
+    public List<String> queryValidStoreQualifications() {
+        return fsStoreMapper.queryValidStoreQualifications();
+    }
+
     public static Map<String, Object> getDiff(Object obj1, Object obj2) throws IllegalAccessException {
         Map<String, Object> diff = new HashMap<>();
         if (obj1 == null || obj2 == null || !obj1.getClass().equals(obj2.getClass())) {
@@ -457,6 +461,11 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
         log.info("定时任务店铺资质过期更新状态--------------------------end{}");
     }
 
+    @Override
+    public List<String> queryValidStoreLastInfo(String account) {
+        return fsStoreMapper.queryValidStoreLastInfo(account);
+    }
+
     /**
      * 获取两个对象的所有差异字段(基于旧对象的所有字段,以新对象字段值为准进行对比)
      * 只要新旧值不同就视为差异

+ 21 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListVO.java

@@ -119,4 +119,25 @@ public class FsStoreProductListVO  implements Serializable
     // 同步药品状态 推送状态 0推送中1成功2失
     private Byte pushStatus;
 
+    /**
+     * 审核说明(0 首营 1非首映)
+     */
+    private String reviewAudit;
+
+    /**
+     * 首营弹资质上传证明
+     */
+    private String qualificationCertificate;
+
+    /**
+     * 首营弹资质开始时间
+     */
+    private String qualificationCertificateStart;
+    /**
+     * 首营弹资质结束时间
+     */
+    private  String  qualificationCertificateEnd;
+
+
+
 }

+ 4 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductQueryVO.java

@@ -139,4 +139,8 @@ public class FsStoreProductQueryVO implements Serializable
 
     private String storeId;
 
+    /**
+     * 说明书
+     * **/
+    private String instructionManual;
 }

+ 9 - 1
fs-service/src/main/java/com/fs/hospital580/mapper/Hospital580PrescriptionScrmMapper.java

@@ -3,6 +3,9 @@ package com.fs.hospital580.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -14,5 +17,10 @@ import org.apache.ibatis.annotations.Mapper;
  */
 @Mapper
 public interface Hospital580PrescriptionScrmMapper extends BaseMapper<Hospital580PrescriptionScrmEntity> {
-
+    /**
+     * 获24小时的未支付处方信息审核的处方信息
+     * @param twentyFourHoursAgo 过期日期
+     * @return list
+     * **/
+    List<Hospital580PrescriptionScrmEntity> getExpiredPrescriptionInfo(@Param("twentyFourHoursAgo") String twentyFourHoursAgo);
 }

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

@@ -16,4 +16,9 @@ import javax.validation.constraints.NotNull;
 public interface Hospital580PrescriptionScrmService extends IService<Hospital580PrescriptionScrmEntity> {
 
     boolean isByStoreOrder(Long storeOrderId);
+
+    /**
+     * 处方失效定时任务
+     * **/
+    void prescriptionInvalid();
 }

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

@@ -2,10 +2,18 @@ package com.fs.hospital580.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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 org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -17,9 +25,35 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class Hospital580PrescriptionScrmServiceImpl extends ServiceImpl<Hospital580PrescriptionScrmMapper, Hospital580PrescriptionScrmEntity> implements Hospital580PrescriptionScrmService {
+    @Autowired
+    private FsStoreOrderScrmMapper fsStoreOrderScrmMapper;
 
     @Override
     public boolean isByStoreOrder(Long storeOrderId) {
         return this.count(new LambdaQueryWrapper<Hospital580PrescriptionScrmEntity>().eq(Hospital580PrescriptionScrmEntity::getStoreOrderId, storeOrderId)) > 0;
     }
+
+
+    @Override
+    @Transactional
+    public void prescriptionInvalid() {
+        // 计算24小时前的时间点
+        LocalDateTime twentyFourHoursAgo = LocalDateTime.now().minusHours(24);
+
+        // 定义格式化器(年月日时分秒)
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        // 格式化时间
+        String formattedTime = twentyFourHoursAgo.format(formatter);
+
+        //获取处方信息
+        List<Hospital580PrescriptionScrmEntity> PrescriptionList = baseMapper.getExpiredPrescriptionInfo(formattedTime);
+
+        if(!PrescriptionList.isEmpty()){
+            //获取订单信息
+           List<Long> orderIds=PrescriptionList.stream().map(Hospital580PrescriptionScrmEntity::getStoreOrderId).collect(Collectors.toList());
+           //订单状态取消,开放是订单状态为取消即订单失效
+            fsStoreOrderScrmMapper.batchUpdateOrderStatusById(orderIds,"-3");
+        }
+    }
 }

+ 8 - 5
fs-service/src/main/resources/application-config-dev-yjb.yml

@@ -76,11 +76,14 @@ watch:
   password3: v9xsKuqn_$d2y
 
 fs :
-  commonApi: http://172.16.0.16:8010
-  h5CommonApi: http://119.29.195.254:8010
-nuonuo:
-  key: 10924508
-  secret: A2EB20764D304D16
+  commonApi: http://127.0.0.1:7771
+  h5CommonApi: http://127.0.0.1
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb5
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 
 # 存储捅配置
 # 存储捅配置

+ 5 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -1929,4 +1929,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         AND sps.product_type = 2
         GROUP BY sos.id
     </select>
+
+    <update id="batchUpdateOrderStatusById">
+        update fs_store_order_scrm SET  status = #{status} WHERE
+                                                               id IN <foreach collection="orderIds" item="item" index="index" open="(" separator="," close=")">#{item}</foreach>
+    </update>
 </mapper>

+ 73 - 20
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="precautions" column="precautions"/>
         <result property="isAudit" column="is_audit"/>
         <result property="storeId" column="store_id"/>
+        <result property="instructionManual" column="instruction_manual"/>
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
@@ -78,7 +79,7 @@ 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
+               adverse_reactions,contraindications,precautions,is_audit,store_id,instruction_manual,review_audit,qualification_certificate,qualification_certificate_start,qualification_certificate_end
                from fs_store_product_scrm
     </sql>
 
@@ -255,6 +256,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="precautions != null and precautions != ''">precautions ,</if>
             <if test="isAudit != null and isAudit != ''">is_audit ,</if>
             <if test="storeId != null and storeId != ''">store_id ,</if>
+            <if test="instructionManual != null and instructionManual != ''">instruction_manual ,</if>
+            <if test="reviewAudit != null and reviewAudit != ''">review_audit ,</if>
+            <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>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
@@ -319,6 +325,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="precautions != null and precautions != ''">#{precautions} ,</if>
             <if test="isAudit != null and isAudit != ''">#{isAudit} ,</if>
             <if test="storeId != null and storeId != ''">#{storeId} ,</if>
+            <if test="instructionManual != null and instructionManual != ''">#{instructionManual} ,</if>
+            <if test="reviewAudit != null and reviewAudit != ''">#{reviewAudit} ,</if>
+            <if test="qualificationCertificate != null and qualificationCertificate != ''">#{qualificationCertificate} ,</if>
+            <if test="qualificationCertificateStart != null">#{qualificationCertificateStart} ,</if>
+            <if test="qualificationCertificateEnd != null ">#{qualificationCertificateEnd} ,</if>
          </trim>
     </insert>
 
@@ -387,7 +398,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="precautions != null and precautions != ''">precautions = #{precautions} ,</if>
             <if test="isAudit != null and isAudit != ''">is_audit = #{isAudit} ,</if>
             <if test="storeId != null and storeId != ''">store_id = #{storeId} ,</if>
-
+            <if test="instructionManual != null and instructionManual != ''">instruction_manual = #{instructionManual} ,</if>
+            <if test="reviewAudit != null and reviewAudit != ''">review_audit = #{reviewAudit} ,</if>
+            <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>
         </trim>
         where product_id = #{productId}
     </update>
@@ -431,24 +446,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <select id="selectFsStoreProductTuiListQuery" resultType="com.fs.hisStore.vo.FsStoreProductListQueryVO">
-        SELECT COUNT(*) OVER (PARTITION BY fsp.product_name) AS storeCount,p1.storeIds,fsp.*
-        FROM fs_store_product_scrm fsp
-        left join (select GROUP_CONCAT(distinct fsp1.store_id SEPARATOR ',' ) AS storeIds,fsp1.product_name
-        from  fs_store_product_scrm fsp1 group by fsp1.product_name) p1 on p1.product_name = fsp.product_name
-        <if test='config.isStores == "1" '>
-            inner join fs_store_scrm fs on fs.store_id = fsp.store_id
-        </if>
-        <if test='config.isAudit == "1" '>
-        and fs.is_audit = '1'
-        </if>
-        where fsp.is_del=0 and fsp.is_show=1 and fsp.is_good=1
-        <if test='config.isAudit == "1" '>
-        and fsp.is_audit = '1'
-        </if>
-        <if test='config.isStores == "1" '>
-            AND fs.status = '1'
-        </if>
-        and fsp.is_best=1 and fsp.is_display=1 order by fsp.sort desc,fsp.product_id desc
+            SELECT
+            t_all.storeCountAll AS storeCount,
+            t_all.storeIdsAll AS storeIds,
+            fsp.*
+            FROM fs_store_product_scrm fsp
+            LEFT JOIN (
+            SELECT
+            product_name,
+            COUNT(DISTINCT store_id) AS storeCountAll,
+            GROUP_CONCAT(DISTINCT store_id SEPARATOR ',') AS storeIdsAll
+            FROM fs_store_product_scrm
+            WHERE is_del=0 AND is_show=1
+            <if test='config.isStores == "1" '>
+                AND store_id IN (SELECT store_id FROM fs_store_scrm WHERE status = '1')
+            </if>
+            <if test='config.isAudit == "1" '>
+                AND is_audit = '1'
+            </if>
+            GROUP BY product_name
+            ) t_all ON t_all.product_name = fsp.product_name
+
+            <if test='config.isStores == "1" '>
+                INNER JOIN fs_store_scrm fs ON fs.store_id = fsp.store_id
+            </if>
+
+            WHERE
+            fsp.is_del = 0
+            AND fsp.is_show = 1
+            AND fsp.is_good = 1
+            AND fsp.is_best = 1
+            AND fsp.is_display = 1
+            <if test='config.isAudit == "1" '>
+                AND fsp.is_audit = '1'
+            </if>
+            <if test='config.isStores == "1" '>
+                AND fs.status = '1'
+            </if>
+            GROUP BY fsp.product_name
+            ORDER BY fsp.sort DESC, fsp.product_id DESC
     </select>
     <select id="bulkCopyFsStoreProductByIds" resultMap="FsStoreProductResult">
         <include refid="selectFsStoreProductVo"/>
@@ -546,4 +582,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         #{item}
     </foreach>
     </select>
+
+    <select id="instructionsViewable" resultType="int">
+        SELECT
+            IFNULL(COUNT(*), 0)
+        FROM
+            fs_store_product_scrm p
+                INNER JOIN fs_store_order_item_scrm ois ON p.product_id = ois.product_id
+                INNER JOIN fs_store_order_scrm o ON ois.order_id = o.id
+                INNER JOIN fs_store_hospital580_prescription_scrm ps ON o.id = ps.store_order_id
+        WHERE
+            o.`status` IN (0,1,2,3)
+           AND p.product_id = #{param.productId}
+           AND ps.audit_status = 2
+	       AND ps.user_id = #{param.userId}
+           AND ps.pid IS NOT NULL
+        GROUP BY p.product_id
+    </select>
 </mapper>

+ 75 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -187,6 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherSpecialQualificationCode !=null ">other_special_qualification_code , </if>
             <if test="qualityAssuranceAgreementCode !=null ">quality_assurance_agreement_code , </if>
             <if test="settlementAgreementCode !=null ">settlement_agreement_code , </if>
+            <if test="isMedicalDevice1ExpiryPermanent !=null ">is_medical_device1Expiry_permanent , </if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="cityIds != null">#{cityIds},</if>
@@ -264,6 +265,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherSpecialQualificationCode !=null ">#{otherSpecialQualificationCode} , </if>
             <if test="qualityAssuranceAgreementCode !=null ">#{qualityAssuranceAgreementCode} , </if>
             <if test="settlementAgreementCode !=null ">#{settlementAgreementCode} , </if>
+            <if test="isMedicalDevice1ExpiryPermanent !=null ">#{isMedicalDevice1ExpiryPermanent} , </if>
         </trim>
     </insert>
 
@@ -343,6 +345,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherSpecialQualificationCode !=null ">other_special_qualification_code=#{otherSpecialQualificationCode} , </if>
             <if test="qualityAssuranceAgreementCode !=null ">quality_assurance_agreement_code=#{qualityAssuranceAgreementCode} , </if>
             <if test="settlementAgreementCode !=null ">settlement_agreement_code=#{settlementAgreementCode} , </if>
+            <if test="isMedicalDevice1ExpiryPermanent !=null ">is_medical_device1Expiry_permanent=#{isMedicalDevice1ExpiryPermanent} , </if>
         </trim>
         where store_id = #{storeId}
     </update>
@@ -494,4 +497,76 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </foreach>
         GROUP BY ss.store_id
     </select>
+    <select id="countNewMerchantsByDate" resultType="java.lang.Long">
+        SELECT COUNT(DISTINCT business_code) FROM fs_store_scrm
+        WHERE merchant_id LIKE CONCAT(#{datePrefix}, '%')
+          AND business_code IS NOT NULL
+          AND business_code != ''
+    </select>
+    <select id="countStoresByMerchant" resultType="java.lang.Integer">
+        SELECT COUNT(*) FROM fs_store_scrm
+        WHERE merchant_id = #{merchantId}
+    </select>
+    <select id="queryValidStoreQualifications" resultType="java.lang.String">
+        SELECT
+        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 '营业执照已过期,需要商家更新;' 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 (
+        (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 != '';
+    </select>
+    <select id="queryValidStoreLastInfo" resultType="java.lang.String">
+        SELECT
+        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 CONCAT('营业执照已于', business_license_expire_end, '到期;') 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 CONCAT('药品经营许可证已于', drug_license_expiry_end, '到期;') 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 CONCAT('一类器械生产备案已于', medical_device1_expiry_end, '到期;') ELSE '' END,
+        CASE WHEN medicalDevice2 IS NOT NULL AND medical_device2_expiry_end IS NOT NULL AND medical_device2_expiry_end &lt; CURDATE() THEN CONCAT('二类医疗器械备案已于', medical_device2_expiry_end, '到期;') ELSE '' END,
+        CASE WHEN medicalDevice3 IS NOT NULL AND medical_device3_expiry_end IS NOT NULL AND medical_device3_expiry_end &lt;CURDATE() THEN CONCAT('三类器械经营许可证已于', medical_device3_expiry_end, '到期;') 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 CONCAT('食品经营许可证已于', food_license_expiry_end, '到期;') 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 CONCAT('医疗机构执业许可证已于', medical_license_expiry_end, '到期;') ELSE '' END
+        ) AS warning_message
+
+        FROM fs_store_scrm
+        WHERE STATUS = 1
+        AND account = #{account}
+        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())
+        )
+        HAVING warning_message != '';
+    </select>
 </mapper>

+ 10 - 0
fs-service/src/main/resources/mapper/hospital580/Hospital580PrescriptionScrmMapper.xml

@@ -53,4 +53,14 @@
         pre_id, user_id, service_type, is_examine, is_pregnant_woman, is_lactation, souce_from, user_family_name, user_family_id_card, user_family_age, user_family_gender, user_family_phone, relationship, user_family_addr, img_list, third_return_url, create_time, update_time, pid, hospital_name, store_id, store_name, diagnosis_id, doctor_sign_time, doctor_id, doctor_office, doctor_name, tags, status, memo, remarks, reason, dst_file_path, created_time, serial_no, audit_status, audit_time, audit_apothecary_name, jump_url, prescription_status, store_order_id
     </sql>
 
+    <select id="getExpiredPrescriptionInfo" resultType="com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity">
+        SELECT
+            ps.store_order_id
+        FROM
+            fs_store_hospital580_prescription_scrm ps
+                LEFT JOIN fs_store_order_scrm sos ON ps.store_order_id = sos.id
+        WHERE
+            ps.create_time &lt;= #{twentyFourHoursAgo}
+          AND sos.`status` = 0
+    </select>
 </mapper>

+ 55 - 34
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreScrmController.java

@@ -3,9 +3,15 @@ package com.fs.hisStore.controller.store;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.exception.base.BaseException;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.erp.utils.CommonUtils;
 import com.fs.framework.service.TokenServiceScrm;
 import com.fs.his.param.FsStoreAuditParam;
 import com.fs.hisStore.domain.FsStoreScrm;
@@ -14,10 +20,14 @@ import com.fs.hisStore.param.FsStoreScrmInfoParam;
 import com.fs.hisStore.service.IFsStoreScrmService;
 import com.fs.hisStore.utils.UserUtil;
 import com.fs.hisStore.vo.FsStoreDetailsScrmVo;
+import io.jsonwebtoken.lang.Collections;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Optional;
 
 /**
  * 店铺管理Controller
@@ -27,19 +37,18 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/store/store/store")
-public class FsStoreScrmController extends BaseController
-{
+public class FsStoreScrmController extends BaseController {
     @Autowired
     private IFsStoreScrmService fsStoreService;
     @Autowired
     private TokenServiceScrm tokenService;
+
     /**
      * 查询店铺管理列表
      */
 
     @GetMapping("/list")
-    public TableDataInfo list(FsStoreScrm fsStore)
-    {
+    public TableDataInfo list(FsStoreScrm fsStore) {
         startPage();
         List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
         return getDataTable(list);
@@ -49,10 +58,9 @@ public class FsStoreScrmController extends BaseController
      * 导出店铺管理列表
      */
 
-    @Log(title = "店铺管理", businessType = BusinessType.EXPORT,logParam = {"店铺","导出店铺信息"},isStoreLog = true)
+    @Log(title = "店铺管理", businessType = BusinessType.EXPORT, logParam = {"店铺", "导出店铺信息"}, isStoreLog = true)
     @GetMapping("/export")
-    public AjaxResult export(FsStoreScrm fsStore)
-    {
+    public AjaxResult export(FsStoreScrm fsStore) {
         List<FsStoreScrm> list = fsStoreService.selectFsStoreList(fsStore);
         ExcelUtil<FsStoreScrm> util = new ExcelUtil<FsStoreScrm>(FsStoreScrm.class);
         return util.exportExcel(list, "店铺管理数据");
@@ -62,8 +70,7 @@ public class FsStoreScrmController extends BaseController
      * 获取店铺管理详细信息
      */
     @GetMapping(value = "/{storeId}")
-    public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
-    {
+    public AjaxResult getInfo(@PathVariable("storeId") Long storeId) {
         return AjaxResult.success(fsStoreService.selectFsStoreByStoreId(storeId));
     }
 
@@ -71,10 +78,9 @@ public class FsStoreScrmController extends BaseController
      * 新增店铺管理
      */
 
-    @Log(title = "店铺管理", businessType = BusinessType.INSERT,logParam = {"店铺","新增店铺信息"},isStoreLog = true)
+    @Log(title = "店铺管理", businessType = BusinessType.INSERT, logParam = {"店铺", "新增店铺信息"}, isStoreLog = true)
     @PostMapping
-    public AjaxResult add(@RequestBody FsStoreScrm fsStore)
-    {
+    public AjaxResult add(@RequestBody FsStoreScrm fsStore) {
         return toAjax(fsStoreService.insertFsStore(fsStore).intValue());
     }
 
@@ -82,24 +88,22 @@ public class FsStoreScrmController extends BaseController
      * 修改店铺管理
      */
 
-    @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺信息"},isStoreLog = true)
+    @Log(title = "店铺管理", businessType = BusinessType.UPDATE, logParam = {"店铺", "修改店铺信息"}, isStoreLog = true)
     @PutMapping
-    public AjaxResult edit(@RequestBody FsStoreScrmInfoParam fsStore)
-    {
+    public AjaxResult edit(@RequestBody FsStoreScrmInfoParam fsStore) {
         return toAjax(fsStoreService.updateStoreInfo(fsStore));
     }
+
     /**
      * 修改店铺logo
      */
-    @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺LOGO信息"},isStoreLog = true)
+    @Log(title = "店铺管理", businessType = BusinessType.UPDATE, logParam = {"店铺", "修改店铺LOGO信息"}, isStoreLog = true)
     @PutMapping("/editLogo")
-    public AjaxResult editLogo(@RequestBody FsStoreScrm fsStore)
-    {
+    public AjaxResult editLogo(@RequestBody FsStoreScrm fsStore) {
         StoreLoginUserScrm loginUser = UserUtil.getLoginUser();
         fsStore.setStoreId(loginUser.getFsStore().getStoreId());
 
-        if (fsStoreService.updateFsStoreLogo(fsStore) > 0)
-        {
+        if (fsStoreService.updateFsStoreLogo(fsStore) > 0) {
             // 更新缓存用户信息
             FsStoreScrm fsStore1 = loginUser.getFsStore();
             fsStore1.setLogoUrl(fsStore.getLogoUrl());
@@ -114,14 +118,12 @@ public class FsStoreScrmController extends BaseController
     /**
      * 修改店铺基础信息
      */
-    @Log(title = "修改店铺基础信息", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺基础信息"},isStoreLog = true)
+    @Log(title = "修改店铺基础信息", businessType = BusinessType.UPDATE, logParam = {"店铺", "修改店铺基础信息"}, isStoreLog = true)
     @PutMapping("/editData")
-    public AjaxResult editData(@RequestBody FsStoreScrm fsStore)
-    {
+    public AjaxResult editData(@RequestBody FsStoreScrm fsStore) {
         StoreLoginUserScrm loginUser = UserUtil.getLoginUser();
         fsStore.setStoreId(loginUser.getFsStore().getStoreId());
-        if (fsStoreService.updateEditData(fsStore) > 0)
-        {
+        if (fsStoreService.updateEditData(fsStore) > 0) {
             // 更新缓存用户信息
             FsStoreScrm fsStore1 = loginUser.getFsStore();
             fsStore1.setPhone(fsStore.getPhone());
@@ -141,10 +143,9 @@ public class FsStoreScrmController extends BaseController
      * 删除店铺管理
      */
 
-    @Log(title = "店铺管理", businessType = BusinessType.DELETE,logParam = {"店铺","删除店铺信息"},isStoreLog = true)
-	@DeleteMapping("/{storeIds}")
-    public AjaxResult remove(@PathVariable Long[] storeIds)
-    {
+    @Log(title = "店铺管理", businessType = BusinessType.DELETE, logParam = {"店铺", "删除店铺信息"}, isStoreLog = true)
+    @DeleteMapping("/{storeIds}")
+    public AjaxResult remove(@PathVariable Long[] storeIds) {
         return toAjax(fsStoreService.deleteFsStoreByStoreIds(storeIds));
     }
 
@@ -152,10 +153,9 @@ public class FsStoreScrmController extends BaseController
      * 修改店铺管理
      */
 
-    @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","店铺审核"},isStoreLog = true)
+    @Log(title = "店铺管理", businessType = BusinessType.UPDATE, logParam = {"店铺", "店铺审核"}, isStoreLog = true)
     @PutMapping("/audit")
-    public AjaxResult audit(@RequestBody FsStoreAuditParam fsStore)
-    {
+    public AjaxResult audit(@RequestBody FsStoreAuditParam fsStore) {
         return toAjax(fsStoreService.updateFsStoreAudit(fsStore));
     }
 
@@ -163,10 +163,31 @@ public class FsStoreScrmController extends BaseController
      * 获取店铺管理详细信息
      */
     @GetMapping("/getStoreInfo")
-    public AjaxResult getStoreInfo()
-    {
+    public AjaxResult getStoreInfo() {
         FsStoreScrm user = UserUtil.getLoginUser().getFsStore();
         FsStoreDetailsScrmVo fsStore = fsStoreService.getStoreInfoByStoreId(user.getStoreId());
         return AjaxResult.success(fsStore);
     }
+
+    /**
+     * 商家店铺资质提示信息
+     */
+    @GetMapping("/queryValidStoreLastInfo")
+    public R queryValidStoreLastInfo() {
+        StoreLoginUserScrm loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if (loginUser != null) {
+            if (loginUser.getFsStore() != null) {
+                // 判断account是否为空
+                String account = loginUser.getFsStore().getAccount();
+                if (account == null && account.isEmpty()) {
+                    throw new BaseException("请先完善店铺账户信息");
+                }
+                List<String> list = fsStoreService.queryValidStoreLastInfo(account);
+                if (!Collections.isEmpty(list)) {
+                    return R.ok().put("code", 200).put("data", list);
+                }
+            }
+        }
+        return R.ok().put("code", 0);
+    }
 }

+ 19 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/ProductScrmController.java

@@ -304,4 +304,23 @@ public class ProductScrmController extends AppBaseController {
         List<FsStoreCartGroupStoreVO> carts= cartService.selectFsStoreCartListByUidMultiStore(Long.parseLong(getUserId()));
         return R.ok().put("carts",carts);
     }
+
+    /**
+     * 校验处方药说明书查看权限
+     * @param param 请求参数
+     * @return R
+     * **/
+    @ApiOperation("校验说明书查看权限")
+    @PostMapping("/instructionsViewable")
+    public R instructionsViewable(@RequestBody FsStoreCartCountParam param){
+       Long userId = Long.parseLong(getUserId());
+        if(userId == null){
+            return  R.error("操作失败,用户信息不存在!");
+        }
+        if(param.getProductId() == null){
+            return R.error("操作失败,商品信息不能为空!");
+        }
+        param.setUserId(userId);
+        return productService.instructionsViewable(param);
+    }
 }

+ 142 - 142
fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

@@ -1366,148 +1366,148 @@ public class StoreOrderScrmController extends AppBaseController {
         return R.ok().put("order", orderRes).put("prescribeOrder",prescribeOrder);
     }
 
-//    @Login
-//    @ApiOperation("亲友支付")
-//    @PostMapping("/otherPaymentByCombinationId")
-//    @Transactional
-//    public R otherPaymentByCombinationId(@Validated @RequestBody FsStoreOrderOtherPayCombinationIdParam param, HttpServletRequest request) {
-//        final WxMaService wxService = WxMaConfiguration.getMaService(param.getAppId());
-//        try {
-//            //组合微信支付order
-//            FsStoreOrderScrm fsStoreOrder = new FsStoreOrderScrm();
-//            BigDecimal payPrice = BigDecimal.ZERO;
-//            BigDecimal payMoneyTotal = BigDecimal.ZERO;
-//
-//            String payCode = IdUtil.getSnowflake(0, 0).nextIdStr();
-//            //新增的支付详情id
-//            ArrayList<Long> paymentIds = new ArrayList<>();
-//            String ip = IpUtil.getRequestIp();
-//            WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(param.getCode());
-//            FsUserScrm user = userService.selectFsUserByMaOpenId(session.getOpenid());
-//            if (user == null) {
-//                //创建
-//                user = new FsUserScrm();
-//                user.setUsername("");
-//                user.setNickname("微信用户");
-//                user.setStatus(1);
-//                user.setMaOpenId(session.getOpenid());
-//                user.setUnionId(session.getUnionid());
-//                user.setIsWeixinAuth(0);
-//                user.setLastIp(ip);
-//                user.setCreateTime(new Date());
-//                userService.insertFsUser(user);
-//            }
-////            FsStoreOrder order = orderService.selectFsStoreOrderById(param.getOrderId());
-//            List<FsStoreOrderScrm> orders = orderService.getStoreOrderByCombinationId(param.getCombinationOrderId());
-//            for (FsStoreOrderScrm order : orders) {
-//                if (order == null) {
-//                    return R.error("订单不存在");
-//                }
-//                if (order.getStatus() != OrderInfoEnum.STATUS_0.getValue()) {
-//                    return R.error("此订单不能支付");
-//                }
-//                if (order.getPayMoney().compareTo(new BigDecimal(0)) < 1) {
-//                    return R.error("此订单没有可支付的金额");
-//                }
-//                payPrice = NumberUtil.add(payPrice, order.getPayPrice());
-//                payMoneyTotal = NumberUtil.add(payMoneyTotal, order.getPayMoney());
-//                String paySubCode = IdUtil.getSnowflake(0, 0).nextIdStr();
-//                //小雨点支付
-//                FsStorePaymentScrm storePayment = new FsStorePaymentScrm();
-//                storePayment.setCompanyId(order.getCompanyId());
-//                storePayment.setCompanyUserId(order.getCompanyUserId());
-//                storePayment.setStatus(0);
-//                storePayment.setPayCode(payCode);
-//                storePayment.setPaySubCode(paySubCode);
-//                storePayment.setPayMoney(order.getPayMoney());
-//                storePayment.setCreateTime(new Date());
-//                storePayment.setPayTypeCode("weixin");
-//                storePayment.setBusinessType(2);
-//                storePayment.setRemark("商城订单支付");
-//                storePayment.setOpenId(session.getOpenid());
-//                storePayment.setUserId(user.getUserId());
-//                storePayment.setBusinessOrderId(order.getCombinationOrderId().toString());
-//                storePayment.setOrderId(order.getId());
-//                fsStorePaymentMapper.insertFsStorePayment(storePayment);
-//                paymentIds.add(storePayment.getPaymentId());
-//
-//            }
-//
-//            //创建订单
-//            fsStoreOrder.setPayType(orders.get(0).getPayType());
-//            fsStoreOrder.setCompanyId(orders.get(0).getCompanyId());
-//            fsStoreOrder.setCompanyUserId(orders.get(0).getCompanyUserId());
-//            fsStoreOrder.setPayMoney(payMoneyTotal);
-////        fsStoreOrder.setPayMoney(BigDecimal.valueOf(0.01));
-//            fsStoreOrder.setRealName(orders.get(0).getRealName());
-//            fsStoreOrder.setCombinationOrderId(orders.get(0).getCombinationOrderId());
-//
-//            FsStorePaymentScrm payment = new FsStorePaymentScrm();
-//            payment.setCompanyId(fsStoreOrder.getCompanyId());
-//            payment.setCompanyUserId(fsStoreOrder.getCompanyUserId());
-//            payment.setStatus(0);
-//            payment.setPayCode(payCode);
-//            payment.setPayMoney(fsStoreOrder.getPayMoney());
-//            payment.setCreateTime(new Date());
-//            payment.setPayTypeCode("weixin");
-//            payment.setBusinessType(2);
-//            payment.setRemark("商城订单支付");
-//            payment.setOpenId(session.getOpenid());
-//            payment.setUserId(user.getUserId());
-//
-//            HuiFuCreateOrder o = new HuiFuCreateOrder();
-//            o.setTradeType("T_MINIAPP");
-//            o.setOpenid(user.getMaOpenId());
-////            o.setReqSeqId("store-" + storePayment.getPayCode());
-//            o.setReqSeqId("store-" + payment.getPayCode());
-//            o.setTransAmt(payment.getPayMoney().toString());
-//            o.setGoodsDesc("商城订单支付");
-//            HuifuCreateOrderResult result = huiFuService.createOrder(o);
-//            if (result.getBank_code() != null && result.getBank_code().equals("00000000")) {
-//                for (int i = 0; i < paymentIds.size(); i++) {
-//                    FsStorePaymentScrm mt = new FsStorePaymentScrm();
-//                    mt.setPaymentId(Long.parseLong(paymentIds.get(i).toString()));
-//                    mt.setTradeNo(result.getHf_seq_id());
-//                    fsStorePaymentMapper.updateFsStorePayment(mt);
-//                    redisCache.setCacheObject("isPaying:" + orders.get(i).getId(), orders.get(i).getId().toString(), 1, TimeUnit.MINUTES);
-//                }
-//
-//                String mes = result.getPay_info();
-//                JSONObject payInfo = JSONUtil.parseObj(mes);
-//                FsHuiFuPayInfo fsHuiFuPayInfo = new FsHuiFuPayInfo();
-//                if (payInfo.get("timeStamp") != null) {
-//                    fsHuiFuPayInfo.setTimeStamp(payInfo.get("timeStamp").toString());
-//                }
-//                if (payInfo.get("package") != null) {
-//                    fsHuiFuPayInfo.setPackageStr(payInfo.get("package").toString());
-//                }
-//                if (payInfo.get("paySign") != null) {
-//                    fsHuiFuPayInfo.setPaySign(payInfo.get("paySign").toString());
-//
-//                }
-//                if (payInfo.get("appId") != null) {
-//                    fsHuiFuPayInfo.setAppId(payInfo.get("appId").toString());
-//
-//                }
-//                if (payInfo.get("signType") != null) {
-//                    fsHuiFuPayInfo.setSignType(payInfo.get("signType").toString());
-//
-//                }
-//                if (payInfo.get("nonceStr") != null) {
-//                    fsHuiFuPayInfo.setNonceStr(payInfo.get("nonceStr").toString());
-//                }
-//
-//                return R.ok().put("result", fsHuiFuPayInfo);
-//            } else {
-//                return R.error(result.getResp_desc());
-//            }
-//
-//
-//        } catch (WxErrorException e) {
-//            e.printStackTrace();
-//            return R.error(e.getMessage());
-//        }
-//    }
+    @Login
+    @ApiOperation("亲友支付")
+    @PostMapping("/otherPaymentByCombinationId")
+    @Transactional
+    public R otherPaymentByCombinationId(@Validated @RequestBody FsStoreOrderOtherPayCombinationIdParam param, HttpServletRequest request) {
+        final WxMaService wxService = WxMaConfiguration.getMaService(param.getAppId());
+        try {
+            //组合微信支付order
+            FsStoreOrderScrm fsStoreOrder = new FsStoreOrderScrm();
+            BigDecimal payPrice = BigDecimal.ZERO;
+            BigDecimal payMoneyTotal = BigDecimal.ZERO;
+
+            String payCode = IdUtil.getSnowflake(0, 0).nextIdStr();
+            //新增的支付详情id
+            ArrayList<Long> paymentIds = new ArrayList<>();
+            String ip = IpUtil.getRequestIp();
+            WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(param.getCode());
+            FsUser user = userService.selectFsUserByMaOpenId(session.getOpenid());
+            if (user == null) {
+                //创建
+                user = new FsUser();
+                user.setUsername("");
+                user.setNickname("微信用户");
+                user.setStatus(1);
+                user.setMaOpenId(session.getOpenid());
+                user.setUnionId(session.getUnionid());
+                user.setIsWeixinAuth(0);
+                user.setLastIp(ip);
+                user.setCreateTime(new Date());
+                userService.insertFsUser(user);
+            }
+//            FsStoreOrder order = orderService.selectFsStoreOrderById(param.getOrderId());
+            List<FsStoreOrderScrm> orders = orderService.getStoreOrderByCombinationId(param.getCombinationOrderId());
+            for (FsStoreOrderScrm order : orders) {
+                if (order == null) {
+                    return R.error("订单不存在");
+                }
+                if (order.getStatus() != OrderInfoEnum.STATUS_0.getValue()) {
+                    return R.error("此订单不能支付");
+                }
+                if (order.getPayMoney().compareTo(new BigDecimal(0)) < 1) {
+                    return R.error("此订单没有可支付的金额");
+                }
+                payPrice = NumberUtil.add(payPrice, order.getPayPrice());
+                payMoneyTotal = NumberUtil.add(payMoneyTotal, order.getPayMoney());
+                String paySubCode = IdUtil.getSnowflake(0, 0).nextIdStr();
+                //小雨点支付
+                FsStorePaymentScrm storePayment = new FsStorePaymentScrm();
+                storePayment.setCompanyId(order.getCompanyId());
+                storePayment.setCompanyUserId(order.getCompanyUserId());
+                storePayment.setStatus(0);
+                storePayment.setPayCode(payCode);
+                storePayment.setPaySubCode(paySubCode);
+                storePayment.setPayMoney(order.getPayMoney());
+                storePayment.setCreateTime(new Date());
+                storePayment.setPayTypeCode("weixin");
+                storePayment.setBusinessType(2);
+                storePayment.setRemark("商城订单支付");
+                storePayment.setOpenId(session.getOpenid());
+                storePayment.setUserId(user.getUserId());
+                storePayment.setBusinessOrderId(order.getCombinationOrderId().toString());
+                storePayment.setOrderId(order.getId());
+                fsStorePaymentMapper.insertFsStorePayment(storePayment);
+                paymentIds.add(storePayment.getPaymentId());
+
+            }
+
+            //创建订单
+            fsStoreOrder.setPayType(orders.get(0).getPayType());
+            fsStoreOrder.setCompanyId(orders.get(0).getCompanyId());
+            fsStoreOrder.setCompanyUserId(orders.get(0).getCompanyUserId());
+            fsStoreOrder.setPayMoney(payMoneyTotal);
+//        fsStoreOrder.setPayMoney(BigDecimal.valueOf(0.01));
+            fsStoreOrder.setRealName(orders.get(0).getRealName());
+            fsStoreOrder.setCombinationOrderId(orders.get(0).getCombinationOrderId());
+
+            FsStorePaymentScrm payment = new FsStorePaymentScrm();
+            payment.setCompanyId(fsStoreOrder.getCompanyId());
+            payment.setCompanyUserId(fsStoreOrder.getCompanyUserId());
+            payment.setStatus(0);
+            payment.setPayCode(payCode);
+            payment.setPayMoney(fsStoreOrder.getPayMoney());
+            payment.setCreateTime(new Date());
+            payment.setPayTypeCode("weixin");
+            payment.setBusinessType(2);
+            payment.setRemark("商城订单支付");
+            payment.setOpenId(session.getOpenid());
+            payment.setUserId(user.getUserId());
+
+            HuiFuCreateOrder o = new HuiFuCreateOrder();
+            o.setTradeType("T_MINIAPP");
+            o.setOpenid(user.getMaOpenId());
+//            o.setReqSeqId("store-" + storePayment.getPayCode());
+            o.setReqSeqId("store-" + payment.getPayCode());
+            o.setTransAmt(payment.getPayMoney().toString());
+            o.setGoodsDesc("商城订单支付");
+            HuifuCreateOrderResult result = huiFuService.createOrder(o);
+            if (result.getBank_code() != null && result.getBank_code().equals("00000000")) {
+                for (int i = 0; i < paymentIds.size(); i++) {
+                    FsStorePaymentScrm mt = new FsStorePaymentScrm();
+                    mt.setPaymentId(Long.parseLong(paymentIds.get(i).toString()));
+                    mt.setTradeNo(result.getHf_seq_id());
+                    fsStorePaymentMapper.updateFsStorePayment(mt);
+                    redisCache.setCacheObject("isPaying:" + orders.get(i).getId(), orders.get(i).getId().toString(), 1, TimeUnit.MINUTES);
+                }
+
+                String mes = result.getPay_info();
+                JSONObject payInfo = JSONUtil.parseObj(mes);
+                FsHuiFuPayInfo fsHuiFuPayInfo = new FsHuiFuPayInfo();
+                if (payInfo.get("timeStamp") != null) {
+                    fsHuiFuPayInfo.setTimeStamp(payInfo.get("timeStamp").toString());
+                }
+                if (payInfo.get("package") != null) {
+                    fsHuiFuPayInfo.setPackageStr(payInfo.get("package").toString());
+                }
+                if (payInfo.get("paySign") != null) {
+                    fsHuiFuPayInfo.setPaySign(payInfo.get("paySign").toString());
+
+                }
+                if (payInfo.get("appId") != null) {
+                    fsHuiFuPayInfo.setAppId(payInfo.get("appId").toString());
+
+                }
+                if (payInfo.get("signType") != null) {
+                    fsHuiFuPayInfo.setSignType(payInfo.get("signType").toString());
+
+                }
+                if (payInfo.get("nonceStr") != null) {
+                    fsHuiFuPayInfo.setNonceStr(payInfo.get("nonceStr").toString());
+                }
+
+                return R.ok().put("result", fsHuiFuPayInfo);
+            } else {
+                return R.error(result.getResp_desc());
+            }
+
+
+        } catch (WxErrorException e) {
+            e.printStackTrace();
+            return R.error(e.getMessage());
+        }
+    }
 
     /**
      * 检查订单列表中是否存在含处方药但未开方的订单

+ 1 - 1
fs-user-app/src/main/resources/application.yml

@@ -13,4 +13,4 @@ spring:
 #    active: druid-sxjz
 #    active: druid-qdtst
 #    active: druid-yzt
-    active: dev-jnlzjk
+    active: dev-yjb