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()); 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..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 @@ -53,7 +53,7 @@ public interface ArticleService extends IService
{ Article updateArticle(Article article); /** - * 删除文章 + * 删除文章--id * * @param id */ @@ -87,4 +87,12 @@ 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); } \ 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..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 @@ -91,4 +91,12 @@ 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; + } } \ No newline at end of file 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); } 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..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 @@ -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,15 @@ 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 = "修改文章状态") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "文章ID", required = true, paramType = "path"),