From 81c7a72b9c6c27d4a41cdb66a9a6d2b0750f2d65 Mon Sep 17 00:00:00 2001 From: Chopper Date: Mon, 11 Apr 2022 14:18:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=9C=A8=E8=B4=AD=E7=89=A9=E8=BD=A6=E4=B8=AD=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E4=BC=9A=E5=87=BA=E7=8E=B0=E7=9A=84=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=9E=81=E7=AB=AFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java | 5 +++++ .../cn/lili/modules/order/cart/render/impl/CouponRender.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java b/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java index e05113b1..45d9cd87 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/entity/dto/TradeDTO.java @@ -160,4 +160,9 @@ public class TradeDTO implements Serializable { } return skuList; } + + public void removeCoupon() { + this.canUseCoupons = new ArrayList<>(); + this.cantUseCoupons = new ArrayList<>(); + } } diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java index 9eb7f01e..549dbd04 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CouponRender.java @@ -57,8 +57,12 @@ public class CouponRender implements CartRenderStep { * @param tradeDTO 交易dto */ private void renderCouponRule(TradeDTO tradeDTO) { + // 清除之前的优惠券 + tradeDTO.removeCoupon(); + List memberCouponList = memberCouponService.getMemberCoupons(tradeDTO.getMemberId()); + //获取最新优惠券 memberCouponList = memberCouponList.stream() .filter(item -> item.getStartTime().before(new Date()) && item.getEndTime().after(new Date())) .collect(Collectors.toList()); From 6966376f916d20cde507acd099a231020d36c1f0 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Wed, 13 Apr 2022 11:06:51 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E7=B1=BB=E5=9E=8B=E4=BF=AE=E6=94=B9=E5=8F=8A?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E7=B1=BB=E5=9E=8B=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/page/service/ArticleService.java | 18 +++++++++++++++- .../page/serviceimpl/ArticleServiceImpl.java | 13 ++++++++++++ .../other/ArticleManagerController.java | 21 +++++++++++++++++-- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java b/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java index cd677a0b..9fd53538 100644 --- a/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java +++ b/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java @@ -53,7 +53,7 @@ public interface ArticleService extends IService
{ Article updateArticle(Article article); /** - * 删除文章 + * 删除文章--id * * @param id */ @@ -87,4 +87,20 @@ public interface ArticleService extends IService
{ */ @CacheEvict(key = "#id") Boolean updateArticleStatus(String id, boolean status); + + /** + * 修改文章--文章类型修改 + * @param article + * @return + */ + @CacheEvict(key = "#article.type") + Article updateArticleType(Article article); + + /** + * 删除文章--类型 + * @param type + * @param id + */ + @CacheEvict(key = "#type") + void delAllByType(String type, String id); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java b/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java index 5c942301..312ad9cc 100644 --- a/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java @@ -91,4 +91,17 @@ public class ArticleServiceImpl extends ServiceImpl impl article.setOpenStatus(status); return this.updateById(article); } + + @Override + public Article updateArticleType(Article article) { + Article oldArticle = this.getById(article.getId()); + BeanUtil.copyProperties(article, oldArticle); + this.updateById(oldArticle); + return oldArticle; + } + + @Override + public void delAllByType(String type,String id) { + this.removeById(id); + } } \ No newline at end of file diff --git a/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java index f9cf79ce..b74da239 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java @@ -60,7 +60,7 @@ public class ArticleManagerController { return ResultUtil.data(article); } - @ApiOperation(value = "修改文章") + @ApiOperation(value = "修改文章--文章id") @ApiImplicitParam(name = "id", value = "文章ID", required = true, paramType = "path") @PutMapping(value = "update/{id}", consumes = "application/json", produces = "application/json") public ResultMessage
update(@RequestBody Article article, @PathVariable("id") String id) { @@ -68,6 +68,23 @@ public class ArticleManagerController { return ResultUtil.data(articleService.updateArticle(article)); } + @ApiOperation(value = "修改文章--文章类型") + @ApiImplicitParam(name = "type", value = "文章类型", required = true, paramType = "path") + @PutMapping(value = "updateArticle/{type}", consumes = "application/json", produces = "application/json") + public ResultMessage
updateArticle(@RequestBody Article article, @PathVariable("type") String type,String id) { + article.setId(id); + article.setType(type); + return ResultUtil.data(articleService.updateArticleType(article)); + } + + @ApiOperation(value = "文章删除-文章类型") + @ApiImplicitParam(name = "type", value = "文章类型", required = true, dataType = "String", paramType = "path") + @DeleteMapping(value = "/delByIds/{type}") + public ResultMessage delAllByType(@PathVariable String type,String id) { + articleService.delAllByType(type,id); + return ResultUtil.success(); + } + @ApiOperation(value = "修改文章状态") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "文章ID", required = true, paramType = "path"), @@ -80,7 +97,7 @@ public class ArticleManagerController { } - @ApiOperation(value = "批量删除") + @ApiOperation(value = "批量删除--id") @ApiImplicitParam(name = "id", value = "文章ID", required = true, dataType = "String", paramType = "path") @DeleteMapping(value = "/delByIds/{id}") public ResultMessage delAllByIds(@PathVariable String id) { From d13b0404fbace4dc493b44235481a634349e0660 Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 13 Apr 2022 11:49:23 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81=E5=9C=A8info?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E7=9A=84=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/sms/impl/SmsUtilAliImplService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/sms/impl/SmsUtilAliImplService.java b/framework/src/main/java/cn/lili/modules/sms/impl/SmsUtilAliImplService.java index 19e999b9..f54982e2 100644 --- a/framework/src/main/java/cn/lili/modules/sms/impl/SmsUtilAliImplService.java +++ b/framework/src/main/java/cn/lili/modules/sms/impl/SmsUtilAliImplService.java @@ -122,7 +122,9 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil { //如果是测试模式 默认验证码 6个1 if (systemSettingProperties.getIsTestModel()) { code = "111111"; + log.info("测试模式 - 接收手机:{},验证码:{}",mobile,code); } else { + log.info("接收手机:{},验证码:{}",mobile,code); //发送短信 this.sendSmsCode(smsSetting.getSignName(), mobile, params, templateCode); } From ec04c3221fda8635ee9b6ed14640394f653810c9 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Wed, 13 Apr 2022 12:00:40 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/page/service/ArticleService.java | 8 -------- .../modules/page/serviceimpl/ArticleServiceImpl.java | 5 ----- .../controller/other/ArticleManagerController.java | 10 +--------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java b/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java index 9fd53538..67e97b56 100644 --- a/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java +++ b/framework/src/main/java/cn/lili/modules/page/service/ArticleService.java @@ -95,12 +95,4 @@ public interface ArticleService extends IService
{ */ @CacheEvict(key = "#article.type") Article updateArticleType(Article article); - - /** - * 删除文章--类型 - * @param type - * @param id - */ - @CacheEvict(key = "#type") - void delAllByType(String type, String id); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java b/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java index 312ad9cc..77ddd2f8 100644 --- a/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/page/serviceimpl/ArticleServiceImpl.java @@ -99,9 +99,4 @@ public class ArticleServiceImpl extends ServiceImpl impl this.updateById(oldArticle); return oldArticle; } - - @Override - public void delAllByType(String type,String id) { - this.removeById(id); - } } \ No newline at end of file diff --git a/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java b/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java index b74da239..ea8e22ab 100644 --- a/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/other/ArticleManagerController.java @@ -77,14 +77,6 @@ public class ArticleManagerController { return ResultUtil.data(articleService.updateArticleType(article)); } - @ApiOperation(value = "文章删除-文章类型") - @ApiImplicitParam(name = "type", value = "文章类型", required = true, dataType = "String", paramType = "path") - @DeleteMapping(value = "/delByIds/{type}") - public ResultMessage delAllByType(@PathVariable String type,String id) { - articleService.delAllByType(type,id); - return ResultUtil.success(); - } - @ApiOperation(value = "修改文章状态") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "文章ID", required = true, paramType = "path"), @@ -97,7 +89,7 @@ public class ArticleManagerController { } - @ApiOperation(value = "批量删除--id") + @ApiOperation(value = "批量删除") @ApiImplicitParam(name = "id", value = "文章ID", required = true, dataType = "String", paramType = "path") @DeleteMapping(value = "/delByIds/{id}") public ResultMessage delAllByIds(@PathVariable String id) {