فهرست منبع

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

yjwang 3 هفته پیش
والد
کامیت
330c61bd66

+ 5 - 1
fs-service/src/main/java/com/fs/hisStore/domain/FsPlatformProductScrm.java

@@ -26,7 +26,6 @@ public class FsPlatformProductScrm extends BaseEntity {
     /**
      * 商品id
      */
-    @TableId(value = "product_id", type = IdType.ID_WORKER)
     private Long productId;
 
     /**
@@ -576,4 +575,9 @@ public class FsPlatformProductScrm extends BaseEntity {
      * **/
     private String medicalDeviceCode;
 
+    /**
+     * 来自店铺的商品-商品id
+     * **/
+    private Long storeProductId;
+
 }

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

@@ -573,4 +573,9 @@ public class FsStoreProductScrm extends BaseEntity {
      * 器械编号
      * **/
     private String medicalDeviceCode;
+
+    /**
+     * 平台商品id
+     * **/
+    private Long platformProductId;
 }

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

@@ -229,4 +229,9 @@ public interface FsStoreScrmMapper
      * 店铺名称是否已存在
      * **/
     Boolean isStoreNameExist(@Param("storeName") String storeName, @Param("storeId") Long storeId);
+
+    /**
+     * 店铺审核
+     * **/
+    Integer auditStore(FsStoreScrm FsStoreScrm);
 }

+ 15 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/IFsPlatformProductScrmMapper.java

@@ -26,6 +26,14 @@ public interface IFsPlatformProductScrmMapper {
      */
     List<String> getProductNoticeInfo();
 
+
+    /**
+     * 根据店铺商品id去查询商品是否存在
+     * @param
+     * @return
+     */
+   Boolean selectByStoreProductId(@Param("storeProductId") Long storeProductId);
+
     /**
      * 通过商品id获取商品详细信息
      * @param productId
@@ -62,4 +70,11 @@ public interface IFsPlatformProductScrmMapper {
      * @return 结果
      */
     int updateFsPlatformProduct(FsPlatformProductScrm product);
+
+    /**
+     * 商品名称是否存在
+     * @param productName
+     * @return
+     */
+    Boolean productNameExist(@Param("productName") String productName);
 }

+ 61 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsPlatFormProductAddEditParam.java

@@ -6,6 +6,7 @@ import com.fs.hisStore.dto.ProductArrtDTO;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.List;
 
 /**
@@ -259,8 +260,10 @@ public class FsPlatFormProductAddEditParam {
 
     //属性项目
     private List<ProductArrtDTO> items;
+
     //sku结果集
     private List<FsStoreProductAttrValueScrm> values;
+
     // 指定企业
     private String companyIds;
 
@@ -374,4 +377,62 @@ public class FsPlatFormProductAddEditParam {
      * **/
     private String medicalDeviceCode;
 
+    /**
+     * 来自店铺的商品-商品id
+     * **/
+    private Long storeProductId;
+
+//    //不一致的错误信息
+//    /**
+//     * 生产许可证件有效期开始
+//     **/
+//    private LocalDate licenseStart;
+//
+//    /**
+//     * 生产许可证件有效期结束
+//     **/
+//    private LocalDate licenseEnd;
+//
+//    /**
+//     * 注册证书有效期开始
+//     **/
+//    private LocalDate certificateStart;
+//
+//    /**
+//     * 注册证书有效期结束
+//     **/
+//    private LocalDate certificateEnd;
+//
+//    /**
+//     * 营业执照有效期开始
+//     **/
+//    private LocalDate businessStart;
+//
+//    /**
+//     * 营业执照有效期结束
+//     **/
+//    private LocalDate businessEnd;
+//
+//    /**
+//     * 备案证书有效期开始
+//     **/
+//    private LocalDate voucherStart;
+//
+//    /**
+//     * 备案证书有效期结束
+//     **/
+//    private LocalDate voucherEnd;
+//
+//    /**
+//     * GMP认证有效期开始
+//     **/
+//    private LocalDate gmpAuthStart;
+//
+//    /**
+//     * GMP认证有效期结束
+//     **/
+//    private LocalDate gmpAuthEnd;
+
+
+
 }

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

@@ -53,4 +53,11 @@ public interface IFsPlatformProductScrmService {
      * @return
      */
     R addOrEdit(FsPlatFormProductAddEditParam fsStoreProduct);
+
+    /**
+     * 总后台总库商品一键加入到自己的店铺去
+     * @param fsStoreProduct
+     * @return  R
+     */
+    R oneClickStorage(FsPlatFormProductAddEditParam fsStoreProduct);
 }

+ 61 - 6
fs-service/src/main/java/com/fs/hisStore/service/impl/FsPlatformProductScrmServiceImpl.java

@@ -18,6 +18,7 @@ import com.fs.hisStore.service.IFsPlatformProductScrmService;
 import com.fs.hisStore.utils.StoreAuditLogUtil;
 import com.fs.hisStore.vo.FsPlatformProductListVO;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +31,7 @@ import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.function.Consumer;
+import com.fs.hisStore.util.FsProductUtils;
 
 /**
  * @description:
@@ -64,6 +66,10 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
     @Autowired
     private FsStoreProductGroupScrmMapper fsStoreProductGroupMapper;
 
+    @Autowired
+    private FsStoreProductScrmMapper fsStoreProductMapper;
+
+
 
     /**
      * 查询商品列表
@@ -148,7 +154,7 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
         copyProductInfo.setIsShow(1);
 
         //插入复制商品
-        copyProductInfo.setProductId(createId());
+        copyProductInfo.setProductId(FsProductUtils.createId());
         if(fsPlatformProductScrmMapper.insertFsPlatformProduct(copyProductInfo) < 1){
             return R.error("操作失败,复制信息异常!");
         }
@@ -199,7 +205,6 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
         product.setBusinessLink(param.getBusinessLink());
         product.setCreateTime(new Date());
 
-
         //这里是更新
         if(param.getProductId() != null && param.getProductId() > 0){
             FsPlatformProductScrm oldFsStoreProduct = fsPlatformProductScrmMapper.selectFsPlatformProductById(product.getProductId());
@@ -237,7 +242,7 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
                 product.setIsAudit("1");
             }
             //复制新的id
-            product.setProductId(createId());
+            product.setProductId(FsProductUtils.createId());
             fsPlatformProductScrmMapper.insertFsPlatformProduct(product);
         }
         storeAuditLogUtil.addOperLog(product.getProductId());
@@ -246,6 +251,58 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
         return R.ok();
     }
 
+    /**
+     * 总后台总库商品一键加入到自己的店铺去
+     * @param fsStoreProduct
+     * @return  R
+     */
+    @Override
+    public R oneClickStorage(FsPlatFormProductAddEditParam fsStoreProduct) {
+        //获取复制商品信息
+        FsPlatformProductScrm copyProductInfo = fsPlatformProductScrmMapper.selectFsPlatformProductById(fsStoreProduct.getProductId());
+        if(copyProductInfo==null){
+            return R.error("复制,商品数据不存在!");
+        }
+        //这个商品是否已经在我店铺存在了
+        Long storeProductId = copyProductInfo.getStoreProductId();
+        //存在
+        FsStoreProductScrm  ObjectExist = fsStoreProductMapper.selectFsStoreProductById(storeProductId);
+        if(ObjectUtils.isNotEmpty(ObjectExist)){
+            return R.error("这个商品你店铺已经有了,无需重复添加!");
+        }
+        //插入复制商品
+        Long platformProductId = copyProductInfo.getProductId();
+        FsStoreProductScrm fsStoreProductScrm = new FsStoreProductScrm();
+        BeanUtils.copyProperties(copyProductInfo, fsStoreProductScrm); //copy
+        fsStoreProductScrm.setProductId(null);
+        fsStoreProductScrm.setIsShow(0);//下架状态
+        fsStoreProductScrm.setIsAudit("0");//未审核状态
+        fsStoreProductScrm.setCreateTime(new Date());
+        fsStoreProductScrm.setUpdateTime(new Date());
+        fsStoreProductScrm.setPlatformProductId(platformProductId);
+        fsStoreProductScrm.setStoreId(fsStoreProduct.getStoreId());
+        int insertRowNum = fsStoreProductMapper.insertFsStoreProduct(fsStoreProductScrm);
+        boolean flag = insertRowNum > 0;
+        if(flag){
+            Long productId = fsStoreProductScrm.getProductId();
+            //复制规格
+            List<FsStoreProductAttrScrm> fsStoreProductAttrScrms = fsStoreProductAttrMapper.selectFsStoreProductAttrByProductId(platformProductId);
+            for (FsStoreProductAttrScrm fsStoreProductAttrScrm : fsStoreProductAttrScrms){
+                fsStoreProductAttrScrm.setId(null);
+                fsStoreProductAttrScrm.setProductId(productId);
+                fsStoreProductAttrMapper.insertFsStoreProductAttr(fsStoreProductAttrScrm);
+            }
+            List<FsStoreProductAttrValueScrm> fsStoreProductAttrValueScrms = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(platformProductId);
+            for (FsStoreProductAttrValueScrm fsStoreProductAttrValueScrm : fsStoreProductAttrValueScrms){
+                fsStoreProductAttrValueScrm.setId(null);
+                fsStoreProductAttrValueScrm.setProductId(productId);
+                fsStoreProductAttrValueScrm.setStoreId(fsStoreProduct.getStoreId());
+                fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(fsStoreProductAttrValueScrm);
+            }
+        }
+        return flag?R.ok():R.error("添加失败!");
+    }
+
     private void handleProductAttributes(FsPlatFormProductAddEditParam param, FsPlatformProductScrm product, Long storeId) {
         if (param.getSpecType().equals(0)) {
             ProductArrtDTO fromatDetailDto = ProductArrtDTO.builder()
@@ -441,9 +498,7 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
         return diff;
     }
 
-    private static Long createId(){
-        return IdWorker.getId()  % 100000000L;  // 返回后8位(又重复风险);
-    }
+
 
 
 }

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

