fix: 修复token过期返回403

This commit is contained in:
ah--desktop
2025-09-25 22:36:10 +08:00
parent 570e8986cd
commit 2ddff44068
69 changed files with 398 additions and 335 deletions
@@ -10,6 +10,11 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.core.AuthenticationException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import top.xyquan.ecomdmbbackend.common.filter.JwtAuthenticationFilter;
import top.xyquan.ecomdmbbackend.utils.JwtUtils;
@@ -43,8 +48,23 @@ public class SecurityConfig {
"/swagger-ui/**", "/swagger-ui.html")
.permitAll()
.anyRequest().authenticated())
.exceptionHandling(exceptions -> exceptions
.authenticationEntryPoint(new CustomAuthenticationEntryPoint()))
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
return http.build();
}
/**
* 自定义认证入口点,返回401状态码
*/
private static class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request, HttpServletResponse response,
AuthenticationException authException) throws IOException {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write("{\"code\":401,\"message\":\"Token无效或已过期,请重新登录\",\"data\":null}");
}
}
}
@@ -1,39 +0,0 @@
package top.xyquan.ecomdmbbackend.modules.ec.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.CreatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.PromotionFeeFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.UpdatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.PromotionFeeVO;
/**
* 推广费记录服务接口
*/
public interface PromotionFeeService {
/**
* 创建推广费记录
*/
Long createPromotionFee(CreatePromotionFeeDTO dto);
/**
* 更新推广费记录
*/
void updatePromotionFee(UpdatePromotionFeeDTO dto);
/**
* 删除推广费记录
*/
void deletePromotionFee(Long id);
/**
* 根据ID查询推广费记录
*/
PromotionFeeVO getPromotionFeeById(Long id);
/**
* 分页查询推广费记录
*/
IPage<PromotionFeeVO> getPromotionFeePage(Page<PromotionFeeVO> page, PromotionFeeFilterDTO filter);
}
@@ -1,90 +0,0 @@
package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.modules.ec.mapper.PromotionFeeMapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.CreatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.PromotionFeeFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.UpdatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.PromotionFeePO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.PromotionFeeVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.PromotionFeeService;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
import java.util.List;
import java.util.stream.Collectors;
/**
* 推广费记录服务实现类
*/
@Service
@RequiredArgsConstructor
public class PromotionFeeServiceImpl implements PromotionFeeService {
private final PromotionFeeMapper promotionFeeMapper;
private final CurrentUserContext currentUserContext;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createPromotionFee(CreatePromotionFeeDTO dto) {
PromotionFeePO po = new PromotionFeePO();
BeanUtils.copyProperties(dto, po);
po.setCompanyId(currentUserContext.getCurrentCompanyId());
po.setCreateBy(currentUserContext.getCurrentUserId());
po.setUpdateBy(currentUserContext.getCurrentUserId());
promotionFeeMapper.insert(po);
return po.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updatePromotionFee(UpdatePromotionFeeDTO dto) {
PromotionFeePO po = new PromotionFeePO();
BeanUtils.copyProperties(dto, po);
po.setUpdateBy(currentUserContext.getCurrentUserId());
promotionFeeMapper.updateById(po);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deletePromotionFee(Long id) {
// 硬删除推广费记录(外键约束会自动处理相关数据)
promotionFeeMapper.deleteById(id);
}
@Override
public PromotionFeeVO getPromotionFeeById(Long id) {
PromotionFeePO po = promotionFeeMapper.selectById(id);
if (po == null) {
return null;
}
PromotionFeeVO vo = new PromotionFeeVO();
BeanUtils.copyProperties(po, vo);
return vo;
}
@Override
public IPage<PromotionFeeVO> getPromotionFeePage(Page<PromotionFeeVO> page, PromotionFeeFilterDTO filter) {
Page<PromotionFeePO> poPage = new Page<>(page.getCurrent(), page.getSize());
IPage<PromotionFeePO> poPageResult = promotionFeeMapper.selectPageWithFilter(poPage, filter);
Page<PromotionFeeVO> voPage = new Page<>(poPageResult.getCurrent(), poPageResult.getSize(), poPageResult.getTotal());
List<PromotionFeeVO> voList = poPageResult.getRecords().stream()
.map(po -> {
PromotionFeeVO vo = new PromotionFeeVO();
BeanUtils.copyProperties(po, vo);
return vo;
})
.collect(Collectors.toList());
voPage.setRecords(voList);
return voPage;
}
}
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.controller;
package top.xyquan.ecomdmbbackend.modules.ecom.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -9,13 +9,13 @@ import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.BatchImportOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.OrderFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.BatchImportResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.OrderService;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.BatchImportOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.CreateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.OrderFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.UpdateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.BatchImportResultVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.OrderVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.OrderService;
/**
* 订单管理控制器
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.controller;
package top.xyquan.ecomdmbbackend.modules.ecom.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -7,10 +7,10 @@ import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderStatusVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.OrderStatusService;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.CreateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.UpdateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.OrderStatusVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.OrderStatusService;
import java.util.List;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.controller;
package top.xyquan.ecomdmbbackend.modules.ecom.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -11,12 +11,12 @@ import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductWithSpecsDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductService;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductWithSpecsDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.ProductFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.UpdateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductService;
/**
* 商品管理控制器
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.controller;
package top.xyquan.ecomdmbbackend.modules.ecom.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -11,13 +11,13 @@ import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductSpecFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService.ProductSpecQueryDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.ProductSpecFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.UpdateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductSpecService.ProductSpecQueryDTO;
/**
* 商品规格管理控制器
@@ -1,19 +1,20 @@
package top.xyquan.ecomdmbbackend.modules.ec.controller;
package top.xyquan.ecomdmbbackend.modules.ecom.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.CreatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.PromotionFeeFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.UpdatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.PromotionFeeVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.PromotionFeeService;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.CreatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.PromotionFeeFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.UpdatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.PromotionFeeVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.PromotionFeeService;
/**
* 推广费记录控制器
@@ -28,6 +29,7 @@ public class PromotionFeeController {
@PostMapping
@Operation(summary = "创建推广费记录", description = "创建新的推广费记录")
@RequireRole(description = "创建推广费记录", allowUser = false)
public ApiResponse<Long> createPromotionFee(@Valid @RequestBody CreatePromotionFeeDTO dto) {
Long id = promotionFeeService.createPromotionFee(dto);
return ApiResponse.success(id);
@@ -35,6 +37,7 @@ public class PromotionFeeController {
@PutMapping
@Operation(summary = "更新推广费记录", description = "更新推广费记录信息")
@RequireRole(description = "更新推广费记录", allowUser = false)
public ApiResponse<Void> updatePromotionFee(@Valid @RequestBody UpdatePromotionFeeDTO dto) {
promotionFeeService.updatePromotionFee(dto);
return ApiResponse.success();
@@ -42,6 +45,7 @@ public class PromotionFeeController {
@DeleteMapping("/{id}")
@Operation(summary = "删除推广费记录", description = "删除指定的推广费记录")
@RequireRole(description = "删除推广费记录", allowUser = false)
public ApiResponse<Void> deletePromotionFee(
@Parameter(description = "记录ID", required = true) @PathVariable Long id) {
promotionFeeService.deletePromotionFee(id);
@@ -50,20 +54,19 @@ public class PromotionFeeController {
@GetMapping("/{id}")
@Operation(summary = "查询推广费记录详情", description = "根据ID查询推广费记录详情")
@RequireRole(description = "查询推广费记录详情", allowUser = true)
public ApiResponse<PromotionFeeVO> getPromotionFeeById(
@Parameter(description = "记录ID", required = true) @PathVariable Long id) {
PromotionFeeVO vo = promotionFeeService.getPromotionFeeById(id);
return ApiResponse.success(vo);
}
@GetMapping("/page")
@PostMapping("/page")
@Operation(summary = "分页查询推广费记录", description = "分页查询推广费记录列表")
public ApiResponse<IPage<PromotionFeeVO>> getPromotionFeePage(
@Parameter(description = "页码", example = "1") @RequestParam(defaultValue = "1") Long current,
@Parameter(description = "每页大小", example = "10") @RequestParam(defaultValue = "10") Long size,
PromotionFeeFilterDTO filter) {
Page<PromotionFeeVO> page = new Page<>(current, size);
IPage<PromotionFeeVO> result = promotionFeeService.getPromotionFeePage(page, filter);
@RequireRole(description = "查询推广费记录列表", allowUser = true)
public ApiResponse<PageResultVO<PromotionFeeVO>> getPromotionFeePage(
@Valid @RequestBody PageQueryDTO<PromotionFeeFilterDTO> pageQueryDTO) {
PageResultVO<PromotionFeeVO> result = promotionFeeService.getPromotionFeePage(pageQueryDTO);
return ApiResponse.success(result);
}
}
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.controller;
package top.xyquan.ecomdmbbackend.modules.ecom.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -7,10 +7,10 @@ import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.CreatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.UpdatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.PromotionFeeTypeVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.PromotionFeeTypeService;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.CreatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.UpdatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.PromotionFeeTypeVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.PromotionFeeTypeService;
import java.util.List;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.controller;
package top.xyquan.ecomdmbbackend.modules.ecom.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -12,11 +12,11 @@ import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.CreateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.ShopFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.UpdateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ShopVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.ShopService;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.CreateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.ShopFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.UpdateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ShopVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ShopService;
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
import top.xyquan.ecomdmbbackend.utils.FileUploadUtils;
@@ -1,8 +1,8 @@
package top.xyquan.ecomdmbbackend.modules.ec.mapper;
package top.xyquan.ecomdmbbackend.modules.ecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.OrderPO;
/**
* 订单Mapper接口
@@ -1,8 +1,8 @@
package top.xyquan.ecomdmbbackend.modules.ec.mapper;
package top.xyquan.ecomdmbbackend.modules.ecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderStatusPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.OrderStatusPO;
/**
* 订单状态Mapper
@@ -1,8 +1,8 @@
package top.xyquan.ecomdmbbackend.modules.ec.mapper;
package top.xyquan.ecomdmbbackend.modules.ecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductPO;
/**
* 商品Mapper接口
@@ -1,12 +1,12 @@
package top.xyquan.ecomdmbbackend.modules.ec.mapper;
package top.xyquan.ecomdmbbackend.modules.ecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductSpecFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.ProductSpecFilterDTO;
/**
* 商品规格Mapper
@@ -1,12 +1,12 @@
package top.xyquan.ecomdmbbackend.modules.ec.mapper;
package top.xyquan.ecomdmbbackend.modules.ecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.PromotionFeePO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.PromotionFeeFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.PromotionFeePO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.PromotionFeeFilterDTO;
/**
* 推广费记录Mapper
@@ -1,8 +1,8 @@
package top.xyquan.ecomdmbbackend.modules.ec.mapper;
package top.xyquan.ecomdmbbackend.modules.ecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.PromotionFeeTypePO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.PromotionFeeTypePO;
import java.util.List;
@@ -1,8 +1,8 @@
package top.xyquan.ecomdmbbackend.modules.ec.mapper;
package top.xyquan.ecomdmbbackend.modules.ecom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ShopPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ShopPO;
/**
* 店铺Mapper接口
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop;
package top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.po;
package top.xyquan.ecomdmbbackend.modules.ecom.model.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.po;
package top.xyquan.ecomdmbbackend.modules.ecom.model.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.po;
package top.xyquan.ecomdmbbackend.modules.ecom.model.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.po;
package top.xyquan.ecomdmbbackend.modules.ecom.model.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.po;
package top.xyquan.ecomdmbbackend.modules.ecom.model.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.po;
package top.xyquan.ecomdmbbackend.modules.ecom.model.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.po;
package top.xyquan.ecomdmbbackend.modules.ecom.model.po;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
package top.xyquan.ecomdmbbackend.modules.ecom.model.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -1,15 +1,15 @@
package top.xyquan.ecomdmbbackend.modules.ec.service;
package top.xyquan.ecomdmbbackend.modules.ecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.BatchImportOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.OrderFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.BatchImportResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.BatchImportOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.CreateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.OrderFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.UpdateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.OrderPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.BatchImportResultVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.OrderVO;
/**
* 订单服务接口
@@ -1,8 +1,8 @@
package top.xyquan.ecomdmbbackend.modules.ec.service;
package top.xyquan.ecomdmbbackend.modules.ecom.service;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderStatusVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.CreateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.UpdateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.OrderStatusVO;
import java.util.List;
@@ -1,14 +1,14 @@
package top.xyquan.ecomdmbbackend.modules.ec.service;
package top.xyquan.ecomdmbbackend.modules.ecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductWithSpecsDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductWithSpecsDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.ProductFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.UpdateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductVO;
import java.util.List;
@@ -1,14 +1,14 @@
package top.xyquan.ecomdmbbackend.modules.ec.service;
package top.xyquan.ecomdmbbackend.modules.ecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductSpecFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.ProductSpecFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.UpdateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductVO;
import java.util.List;
@@ -0,0 +1,39 @@
package top.xyquan.ecomdmbbackend.modules.ecom.service;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.CreatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.PromotionFeeFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.UpdatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.PromotionFeeVO;
/**
* 推广费记录服务接口
*/
public interface PromotionFeeService {
/**
* 创建推广费记录
*/
Long createPromotionFee(CreatePromotionFeeDTO dto);
/**
* 更新推广费记录
*/
void updatePromotionFee(UpdatePromotionFeeDTO dto);
/**
* 删除推广费记录
*/
void deletePromotionFee(Long id);
/**
* 根据ID查询推广费记录
*/
PromotionFeeVO getPromotionFeeById(Long id);
/**
* 分页查询推广费记录
*/
PageResultVO<PromotionFeeVO> getPromotionFeePage(PageQueryDTO<PromotionFeeFilterDTO> pageQueryDTO);
}
@@ -1,8 +1,8 @@
package top.xyquan.ecomdmbbackend.modules.ec.service;
package top.xyquan.ecomdmbbackend.modules.ecom.service;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.CreatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.UpdatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.PromotionFeeTypeVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.CreatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.UpdatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.PromotionFeeTypeVO;
import java.util.List;
@@ -1,14 +1,14 @@
package top.xyquan.ecomdmbbackend.modules.ec.service;
package top.xyquan.ecomdmbbackend.modules.ecom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.CreateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.ShopFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.UpdateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ShopPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ShopVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.CreateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.ShopFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.UpdateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ShopPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ShopVO;
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
import java.util.List;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
package top.xyquan.ecomdmbbackend.modules.ecom.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -10,21 +10,21 @@ import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.common.exception.BusinessException;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.mapper.OrderMapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.BatchImportOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.OrderFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ShopPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.BatchImportResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.OrderService;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductService;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.modules.ec.service.ShopService;
import top.xyquan.ecomdmbbackend.modules.ecom.mapper.OrderMapper;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.BatchImportOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.CreateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.OrderFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.UpdateOrderDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.OrderPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ShopPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.BatchImportResultVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.OrderVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.OrderService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ShopService;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
import java.util.ArrayList;
@@ -1,16 +1,16 @@
package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
package top.xyquan.ecomdmbbackend.modules.ecom.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.modules.ec.mapper.OrderStatusMapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderStatusPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderStatusVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.OrderStatusService;
import top.xyquan.ecomdmbbackend.modules.ecom.mapper.OrderStatusMapper;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.CreateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.order.UpdateOrderStatusDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.OrderStatusPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.OrderStatusVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.OrderStatusService;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
import java.util.List;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
package top.xyquan.ecomdmbbackend.modules.ecom.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -11,17 +11,17 @@ import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.common.exception.BusinessException;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.mapper.ProductMapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductWithSpecsDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductService;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.modules.ecom.mapper.ProductMapper;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductWithSpecsDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.ProductFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.UpdateProductDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.modules.media.service.MediaImageService;
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
package top.xyquan.ecomdmbbackend.modules.ecom.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -10,16 +10,16 @@ import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.common.exception.BusinessException;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.mapper.ProductSpecMapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductSpecFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductService;
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.modules.ecom.mapper.ProductSpecMapper;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.CreateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.ProductSpecFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.product.UpdateProductSpecDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ProductSpecPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductSpecVO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ProductVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ProductSpecService;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
import java.util.List;
@@ -0,0 +1,130 @@
package top.xyquan.ecomdmbbackend.modules.ecom.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ecom.mapper.PromotionFeeMapper;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.CreatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.PromotionFeeFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.UpdatePromotionFeeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.PromotionFeePO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.PromotionFeeVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.PromotionFeeService;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
import java.util.List;
import java.util.stream.Collectors;
/**
* 推广费记录服务实现类
*/
@Service
@RequiredArgsConstructor
public class PromotionFeeServiceImpl implements PromotionFeeService {
private final PromotionFeeMapper promotionFeeMapper;
private final CurrentUserContext currentUserContext;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createPromotionFee(CreatePromotionFeeDTO dto) {
PromotionFeePO po = new PromotionFeePO();
BeanUtils.copyProperties(dto, po);
po.setCompanyId(currentUserContext.getCurrentCompanyId());
po.setCreateBy(currentUserContext.getCurrentUserId());
po.setUpdateBy(currentUserContext.getCurrentUserId());
promotionFeeMapper.insert(po);
return po.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updatePromotionFee(UpdatePromotionFeeDTO dto) {
PromotionFeePO po = new PromotionFeePO();
BeanUtils.copyProperties(dto, po);
po.setUpdateBy(currentUserContext.getCurrentUserId());
promotionFeeMapper.updateById(po);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deletePromotionFee(Long id) {
// 硬删除推广费记录(外键约束会自动处理相关数据)
promotionFeeMapper.deleteById(id);
}
@Override
public PromotionFeeVO getPromotionFeeById(Long id) {
PromotionFeePO po = promotionFeeMapper.selectById(id);
if (po == null) {
return null;
}
return convertToVO(po);
}
@Override
public PageResultVO<PromotionFeeVO> getPromotionFeePage(PageQueryDTO<PromotionFeeFilterDTO> pageQueryDTO) {
// 从token中获取公司ID
Long companyId = currentUserContext.getCurrentCompanyId();
// 创建分页对象
Page<PromotionFeePO> page = new Page<>(pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
// 构建查询条件
LambdaQueryWrapper<PromotionFeePO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PromotionFeePO::getCompanyId, companyId);
// 添加过滤条件
PromotionFeeFilterDTO filter = pageQueryDTO.getFilters();
if (filter != null) {
if (filter.getShopId() != null) {
wrapper.eq(PromotionFeePO::getShopId, filter.getShopId());
}
if (filter.getFeeTypeId() != null) {
wrapper.eq(PromotionFeePO::getFeeTypeId, filter.getFeeTypeId());
}
if (filter.getPlatform() != null && !filter.getPlatform().trim().isEmpty()) {
wrapper.like(PromotionFeePO::getPlatform, filter.getPlatform());
}
if (filter.getFeeDateStart() != null) {
wrapper.ge(PromotionFeePO::getFeeDate, filter.getFeeDateStart());
}
if (filter.getFeeDateEnd() != null) {
wrapper.le(PromotionFeePO::getFeeDate, filter.getFeeDateEnd());
}
}
// 排序
wrapper.orderByDesc(PromotionFeePO::getFeeDate)
.orderByDesc(PromotionFeePO::getCreateTime);
// 执行分页查询
IPage<PromotionFeePO> pageResult = promotionFeeMapper.selectPage(page, wrapper);
// 转换为VO
List<PromotionFeeVO> voList = pageResult.getRecords().stream()
.map(this::convertToVO)
.collect(Collectors.toList());
// 构建分页结果
return PageResultVO.create(voList, pageResult.getTotal(), pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
}
/**
* 转换为VO
*/
private PromotionFeeVO convertToVO(PromotionFeePO po) {
PromotionFeeVO vo = new PromotionFeeVO();
BeanUtils.copyProperties(po, vo);
return vo;
}
}
@@ -1,16 +1,16 @@
package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
package top.xyquan.ecomdmbbackend.modules.ecom.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.modules.ec.mapper.PromotionFeeTypeMapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.CreatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.promotion.UpdatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.PromotionFeeTypePO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.PromotionFeeTypeVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.PromotionFeeTypeService;
import top.xyquan.ecomdmbbackend.modules.ecom.mapper.PromotionFeeTypeMapper;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.CreatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.promotion.UpdatePromotionFeeTypeDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.PromotionFeeTypePO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.PromotionFeeTypeVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.PromotionFeeTypeService;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
import java.util.List;
@@ -1,4 +1,4 @@
package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
package top.xyquan.ecomdmbbackend.modules.ecom.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -10,13 +10,13 @@ import org.springframework.transaction.annotation.Transactional;
import top.xyquan.ecomdmbbackend.common.exception.BusinessException;
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
import top.xyquan.ecomdmbbackend.modules.ec.mapper.ShopMapper;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.CreateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.ShopFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.UpdateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ShopPO;
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ShopVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.ShopService;
import top.xyquan.ecomdmbbackend.modules.ecom.mapper.ShopMapper;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.CreateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.ShopFilterDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.dto.shop.UpdateShopDTO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.po.ShopPO;
import top.xyquan.ecomdmbbackend.modules.ecom.model.vo.ShopVO;
import top.xyquan.ecomdmbbackend.modules.ecom.service.ShopService;
import top.xyquan.ecomdmbbackend.modules.media.service.MediaImageService;
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
@@ -19,8 +19,8 @@ import top.xyquan.ecomdmbbackend.modules.org.model.vo.CompanyVO;
import top.xyquan.ecomdmbbackend.modules.org.service.CompanyService;
import top.xyquan.ecomdmbbackend.modules.media.service.MediaImageService;
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
import top.xyquan.ecomdmbbackend.modules.ec.service.OrderStatusService;
import top.xyquan.ecomdmbbackend.modules.ec.service.PromotionFeeTypeService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.OrderStatusService;
import top.xyquan.ecomdmbbackend.modules.ecom.service.PromotionFeeTypeService;
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
import org.springframework.web.multipart.MultipartFile;
@@ -3,7 +3,7 @@ server:
spring:
datasource:
url: "jdbc:mysql://jumper:3306/ecom_dmb_dev?characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true"
url: "jdbc:mysql://192.168.10.3:3306/ecom_dmb_dev?characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true"
username: ecom_dmb_dev
password: ecom_dmb_dev
hikari: