浏览代码

刷单小程序兼容

yjwang 2 周之前
父节点
当前提交
6b2b7e693d

+ 5 - 0
fs-service/src/main/java/com/fs/common/param/BaseQueryParam.java

@@ -19,4 +19,9 @@ public class BaseQueryParam extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "搜索字符串")
     private String keyword;
 
+    /**
+     * 是否药品
+     * **/
+    private Integer isDrug;
+
 }

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

@@ -40,6 +40,11 @@ public class FsStoreProductCategoryScrm extends BaseEntity
     @Excel(name = "删除状态")
     private Integer isDel;
 
+    /**
+     * 是否药品0否药品1
+     * **/
+    private Integer isDrug;
+
     public Long getStoreId() {
         return storeId;
     }
@@ -115,5 +120,11 @@ public class FsStoreProductCategoryScrm extends BaseEntity
         return isDel;
     }
 
+    public Integer getIsDrug() {
+        return isDrug;
+    }
 
+    public void setIsDrug(Integer isDrug) {
+        this.isDrug = isDrug;
+    }
 }

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductCategoryScrmMapper.java

@@ -79,6 +79,9 @@ public interface FsStoreProductCategoryScrmMapper
             "<if test = 'maps.storeId != null    '> " +
             "and c.store_id =#{maps.storeId} " +
             "</if>" +
+            "<if test = 'maps.isDrug != null and maps.isDrug == 0'> " +
+            "and c.is_drug = #{maps.isDrug} " +
+            "</if>" +
             " order by c.sort asc "+
             "</script>"})
     List<FsStoreProductCategoryScrm> selectFsStoreProductCategoryListQuery(@Param("maps") FsStoreProductCategoryScrm param);

+ 65 - 3
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -16,6 +16,7 @@ import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.param.FsStoreProductQueryParam;
 import com.fs.hisStore.vo.*;
 import com.fs.statis.dto.ProductAuditDTO;
+import io.swagger.models.auth.In;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -178,7 +179,7 @@ public interface FsStoreProductScrmMapper
         "from fs_store_product_scrm p " +
         "left join fs_store_product_category_scrm pc " +
         "on p.cate_id = pc.cate_id " +
-        "left JOIN fs_store_scrm ss " +
+        "inner JOIN fs_store_scrm ss " +
         "on ss.store_id = p.store_id " +
         "left join ( " +
         "select product_id, push_status " +
@@ -205,7 +206,7 @@ public interface FsStoreProductScrmMapper
         "</if> " +
         "where 1=1 " +
         //审核通过的才会展示到列表,防止主要商品列表中展示未审核商品
-        "<if test='maps.isAudit == null'>"+
+        "<if test='maps.isAudit == null and (maps.isDrug == null or (maps.isDrug != null and maps.isDrug == 1))'>"+
             "<if test='maps.isShow == 1'>" +
                 "and p.is_audit =  1"+
             "</if>" +
@@ -213,6 +214,8 @@ public interface FsStoreProductScrmMapper
                 "and p.is_audit !=  1"+
             "</if>" +
         "</if>" +
+
+
         // 评论内容条件
         "<if test='maps.commentContent != null and maps.commentContent.trim() != \"\"'> " +
         "and fsosc.content like CONCAT('%', #{maps.commentContent}, '%') " +
@@ -394,6 +397,10 @@ public interface FsStoreProductScrmMapper
             "and p.is_good = #{maps.isGood}" +
             "</if>" +
 
+            "<if test = 'maps.isDrug != null and maps.isDrug != \"\"' > " +
+            "and p.is_drug = #{maps.isDrug}" +
+            "</if>" +
+
             "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
             "order by p.sort desc,product_id desc" +
             "</if>" +
@@ -460,7 +467,7 @@ public interface FsStoreProductScrmMapper
             "</if>" +
             "and  p.is_good=1 and p.is_display=1 order by p.sort desc limit #{count}")
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count,@Param("config") MedicalMallConfig  config);
-    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(@Param("config") MedicalMallConfig  config);
+    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(@Param("config") MedicalMallConfig  config, @Param("isDrug") Integer isDrug);
 
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(@Param("config") MedicalMallConfig  config);
     @Select({"<script> " +
@@ -636,4 +643,59 @@ public interface FsStoreProductScrmMapper
      */
     List<ForbiddenOnlineMedicine> selectForbiddenKeywords(@Param("keyword") String keyword);
 
+    @Select({"<script> " +
+//            "select p.* from fs_store_product_scrm p  " +
+            "SELECT\n" +
+            "\tp.* \n" +
+            "FROM\n" +
+            "\tfs_store_product_scrm p\n" +
+            "where p.is_del=0 and p.is_show=1  and p.is_audit = '1'" +
+            "<if test = 'maps.productName != null and  maps.productName !=\"\"    '> " +
+            "and (p.product_name like CONCAT('%',#{maps.productName},'%')  or p.keyword like concat('%',#{maps.productName},'%') ) " +
+            "</if>" +
+            "<if test = 'maps.isDisplay != null and maps.isDisplay == 1   '> " +
+            "and p.is_display =#{maps.isDisplay}  " +
+            "</if>" +
+            "<if test = 'maps.companyId != null'> " +
+            "and find_in_set(#{maps.companyId}, p.company_ids) " +
+            "</if>" +
+            "<if test = 'maps.cateId != null    '> " +
+            "and p.cate_id =#{maps.cateId}  " +
+            "</if>" +
+            "<if test = 'maps.storeId != null and maps.storeId != \"\"' > " +
+            "and p.store_id = #{maps.storeId}" +
+            "</if>" +
+            "<if test = 'maps.isGood != null and maps.isGood != \"\"' > " +
+            "and p.is_good = #{maps.isGood}" +
+            "</if>" +
+
+            "<if test = 'maps.isDrug != null and maps.isDrug == 0' > " +
+            "and p.is_drug = #{maps.isDrug}" +
+            "</if>" +
+
+            "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
+            "order by p.sort desc,product_id desc" +
+            "</if>" +
+            "<if test = 'maps.priceOrder != null and maps.priceOrder==\"desc\"   '> " +
+            "order by p.price desc " +
+            "</if>" +
+            "<if test = 'maps.priceOrder != null and maps.priceOrder==\"asc\"   '> " +
+            "order by p.price asc " +
+            "</if>" +
+            "<if test = 'maps.salesOrder != null  and maps.salesOrder==\"desc\" '> " +
+            "order by p.sales desc " +
+            "</if>" +
+            "<if test = 'maps.salesOrder != null  and maps.salesOrder==\"asc\" '> " +
+            "order by p.sales asc " +
+            "</if>" +
+            "<if test = 'maps.newOrder != null and maps.newOrder==\"desc\" '> " +
+            "and p.is_new =1 order by p.create_time desc  " +
+            "</if>" +
+            "</script>"})
+    List<FsStoreProductListQueryVO> selectFsStoreProductOrdinaryListQuery(@Param("maps")FsStoreProductQueryParam param);
+
+    /**
+     * 普通商品我猜你喜欢列表
+     * **/
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListList();
 }

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

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.fs.common.core.domain.R;
+import com.fs.common.param.BaseQueryParam;
 import com.fs.common.utils.txocr.ContainsResult;
 import com.fs.his.domain.FsStoreProduct;
 import com.fs.hisStore.domain.ForbiddenOnlineMedicine;
@@ -113,7 +114,7 @@ public interface IFsStoreProductScrmService
 
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count);
 
-    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery();
+    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(BaseQueryParam param);
 
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery();
 
@@ -185,4 +186,16 @@ public interface IFsStoreProductScrmService
      * @param cateId 分类id
      */
     ContainsResult checkStoreDrugLicense(Long storeId, Long cateId);
+
+    /**
+     * 普通商品查询
+     * @param param 请求参数
+     * **/
+    List<FsStoreProductListQueryVO> selectFsStoreProductOrdinaryListQuery(FsStoreProductQueryParam param);
+
+
+    /**
+     * 普通商品查询
+     * **/
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListList();
 }

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

@@ -19,6 +19,7 @@ import com.fs.common.BeanCopyUtils;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
 import com.fs.common.exception.ServiceException;
