diff --git a/buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java index f348c882..1d26fef2 100644 --- a/buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/order/OrderComplaintBuyerController.java @@ -82,7 +82,7 @@ public class OrderComplaintBuyerController { @PostMapping("/communication") public ResultMessage addCommunication(@RequestParam String complainId, @RequestParam String content) { AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser()); - OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.BUYER.name(), currentUser.getId(), currentUser.getNickName()); + OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.BUYER.name(), currentUser.getNickName(), currentUser.getId()); orderComplaintCommunicationService.addCommunication(communicationVO); return ResultUtil.data(communicationVO); } diff --git a/common-api/src/main/java/cn/lili/controller/security/CommonSecurityConfig.java b/common-api/src/main/java/cn/lili/controller/security/CommonSecurityConfig.java index 8fa1f8c2..5ad1d4a2 100644 --- a/common-api/src/main/java/cn/lili/controller/security/CommonSecurityConfig.java +++ b/common-api/src/main/java/cn/lili/controller/security/CommonSecurityConfig.java @@ -1,8 +1,5 @@ package cn.lili.controller.security; -import cn.lili.cache.Cache; -import cn.lili.common.security.CustomAccessDeniedHandler; -import cn.lili.common.properties.IgnoredUrlsProperties; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; @@ -25,19 +22,10 @@ import org.springframework.web.cors.CorsConfigurationSource; public class CommonSecurityConfig extends WebSecurityConfigurerAdapter { - /** - * 忽略验权配置 - */ - @Autowired - private IgnoredUrlsProperties ignoredUrlsProperties; /** * spring security -》 权限不足处理 */ @Autowired - private CustomAccessDeniedHandler accessDeniedHandler; - @Autowired - private Cache cache; - @Autowired private CorsConfigurationSource corsConfigurationSource; @Override diff --git a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java index 82df940e..429a3950 100644 --- a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java +++ b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java @@ -253,14 +253,17 @@ public class GoodsMessageListener implements RocketMQListener { try { log.info("更新商品索引促销信息: {}", promotionsJsonStr); JSONObject jsonObject = JSONUtil.parseObj(promotionsJsonStr); + // 转换为详细的促销信息(注:促销信息必须继承自 BasePromotions,且必须保证派生类存在与sdk包下) BasePromotions promotions = (BasePromotions) jsonObject.get("promotions", ClassLoaderUtil.loadClass(jsonObject.get("promotionsType").toString())); + // 获取促销唯一key,由 促销类型 + 促销id 组成 String esPromotionKey = jsonObject.get("esPromotionKey").toString(); if (PromotionsScopeTypeEnum.PORTION_GOODS.name().equals(promotions.getScopeType())) { PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams(); searchParams.setPromotionId(promotions.getId()); List promotionGoodsList = this.promotionGoodsService.listFindAll(searchParams); List skuIds = promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList()); + // 更新商品索引促销信息(删除原索引中相关的促销信息,更新索引中促销信息) this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey); this.goodsIndexService.updateEsGoodsIndexByList(promotionGoodsList, promotions, esPromotionKey); } else if (PromotionsScopeTypeEnum.PORTION_GOODS_CATEGORY.name().equals(promotions.getScopeType())) { @@ -268,9 +271,11 @@ public class GoodsMessageListener implements RocketMQListener { searchParams.setCategoryPath(promotions.getScopeId()); List goodsSkuByList = this.goodsSkuService.getGoodsSkuByList(searchParams); List skuIds = goodsSkuByList.stream().map(GoodsSku::getId).collect(Collectors.toList()); + // 更新商品索引促销信息(删除原索引中相关的促销信息,更新索引中促销信息) this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey); this.goodsIndexService.updateEsGoodsIndexPromotions(skuIds, promotions, esPromotionKey); } else if (PromotionsScopeTypeEnum.ALL.name().equals(promotions.getScopeType())) { + // 更新商品索引促销信息(删除原索引中相关的促销信息,更新索引中促销信息) this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(esPromotionKey); this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey); } diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/coupon/CouponExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/coupon/CouponExecute.java index 613380d6..acb0503c 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/coupon/CouponExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/coupon/CouponExecute.java @@ -34,7 +34,7 @@ public class CouponExecute implements EveryDayExecute { */ @Override public void execute() { - //将过期优惠券变更为过期状体 + //将过期优惠券变更为过期状态 LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name()) .le(MemberCoupon::getEndTime, new Date()) diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java index 6772fb93..4b450d6c 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/StoreCollectionServiceImpl.java @@ -36,7 +36,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl storeCollection(PageVO pageVo) { - QueryWrapper queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("sc.member_id", UserContext.getCurrentUser().getId()); queryWrapper.orderByDesc("sc.create_time"); return this.baseMapper.storeCollectionVOList(PageUtil.initPage(pageVo), queryWrapper); @@ -44,10 +44,10 @@ public class StoreCollectionServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("member_id", UserContext.getCurrentUser().getId()); queryWrapper.eq("store_id", storeId); - return Optional.ofNullable(this.getOne(queryWrapper)).isPresent(); + return Optional.ofNullable(this.getOne(queryWrapper, false)).isPresent(); } @Override @@ -67,7 +67,7 @@ public class StoreCollectionServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("member_id", UserContext.getCurrentUser().getId()); queryWrapper.eq("store_id", storeId); storeService.updateStoreCollectionNum(new CollectionDTO(storeId, -1)); diff --git a/framework/src/main/java/cn/lili/modules/sms/entity/dos/SmsReach.java b/framework/src/main/java/cn/lili/modules/sms/entity/dos/SmsReach.java index 09ec8dfa..33ff2db6 100644 --- a/framework/src/main/java/cn/lili/modules/sms/entity/dos/SmsReach.java +++ b/framework/src/main/java/cn/lili/modules/sms/entity/dos/SmsReach.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import org.springframework.data.annotation.CreatedDate; import org.springframework.format.annotation.DateTimeFormat; @@ -23,8 +24,11 @@ import java.util.Date; @Data @TableName("li_sms_reach") @ApiModel(value = "短信任务") +@EqualsAndHashCode(callSuper = true) public class SmsReach extends BaseIdEntity { + private static final long serialVersionUID = -8106666482841131277L; + @ApiModelProperty(value = "签名名称", required = true) private String signName; diff --git a/manager-api/src/main/java/cn/lili/controller/order/OrderComplaintManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/OrderComplaintManagerController.java index e0cf6b43..c3286749 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/OrderComplaintManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/OrderComplaintManagerController.java @@ -23,6 +23,8 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Objects; + /** * 管理端,交易投诉接口 * @@ -74,8 +76,8 @@ public class OrderComplaintManagerController { }) @PostMapping("/communication") public ResultMessage addCommunication(@RequestParam String complainId, @RequestParam String content) { - AuthUser currentUser = UserContext.getCurrentUser(); - OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.PLATFORM.name(), currentUser.getId(), currentUser.getUsername()); + AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser()); + OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.PLATFORM.name(), currentUser.getUsername(), currentUser.getId()); orderComplaintCommunicationService.addCommunication(communicationVO); return ResultUtil.data(communicationVO); } diff --git a/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java b/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java index d93e73e1..80ca8903 100644 --- a/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/passport/AdminUserManagerController.java @@ -8,7 +8,6 @@ import cn.lili.common.security.AuthUser; import cn.lili.common.security.context.UserContext; import cn.lili.common.security.enums.UserEnums; import cn.lili.common.security.token.Token; -import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; import cn.lili.common.vo.SearchVO; @@ -17,7 +16,6 @@ import cn.lili.modules.permission.entity.dos.AdminUser; import cn.lili.modules.permission.entity.dto.AdminUserDTO; import cn.lili.modules.permission.entity.vo.AdminUserVO; import cn.lili.modules.permission.service.AdminUserService; -import cn.lili.modules.permission.service.DepartmentService; import cn.lili.modules.verification.entity.enums.VerificationEnums; import cn.lili.modules.verification.service.VerificationService; import cn.lili.mybatis.util.PageUtil; @@ -49,8 +47,6 @@ import java.util.List; public class AdminUserManagerController { @Autowired private AdminUserService adminUserService; - @Autowired - private DepartmentService departmentService; /** * 会员 */ diff --git a/seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java b/seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java index 3913294f..72faab7b 100644 --- a/seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/order/OrderComplaintStoreController.java @@ -68,7 +68,7 @@ public class OrderComplaintStoreController { @PostMapping("/communication") public ResultMessage addCommunication(@RequestParam String complainId, @RequestParam String content) { AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser()); - OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.STORE.name(), currentUser.getStoreId(), currentUser.getUsername()); + OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.STORE.name(), currentUser.getUsername(), currentUser.getStoreId()); orderComplaintCommunicationService.addCommunication(communicationVO); return ResultUtil.success(); }