From f6c2f32c485f5b8f7229be04d3d6cd753dfe5266 Mon Sep 17 00:00:00 2001 From: qiaohui <924337501@qq.com> Date: Thu, 24 Oct 2024 20:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=AE=A2=E6=88=B7=E6=9C=80=E8=BF=91=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E7=9A=84=E5=95=86=E5=93=81=E4=BB=B7=E6=A0=BC=E5=8F=8A=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=8E=A5=E5=8F=A3getByUserIdAndProductIds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hiver-admin/test-output/test-report.html | 18 +++++++------- .../controller/ShopPrintController.java | 24 ++++--------------- .../mall/controller/ProductController.java | 15 ++++++++++++ .../hiver/mall/dao/mapper/ProductMapper.java | 2 ++ .../mall/service/mybatis/ProductService.java | 2 ++ .../mybatis/ProductServiceImpl.java | 6 +++++ .../main/resources/mapper/ProductMapper.xml | 22 +++++++++++++++++ 7 files changed, 61 insertions(+), 28 deletions(-) diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html index f4d31fea..cf1276a6 100644 --- a/hiver-admin/test-output/test-report.html +++ b/hiver-admin/test-output/test-report.html @@ -5,7 +5,7 @@ -Hiver测试报告 +Hiver娴嬭瘯鎶ュ憡 @@ -35,7 +35,7 @@ Hiver
  • -十月 19, 2024 22:12:49 +鍗佹湀 23, 2024 23:46:29
  • @@ -84,7 +84,7 @@

    passTest

    -

    22:12:51 下午 / 0.028 secs

    +

    23:46:29 涓嬪崍 / 0.01 secs

    @@ -92,9 +92,9 @@
    #test-id=1
    passTest
    -10.19.2024 22:12:51 -10.19.2024 22:12:51 -0.028 secs +10.23.2024 23:46:29 +10.23.2024 23:46:29 +0.01 secs
    @@ -104,7 +104,7 @@ Pass - 22:12:51 + 23:46:29 Test passed @@ -128,13 +128,13 @@

    Started

    -

    十月 19, 2024 22:12:49

    +

    鍗佹湀 23, 2024 23:46:29

    Ended

    -

    十月 19, 2024 22:12:51

    +

    鍗佹湀 23, 2024 23:46:29

    diff --git a/hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java b/hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java index 17895fd8..02978caa 100644 --- a/hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java +++ b/hiver-core/src/main/java/cc/hiver/core/shopprint/controller/ShopPrintController.java @@ -66,19 +66,12 @@ public class ShopPrintController { } } - /** - * 鍒犻櫎鐗╂祦绾胯矾 - * - * @param id - * @return Result - * @author 鐜嬪瘜搴 - * @date 2024/8/24 - */ - @PostMapping(value = "/delete") + + @GetMapping(value = "/delete", produces = "application/json") @ApiOperation("鍒犻櫎搴楅摵鎵撳嵃鍐呭") - public Result deleteLogisticsRoute(String id) { + public Result deleteShopPrint(String id) { if (StringUtils.isEmpty(id)) { - return ResultUtil.error("绾胯矾id涓嶈兘涓虹┖锛"); + return ResultUtil.error("id涓嶈兘涓虹┖锛"); } final boolean b = shopPrintService.removeById(id); if (b) { @@ -88,14 +81,7 @@ public class ShopPrintController { } } - /** - * 鍒嗛〉鏌ヨ鐗╂祦绾胯矾 - * - * @param logisticsRouteQueryVo - * @return Result> - * @author 鐜嬪瘜搴 - * @date 2024/8/24 - */ + @RequestMapping(value = "/getList", method = RequestMethod.POST) @ApiOperation(value = "鏌ヨ鎵撳嵃鍐呭") public Result> getLogisticsRoutePageList(@RequestBody(required = false) ShopPrintQueryVo shopPrintQueryVo) { diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java index 1f7ce840..8198632e 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductController.java @@ -378,4 +378,19 @@ public class ProductController { return ResultUtil.success("鏈煡鍒板搴斿晢鍝佷俊鎭!"); } } + + @RequestMapping(value = "/getByUserIdAndProductIds", method = RequestMethod.POST) + @ApiOperation("鎵归噺鑾峰彇瀹㈡埛鏈杩戣喘涔扮殑鍟嗗搧浠锋牸鍙婃暟閲") + public Result getByUserIdAndProductIds(String userId, String productIds) { + String[] ids = {}; + if(StringUtils.isNotEmpty(productIds)){ + ids = productIds.split(","); + } + final List byProductSn = productService.getByUserIdAndProductIds(userId, ids); + if (byProductSn != null) { + return new ResultUtil>().setData(byProductSn); + } else { + return ResultUtil.success("鏈煡鍒板搴斿晢鍝佷俊鎭!"); + } + } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java index f91fb371..9c1c8484 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductMapper.java @@ -47,6 +47,8 @@ public interface ProductMapper extends BaseMapper { ProductLastBuyVo getByUserIdAndProductId(@Param("userId") String userId, @Param("productId") String productId); + List getByUserIdAndProductIds(@Param("userId") String userId, @Param("array") String[] productIds); + Product getByIdOrBrcode(String id); List getByBarcode(@Param("barcode") String barcode, @Param("shopId") String shopId); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java index ea282740..51642c8a 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductService.java @@ -34,6 +34,8 @@ public interface ProductService extends IService { ProductLastBuyVo getByUserIdAndProductId(String userId, String productId); + List getByUserIdAndProductIds(String userId, String[] productId); + Product getByIdOrBrcode(String id,String customerId); List getByBarcode(String barcode, String customerId); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java index 2bceae5c..bff8557a 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java @@ -182,6 +182,12 @@ public class ProductServiceImpl extends ServiceImpl impl return baseMapper.getByUserIdAndProductId(userId, productId); } + + @Override + public List getByUserIdAndProductIds(String userId, String[] productIds) { + return baseMapper.getByUserIdAndProductIds(userId, productIds); + } + @Override public Product getByIdOrBrcode(String id, String customerId) { final Product byIdOrBrcode = baseMapper.getByIdOrBrcode(id); diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml index 78fbdb2f..af774cac 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml @@ -746,6 +746,28 @@ limit 1 + + +