+import com.fs.common.param.BaseQueryParam;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.txocr.ContainsResult;
 import com.fs.common.utils.txocr.TxOcrClient;
@@ -978,10 +979,10 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     }
 
     @Override
-    public List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery() {
+    public List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(BaseQueryParam param) {
         SysConfig config = configService.selectConfigByConfigKey("medicalMall.func.switch");
         MedicalMallConfig medicalMallConfig = JSON.parseObject(config.getConfigValue(), MedicalMallConfig.class);
-        return fsStoreProductMapper.selectFsStoreProductTuiListQuery(medicalMallConfig);
+        return fsStoreProductMapper.selectFsStoreProductTuiListQuery(medicalMallConfig,param.getIsDrug());
     }
 
     @Override
@@ -1500,6 +1501,16 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         return TxOcrClient.enterpriseLicenseOCR(drugLicenseUrl, cateName);
     }
 
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductOrdinaryListQuery(FsStoreProductQueryParam param) {
+        return fsStoreProductMapper.selectFsStoreProductOrdinaryListQuery(param);
+    }
+
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductGoodListList() {
+        return fsStoreProductMapper.selectFsStoreProductGoodListList();
+    }
+
     @Override
     public List<Map<String, String>> getStoreProductColumns() {
         List<Map<String, String> > list = fsStoreProductMapper.getStoreProductColumns();

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

@@ -18,7 +18,7 @@ public interface MedicineMapper {
     @Mapping(source = "productName", target = "commonName")
     @Mapping(source = "productName", target = "name")
     @Mapping(source = "dosageForm", target = "dosage")
-    @Mapping(source = "dosage", target = "spec")
+    @Mapping(source = "prescribeSpec", target = "spec")
     @Mapping(source = "prescribeSpec", target = "packingSpec")
     @Mapping(source = "manufacturer", target = "manufacturer")
     @Mapping(source = "drugRegCertNo", target = "approvalNumber")

+ 7 - 7
fs-service/src/main/resources/application-dev-yjb.yml

@@ -33,7 +33,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                    url: jdbc:mysql://nj-cdb-6306xy90.sql.tencentcdb.com:27077/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    url: jdbc:mysql://nj-cdb-4tbz4oqv.sql.tencentcdb.com:25247/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
                     password: Ylrz147..
                 # 初始连接数
@@ -81,7 +81,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                  url: jdbc:mysql://nj-cdb-6306xy90.sql.tencentcdb.com:27077/fs_his_sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                  url: jdbc:mysql://nj-cdb-4tbz4oqv.sql.tencentcdb.com:25247/fs_his_sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                   username: root
                   password: Ylrz147..
                 # 初始连接数
@@ -158,8 +158,8 @@ openIM:
 isNewWxMerchant: true
 
 hospital580:
-    url: https://ehospital-openapi-test.sq580.com
-    clientId: yjbz_15700159162_test
-    secretKey: ESzFwwum4Jz95f4ubg4rP7lQG4LZsWFv
-    storeId: 17478
-    callbackUrl: http://v78ee625.natappfree.cc/hospital580/sync/medicine
+    url: https://ehospital-openapi.sq580.com
+    clientId: yjbz_4537_prod
+    secretKey: F5oXOThiYOLkZK4zBsp8R4ecs7c25umw
+    storeId: 188804
+    callbackUrl: https://storeuserapp.bjyjbao.com/hospital580/sync/medicine

+ 1 - 1
fs-service/src/main/resources/application-druid-bnkc-test.yml

@@ -39,7 +39,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                  url: jdbc:mysql://nj-cdb-n80v6uox.sql.tencentcdb.com:22935/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                  url: jdbc:mysql://nj-cdb-n80v6uox.sql.tencentcdb.com:22935/fs_his_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                   username: root
                   password: Ylrz_1q2w3e4r5t6y
                 # 从库数据源

+ 6 - 1
fs-service/src/main/resources/mapper/hisStore/FsStoreProductCategoryScrmMapper.xml

@@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="isDel"    column="is_del"    />
         <result property="storeId"    column="store_id"    />
+        <result property="isDrug"    column="is_drug"    />
     </resultMap>
 
     <sql id="selectFsStoreProductCategoryVo">
-        select cate_id, pid, cate_name, sort, pic, is_show, create_time, update_time, is_del,store_id from fs_store_product_category_scrm
+        select cate_id, pid, cate_name, sort, pic, is_show, create_time, update_time, is_del,store_id,is_drug from fs_store_product_category_scrm
     </sql>
 
     <select id="selectFsStoreProductCategoryList" parameterType="FsStoreProductCategoryScrm" resultMap="FsStoreProductCategoryResult">
@@ -30,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pic != null  and pic != ''"> and pic = #{pic}</if>
             <if test="isShow != null "> and is_show = #{isShow}</if>
             <if test="isDel != null "> and is_del = #{isDel}</if>
+            <if test="isDrug != null "> and is_drug = #{isDrug}</if>
             <if test="storeId != null "> and store_id = #{storeId}</if>
         </where>
     </select>
@@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
             <if test="isDel != null">is_del,</if>
             <if test="storeId != null">store_id,</if>
+            <if test="isDrug != null ">is_drug ,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="pid != null">#{pid},</if>
@@ -62,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isDel != null">#{isDel},</if>
             <if test="storeId != null">#{storeId},</if>
+            <if test="isDrug != null ">#{isDrug} ,</if>
          </trim>
     </insert>
 
@@ -76,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
+            <if test="isDrug != null ">is_drug = #{isDrug},</if>
         </trim>
         where cate_id = #{cateId}
     </update>

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

@@ -571,7 +571,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             GROUP BY product_name
             ) t_all ON t_all.product_name = fsp.product_name
 
-            <if test='config.isStores == "1" '>
+            <if test='config.isStores == "1" and (isDrug == null or isDrug != null and isDrug == 1)'>
                 INNER JOIN fs_store_scrm fs ON fs.store_id = fsp.store_id
             </if>
 
@@ -581,12 +581,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND fsp.is_good = 1
             AND fsp.is_best = 1
             AND fsp.is_display = 1
-            <if test='config.isAudit == "1" '>
+            <if test='config.isAudit == "1" and (isDrug == null or isDrug != null and isDrug == 1)'>
                 AND fsp.is_audit = '1'
             </if>
-            <if test='config.isStores == "1" '>
+            <if test='config.isStores == "1" and (isDrug == null or isDrug != null and isDrug == 1)'>
                 AND fs.status = '1'
             </if>
+             <if test='isDrug != null '>
+                 AND fsp.is_drug = #{isDrug}
+             </if>
             GROUP BY fsp.product_name
             ORDER BY fsp.sort DESC, fsp.product_id DESC
     </select>
@@ -856,4 +859,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+    <select id="selectFsStoreProductGoodListList" resultType="com.fs.hisStore.vo.FsStoreProductListQueryVO">
+        select p.* from fs_store_product_scrm p
+        where p.is_del = 0
+        and p.is_show = 1
+        and p.is_good = 1
+        and p.is_display = 1
+        and p.is_drug = 0
+        order by p.sort desc
+    </select>
+
 </mapper>

+ 9 - 1
fs-user-app/src/main/java/com/fs/app/controller/store/IndexScrmController.java

@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.Cacheable;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.LinkedList;
 import java.util.List;
 
 
@@ -58,10 +59,17 @@ public class IndexScrmController extends AppBaseController {
 	@ApiOperation("获取首页数据")
 	@GetMapping("/getIndexData")
 	public R getIndexData(HttpServletRequest request){
+		String isDrug=request.getParameter("isDrug");
 		List<FsArticleCateListQueryVO> articleCateList=articleCateService.selectFsArticleCateListQuery();
 		List<FsAdvListQueryVO> advList=advService.selectFsAdvListQuery(1);
 		List<FsStoreProductListQueryVO> newProductList=productService.selectFsStoreProductNewQuery(10);
-		List<FsStoreProductListQueryVO> hotProductList=productService.selectFsStoreProductHotQuery(10);
+		List<FsStoreProductListQueryVO> hotProductList=null;
+		if(isDrug != null && isDrug.equals("0")){
+			hotProductList = new LinkedList<>();
+		}else {
+			newProductList=productService.selectFsStoreProductNewQuery(10);
+		}
+		productService.selectFsStoreProductHotQuery(10);
 		IndexVO vo=IndexVO.builder().articleCateList(articleCateList).advList(advList).newProductList(newProductList).hotProductList(hotProductList).build();
 		return R.ok().put("data", vo);
 	}

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

@@ -4,6 +4,7 @@ package com.fs.app.controller.store;
 import com.alibaba.fastjson.JSON;
 import com.fs.app.annotation.Login;
 import com.fs.app.controller.AppBaseController;
+import com.fs.common.BeanCopyUtils;
 import com.fs.common.core.domain.R;
 import com.fs.common.param.BaseQueryParam;
 import com.fs.common.utils.StringUtils;
@@ -19,6 +20,9 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.models.auth.In;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -65,12 +69,13 @@ public class ProductScrmController extends AppBaseController {
      * @return     */
     @ApiOperation("获取分类")
     @GetMapping("/getProductCate")
-    public R getProductCate(@RequestParam(name = "storeId",required = false) Long storeId){
+    public R getProductCate(@RequestParam(name = "storeId",required = false) Long storeId,@RequestParam(name = "isDrug",required = false) Integer isDrug){
         try {
             FsStoreProductCategoryScrm param=new FsStoreProductCategoryScrm();
             param.setIsShow(1);
             param.setIsDel(0);
             param.setStoreId(storeId);
+            param.setIsDrug(isDrug);
             List<FsStoreProductCategoryScrm> list=categoryService.selectFsStoreProductCategoryListQuery(param);
             return R.ok().put("data",list);
         } catch (Exception e){
@@ -79,12 +84,13 @@ public class ProductScrmController extends AppBaseController {
     }
     @ApiOperation("获取分类")
     @GetMapping("/getProductCateByPid")
-    public R getProductCateByPid(@RequestParam(value="pid") Long pid, @RequestParam(value="storeId",required = false) Long storeId,HttpServletRequest request){
+    public R getProductCateByPid(@RequestParam(value="pid") Long pid, @RequestParam(value="storeId",required = false) Long storeId, @Param("isDrug") Integer isDrug, HttpServletRequest request){
         try {
             FsStoreProductCategoryScrm param=new FsStoreProductCategoryScrm();
             param.setIsShow(1);
             param.setIsDel(0);
             param.setPid(pid);
+            param.setIsDrug(isDrug);
             param.setStoreId(storeId);
             List<FsStoreProductCategoryScrm> list=categoryService.selectFsStoreProductCategoryListQuery(param);
             return R.ok().put("data",list);
@@ -98,29 +104,44 @@ public class ProductScrmController extends AppBaseController {
     public R getProducts(FsStoreProductQueryParam param, HttpServletRequest request){
         PageHelper.startPage(param.getPage(), param.getPageSize());
         param.setIsDisplay(1);
-        List<FsStoreProductListQueryVO> productList=productService.selectFsStoreProductListQuery(param);
+        List<FsStoreProductListQueryVO> productList = null;
+        if(param.getIsDrug() != null && param.getIsDrug() == 0){
+            productList = productService.selectFsStoreProductOrdinaryListQuery(param);
+        }else {
+            productList = productService.selectFsStoreProductListQuery(param);
+        }
         PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(productList);
         return R.ok().put("data",listPageInfo);
     }
     @ApiOperation("获取商品详情")
     @GetMapping("/getProductDetails")
-    public R getProductDetails(@RequestParam(value="productId") Long productId,String storeId){
-        FsStoreProductQueryVO product=productService.selectFsStoreProductByIdQuery(productId, storeId);
-        if(product==null){
-            return R.error("商品不存在或已下架");
-        }
-        //增加店铺信息
+    public R getProductDetails(@RequestParam(value="productId") Long productId,String storeId,Integer isDrug){
+        FsStoreProductQueryVO product = new FsStoreProductQueryVO();
         FsStoreScrm fsStoreScrm = null;
-        if(StringUtils.isNotEmpty(product.getStoreId())){
-            fsStoreScrm = storeScrmService.selectFsStoreByStoreId(Long.parseLong(product.getStoreId()));
-            //根据按判断校验条件
-            SysConfig mallconfig = configService.selectConfigByConfigKey("medicalMall.func.switch");
-            MedicalMallConfig medicalMallConfig = JSON.parseObject(mallconfig.getConfigValue(), MedicalMallConfig.class);
+        if(isDrug != null && isDrug == 0){
+            FsStoreProductScrm productScrm = productService.selectFsStoreProductById(productId);
+            if(productScrm == null){
+                return R.error("操作失败,商品不存在!");
+            }
+            BeanUtils.copyProperties(productScrm, product);
+        }else {
+            product = productService.selectFsStoreProductByIdQuery(productId, storeId);
+            if(product==null){
+                return R.error("商品不存在或已下架");
+            }
+            //增加店铺信息
+            if(StringUtils.isNotEmpty(product.getStoreId())){
+                fsStoreScrm = storeScrmService.selectFsStoreByStoreId(Long.parseLong(product.getStoreId()));
+                //根据按判断校验条件
+                SysConfig mallconfig = configService.selectConfigByConfigKey("medicalMall.func.switch");
+                MedicalMallConfig medicalMallConfig = JSON.parseObject(mallconfig.getConfigValue(), MedicalMallConfig.class);
 
-            if(medicalMallConfig != null && medicalMallConfig.isThreePartyEntry() && fsStoreScrm.getStatus() != 1){
-                return R.error("当前商品店铺"+fsStoreScrm.getStoreName()+"已停用!");
+                if(medicalMallConfig != null && medicalMallConfig.isThreePartyEntry() && fsStoreScrm.getStatus() != 1){
+                    return R.error("当前商品店铺"+fsStoreScrm.getStoreName()+"已停用!");
+                }
             }
         }
+
         List<FsStoreProductAttrScrm> productAttr=attrService.selectFsStoreProductAttrByProductId(product.getProductId());
         List<FsStoreProductAttrValueScrm> productValues=attrValueService.selectFsStoreProductAttrValueByProductId(product.getProductId());
 
@@ -272,15 +293,28 @@ public class ProductScrmController extends AppBaseController {
     @GetMapping("/getTuiProducts")
     public R getTuiProducts(BaseQueryParam param, HttpServletRequest request){
         PageHelper.startPage(param.getPage(), param.getPageSize());
-        List<FsStoreProductListQueryVO> list=productService.selectFsStoreProductTuiListQuery();
-        PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list.size() < 4?list.subList(0,list.size()):list.subList(0,4));
+        List<FsStoreProductListQueryVO> list=productService.selectFsStoreProductTuiListQuery(param);
+        PageInfo<FsStoreProductListQueryVO> listPageInfo;
+
+        //普通商品
+        if(param.getIsDrug() != null && param.getIsDrug() == 0){
+            listPageInfo = new PageInfo<>(list);
+        }else {//药品
+            listPageInfo=new PageInfo<>(list.size() < 4?list.subList(0,list.size()):list.subList(0,4));
+        }
+
         return R.ok().put("data",listPageInfo);
     }
     @ApiOperation("获取喜欢商品数据")
     @GetMapping("/getGoodsProducts")
     public R getGoodsProducts(BaseQueryParam param, HttpServletRequest request){
         PageHelper.startPage(param.getPage(), param.getPageSize());
-        List<FsStoreProductListQueryVO> list=productService.selectFsStoreProductGoodListQuery();
+        List<FsStoreProductListQueryVO> list;
+        if(param.getIsDrug() != null && param.getIsDrug() == 0){
+            list =productService.selectFsStoreProductGoodListList();
+        }else {
+            list = productService.selectFsStoreProductGoodListQuery();
+        }
         PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
         return R.ok().put("data",listPageInfo);
 

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

@@ -470,6 +470,7 @@ public class StoreOrderScrmController extends AppBaseController {
                 o.setReqSeqId("store-" + storePayment.getPayCode());
                 o.setTransAmt(storePayment.getPayMoney().toString());
                 o.setGoodsDesc("商城订单支付");
+                o.setAppId(param.getAppId());
                 HuifuCreateOrderResult result = huiFuService.createOrder(o);
                 //创建订单
                 if (result.getBank_code() != null && result.getBank_code().equals("00000000")) {