mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 16:35:06 +08:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@ -1,18 +1,25 @@
|
||||
package cn.iocoder.yudao.module.product.controller.app.category;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.product.controller.app.category.vo.AppCategoryRespVO;
|
||||
import cn.iocoder.yudao.module.product.convert.category.ProductCategoryConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
|
||||
import cn.iocoder.yudao.module.product.service.category.ProductCategoryService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
@ -32,7 +39,19 @@ public class AppCategoryController {
|
||||
public CommonResult<List<AppCategoryRespVO>> getProductCategoryList() {
|
||||
List<ProductCategoryDO> list = categoryService.getEnableCategoryList();
|
||||
list.sort(Comparator.comparing(ProductCategoryDO::getSort));
|
||||
return success(ProductCategoryConvert.INSTANCE.convertList03(list));
|
||||
return success(BeanUtils.toBean(list, AppCategoryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list-by-ids")
|
||||
@Operation(summary = "获得商品分类列表,指定编号")
|
||||
@Parameter(name = "ids", description = "商品分类编号数组", required = true)
|
||||
public CommonResult<List<AppCategoryRespVO>> getProductCategoryList(@RequestParam("ids") List<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return success(Collections.emptyList());
|
||||
}
|
||||
List<ProductCategoryDO> list = categoryService.getEnableCategoryList(ids);
|
||||
list.sort(Comparator.comparing(ProductCategoryDO::getSort));
|
||||
return success(BeanUtils.toBean(list, AppCategoryRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,14 +42,6 @@ public class AppFavoriteController {
|
||||
return success(productFavoriteService.createFavorite(getLoginUserId(), reqVO.getSpuId()));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/create-list")
|
||||
@Operation(summary = "添加多个商品收藏")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> createFavoriteList(@RequestBody @Valid AppFavoriteBatchReqVO reqVO) {
|
||||
// todo @jason:待实现;如果有已经收藏的,不用报错,忽略即可;
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/delete")
|
||||
@Operation(summary = "取消单个商品收藏")
|
||||
@PreAuthenticated
|
||||
@ -58,15 +50,6 @@ public class AppFavoriteController {
|
||||
return success(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/delete-list")
|
||||
@Operation(summary = "取消多个商品收藏")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> deleteFavoriteList(@RequestBody @Valid AppFavoriteBatchReqVO reqVO) {
|
||||
// todo @jason:待实现
|
||||
// productFavoriteService.deleteFavorite(getLoginUserId(), reqVO.getSpuId());
|
||||
return success(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@Operation(summary = "获得商品收藏分页")
|
||||
@PreAuthenticated
|
||||
|
@ -78,9 +78,7 @@ public class AppProductSpuController {
|
||||
|
||||
@GetMapping("/list-by-ids")
|
||||
@Operation(summary = "获得商品 SPU 列表")
|
||||
@Parameters({
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
})
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
public CommonResult<List<AppProductSpuPageRespVO>> getSpuList(@RequestParam("ids") Set<Long> ids) {
|
||||
List<ProductSpuDO> list = productSpuService.getSpuList(ids);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
|
@ -18,6 +18,7 @@ public class AppProductSpuPageReqVO extends PageParam {
|
||||
|
||||
public static final String SORT_FIELD_PRICE = "price";
|
||||
public static final String SORT_FIELD_SALES_COUNT = "salesCount";
|
||||
public static final String SORT_FIELD_CREATE_TIME = "createTime";
|
||||
|
||||
public static final String RECOMMEND_TYPE_HOT = "hot";
|
||||
public static final String RECOMMEND_TYPE_BENEFIT = "benefit";
|
||||
|
@ -28,5 +28,4 @@ public interface ProductCategoryConvert {
|
||||
|
||||
List<ProductCategoryRespVO> convertList(List<ProductCategoryDO> list);
|
||||
|
||||
List<AppCategoryRespVO> convertList03(List<ProductCategoryDO> list);
|
||||
}
|
||||
|
@ -84,26 +84,27 @@ public interface ProductCommentConvert {
|
||||
return divide.intValue();
|
||||
}
|
||||
|
||||
ProductCommentDO convert(ProductCommentCreateReqDTO createReqDTO);
|
||||
|
||||
@Mapping(target = "scores",
|
||||
expression = "java(convertScores(createReqDTO.getDescriptionScores(), createReqDTO.getBenefitScores()))")
|
||||
default ProductCommentDO convert(ProductCommentCreateReqDTO createReqDTO, ProductSpuDO spuDO, ProductSkuDO skuDO, MemberUserRespDTO user) {
|
||||
ProductCommentDO commentDO = convert(createReqDTO);
|
||||
ProductCommentDO convert(ProductCommentCreateReqDTO createReqDTO);
|
||||
|
||||
default ProductCommentDO convert(ProductCommentCreateReqDTO createReqDTO,
|
||||
ProductSpuDO spu, ProductSkuDO sku, MemberUserRespDTO user) {
|
||||
ProductCommentDO comment = convert(createReqDTO).setReplyStatus(false);
|
||||
if (user != null) {
|
||||
commentDO.setUserId(user.getId());
|
||||
commentDO.setUserNickname(user.getNickname());
|
||||
commentDO.setUserAvatar(user.getAvatar());
|
||||
comment.setUserId(user.getId());
|
||||
comment.setUserNickname(user.getNickname());
|
||||
comment.setUserAvatar(user.getAvatar());
|
||||
}
|
||||
if (spuDO != null) {
|
||||
commentDO.setSpuId(spuDO.getId());
|
||||
commentDO.setSpuName(spuDO.getName());
|
||||
if (spu != null) {
|
||||
comment.setSpuId(spu.getId());
|
||||
comment.setSpuName(spu.getName());
|
||||
}
|
||||
if (skuDO != null) {
|
||||
commentDO.setSkuPicUrl(skuDO.getPicUrl());
|
||||
commentDO.setSkuProperties(skuDO.getProperties());
|
||||
if (sku != null) {
|
||||
comment.setSkuPicUrl(sku.getPicUrl());
|
||||
comment.setSkuProperties(sku.getProperties());
|
||||
}
|
||||
return commentDO;
|
||||
return comment;
|
||||
}
|
||||
|
||||
@Mapping(target = "visible", constant = "true")
|
||||
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCateg
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -32,4 +33,10 @@ public interface ProductCategoryMapper extends BaseMapperX<ProductCategoryDO> {
|
||||
return selectList(ProductCategoryDO::getStatus, status);
|
||||
}
|
||||
|
||||
default List<ProductCategoryDO> selectListByIdAndStatus(Collection<Long> ids, Integer status) {
|
||||
return selectList(new LambdaQueryWrapperX<ProductCategoryDO>()
|
||||
.in(ProductCategoryDO::getId, ids)
|
||||
.eq(ProductCategoryDO::getStatus, status));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -84,6 +84,9 @@ public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> {
|
||||
} else if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_PRICE)) {
|
||||
query.orderBy(true, pageReqVO.getSortAsc(), ProductSpuDO::getPrice)
|
||||
.orderByDesc(ProductSpuDO::getSort).orderByDesc(ProductSpuDO::getId);
|
||||
} else if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_CREATE_TIME)) {
|
||||
query.orderBy(true, pageReqVO.getSortAsc(), ProductSpuDO::getCreateTime)
|
||||
.orderByDesc(ProductSpuDO::getSort).orderByDesc(ProductSpuDO::getId);
|
||||
} else {
|
||||
query.orderByDesc(ProductSpuDO::getSort).orderByDesc(ProductSpuDO::getId);
|
||||
}
|
||||
|
@ -76,6 +76,14 @@ public interface ProductCategoryService {
|
||||
*/
|
||||
List<ProductCategoryDO> getEnableCategoryList();
|
||||
|
||||
/**
|
||||
* 获得开启状态的商品分类列表,指定编号
|
||||
*
|
||||
* @param ids 商品分类编号数组
|
||||
* @return 商品分类列表
|
||||
*/
|
||||
List<ProductCategoryDO> getEnableCategoryList(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 校验商品分类是否有效。如下情况,视为无效:
|
||||
* 1. 商品分类编号不存在
|
||||
@ -84,4 +92,5 @@ public interface ProductCategoryService {
|
||||
* @param ids 商品分类编号数组
|
||||
*/
|
||||
void validateCategoryList(Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
@ -170,4 +170,9 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
|
||||
return productCategoryMapper.selectListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductCategoryDO> getEnableCategoryList(List<Long> ids) {
|
||||
return productCategoryMapper.selectListByIdAndStatus(ids, CommonStatusEnum.ENABLE.getStatus());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,11 +7,10 @@ import cn.iocoder.yudao.module.promotion.convert.combination.CombinationActivity
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationRecordDO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum;
|
||||
import cn.iocoder.yudao.module.promotion.service.combination.CombinationRecordService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.COMBINATION_RECORD_NOT_EXISTS;
|
||||
|
||||
@ -25,21 +24,21 @@ import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.COMBINA
|
||||
public class CombinationRecordApiImpl implements CombinationRecordApi {
|
||||
|
||||
@Resource
|
||||
private CombinationRecordService recordService;
|
||||
private CombinationRecordService combinationRecordService;
|
||||
|
||||
@Override
|
||||
public void validateCombinationRecord(Long userId, Long activityId, Long headId, Long skuId, Integer count) {
|
||||
recordService.validateCombinationRecord(userId, activityId, headId, skuId, count);
|
||||
combinationRecordService.validateCombinationRecord(userId, activityId, headId, skuId, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CombinationRecordCreateRespDTO createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) {
|
||||
return CombinationActivityConvert.INSTANCE.convert4(recordService.createCombinationRecord(reqDTO));
|
||||
return CombinationActivityConvert.INSTANCE.convert4(combinationRecordService.createCombinationRecord(reqDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCombinationRecordSuccess(Long userId, Long orderId) {
|
||||
CombinationRecordDO record = recordService.getCombinationRecord(userId, orderId);
|
||||
CombinationRecordDO record = combinationRecordService.getCombinationRecord(userId, orderId);
|
||||
if (record == null) {
|
||||
throw exception(COMBINATION_RECORD_NOT_EXISTS);
|
||||
}
|
||||
@ -48,7 +47,7 @@ public class CombinationRecordApiImpl implements CombinationRecordApi {
|
||||
|
||||
@Override
|
||||
public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count) {
|
||||
return recordService.validateJoinCombination(userId, activityId, headId, skuId, count);
|
||||
return combinationRecordService.validateJoinCombination(userId, activityId, headId, skuId, count);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.promotion.controller.app.coupon;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.coupon.vo.coupon.*;
|
||||
import cn.iocoder.yudao.module.promotion.convert.coupon.CouponConvert;
|
||||
@ -59,7 +60,8 @@ public class AppCouponController {
|
||||
@Operation(summary = "获得匹配指定商品的优惠劵列表", description = "用于下单页,展示优惠劵列表")
|
||||
public CommonResult<List<AppCouponMatchRespVO>> getMatchCouponList(AppCouponMatchReqVO matchReqVO) {
|
||||
// todo: 优化:优惠金额倒序
|
||||
return success(CouponConvert.INSTANCE.convertList(couponService.getMatchCouponList(getLoginUserId(), matchReqVO)));
|
||||
List<CouponDO> list = couponService.getMatchCouponList(getLoginUserId(), matchReqVO);
|
||||
return success(BeanUtils.toBean(list, AppCouponMatchRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ -68,7 +70,16 @@ public class AppCouponController {
|
||||
public CommonResult<PageResult<AppCouponRespVO>> getCouponPage(AppCouponPageReqVO pageReqVO) {
|
||||
PageResult<CouponDO> pageResult = couponService.getCouponPage(
|
||||
CouponConvert.INSTANCE.convert(pageReqVO, Collections.singleton(getLoginUserId())));
|
||||
return success(CouponConvert.INSTANCE.convertAppPage(pageResult));
|
||||
return success(BeanUtils.toBean(pageResult, AppCouponRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得优惠劵")
|
||||
@Parameter(name = "id", description = "优惠劵编号", required = true, example = "1024")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppCouponRespVO> getCoupon(@RequestParam("id") Long id) {
|
||||
CouponDO coupon = couponService.getCoupon(getLoginUserId(), id);
|
||||
return success(BeanUtils.toBean(coupon, AppCouponRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/get-unused-count")
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.promotion.controller.app.coupon;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
||||
import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi;
|
||||
import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO;
|
||||
@ -43,6 +44,20 @@ public class AppCouponTemplateController {
|
||||
@Resource
|
||||
private ProductSpuApi productSpuApi;
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得优惠劵模版")
|
||||
@Parameter(name = "id", description = "优惠券模板编号", required = true, example = "1024")
|
||||
public CommonResult<AppCouponTemplateRespVO> getCouponTemplate(Long id) {
|
||||
CouponTemplateDO template = couponTemplateService.getCouponTemplate(id);
|
||||
if (template == null) {
|
||||
return success(null);
|
||||
}
|
||||
// 处理是否可领取
|
||||
Map<Long, Boolean> canCanTakeMap = couponService.getUserCanCanTakeMap(getLoginUserId(), List.of(template));
|
||||
return success(BeanUtils.toBean(template, AppCouponTemplateRespVO.class)
|
||||
.setCanTake(canCanTakeMap.get(template.getId())));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得优惠劵模版列表")
|
||||
@Parameters({
|
||||
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.Min;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "用户 App - 优惠劵 Response VO")
|
||||
@Data
|
||||
@ -19,10 +20,15 @@ public class AppCouponRespVO {
|
||||
@Schema(description = "优惠劵状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") // 参见 CouponStatusEnum 枚举
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否设置满多少金额可用", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
// 单位:分;0 - 不限制
|
||||
@Schema(description = "是否设置满多少金额可用", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") // 单位:分;0 - 不限制
|
||||
private Integer usePrice;
|
||||
|
||||
@Schema(description = "商品范围", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer productScope;
|
||||
|
||||
@Schema(description = "商品范围编号的数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private List<Long> productScopeValues;
|
||||
|
||||
@Schema(description = "固定日期 - 生效开始时间")
|
||||
private LocalDateTime validStartTime;
|
||||
|
||||
|
@ -1,10 +1,14 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.app.coupon.vo.template;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler;
|
||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.Min;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "用户 App - 优惠劵模板 Response VO")
|
||||
@Data
|
||||
@ -19,10 +23,15 @@ public class AppCouponTemplateRespVO {
|
||||
@Schema(description = "每人限领个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "66") // -1 - 则表示不限制
|
||||
private Integer takeLimitCount;
|
||||
|
||||
@Schema(description = "是否设置满多少金额可用", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
// 单位:分;0 - 不限制
|
||||
@Schema(description = "是否设置满多少金额可用", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") // 单位:分;0 - 不限制
|
||||
private Integer usePrice;
|
||||
|
||||
@Schema(description = "商品范围", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer productScope;
|
||||
|
||||
@Schema(description = "商品范围编号的数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private List<Long> productScopeValues;
|
||||
|
||||
@Schema(description = "生效日期类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer validityType;
|
||||
|
||||
|
@ -58,8 +58,4 @@ public interface CouponConvert {
|
||||
|
||||
CouponPageReqVO convert(AppCouponPageReqVO pageReqVO, Collection<Long> userIds);
|
||||
|
||||
PageResult<AppCouponRespVO> convertAppPage(PageResult<CouponDO> pageResult);
|
||||
|
||||
List<AppCouponMatchRespVO> convertList(List<CouponDO> list);
|
||||
|
||||
}
|
||||
|
@ -168,4 +168,13 @@ public interface CouponService {
|
||||
*/
|
||||
Map<Long, Boolean> getUserCanCanTakeMap(Long userId, List<CouponTemplateDO> templates);
|
||||
|
||||
/**
|
||||
* 获得优惠劵
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param id 编号
|
||||
* @return 优惠劵
|
||||
*/
|
||||
CouponDO getCoupon(Long userId, Long id);
|
||||
|
||||
}
|
||||
|
@ -315,6 +315,11 @@ public class CouponServiceImpl implements CouponService {
|
||||
userIds.removeIf(userId -> MapUtil.getInt(userTakeCountMap, userId, 0) >= couponTemplate.getTakeLimitCount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CouponDO getCoupon(Long userId, Long id) {
|
||||
return couponMapper.selectByIdAndUserId(id, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得自身的代理对象,解决 AOP 生效问题
|
||||
*
|
||||
|
@ -14,26 +14,21 @@ public class AfterSaleLogRespVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22634")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "售后编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3023")
|
||||
@NotNull(message = "售后编号不能为空")
|
||||
private Long afterSaleId;
|
||||
|
||||
@Schema(description = "售后状态(之前)", example = "2")
|
||||
private Integer beforeStatus;
|
||||
|
||||
@Schema(description = "售后状态(之后)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "售后状态(之后)不能为空")
|
||||
private Integer afterStatus;
|
||||
|
||||
@Schema(description = "操作明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "维权完成,退款金额:¥37776.00")
|
||||
@NotNull(message = "操作明细不能为空")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.trade.controller.app.aftersale;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.log.AfterSaleLogRespVO;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppAfterSaleCreateReqVO;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppAfterSaleDeliveryReqVO;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppAfterSaleRespVO;
|
||||
@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.aftersale;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.log.AppAfterSaleLogRespVO;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.AfterSaleLogDO;
|
||||
import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 售后日志")
|
||||
@RestController
|
||||
@RequestMapping("/trade/after-sale-log")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class AppAfterSaleLogController {
|
||||
|
||||
@Resource
|
||||
private AfterSaleLogService afterSaleLogService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得售后日志列表")
|
||||
@Parameter(name = "afterSaleId", description = "售后编号", required = true, example = "1")
|
||||
public CommonResult<List<AppAfterSaleLogRespVO>> getAfterSaleLogList(
|
||||
@RequestParam("afterSaleId") Long afterSaleId) {
|
||||
List<AfterSaleLogDO> logs = afterSaleLogService.getAfterSaleLogList(afterSaleId);
|
||||
return success(BeanUtils.toBean(logs, AppAfterSaleLogRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -35,6 +35,12 @@ public class AppAfterSaleRespVO {
|
||||
@Schema(description = "补充凭证图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private List<String> applyPicUrls;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
// ========== 交易订单相关 ==========
|
||||
|
||||
@Schema(description = "交易订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - App 交易售后日志 Response VO")
|
||||
@Data
|
||||
public class AppAfterSaleLogRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20669")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "操作明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "维权完成,退款金额:¥37776.00")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -97,7 +97,7 @@ public class AppTradeOrderController {
|
||||
@GetMapping("/get-express-track-list")
|
||||
@Operation(summary = "获得交易订单的物流轨迹")
|
||||
@Parameter(name = "id", description = "交易订单编号")
|
||||
public CommonResult<List<?>> getOrderExpressTrackList(@RequestParam("id") Long id) {
|
||||
public CommonResult<List<AppOrderExpressTrackRespDTO>> getOrderExpressTrackList(@RequestParam("id") Long id) {
|
||||
return success(TradeOrderConvert.INSTANCE.convertList02(
|
||||
tradeOrderQueryService.getExpressTrackList(id, getLoginUserId())));
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.trade.controller.app.order.vo.item.AppTradeOrderItemRespVO;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderRefundStatusEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -20,6 +21,9 @@ public class AppTradeOrderDetailRespVO {
|
||||
@Schema(description = "订单流水号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1146347329394184195")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "订单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "下单时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ -118,6 +122,12 @@ public class AppTradeOrderDetailRespVO {
|
||||
|
||||
// ========== 售后基本信息 ==========
|
||||
|
||||
@Schema(description = "售后状态", example = "0")
|
||||
private Integer refundStatus;
|
||||
|
||||
@Schema(description = "退款金额,单位:分", example = "100")
|
||||
private Integer refundPrice;
|
||||
|
||||
// ========== 营销基本信息 ==========
|
||||
|
||||
@Schema(description = "优惠劵编号", example = "1024")
|
||||
|
@ -206,7 +206,8 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
|
||||
|
||||
/**
|
||||
* 查询物流轨迹
|
||||
* 加个 spring 缓存,30 分钟;主要考虑及时性要求不高,但是每次调用需要钱;TODO @艿艿:这个时间不会搞了。。。交给你了哈哈哈
|
||||
*
|
||||
* 缓存的目的:考虑及时性要求不高,但是每次调用需要钱
|
||||
*
|
||||
* @param code 快递公司编码
|
||||
* @param logisticsNo 发货快递单号
|
||||
@ -216,7 +217,6 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
|
||||
@Cacheable(cacheNames = RedisKeyConstants.EXPRESS_TRACK, key = "#code + '-' + #logisticsNo + '-' + #receiverMobile",
|
||||
condition = "#result != null")
|
||||
public List<ExpressTrackRespDTO> getExpressTrackList(String code, String logisticsNo, String receiverMobile) {
|
||||
// 查询物流轨迹
|
||||
return expressClientFactory.getDefaultExpressClient().getExpressTrackList(
|
||||
new ExpressTrackQueryReqDTO().setExpressCode(code).setLogisticsNo(logisticsNo)
|
||||
.setPhone(receiverMobile));
|
||||
|
Reference in New Issue
Block a user