@@ -39,6 +39,7 @@ import com.fs.hisStore.domain.*;
 import com.fs.hisStore.dto.ForbiddenDrugItemDTO;
 import com.fs.hisStore.dto.FsStoreProductScrmInfoDTO;
 import com.fs.hisStore.mapper.*;
+import com.fs.hisStore.param.FsPlatFormProductAddEditParam;
 import com.fs.hisStore.param.FsStoreCartCountParam;
 import com.fs.hisStore.service.IFsPlatformProductScrmService;
 import com.fs.hisStore.service.IFsStoreProductCategoryScrmService;
@@ -46,6 +47,7 @@ import com.fs.hisStore.service.categoryVal.AbstractHandler;
 import com.fs.hisStore.service.categoryVal.ProductCategoryCheckFactory;
 import com.fs.hisStore.util.DrugComponentAnalyzer;
 import com.fs.hisStore.util.ForbiddenDrugListManager;
+import com.fs.hisStore.util.FsProductUtils;
 import com.fs.hisStore.utils.StoreAuditLogUtil;
 import com.fs.hisStore.util.BusinessScopeProductTypeUtil;
 import com.fs.statis.dto.ModifyMoreDTO;
@@ -132,7 +134,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 
     @Lazy
     @Autowired
-    private IFsPlatformProductScrmService ifsPlatformProductService;
+    private IFsPlatformProductScrmMapper iFsPlatformProductScrmMapper;
 
 
     private ForbiddenDrugListManager forbiddenListManager = new ForbiddenDrugListManager();
@@ -399,7 +401,6 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 //            if(StringUtils.isNotEmpty(item.getStoreId()))
 //                item.setStoreName(fsStoreScrmService.selectFsStoreByStoreId(Long.parseLong(item.getStoreId())).getStoreName());
         }
-
         return fsStoreProductListVOS;
     }
 
@@ -601,7 +602,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
             fsStoreProductMapper.insertFsStoreProduct(product);
         }
         storeAuditLogUtil.addOperLog(product.getProductId());
-        //处理规格
+        //处理规格
         handleProductAttributes(param, product, storeId);
         return R.ok();
     }
@@ -614,7 +615,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     .build();
             List<ProductArrtDTO> items=new ArrayList<>();
             items.add(fromatDetailDto);
