Bläddra i källkod

feat:商城-添加appid过滤商品展示

caoliqin 1 dag sedan
förälder
incheckning
4942818685

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

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -76,7 +77,7 @@ public class FsStoreStatisticsScrmController extends BaseController
             List<JSONObject> jsonObjectList = storeOrderService.selectFsStoreOrderCounts(timeEntity.toMap());
             List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
             List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
-            List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
+            List<BigDecimal> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getBigDecimal("payPrice")).collect(Collectors.toList());
             //表格数据
             List<FsStoreOrderCountsVO> tableData = storeOrderService.selectFsStoreOrderCountsByDept(timeEntity.toMap(),param.getDeptId());
             return R.ok().put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice).put("tableData",tableData);

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

@@ -478,6 +478,9 @@ public interface FsStoreOrderScrmMapper
             "<if test = 'maps.userId != null     '> " +
             "and o.user_id=#{maps.userId} " +
             "</if>" +
+            "<if test = 'maps.appId != null and  maps.appId !=\"\"    '> " +
+            "and o.app_id =#{maps.appId} " +
+            "</if>" +
             " order by o.id desc "+
             "</script>"})
     List<FsMyStoreOrderListQueryVO> selectFsMyStoreOrderListVO(@Param("maps")FsMyStoreOrderQueryParam param);

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

@@ -274,7 +274,7 @@ public interface FsStoreProductScrmMapper
             "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, @Param("param") BaseQueryParam param);
-    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(@Param("config") MedicalMallConfig  config);
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(@Param("config") MedicalMallConfig  config, @Param("param") BaseQueryParam param);
     @Select({"<script> " +
             "select count(1) from fs_store_product_scrm  " +
             "where 1=1 " +

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsMyStoreOrderQueryParam.java

@@ -1,6 +1,7 @@
 package com.fs.hisStore.param;
 
 import com.fs.common.param.BaseQueryParam;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -13,4 +14,6 @@ public class FsMyStoreOrderQueryParam extends BaseQueryParam implements Serializ
     private Long companyId;
     private Long companyUserId;
     private Integer deliveryStatus;
+    @ApiModelProperty(value = "当前的appid")
+    private String appId;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductPackageQueryParam.java

@@ -1,6 +1,7 @@
 package com.fs.hisStore.param;
 
 import com.fs.common.param.BaseQueryParam;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -12,4 +13,6 @@ public class FsStoreProductPackageQueryParam extends BaseQueryParam implements S
     private String title;
     private String cateId;
     private Integer status;
+    @ApiModelProperty(value = "当前的appid")
+    private String appId;
 }

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

@@ -97,15 +97,15 @@ public interface IFsStoreProductScrmService
     void incProductStock(Long num, Long productId, Long productAttrValueId);
 
 
-    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count);
+    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count, String appId);
 
-    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count);
+    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count, String appId);
 
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count);
 
     List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(BaseQueryParam param);
 
-    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery();
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(BaseQueryParam param);
 
     Long selectFsStoreProductCount(int type);
     Long selectFsStoreProductCount(int type,Long companyId);

+ 6 - 4
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -1058,18 +1058,20 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     }
 
     @Override
-    public List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count) {
+    public List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count, String appId) {
         HashMap<String, Object> map = new HashMap<>();
         map.put("count", count);
         map.put("config", medicalMallConfig);
+        map.put("appId", appId);
         return fsStoreProductMapper.selectFsStoreProductNewQuery(map);
     }
 
     @Override
-    public List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count) {
+    public List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count, String appId) {
         HashMap<String, Object> map = new HashMap<>();
         map.put("count", count);
         map.put("config", medicalMallConfig);
+        map.put("appId", appId);
         return fsStoreProductMapper.selectFsStoreProductHotQuery(map);
     }
 
@@ -1084,8 +1086,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
     }
 
     @Override
-    public List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery() {
-        return fsStoreProductMapper.selectFsStoreProductGoodListQuery(medicalMallConfig);
+    public List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(BaseQueryParam param) {
+        return fsStoreProductMapper.selectFsStoreProductGoodListQuery(medicalMallConfig, param);
     }
 
     @Override

+ 9 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -513,6 +513,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test='config.isAudit == "1"'>
             and p.is_audit = '1'
         </if>
+        <if test='appId != null and appId = "" '>
+            and ((FIND_IN_SET(#{appId}, p.app_ids) > 0))
+        </if>
         and p.is_new=1 and p.is_display=1 order by p.sort desc limit #{count}
     </select>
     <select id="selectFsStoreProductHotQuery" resultType="com.fs.hisStore.vo.FsStoreProductListQueryVO">
@@ -524,6 +527,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test='config.isAudit == "1" '>
         and p.is_audit = '1'
         </if>
+        <if test='appId != null and appId = "" '>
+            and ((FIND_IN_SET(#{appId}, p.app_ids) > 0))
+        </if>
         and  p.is_hot=1 and p.is_display=1 order by p.sort desc limit #{count}
     </select>
     <select id="selectFsStoreProductGoodListQuery" resultType="com.fs.hisStore.vo.FsStoreProductListQueryVO">
@@ -535,6 +541,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test='config.isAudit == "1" '>
         and p.is_audit = '1'
         </if>
+        <if test = 'param.appId != null and param.appId != ""'>
+        and ((FIND_IN_SET(#{param.appId}, p.app_ids) > 0))
+        </if>
         and  p.is_good=1 and p.is_display=1 order by p.sort desc
     </select>
 

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

@@ -69,8 +69,8 @@ public class IndexScrmController extends AppBaseController {
 	public R getIndexData(HttpServletRequest request){
 		List<FsArticleCateListQueryVO> articleCateList=articleCateService.selectFsArticleCateListQuery();
 		List<FsAdvListQueryVO> advList=advService.selectFsAdvListQuery(1);
-		List<FsStoreProductListQueryVO> newProductList=productService.selectFsStoreProductNewQuery(10);
-		List<FsStoreProductListQueryVO> hotProductList=productService.selectFsStoreProductHotQuery(12);
+		List<FsStoreProductListQueryVO> newProductList=productService.selectFsStoreProductNewQuery(10, request.getParameter("appId"));
+		List<FsStoreProductListQueryVO> hotProductList=productService.selectFsStoreProductHotQuery(12, request.getParameter("appId"));
 		IndexVO vo=IndexVO.builder().articleCateList(articleCateList).advList(advList).newProductList(newProductList).hotProductList(hotProductList).build();
 		return R.ok().put("data", vo);
 	}

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

@@ -268,7 +268,7 @@ public class ProductScrmController extends AppBaseController {
     @GetMapping("/getGoodsProducts")
     public R getGoodsProducts(BaseQueryParam param, HttpServletRequest request){
         PageHelper.startPage(param.getPage(), param.getPageSize());
-        List<FsStoreProductListQueryVO> list=productService.selectFsStoreProductGoodListQuery();
+        List<FsStoreProductListQueryVO> list=productService.selectFsStoreProductGoodListQuery(param);
         PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
         return R.ok().put("data",listPageInfo);