Просмотр исходного кода

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

15376779826 3 недель назад
Родитель
Сommit
98b097a497

+ 21 - 6
fs-user-app/src/main/java/com/fs/app/controller/AddressController.java

@@ -79,6 +79,21 @@ public class AddressController extends  AppBaseController {
             return R.error("操作异常");
         }
     }
+
+    @Login
+//    @ApiOperation("获取地址列表")
+    @GetMapping("/getAddressListV2")
+    public R getAddressListV2(HttpServletRequest request){
+        try {
+            FsUserAddress map=new FsUserAddress();
+            map.setUserId(Long.parseLong(getUserId()));
+            map.setIsDel(0);
+            List<FsUserAddress> list=addressService.selectFsUserAddressList(map);
+            return R.ok().put("data",list);
+        } catch (Exception e){
+            return R.error("操作异常");
+        }
+    }
     @Login
 //    @ApiOperation("获取地址信息")
     @GetMapping("/getAddressById")
@@ -106,11 +121,11 @@ public class AddressController extends  AppBaseController {
         }
 
 
-           Long cityId= addressService.selectFsUserAddressByCityName(address.getCity());
-           address.setCityId(cityId);
-           if (cityId==null){
-               return R.error("系统中暂无此区县,请手动选择所在地区");
-           }
+        Long cityId= addressService.selectFsUserAddressByCityName(address.getCity());
+        address.setCityId(cityId);
+        if (cityId==null){
+            return R.error("系统中暂无此区县,请手动选择所在地区");
+        }
 
         address.setPhone(address.getPhone().trim());
         FsUserAddress userAddress=new FsUserAddress();
@@ -163,4 +178,4 @@ public class AddressController extends  AppBaseController {
         return R.ok("操作成功");
     }
 
-}
+}

+ 9 - 2
fs-user-app/src/main/java/com/fs/app/controller/AdvController.java

@@ -30,10 +30,17 @@ public class AdvController extends  AppBaseController {
      * @return     */
     @ApiOperation("获取广告")
     @GetMapping("/getAdv")
-    public R getProductCate(@RequestParam(value="advType") Integer advType, HttpServletRequest request){
+    public R getAdvert(@RequestParam(value="advType") Integer advType, HttpServletRequest request){
+        List<FsAdvListQueryVO> advList=advService.selectFsAdvListQuery(advType);
+        return R.ok().put("data", advList);
+    }
+
+    @ApiOperation("获取广告")
+    @GetMapping("/getAdvV2")
+    public R getAdvV2(@RequestParam(value="advType") Integer advType, HttpServletRequest request){
         List<FsAdvListQueryVO> advList=advService.selectFsAdvListQuery(advType);
         return R.ok().put("data", advList);
     }
 
 
-}
+}

+ 13 - 3
fs-user-app/src/main/java/com/fs/app/controller/CommonController.java

@@ -69,7 +69,7 @@ import java.util.concurrent.TimeUnit;
 public class CommonController extends AppBaseController {
 	Logger logger = LoggerFactory.getLogger(CommonController.class);
 	@Autowired
-    JwtUtils jwtUtils;
+	JwtUtils jwtUtils;
 	@Autowired
 	private ServerConfig serverConfig;
 	@Autowired
@@ -132,7 +132,7 @@ public class CommonController extends AppBaseController {
 	@Autowired
 	private FsWechatTemplateMapper fsWechatTemplateMapper;
 
-//	@ApiOperation("批量推送订单")
+	//	@ApiOperation("批量推送订单")
 //	@GetMapping("pushOms")
 //	public R pushOms(String startTime) throws Exception
 //	{
@@ -161,7 +161,7 @@ public class CommonController extends AppBaseController {
 //	{
 //		PayApiServiceImpl payService = new PayApiServiceImpl();
 //		OrderQueryDTO o = new OrderQueryDTO();
-////        o.setLowOrderId("orderWx123456121");
+	////        o.setLowOrderId("orderWx123456121");
 //		o.setUpOrderId(orderId);
 //		OrderResult order = payService.getOrder(o);
 //
@@ -476,6 +476,16 @@ public class CommonController extends AppBaseController {
 
 	}
 
+	@GetMapping(value = "/getStoreConfigV2")
+	@ApiOperation("获取系统配置")
+	public R getStoreConfigV2()
+	{
+		String config=configService.selectConfigByKey("store.config");
+		StoreConfig storeConfig= JSONUtil.toBean(config,StoreConfig.class);
+		return  R.ok().put("data",storeConfig);
+
+	}
+
 
 
 

+ 16 - 1
fs-user-app/src/main/java/com/fs/app/controller/CouponController.java

@@ -68,6 +68,21 @@ public class CouponController extends AppBaseController {
         }
     }
 
+    @Login
+    @ApiOperation("获取我的优惠券列表")
+    @GetMapping("/getMyCouponListV2")
+    public R getMyCouponListV2(){
+        try {
+            FsStoreCouponUser map=new FsStoreCouponUser();
+            map.setIsDel(0);
+            map.setUserId(Long.parseLong(getUserId()));
+            List<FsStoreCouponUser> list=fsStoreCouponUserService.selectFsStoreCouponUserList(map);
+            return R.ok().put("data",list);
+        } catch (Exception e){
+            return R.error("操作异常");
+        }
+    }
+
     @Login
     @ApiOperation("领取")
     @PostMapping("/receive")
@@ -127,4 +142,4 @@ public class CouponController extends AppBaseController {
     }
 
 
-}
+}