-            param.getValues().get(0).setSku("每"+param.getUnitName());
+            param.getValues().get(0).setSku(param.getUnitName());
             addProductAttr(product.getProductId(),items, param.getValues(), storeId);
         } else {
             addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
@@ -628,7 +629,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
      * @param values 属性值
      * @param storeId 店铺id
      */
-    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
@@ -1318,14 +1319,43 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         // 正常情况是退回后可以申请重新上架的如果不通过2,那么show就变回0(直接在sql中去做的),按照原有逻辑去做
         fsStoreProductMapper.batchAudit(auditDTO);
         storeAuditLogUtil.addBatchAuditList(auditDTO.getProductIds(),auditDTO.getReason(),auditDTO.getAttachImage());
-        //TODO 平台商品库
-//        if(auditDTO.getIsAudit() == 1){
-//            //复制一份到平台商品库
-//            for(Long productId : auditDTO.getProductIds()){
-//                fsStoreProductMapper.selectFsStoreProductById(auditDTO.getProductIds());
-//                ifsPlatformProductService.addOrEdit(auditDTO);
-//            }
-//        }
+        //审核通过进入、平台商品库
+        if(auditDTO.getIsAudit() == 1){
+            //复制一份到平台商品库
+            for(Long storeProductId : auditDTO.getProductIds()){
+                //原商品库
+                FsStoreProductScrm fsStoreProductScrm = fsStoreProductMapper.selectFsStoreProductById(storeProductId);
+                //存在的商品不用一直添加到总库
+                Boolean flag = iFsPlatformProductScrmMapper.productNameExist(fsStoreProductScrm.getProductName());
+                if(flag){
+                    continue;
+                }
+                //复制商品
+                FsPlatformProductScrm fsPlatformProductScrm = new FsPlatformProductScrm();
+                BeanUtils.copyProperties(fsStoreProductScrm, fsPlatformProductScrm); //copy
+//                Long storeProductId = fsPlatformProductScrm.getProductId();//店铺商品id
+                Long id = FsProductUtils.createId();//平台总库商品id
+                fsPlatformProductScrm.setStoreProductId(storeProductId);
+                fsPlatformProductScrm.setProductId(id);
+                fsPlatformProductScrm.setIsShow(9);//对比字典store_product_is_show,草稿
+                fsPlatformProductScrm.setStoreId(null);
+                iFsPlatformProductScrmMapper.insertFsPlatformProduct(fsPlatformProductScrm);
+                //复制规格
+                List<FsStoreProductAttrScrm> fsStoreProductAttrScrms = fsStoreProductAttrMapper.selectFsStoreProductAttrByProductId(storeProductId);
+                for (FsStoreProductAttrScrm fsStoreProductAttrScrm : fsStoreProductAttrScrms){
+                    fsStoreProductAttrScrm.setId(null);
+                    fsStoreProductAttrScrm.setProductId(id);
+                    fsStoreProductAttrMapper.insertFsStoreProductAttr(fsStoreProductAttrScrm);
+                }
+                List<FsStoreProductAttrValueScrm> fsStoreProductAttrValueScrms = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(storeProductId);
+                for (FsStoreProductAttrValueScrm fsStoreProductAttrValueScrm : fsStoreProductAttrValueScrms){
+                    fsStoreProductAttrValueScrm.setId(null);
+                    fsStoreProductAttrValueScrm.setProductId(id);
+                    fsStoreProductAttrValueScrm.setStoreId(null);
+                    fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(fsStoreProductAttrValueScrm);
+                }
+            }
+        }
     }
 
     @Override

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

@@ -362,10 +362,10 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
                 }
             }
         }
-        fsStoreMapper.updateFsStore(updateStore);
+        Integer rowNum = fsStoreMapper.auditStore(updateStore);
         //更新日志
         storeAuditLogUtil.addAudit(fsStore.getStoreId(), fsStore.getReason(), fsStore.getAttachImage());
-        return 1;
+        return rowNum;
     }
 
     @Override

+ 16 - 0
fs-service/src/main/java/com/fs/hisStore/util/FsProductUtils.java

@@ -0,0 +1,16 @@
+package com.fs.hisStore.util;
+
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+
+/**
+ * @description:
+ * @author: Guos
+ * @time: 2025/12/18 下午3:22
+ */
+public class FsProductUtils {
+
+    public static Long createId(){
+        return IdWorker.getId()  % 100000000L;  // 返回后8位(又重复风险);
+    }
+
+}

+ 23 - 20
fs-service/src/main/resources/mapper/hisStore/FsPlatformProductScrmMapper.xml

@@ -91,6 +91,7 @@
         <result property="isLicensePermanent" column="is_license_permanent"/>
         <result property="isCertificatePermanent" column="is_certificate_permanent"/>
         <result property="isGmpAuthPermanent" column="is_gmp_auth_permanent"/>
+        <result property="storeProductId" column="store_product_id"/>
     </resultMap>
 
     <sql id="selectFsPlatFormProductVo">
@@ -107,7 +108,7 @@
                certificate, certificate_start, certificate_end,
                voucher, voucher_start, voucher_end,
                gmp_auth, gmp_auth_start, gmp_auth_end,business_link,medical_device_code,
-               is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent
+               is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent, store_product_id
         from fs_platform_product_scrm
     </sql>
 
@@ -120,18 +121,13 @@
        p.is_display,p.tui_cate_id,p.company_ids,p.is_drug,p.drug_image,p.drug_reg_cert_no,p.common_name,p.dosage_form,
        p.unit_price,p.batch_number,p.mah,p.mah_address,p.manufacturer,p.manufacturer_address,p.indications,p.ingredient,p.dosage,
        p.adverse_reactions,p.contraindications,p.precautions,p.is_audit,p.store_id,
-       p.is_business_permanent,p.is_license_permanent,p.is_certificate_permanent,p.is_gmp_auth_permanent
+       p.is_business_permanent,p.is_license_permanent,p.is_certificate_permanent,p.is_gmp_auth_permanent,store_product_id
     </sql>
 
     <select id="selectList" resultType="com.fs.hisStore.vo.FsPlatformProductListVO">
         SELECT
         <include refid="baseSql"/>,
