mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
review 修改
This commit is contained in:
parent
6bdc31a315
commit
f8db53896f
@ -50,6 +50,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode EXPRESS_CODE_DUPLICATE = new ErrorCode(1011003001, "已经存在该编码的快递公司");
|
ErrorCode EXPRESS_CODE_DUPLICATE = new ErrorCode(1011003001, "已经存在该编码的快递公司");
|
||||||
ErrorCode EXPRESS_TEMPLATE_NOT_EXISTS = new ErrorCode(1011003002, "运费模板不存在");
|
ErrorCode EXPRESS_TEMPLATE_NOT_EXISTS = new ErrorCode(1011003002, "运费模板不存在");
|
||||||
ErrorCode EXPRESS_TEMPLATE_NAME_DUPLICATE = new ErrorCode(1011003002, "已经存在该运费模板名");
|
ErrorCode EXPRESS_TEMPLATE_NAME_DUPLICATE = new ErrorCode(1011003002, "已经存在该运费模板名");
|
||||||
|
ErrorCode PICK_UP_STORE_NOT_EXISTS = new ErrorCode(1011003003, "自提门店不存在");
|
||||||
|
|
||||||
// ========== Price 相关 1011004000 ============
|
// ========== Price 相关 1011004000 ============
|
||||||
ErrorCode PRICE_CALCULATE_PAY_PRICE_ILLEGAL = new ErrorCode(1011004000, "支付价格计算异常,原因:价格小于等于 0");
|
ErrorCode PRICE_CALCULATE_PAY_PRICE_ILLEGAL = new ErrorCode(1011004000, "支付价格计算异常,原因:价格小于等于 0");
|
||||||
|
@ -75,7 +75,6 @@ public class DeliveryExpressController {
|
|||||||
return success(DeliveryExpressConvert.INSTANCE.convertPage(pageResult));
|
return success(DeliveryExpressConvert.INSTANCE.convertPage(pageResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO @jason:运费模版,@芋艿 你的意思是运费模板导出没有必要吧。已经去掉了。这个是快递公司导出
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出快递公司 Excel")
|
@Operation(summary = "导出快递公司 Excel")
|
||||||
@PreAuthorize("@ss.hasPermission('trade:delivery:express:export')")
|
@PreAuthorize("@ss.hasPermission('trade:delivery:express:export')")
|
||||||
@ -87,5 +86,4 @@ public class DeliveryExpressController {
|
|||||||
List<DeliveryExpressExcelVO> dataList = DeliveryExpressConvert.INSTANCE.convertList02(list);
|
List<DeliveryExpressExcelVO> dataList = DeliveryExpressConvert.INSTANCE.convertList02(list);
|
||||||
ExcelUtils.write(response, "快递公司.xls", "数据", DeliveryExpressExcelVO.class, dataList);
|
ExcelUtils.write(response, "快递公司.xls", "数据", DeliveryExpressExcelVO.class, dataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 快递运费模板")
|
@Tag(name = "管理后台 - 快递运费模板")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/trade/delivery/express-template")
|
@RequestMapping("/trade/delivery/express-template")
|
||||||
|
@ -27,8 +27,8 @@ public class DeliveryExpressBaseVO {
|
|||||||
@NotNull(message = "排序不能为空")
|
@NotNull(message = "排序不能为空")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
@Schema(description = "状态(0正常 1停用)", required = true, example = "1")
|
@Schema(description = "状态", required = true, example = "1")
|
||||||
@NotNull(message = "状态(0正常 1停用)不能为空")
|
@NotNull(message = "状态不能为空")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,14 +15,12 @@ import java.util.List;
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class DeliveryExpressTemplateCreateReqVO extends DeliveryExpressTemplateBaseVO {
|
public class DeliveryExpressTemplateCreateReqVO extends DeliveryExpressTemplateBaseVO {
|
||||||
|
|
||||||
// TODO @jason:不用给默认值哈
|
|
||||||
|
|
||||||
@Schema(description = "区域运费列表")
|
@Schema(description = "区域运费列表")
|
||||||
@Valid
|
@Valid
|
||||||
private List<ExpressTemplateChargeBaseVO> templateCharge = Collections.emptyList();
|
private List<ExpressTemplateChargeBaseVO> templateCharge;
|
||||||
|
|
||||||
@Schema(description = "包邮区域列表")
|
@Schema(description = "包邮区域列表")
|
||||||
@Valid
|
@Valid
|
||||||
private List<ExpressTemplateFreeBaseVO> templateFree = Collections.emptyList();
|
private List<ExpressTemplateFreeBaseVO> templateFree;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import lombok.*;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
// TODO @jason:simplae 是不是不用继承 DeliveryExpressTemplateBaseVO,直接 id name 属性就够了。
|
// TODO @jason:simplae 是不是不用继承 DeliveryExpressTemplateBaseVO,直接 id name 属性就够了。
|
||||||
|
// @芋艿 这里给列表显示用的。 需要显示计费方式和排序, 所以继承 DeliveryExpressTemplateBaseVO。 这是去掉了包邮区域和 区域运费列表
|
||||||
@Schema(description = "管理后台 - 快递运费模板 精简 Response VO")
|
@Schema(description = "管理后台 - 快递运费模板 精简 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ -7,7 +7,6 @@ import lombok.ToString;
|
|||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 快递运费模板更新 Request VO")
|
@Schema(description = "管理后台 - 快递运费模板更新 Request VO")
|
||||||
@ -20,14 +19,38 @@ public class DeliveryExpressTemplateUpdateReqVO extends DeliveryExpressTemplateB
|
|||||||
@NotNull(message = "编号不能为空")
|
@NotNull(message = "编号不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
// TODO @jason:pojo 不给默认值哈
|
|
||||||
|
|
||||||
@Schema(description = "区域运费列表")
|
@Schema(description = "区域运费列表")
|
||||||
@Valid
|
@Valid
|
||||||
private List<ExpressTemplateChargeUpdateVO> templateCharge = Collections.emptyList();
|
private List<ExpressTemplateChargeUpdateVO> templateCharge;
|
||||||
|
|
||||||
@Schema(description = "包邮区域列表")
|
@Schema(description = "包邮区域列表")
|
||||||
@Valid
|
@Valid
|
||||||
private List<ExpressTemplateFreeUpdateVO> templateFree = Collections.emptyList();
|
private List<ExpressTemplateFreeUpdateVO> templateFree;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 快递运费模板区域运费更新 Request VO")
|
||||||
|
@Data
|
||||||
|
public static class ExpressTemplateChargeUpdateVO extends ExpressTemplateChargeBaseVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", example = "6592")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// TODO @jason:这几个字段,应该不通过前端传递,而是后端查询后去赋值的
|
||||||
|
@Schema(description = "配送模板编号", example = "1")
|
||||||
|
private Long templateId;
|
||||||
|
|
||||||
|
@Schema(description = "配送计费方式", example = "1")
|
||||||
|
private Integer chargeMode;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 快递运费模板包邮区域更新 Request VO")
|
||||||
|
@Data
|
||||||
|
public static class ExpressTemplateFreeUpdateVO extends ExpressTemplateFreeBaseVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", example = "6592")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "配送模板编号", example = "1")
|
||||||
|
private Long templateId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.expresstemplate;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
// TODO @jason:这个 vo 可以内嵌到 DeliveryExpressTemplateUpdateReqVO,避免 vo 过多,不好分辨
|
|
||||||
@Schema(description = "管理后台 - 快递公司创建 Request VO")
|
|
||||||
@Data
|
|
||||||
public class ExpressTemplateChargeUpdateVO extends ExpressTemplateChargeBaseVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", example = "6592")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
// TODO @jason:这几个字段,应该不通过前端传递,而是后端查询后去赋值的
|
|
||||||
|
|
||||||
@Schema(description = "配送模板编号", example = "1")
|
|
||||||
private Long templateId;
|
|
||||||
|
|
||||||
@Schema(description = "配送计费方式", example = "1")
|
|
||||||
private Integer chargeMode;
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.expresstemplate;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
// TODO @jason:这个 vo 可以内嵌到 DeliveryExpressTemplateUpdateReqVO,避免 vo 过多,不好分辨
|
|
||||||
// TODO @jason:swagger 缺失
|
|
||||||
/**
|
|
||||||
* 快递运费模板包邮 更新 VO
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class ExpressTemplateFreeUpdateVO extends ExpressTemplateFreeBaseVO {
|
|
||||||
|
|
||||||
@Schema(description = "编号", example = "6592")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "配送模板编号", example = "1")
|
|
||||||
private Long templateId;
|
|
||||||
}
|
|
@ -12,12 +12,6 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
|
|||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 快递公司 Convert
|
|
||||||
*
|
|
||||||
* @author jason
|
|
||||||
*/
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DeliveryExpressConvert {
|
public interface DeliveryExpressConvert {
|
||||||
|
|
||||||
|
@ -11,11 +11,6 @@ import org.mapstruct.factory.Mappers;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* 快递运费模板 Convert
|
|
||||||
*
|
|
||||||
* @author jason
|
|
||||||
*/
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DeliveryExpressTemplateConvert {
|
public interface DeliveryExpressTemplateConvert {
|
||||||
|
|
||||||
@ -48,7 +43,7 @@ public interface DeliveryExpressTemplateConvert {
|
|||||||
|
|
||||||
DeliveryExpressTemplateChargeDO convertTemplateCharge(Long templateId, Integer chargeMode, ExpressTemplateChargeBaseVO vo);
|
DeliveryExpressTemplateChargeDO convertTemplateCharge(Long templateId, Integer chargeMode, ExpressTemplateChargeBaseVO vo);
|
||||||
|
|
||||||
DeliveryExpressTemplateChargeDO convertTemplateCharge(ExpressTemplateChargeUpdateVO vo);
|
DeliveryExpressTemplateChargeDO convertTemplateCharge(DeliveryExpressTemplateUpdateReqVO.ExpressTemplateChargeUpdateVO vo);
|
||||||
|
|
||||||
default List<DeliveryExpressTemplateChargeDO> convertTemplateChargeList(Long templateId, Integer chargeMode, List<ExpressTemplateChargeBaseVO> list) {
|
default List<DeliveryExpressTemplateChargeDO> convertTemplateChargeList(Long templateId, Integer chargeMode, List<ExpressTemplateChargeBaseVO> list) {
|
||||||
return CollectionUtils.convertList(list, vo -> convertTemplateCharge(templateId, chargeMode, vo));
|
return CollectionUtils.convertList(list, vo -> convertTemplateCharge(templateId, chargeMode, vo));
|
||||||
@ -58,7 +53,7 @@ public interface DeliveryExpressTemplateConvert {
|
|||||||
|
|
||||||
DeliveryExpressTemplateFreeDO convertTemplateFree(Long templateId, ExpressTemplateFreeBaseVO vo);
|
DeliveryExpressTemplateFreeDO convertTemplateFree(Long templateId, ExpressTemplateFreeBaseVO vo);
|
||||||
|
|
||||||
DeliveryExpressTemplateFreeDO convertTemplateFree(ExpressTemplateFreeUpdateVO vo);
|
DeliveryExpressTemplateFreeDO convertTemplateFree(DeliveryExpressTemplateUpdateReqVO.ExpressTemplateFreeUpdateVO vo);
|
||||||
|
|
||||||
List<ExpressTemplateChargeBaseVO> convertTemplateChargeList(List<DeliveryExpressTemplateChargeDO> list);
|
List<ExpressTemplateChargeBaseVO> convertTemplateChargeList(List<DeliveryExpressTemplateChargeDO> list);
|
||||||
|
|
||||||
|
@ -82,10 +82,10 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
|
|||||||
private void updateExpressTemplateFree(DeliveryExpressTemplateUpdateReqVO updateReqVO) {
|
private void updateExpressTemplateFree(DeliveryExpressTemplateUpdateReqVO updateReqVO) {
|
||||||
// 1.1 获得新增/修改的区域列表
|
// 1.1 获得新增/修改的区域列表
|
||||||
List<DeliveryExpressTemplateFreeDO> oldFreeList = expressTemplateFreeMapper.selectListByTemplateId(updateReqVO.getId());
|
List<DeliveryExpressTemplateFreeDO> oldFreeList = expressTemplateFreeMapper.selectListByTemplateId(updateReqVO.getId());
|
||||||
List<ExpressTemplateFreeUpdateVO> newFreeList = updateReqVO.getTemplateFree();
|
List<DeliveryExpressTemplateUpdateReqVO.ExpressTemplateFreeUpdateVO> newFreeList = updateReqVO.getTemplateFree();
|
||||||
List<DeliveryExpressTemplateFreeDO> addFreeList = new ArrayList<>(newFreeList.size()); // 新增包邮区域列表
|
List<DeliveryExpressTemplateFreeDO> addFreeList = new ArrayList<>(newFreeList.size()); // 新增包邮区域列表
|
||||||
List<DeliveryExpressTemplateFreeDO> updateFreeList = new ArrayList<>(newFreeList.size()); // 更新包邮区域列表
|
List<DeliveryExpressTemplateFreeDO> updateFreeList = new ArrayList<>(newFreeList.size()); // 更新包邮区域列表
|
||||||
for (ExpressTemplateFreeUpdateVO item : newFreeList) {
|
for (DeliveryExpressTemplateUpdateReqVO.ExpressTemplateFreeUpdateVO item : newFreeList) {
|
||||||
if (Objects.nonNull(item.getId())) {
|
if (Objects.nonNull(item.getId())) {
|
||||||
updateFreeList.add(INSTANCE.convertTemplateFree(item));
|
updateFreeList.add(INSTANCE.convertTemplateFree(item));
|
||||||
} else {
|
} else {
|
||||||
@ -113,10 +113,10 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
|
|||||||
private void updateExpressTemplateCharge(DeliveryExpressTemplateUpdateReqVO updateReqVO) {
|
private void updateExpressTemplateCharge(DeliveryExpressTemplateUpdateReqVO updateReqVO) {
|
||||||
// 1.1 获得新增/修改的区域列表
|
// 1.1 获得新增/修改的区域列表
|
||||||
List<DeliveryExpressTemplateChargeDO> oldChargeList = expressTemplateChargeMapper.selectListByTemplateId(updateReqVO.getId());
|
List<DeliveryExpressTemplateChargeDO> oldChargeList = expressTemplateChargeMapper.selectListByTemplateId(updateReqVO.getId());
|
||||||
List<ExpressTemplateChargeUpdateVO> newChargeList = updateReqVO.getTemplateCharge();
|
List<DeliveryExpressTemplateUpdateReqVO.ExpressTemplateChargeUpdateVO> newChargeList = updateReqVO.getTemplateCharge();
|
||||||
List<DeliveryExpressTemplateChargeDO> addList = new ArrayList<>(newChargeList.size()); // 新增运费区域列表
|
List<DeliveryExpressTemplateChargeDO> addList = new ArrayList<>(newChargeList.size()); // 新增运费区域列表
|
||||||
List<DeliveryExpressTemplateChargeDO> updateList = new ArrayList<>(newChargeList.size()); // 更新运费区域列表
|
List<DeliveryExpressTemplateChargeDO> updateList = new ArrayList<>(newChargeList.size()); // 更新运费区域列表
|
||||||
for (ExpressTemplateChargeUpdateVO item : newChargeList) {
|
for (DeliveryExpressTemplateUpdateReqVO.ExpressTemplateChargeUpdateVO item : newChargeList) {
|
||||||
if (item.getId() != null) {
|
if (item.getId() != null) {
|
||||||
// 计费模式以主表为准
|
// 计费模式以主表为准
|
||||||
item.setChargeMode(updateReqVO.getChargeMode());
|
item.setChargeMode(updateReqVO.getChargeMode());
|
||||||
|
Loading…
Reference in New Issue
Block a user