+ 30 - 1
fs-user-app/src/main/java/com/fs/app/controller/IndexController.java

@@ -89,6 +89,35 @@ public class IndexController extends AppBaseController {
 		return R.ok().put("data", vo);
 	}
 
+	@ApiOperation("获取首页数据")
+	@GetMapping("/getIndexDataV2")
+	public R getIndexDataV2(String appId){
+		boolean flag=false;
+		if (appId!=null){
+			FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(appId);
+			if (config!=null && config.getSpecialMini()==1){
+				flag = true;
+			}
+		}
+		List<FsArticleCateListQueryVO> articleCateList=articleCateService.selectFsArticleCateListQuery();
+		List<FsAdvListQueryVO> advList=advService.selectFsAdvListQuery(1);
+		List<FsStoreProductListQueryVO> newProductList;
+		if (flag){
+			newProductList=productService.selectFsStoreProductNewQuerySp(10);
+		}else {
+			newProductList=productService.selectFsStoreProductNewQuery(10);
+		}
+		List<FsStoreProductListQueryVO> hotProductList;
+		if (flag){
+			hotProductList=productService.selectFsStoreProductHotQuerySp(10);
+		}else {
+			hotProductList=productService.selectFsStoreProductHotQuery(10);
+		}
+
+		IndexVO vo=IndexVO.builder().articleCateList(articleCateList).advList(advList).newProductList(newProductList).hotProductList(hotProductList).build();
+		return R.ok().put("data", vo);
+	}
+
 	@ApiOperation("读取菜单数据")
 	@GetMapping("/getMenu")
 	@Cacheable("menu")
@@ -208,4 +237,4 @@ public class IndexController extends AppBaseController {
 	}
 
 
-}
+}

+ 141 - 2
fs-user-app/src/main/java/com/fs/app/controller/ProductController.java

@@ -58,6 +58,20 @@ public class ProductController extends  AppBaseController {
             return R.error("操作异常");
         }
     }
+
+    @ApiOperation("获取分类")
+    @GetMapping("/getProductCateV2")
+    public R getProductCateV2(){
+        try {
+            FsStoreProductCategory param=new FsStoreProductCategory();
+            param.setIsShow(1);
+            param.setIsDel(0);
+            List<FsStoreProductCategory> list=categoryService.selectFsStoreProductCategoryListQuery(param);
+            return R.ok().put("data",list);
+        } catch (Exception e){
+            return R.error("操作异常");
+        }
+    }
     @ApiOperation("获取分类")
     @GetMapping("/getProductCateByPid")
     public R getProductCateByPid(@RequestParam(value="pid") Long pid){
@@ -73,6 +87,21 @@ public class ProductController extends  AppBaseController {
         }
     }
 