-        case
-        when p.is_show = 1 and p.is_audit = 1 then 1
-        when p.is_show = 0 and p.is_audit = 0 then 0
-        when p.is_show = 1 and p.is_audit = 0 then 3
-        when p.is_show = 0 and p.is_audit = 2 then 4
-        end AS is_show,
+        p.is_show,
         pc.cate_name
         FROM
         fs_platform_product_scrm p
@@ -140,22 +136,15 @@
         WHERE 1=1
         and p.is_del = 0 and p.is_drug = 1
         <if test="maps.isAudit == null and maps.isShow != null">
+            <if test="maps.isShow == -1">
+            </if>
             <if test="maps.isShow == 1">
-                AND p.is_audit = 1
                 AND p.is_show = 1
             </if>
-            <if test="maps.isShow == 0">
-                AND p.is_audit != 1
+            <if test="maps.isShow == 9">
                 AND p.is_show = #{maps.isShow}
             </if>
-            <if test="maps.isShow == -1">
-            </if>
-            <if test="maps.isShow == 3">
-                AND p.is_audit = 0
-                AND p.is_show = 1
-            </if>
-            <if test="maps.isShow == 4">
-                AND p.is_audit = 2
+            <if test="maps.isShow == 0">
                 AND p.is_show = 0
             </if>
         </if>
@@ -231,7 +220,7 @@
             AND p.prescribe_spec LIKE CONCAT('%', #{maps.prescribeSpec}, '%')
         </if>
         ORDER BY
-        p.product_id DESC
+        p.create_time DESC
     </select>
 
     <select id="getProductNoticeInfo" resultType="java.lang.String">
@@ -300,6 +289,18 @@
         WHERE p.product_id IN <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
     </select>
 
+    <select id="selectByStoreProductId" resultType="java.lang.Boolean" >
+        SELECT
+           count(product_id)
+        FROM
+            fs_platform_product_scrm p where p.store_product_id = #{storeProductId}
+    </select>
+
+    <select id="productNameExist" resultType="java.lang.Boolean">
+        select count(product_id)
+        from fs_platform_product_scrm p where p.product_name = #{productName}
+    </select>
+
     <delete id="deleteFsPlatFormProductByIds">
         delete from fs_platform_product_scrm where product_id in
         <foreach item="productId" collection="array" open="(" separator="," close=")">
@@ -400,6 +401,7 @@
             <if test="isLicensePermanent != null">is_license_permanent ,</if>
             <if test="isCertificatePermanent != null">is_certificate_permanent ,</if>
             <if test="isGmpAuthPermanent != null">is_gmp_auth_permanent ,</if>
+            <if test="storeProductId != null">store_product_id ,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="productId != null and productId != ''">#{productId},</if>
@@ -492,6 +494,7 @@
             <if test="isLicensePermanent != null">#{isLicensePermanent} ,</if>
             <if test="isCertificatePermanent != null">#{isCertificatePermanent} ,</if>
             <if test="isGmpAuthPermanent != null">#{isGmpAuthPermanent} ,</if>
+            <if test="storeProductId != null">#{storeProductId} ,</if>
         </trim>
     </insert>
 

+ 10 - 4
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -91,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isLicensePermanent" column="is_license_permanent"/>
         <result property="isCertificatePermanent" column="is_certificate_permanent"/>
         <result property="isGmpAuthPermanent" column="is_gmp_auth_permanent"/>
+        <result property="platformProductId" column="platform_product_id"/>
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
@@ -107,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                certificate, certificate_start, certificate_end,
                voucher, voucher_start, voucher_end,
                gmp_auth, gmp_auth_start, gmp_auth_end,business_link,medical_device_code,
-               is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent
+               is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent,platform_product_id
                from fs_store_product_scrm
     </sql>
 
@@ -120,9 +121,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                p.is_display,p.tui_cate_id,p.company_ids,p.is_drug,p.drug_image,p.drug_reg_cert_no,p.common_name,p.dosage_form,
                p.unit_price,p.batch_number,p.mah,p.mah_address,p.manufacturer,p.manufacturer_address,p.indications,p.ingredient,p.dosage,
                p.adverse_reactions,p.contraindications,p.precautions,p.is_audit,p.store_id,p.medical_device_code,
-               p.is_business_permanent,p.is_license_permanent,p.is_certificate_permanent,p.is_gmp_auth_permanent
+               p.is_business_permanent,p.is_license_permanent,p.is_certificate_permanent,p.is_gmp_auth_permanent,p.platform_product_id
         from fs_store_product_scrm p
-        select product_id, video, image, slider_image, product_name, product_info, keyword, bar_code, cate_id, price, vip_price, ot_price, agent_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage, is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral, integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name, is_display, tui_cate_id, company_ids, store_id, 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 from fs_store_product_scrm
+        select product_id, video, image, slider_image, product_name, product_info, keyword, bar_code, cate_id, price, vip_price, ot_price, agent_price, postage, unit_name, sort, sales, stock, is_show, is_hot, is_benefit, is_best, is_new, description, create_time, update_time, is_postage, is_del, give_integral, cost, is_good, browse, code_path, temp_id, spec_type, is_integral, integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name, is_display, tui_cate_id, company_ids, store_id, 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, platform_product_id from fs_store_product_scrm
     </sql>
 
     <select id="selectFsStoreProductByProductId" parameterType="Long" resultMap="FsStoreProductResult">
@@ -312,6 +313,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isLicensePermanent != null">is_license_permanent ,</if>
             <if test="isCertificatePermanent != null">is_certificate_permanent ,</if>
             <if test="isGmpAuthPermanent != null">is_gmp_auth_permanent ,</if>
+            <if test="platformProductId != null">platform_product_id ,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
@@ -403,6 +405,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isLicensePermanent != null">#{isLicensePermanent} ,</if>
             <if test="isCertificatePermanent != null">#{isCertificatePermanent} ,</if>
             <if test="isGmpAuthPermanent != null">#{isGmpAuthPermanent} ,</if>
+            <if test="platformProductId != null">#{platformProductId} ,</if>
          </trim>
     </insert>
 
@@ -882,7 +885,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     AND p.is_show = 0
                 </if>
             </if>
-            <if test="maps.isAudit != null">
+            <if test="maps.isAudit != null" >
+                <if test="maps.isAudit == '0' or maps.isAudit == 0 ">
+                    AND  p.is_show = 1
+                </if>
                 AND p.is_audit = #{maps.isAudit}
             </if>
             <if test="maps.commentContent != null and maps.commentContent.trim() != ''">

+ 26 - 14
fs-service/src/main/resources/mapper/hisStore/FsStoreScrmMapper.xml

@@ -60,7 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="medicalLicense"	column="medical_license" />
         <result property="medicalLicenseExpiryStart"	column="medical_license_expiry_start" />
         <result property="medicalLicenseExpiryEnd"	column="medical_license_expiry_end" />
-
         <result property="settlementAgreement"	column="settlement_agreement" />
         <result property="settlementAgreementStart"	column="settlement_agreement_start" />
         <result property="settlementAgreementEnd"	column="settlement_agreement_end" />
@@ -346,6 +345,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
     </insert>
 
+    <update id="auditStore" parameterType="FsStoreScrm">
+        update fs_store_scrm
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="isAudit != null">is_audit = #{isAudit},</if>
+            <if test="qualificationUpdateTime !=null ">qualification_update_time = #{qualificationUpdateTime} , </if>
+            <if test="selectableProductTypes !=null and selectableProductTypes !=''"> selectable_product_types = #{selectableProductTypes} ,</if>
+            <if test="permStatus !=null ">perm_status = #{permStatus}, </if>
+        </trim>
+        where store_id = #{storeId}
+    </update>
+
+
     <update id="updateFsStore" parameterType="FsStoreScrm">
         update fs_store_scrm
         <trim prefix="SET" suffixOverrides=",">
@@ -391,15 +403,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="medicalDevice1 !=null and medicalDevice1 !=''"> medical_device1 = #{medicalDevice1} ,</if>
             <if test="medicalDevice1ExpiryStart !=null "> medical_device1_expiry_start = #{medicalDevice1ExpiryStart} ,</if>
             <if test="medicalDevice1ExpiryEnd !=null "> medical_device1_expiry_end = #{medicalDevice1ExpiryEnd} ,</if>
-            <if test="medicalDevice2 !=null and medicalDevice2 !=''"> medical_device2 = #{medicalDevice2} ,</if>
-            <if test="medicalDevice2ExpiryStart !=null "> medical_device2_expiry_start = #{medicalDevice2ExpiryStart} ,</if>
-            <if test="medicalDevice2ExpiryEnd !=null "> medical_device2_expiry_end = #{medicalDevice2ExpiryEnd} ,</if>
-            <if test="medicalDevice3 !=null and medicalDevice3 !=''"> medical_device3 = #{medicalDevice3} ,</if>
-            <if test="medicalDevice3ExpiryStart !=null "> medical_device3_expiry_start = #{medicalDevice3ExpiryStart} ,</if>
-            <if test="medicalDevice3ExpiryEnd !=null "> medical_device3_expiry_end = #{medicalDevice3ExpiryEnd} ,</if>
-            <if test="foodLicense !=null and foodLicense !=''"> food_license = #{foodLicense} ,</if>
-            <if test="foodLicenseExpiryStart !=null "> food_license_expiry_start = #{foodLicenseExpiryStart} ,</if>
-            <if test="foodLicenseExpiryEnd !=null "> food_license_expiry_end = #{foodLicenseExpiryEnd} ,</if>
             <if test="medicalLicense !=null and medicalLicense !=''"> medical_license = #{medicalLicense} ,</if>
             <if test="medicalLicenseExpiryStart !=null "> medical_license_expiry_start = #{medicalLicenseExpiryStart} ,</if>
             <if test="medicalLicenseExpiryEnd !=null "> medical_license_expiry_end = #{medicalLicenseExpiryEnd} ,</if>
@@ -416,8 +419,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="businessCode !=null ">business_code=#{businessCode} , </if>
             <if test="drugCode !=null ">drug_code=#{drugCode} , </if>
             <if test="medicalDevice1Code !=null ">medical_device1_code=#{medicalDevice1Code} , </if>
-            <if test="medicalDevice2Code !=null ">medical_device2_code=#{medicalDevice2Code} , </if>
-            <if test="medicalDevice3Code !=null ">medical_device3_code=#{medicalDevice3Code} , </if>
             <if test="foodCode !=null ">food_code=#{foodCode} , </if>
             <if test="medicalCode !=null ">medical_code=#{medicalCode} , </if>
             <if test="otherSpecialQualificationCode !=null ">other_special_qualification_code=#{otherSpecialQualificationCode} , </if>
@@ -439,14 +440,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="settlementAgreementFileName !=null ">settlement_agreement_file_name = #{settlementAgreementFileName} , </if>
             <if test="qualityAssuranceAgreementFileName !=null ">quality_assurance_agreement_fileName = #{qualityAssuranceAgreementFileName} , </if>
             <if test="otherSpecialQualificationFileName !=null ">other_special_qualification_fileName = #{otherSpecialQualificationFileName} , </if>
-            <if test="medicalDevice2BusinessScope !=null ">medical_device2_business_scope = #{medicalDevice2BusinessScope} , </if>
-            <if test="medicalDevice3BusinessScope !=null ">medical_device3_business_scope = #{medicalDevice3BusinessScope} , </if>
             <if test="drugLicenseBusinessScope !=null ">drug_license_business_scope = #{drugLicenseBusinessScope} , </if>
             <if test="foodLicenseBusinessScope !=null ">food_license_business_scope = #{foodLicenseBusinessScope} , </if>
             <if test="drugScopeHasFrozen !=null ">drug_scope_has_frozen = #{drugScopeHasFrozen}, </if>
             <if test="reportUrl !=null ">report_url = #{reportUrl}, </if>
             <if test="filingUrl !=null ">filing_url = #{filingUrl}, </if>
             <if test="permStatus !=null ">perm_status = #{permStatus}, </if>
+            medical_device2 = #{medicalDevice2} ,
+            medical_device2_business_scope = #{medicalDevice2BusinessScope} ,
+            medical_device2_code = #{medicalDevice2Code} ,
+            medical_device2_expiry_start = #{medicalDevice2ExpiryStart} ,
+            medical_device2_expiry_end = #{medicalDevice2ExpiryEnd} ,
+            medical_device3 = #{medicalDevice3} ,
+            medical_device3_expiry_start = #{medicalDevice3ExpiryStart} ,
+            medical_device3_expiry_end = #{medicalDevice3ExpiryEnd} ,
+            medical_device3_code = #{medicalDevice3Code} ,
+            medical_device3_business_scope = #{medicalDevice3BusinessScope},
+            food_license = #{foodLicense} ,
+            food_license_expiry_start = #{foodLicenseExpiryStart} ,
+            food_license_expiry_end = #{foodLicenseExpiryEnd} ,
         </trim>
         where store_id = #{storeId}
     </update>

+ 128 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/FsPlatformProductScrmController.java

@@ -0,0 +1,128 @@
+package com.fs.hisStore.controller.store;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.hisStore.domain.FsPlatformProductScrm;
+import com.fs.hisStore.domain.FsStoreProductAttrScrm;
+import com.fs.hisStore.domain.StoreLoginUserScrm;
+import com.fs.hisStore.param.FsPlatFormProductAddEditParam;
+import com.fs.hisStore.service.IFsPlatformProductScrmService;
+import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
+import com.fs.hisStore.utils.UserUtil;
+import com.fs.hisStore.vo.FsPlatformProductListVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @description: 总平台商品库
+ * @author: Guos
+ * @time: 2025/12/16 下午2:13
+ */
+@Slf4j
+@RestController
+@RequestMapping("/store/store/platformProduct")
+public class FsPlatformProductScrmController extends BaseController {
+
+    @Autowired
+    private IFsPlatformProductScrmService fsPlatformProductService;
+
+    @Autowired
+    private IFsStoreProductAttrScrmService attrService;
+
+
+    /**
+     * 总后台总库商品一键加入到自己的店铺去
+     * @param fsStoreProduct
+     * @return  R
+     */
+    @Log(title = "总后台商品总库协议过期提醒", businessType = BusinessType.OTHERe)
+    @PostMapping("/oneClickStorage")
+    public R oneClickStorage(@RequestBody FsPlatFormProductAddEditParam fsStoreProduct) {
+        StoreLoginUserScrm loginUser = UserUtil.getLoginUser();
+        fsStoreProduct.setStoreId(loginUser.getFsStore().getStoreId());
+        return fsPlatformProductService.oneClickStorage(fsStoreProduct);
+    }
+
+    /**
+     * 总后台商品总库协议过期提醒
+     * @return
+     */
+    @Log(title = "总后台商品总库协议过期提醒", businessType = BusinessType.OTHERe)
+    @GetMapping("/productNoticeInfo")
+    public R getProductNoticeInfo() {
+        List<String> productNoticeInfo = fsPlatformProductService.getProductNoticeInfo();
+        if (CollectionUtils.isEmpty(productNoticeInfo)) {return R.ok().put("code", 0);}
+        return R.ok().put("code", 200).put("data", productNoticeInfo);
+    }
+
+    /**
+     * 查询商品列表
+     * @param vo
+     * @return TableDataInfo
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(FsPlatformProductScrm vo) {
+        startPage();
+        List<FsPlatformProductListVO> list = fsPlatformProductService.selectList(vo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取商品详细信息
+     * @param productId
+     */
+    @GetMapping(value = "/{productId}")
+    public R getInfo(@PathVariable("productId") Long productId) {
+        FsPlatformProductScrm product = fsPlatformProductService.selectFsPlatformProductById(productId);
+        List<FsStoreProductAttrScrm> attrs = attrService.selectFsStoreProductAttrByProductId(productId);
+        return R.ok().put("data", product).put("attrs", attrs);
+    }
+
+    /**
+     * 商品复制
+     * @param product 商品对象
+     * @return R
+     * */
+    @PreAuthorize("@ss.hasPermi('his:storeProduct:copyProduct')")
+    @PostMapping("/copyProduct")
+    @Log(title = "复制商品", businessType = BusinessType.INSERT, isStoreLog = true, logParam = {"商品", "复制商品"})
+    public R copyProduct(@RequestBody FsPlatformProductScrm product) {
+        return fsPlatformProductService.copyProduct(product);
+    }
+
+    /**
+     * 新增或修改商品
+     * @param fsStoreProduct 商品对象
+     * @return R
+     * */
+    @PreAuthorize("@ss.hasPermi('store:storeProduct:add')")
+    @Log(title = "商品管理", businessType = BusinessType.INSERT, businessTypeExpression = "#p0.getProductId()>0? T(com.fs.common.enums.BusinessType).UPDATE: T(com.fs.common.enums.BusinessType).INSERT"
+            , isStoreLog = true, logParamExpression = "#p0.getProductId()>0? new String[]{'商品','修改商品'}: new String[]{'商品','新增商品'}")
+    @PostMapping(value = "/addOrEdit")
+    public R addOrEdit(@RequestBody FsPlatFormProductAddEditParam fsStoreProduct) {
+        if (ObjectUtils.isNotNull(fsStoreProduct.getIsShow())) {
+            if (fsStoreProduct.getIsShow() == 1) {
+                logger.info("商品上架:{}", fsStoreProduct.getProductName() + new Date());
+            }
+        }
+
+        if (ObjectUtils.isNotNull(fsStoreProduct.getIsDisplay())) {
+            if (fsStoreProduct.getIsDisplay() == 1) {
+                logger.info("商品前端展示:{}", fsStoreProduct.getProductName() + new Date());
+            }
+        }
+        return fsPlatformProductService.addOrEdit(fsStoreProduct);
+    }
+
+
+}

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

@@ -112,7 +112,6 @@ public class FsStoreScrmController extends BaseController {
     /**
      * 修改店铺管理
      */
-
     @Log(title = "店铺管理", businessType = BusinessType.UPDATE, logParam = {"店铺", "修改店铺信息"}, isStoreLog = true)
     @PutMapping
     public AjaxResult edit(@RequestBody FsStoreScrmInfoParam fsStore) {