+    @ApiOperation("获取分类")
+    @GetMapping("/getProductCateByPidV2")
+    public R getProductCateByPidV2(@RequestParam(value="pid") Long pid){
+        try {
+            FsStoreProductCategory param=new FsStoreProductCategory();
+            param.setIsShow(1);
+            param.setIsDel(0);
+            param.setPid(pid);
+            List<FsStoreProductCategory> list=categoryService.selectFsStoreProductCategoryListQuery(param);
+            return R.ok().put("data",list);
+        } catch (Exception e){
+            return R.error("操作异常");
+        }
+    }
+
     @ApiOperation("获取商品列表")
     @GetMapping("/getProducts")
     public R getProducts(FsStoreProductQueryParam param){
@@ -88,6 +117,24 @@ public class ProductController extends  AppBaseController {
         PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(productList);
         return R.ok().put("data",listPageInfo);
     }
+
+
+    @ApiOperation("获取商品列表")
+    @GetMapping("/getProductsV2")
+    public R getProductsV2(FsStoreProductQueryParam param){
+        if (param.getAppId()!=null){
+            FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(param.getAppId());
+            if (config!=null && config.getSpecialMini()==1){
+                param.setSpecialProducts(1);
+            }
+        }
+        PageHelper.startPage(param.getPage(), param.getPageSize());
+        param.setIsDisplay(1);
+        List<FsStoreProductListQueryVO> 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){
@@ -127,6 +174,46 @@ public class ProductController extends  AppBaseController {
         return R.ok().put("product",product).put("productAttr",productAttr).put("productValues",productValues);
     }
 
+
+    @ApiOperation("获取商品详情")
+    @GetMapping("/getProductDetailsV2")
+    public R getProductDetailsV2(@RequestParam(value="productId") Long productId){
+        FsStoreProductQueryVO product=productService.selectFsStoreProductByIdQuery(productId);
+        if(product==null){
+            return R.error("商品不存在或已下架");
+        }
+        List<FsStoreProductAttr> productAttr=attrService.selectFsStoreProductAttrByProductId(product.getProductId());
+        List<FsStoreProductAttrValue> productValues=attrValueService.selectFsStoreProductAttrValueByProductId(product.getProductId());
+
+        //获取用户的TOKEN写入足迹
+        String userId=getUserId();
+        if(userId!=null){
+            FsStoreProductRelation productRelation=new FsStoreProductRelation();
+            productRelation.setIsDel(0);
+            productRelation.setUserId(Long.parseLong(userId));
+            productRelation.setProductId(product.getProductId());
+            productRelation.setType("foot");
+            List<FsStoreProductRelation> productRelations=productRelationService.selectFsStoreProductRelationList(productRelation);
+            if(productRelations!=null&&productRelations.size()>0){
+                FsStoreProductRelation relation=productRelations.get(0);
+                relation.setUpdateTime(new Date());
+                productRelationService.updateFsStoreProductRelation(relation);
+            }
+            else{
+                FsStoreProductRelation relation=new FsStoreProductRelation();
+                relation.setUserId(Long.parseLong(userId));
+                relation.setIsDel(0);
+                relation.setProductId(product.getProductId());
+                relation.setUpdateTime(new Date());
+                relation.setType("foot");
+                relation.setCreateTime(new Date());
+                relation.setUpdateTime(new Date());
+                productRelationService.insertFsStoreProductRelation(relation);
+            }
+        }
+        return R.ok().put("product",product).put("productAttr",productAttr).put("productValues",productValues);
+    }
+
     @Login
     @ApiOperation("添加购物车")
     @PostMapping("/addCart")
@@ -163,6 +250,15 @@ public class ProductController extends  AppBaseController {
         return R.ok().put("data", count);
     }
 
+    @Login
+    @ApiOperation("获取商品购物车数量")
+    @GetMapping("/getCartCountV2")
+    public R getCartCountV2(FsStoreCartCountParam param){
+        param.setUserId(Long.parseLong(getUserId()));
+        Integer count=cartService.selectFsStoreCartCount(param);
+        return R.ok().put("data", count);
+    }
+
     @ApiOperation("获取推荐商品列表")
     @GetMapping("/getTuiProduct")
     public R getTuiProduct(){
@@ -195,9 +291,52 @@ public class ProductController extends  AppBaseController {
         PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
         return R.ok().put("data",listPageInfo);
     }
+
+    @ApiOperation("获取推荐商品数据")
+    @GetMapping("/getTuiProductsV2")
+    public R getTuiProductsV2(BaseQueryParam param,String appId){
+        boolean flag=false;
+        if (appId!=null){
+            FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(appId);
+            if (config!=null && config.getSpecialMini()==1){
+                flag = true;
+            }
+        }
+        PageHelper.startPage(param.getPage(), param.getPageSize());
+        List<FsStoreProductListQueryVO> list = new ArrayList<>();
+        if (flag){
+            list=productService.selectFsStoreProductTuiListQuerySp();
+        }else {
+            list=productService.selectFsStoreProductTuiListQuery();
+        }
+        PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
+        return R.ok().put("data",listPageInfo);
+    }
     @ApiOperation("获取喜欢商品数据")
     @GetMapping("/getGoodsProducts")
-    public R getGoodsProducts(BaseQueryParam param,String appId){
+    public R getFavoriteProducts(BaseQueryParam param,String appId){
+        boolean flag=false;
+        if (appId!=null){
+            FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(appId);
+            if (config!=null && config.getSpecialMini()==1){
+                flag = true;
+            }
+        }
+        PageHelper.startPage(param.getPage(), param.getPageSize());
+        List<FsStoreProductListQueryVO> list = new ArrayList<>();
+        if (flag){
+            list=productService.selectFsStoreProductGoodListQuerySp();
+        }else {
+            list=productService.selectFsStoreProductGoodListQuery();
+        }
+        PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
+        return R.ok().put("data",listPageInfo);
+
+    }
+
+    @ApiOperation("获取喜欢商品数据")
+    @GetMapping("/getGoodsProductsV2")
+    public R getGoodsProductsV2(BaseQueryParam param,String appId){
         boolean flag=false;
         if (appId!=null){
             FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(appId);
@@ -228,4 +367,4 @@ public class ProductController extends  AppBaseController {
 
 
 
-}
+}

+ 23 - 1
fs-user-app/src/main/java/com/fs/app/controller/StoreOrderController.java

@@ -51,7 +51,18 @@ public class StoreOrderController extends  AppBaseController {
     @Login
     @ApiOperation("获取我的订单列表")
     @GetMapping("/getMyStoreOrderList")
-        public R getMyStoreOrderList(FsMyStoreOrderQueryParam param){
+    public R getMyStoreOrderList(FsMyStoreOrderQueryParam param){
+        PageHelper.startPage(param.getPage(), param.getPageSize());
+        param.setUserId(Long.parseLong(getUserId()));
+        List<FsMyStoreOrderListQueryVO> list=orderService.selectFsMyStoreOrderListVO(param);
+        PageInfo<FsMyStoreOrderListQueryVO> listPageInfo=new PageInfo<>(list);
+        return R.ok().put("data",listPageInfo);
+    }
+
+    @Login
+    @ApiOperation("获取我的订单列表")
+    @GetMapping("/getMyStoreOrderListV2")
+    public R getMyStoreOrderListV2(FsMyStoreOrderQueryParam param){
         PageHelper.startPage(param.getPage(), param.getPageSize());
         param.setUserId(Long.parseLong(getUserId()));
         List<FsMyStoreOrderListQueryVO> list=orderService.selectFsMyStoreOrderListVO(param);
@@ -419,4 +430,15 @@ public class StoreOrderController extends  AppBaseController {
         return R.ok().put("count0",count0).put("count1",count1).put("count2",count2).put("afterSalesCount",afterSalesCount);
     }
 
+    @Login
+    @ApiOperation("获取订单总数")
+    @GetMapping("/getOrderCountV2")
+    public R getOrderCountV2(){
+        Integer count0=orderService.selectFsStoreOrderCount(Long.parseLong(getUserId()),0);
+        Integer count1=orderService.selectFsStoreOrderCount(Long.parseLong(getUserId()),1);
+        Integer count2=orderService.selectFsStoreOrderCount(Long.parseLong(getUserId()),2);
+        Integer afterSalesCount=afterSalesService.selectFsStoreAfterSalesCount(Long.parseLong(getUserId()),0);
+        return R.ok().put("count0",count0).put("count1",count1).put("count2",count2).put("afterSalesCount",afterSalesCount);
+    }
+
 }