feat(biz): 新增纸箱规格管理功能

- 新增纸箱规格的创建、更新、删除、详情查看和分页查询接口
- 新增纸箱规格相关的命令和查询对象,包括创建、更新、删除、列表、分页和详情查询
- 新增纸箱规格值对象 BoxSpecVO 用于返回数据
- 修改品牌类型枚举,增加礼盒类型
- 更新订单包装相关字段,将箱子分类调整为箱子规格
- 移除旧的纸箱产品规格枚举类型,改为使用规格ID和名称
- 在品牌相关DTO中增加纸箱规格ID集合及规格列表字段
- 增加MapStruct映射配置以支持新字段转换
- 实现纸箱规格服务的具体业务逻辑和网关调用
- 提供RESTful接口控制器用于外部访问纸箱规格管理功能
This commit is contained in:
shenyifei 2025-11-18 00:16:33 +08:00
parent 69da1bce4e
commit 71dfdbefff
52 changed files with 1056 additions and 91 deletions

View File

@ -0,0 +1,85 @@
package com.xunhong.erp.turbo.admin.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.xunhong.erp.turbo.api.biz.api.BoxSpecServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author shenyifei
*/
@Tag(name = "BoxSpec", description = "纸箱规格管理")
@RestController("operationBoxSpecController")
@RequestMapping(value = "/operation")
@RequiredArgsConstructor
public class BoxSpecController {
@DubboReference(version = "1.0.0")
private final BoxSpecServiceI boxSpecService;
@SaCheckLogin
// @SaCheckPermission(value = {PermissionConstant.MDB_BUSINESS_BOX_SPEC_VIEW})
@GetMapping("listBoxSpec")
@Operation(summary = "纸箱规格列表", method = "GET")
public MultiResponse<BoxSpecVO> listBoxSpec(@ModelAttribute @Validated BoxSpecListQry boxSpecListQry) {
return MultiResponse.of(boxSpecService.list(boxSpecListQry));
}
@SaCheckLogin
// @SaCheckPermission(value = {PermissionConstant.MDB_BUSINESS_BOX_SPEC_CREATE})
@PostMapping("createBoxSpec")
@Operation(summary = "创建纸箱规格", method = "POST")
public SingleResponse<BoxSpecVO> createBoxSpec(@RequestBody @Validated BoxSpecCreateCmd boxSpecCreateCmd) {
return SingleResponse.of(boxSpecService.create(boxSpecCreateCmd));
}
@SaCheckLogin
// @SaCheckPermission(value = {PermissionConstant.MDB_BUSINESS_BOX_SPEC_VIEW})
@GetMapping("showBoxSpec")
@Operation(summary = "纸箱规格详情", method = "GET")
public SingleResponse<BoxSpecVO> showBoxSpec(@ModelAttribute @Validated BoxSpecShowQry boxSpecShowQry) {
return SingleResponse.of(boxSpecService.show(boxSpecShowQry));
}
@SaCheckLogin
// @SaCheckPermission(value = {PermissionConstant.MDB_BUSINESS_BOX_SPEC_VIEW})
@GetMapping("pageBoxSpec")
@Operation(summary = "纸箱规格列表", method = "GET")
public PageResponse<BoxSpecVO> pageBoxSpec(@ModelAttribute @Validated BoxSpecPageQry boxSpecPageQry) {
PageDTO<BoxSpecVO> page = boxSpecService.page(boxSpecPageQry);
return PageResponse.of(page.getRecords(), (int) page.getTotal(), (int) page.getSize(), (int) page.getCurrent());
}
@SaCheckLogin
// @SaCheckPermission(value = {PermissionConstant.MDB_BUSINESS_BOX_SPEC_UPDATE})
@RequestMapping(value = "updateBoxSpec", method = {RequestMethod.PATCH, RequestMethod.PUT})
@Operation(summary = "纸箱规格更新", method = "PATCH")
public SingleResponse<BoxSpecVO> updateBoxSpec(@RequestBody @Validated BoxSpecUpdateCmd boxSpecUpdateCmd) {
return SingleResponse.of(boxSpecService.update(boxSpecUpdateCmd));
}
@SaCheckLogin
// @SaCheckPermission(value = {PermissionConstant.MDB_BUSINESS_BOX_SPEC_DELETE})
@DeleteMapping("destroyBoxSpec")
@Operation(summary = "纸箱规格删除", method = "DELETE")
public Response destroyBoxSpec(@RequestBody @Validated BoxSpecDestroyCmd boxSpecDestroyCmd) {
boxSpecService.destroy(boxSpecDestroyCmd);
return Response.buildSuccess();
}
}

View File

@ -12,6 +12,7 @@ import org.mapstruct.NullValueCheckStrategy;
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS) @Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface BoxBrandAssembler { public interface BoxBrandAssembler {
@Mapping(target = "boxSpecVOList", source = "boxSpecList")
@Mapping(target = "boxProductVOList", source = "boxProductList") @Mapping(target = "boxProductVOList", source = "boxProductList")
BoxBrandVO toBoxBrandVO(BoxBrand boxBrand); BoxBrandVO toBoxBrandVO(BoxBrand boxBrand);
} }

View File

@ -0,0 +1,15 @@
package com.xunhong.erp.turbo.biz.app.assembler;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
/**
* @author shenyifei
*/
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface BoxSpecAssembler {
BoxSpecVO toBoxSpecVO(BoxSpec boxSpec);
}

View File

@ -0,0 +1,29 @@
package com.xunhong.erp.turbo.biz.app.executor.cmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.biz.app.assembler.BoxSpecAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author shenyifei
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class BoxSpecCreateCmdExe {
private final BoxSpecAssembler boxSpecAssembler;
private final BoxSpecGateway boxSpecGateway;
public BoxSpecVO execute(BoxSpecCreateCmd boxSpecCreateCmd) {
BoxSpec boxSpec = boxSpecGateway.save(boxSpecCreateCmd);
return boxSpecAssembler.toBoxSpecVO(boxSpec);
}
}

View File

@ -0,0 +1,22 @@
package com.xunhong.erp.turbo.biz.app.executor.cmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecDestroyCmd;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author shenyifei
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class BoxSpecDestroyCmdExe {
private final BoxSpecGateway boxSpecGateway;
public void execute(BoxSpecDestroyCmd boxSpecDestroyCmd) {
boxSpecGateway.destroy(boxSpecDestroyCmd);
}
}

View File

@ -0,0 +1,27 @@
package com.xunhong.erp.turbo.biz.app.executor.cmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.biz.app.assembler.BoxSpecAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author shenyifei
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class BoxSpecUpdateCmdExe {
private final BoxSpecAssembler boxSpecAssembler;
private final BoxSpecGateway boxSpecGateway;
public BoxSpecVO execute(BoxSpecUpdateCmd boxSpecUpdateCmd) {
BoxSpec boxSpec = boxSpecGateway.update(boxSpecUpdateCmd);
return boxSpecAssembler.toBoxSpecVO(boxSpec);
}
}

View File

@ -0,0 +1,30 @@
package com.xunhong.erp.turbo.biz.app.executor.query;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecListQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.biz.app.assembler.BoxSpecAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author shenyifei
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class BoxSpecListQryExe {
private final BoxSpecGateway boxSpecGateway;
private final BoxSpecAssembler boxSpecAssembler;
public List<BoxSpecVO> execute(BoxSpecListQry boxSpecListQry) {
List<BoxSpec> boxSpecList = boxSpecGateway.list(boxSpecListQry);
return boxSpecList.stream().map(boxSpecAssembler::toBoxSpecVO).toList();
}
}

View File

@ -0,0 +1,29 @@
package com.xunhong.erp.turbo.biz.app.executor.query;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.biz.app.assembler.BoxSpecAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author shenyifei
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class BoxSpecPageQryExe {
private final BoxSpecGateway boxSpecGateway;
private final BoxSpecAssembler boxSpecAssembler;
public IPage<BoxSpecVO> execute(BoxSpecPageQry boxSpecPageQry) {
IPage<BoxSpec> page = boxSpecGateway.page(boxSpecPageQry);
return page.convert(boxSpecAssembler::toBoxSpecVO);
}
}

View File

@ -0,0 +1,29 @@
package com.xunhong.erp.turbo.biz.app.executor.query;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.biz.app.assembler.BoxSpecAssembler;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author shenyifei
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class BoxSpecShowQryExe {
private final BoxSpecAssembler boxSpecAssembler;
private final BoxSpecGateway boxSpecGateway;
public BoxSpecVO execute(BoxSpecShowQry boxSpecShowQry) {
BoxSpec boxSpec = boxSpecGateway.show(boxSpecShowQry);
return boxSpecAssembler.toBoxSpecVO(boxSpec);
}
}

View File

@ -0,0 +1,71 @@
package com.xunhong.erp.turbo.biz.app.service;
import com.xunhong.erp.turbo.api.biz.api.BoxSpecServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxSpecCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxSpecDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.BoxSpecUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxSpecListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxSpecPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.BoxSpecShowQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author shenyifei
*/
@Slf4j
@Service
@DubboService(interfaceClass = BoxSpecServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class BoxSpecServiceImpl implements BoxSpecServiceI {
private final BoxSpecCreateCmdExe boxSpecCreateCmdExe;
private final BoxSpecUpdateCmdExe boxSpecUpdateCmdExe;
private final BoxSpecPageQryExe boxSpecPageQryExe;
private final BoxSpecListQryExe boxSpecListQryExe;
private final BoxSpecShowQryExe boxSpecShowQryExe;
private final BoxSpecDestroyCmdExe boxSpecDestroyCmdExe;
@Override
public BoxSpecVO create(BoxSpecCreateCmd boxSpecCreateCmd) {
return boxSpecCreateCmdExe.execute(boxSpecCreateCmd);
}
@Override
public PageDTO<BoxSpecVO> page(BoxSpecPageQry boxSpecPageQry) {
return PageDTO.of(boxSpecPageQryExe.execute(boxSpecPageQry));
}
@Override
public List<BoxSpecVO> list(BoxSpecListQry boxSpecListQry) {
return boxSpecListQryExe.execute(boxSpecListQry);
}
@Override
public BoxSpecVO update(BoxSpecUpdateCmd boxSpecUpdateCmd) {
return boxSpecUpdateCmdExe.execute(boxSpecUpdateCmd);
}
@Override
public BoxSpecVO show(BoxSpecShowQry boxSpecShowQry) {
return boxSpecShowQryExe.execute(boxSpecShowQry);
}
@Override
public void destroy(BoxSpecDestroyCmd boxSpecDestroyCmd) {
boxSpecDestroyCmdExe.execute(boxSpecDestroyCmd);
}
}

View File

@ -34,7 +34,12 @@ public class BoxBrand extends DTO {
private String image; private String image;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 规格ID列表
*/
private List<Long> specIds;
/**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
@ -63,4 +68,9 @@ public class BoxBrand extends DTO {
*/ */
private LocalDateTime createdAt; private LocalDateTime createdAt;
/**
* 规格列表
*/
private List<BoxSpec> boxSpecList;
} }

View File

@ -2,7 +2,6 @@ package com.xunhong.erp.turbo.biz.domain.entity;
import com.alibaba.cola.domain.Entity; import com.alibaba.cola.domain.Entity;
import com.alibaba.cola.dto.DTO; import com.alibaba.cola.dto.DTO;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxProductSpecTypeEnum;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -43,9 +42,14 @@ public class BoxProduct extends DTO {
private BigDecimal salePrice; private BigDecimal salePrice;
/** /**
* 规格1_2粒装2_4粒装 * 规格Id
*/ */
private BoxProductSpecTypeEnum specType; private Long specId;
/**
* 规格名称
*/
private String specName;
/** /**
* 品牌ID * 品牌ID

View File

@ -0,0 +1,50 @@
package com.xunhong.erp.turbo.biz.domain.entity;
import com.alibaba.cola.domain.Entity;
import com.alibaba.cola.dto.DTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @author shenyifei
*/
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
public class BoxSpec extends DTO {
/**
* 规格ID
*/
private Long specId;
/**
* 规格名称
*/
private String name;
/**
* 排序号
*/
private BigDecimal sort;
/**
* 备注
*/
private String remark;
/**
* 状态1_启用0_禁用
*/
private Boolean status;
/**
* 创建时间
*/
private LocalDateTime createdAt;
}

View File

@ -0,0 +1,30 @@
package com.xunhong.erp.turbo.biz.domain.gateway;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecShowQry;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import java.util.List;
/**
* @author shenyifei
*/
public interface BoxSpecGateway {
BoxSpec save(BoxSpecCreateCmd boxSpecCreateCmd);
IPage<BoxSpec> page(BoxSpecPageQry boxSpecPageQry);
List<BoxSpec> list(BoxSpecListQry boxSpecListQry);
BoxSpec update(BoxSpecUpdateCmd boxSpecUpdateCmd);
BoxSpec show(BoxSpecShowQry boxSpecShowQry);
void destroy(BoxSpecDestroyCmd boxSpecDestroyCmd);
}

View File

@ -15,9 +15,12 @@ import org.mapstruct.NullValueCheckStrategy;
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS) @Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface BoxBrandConvert { public interface BoxBrandConvert {
@Mapping(target = "boxSpecList", source = "boxSpecDOList")
@Mapping(target = "boxProductList", source = "boxProductDOList") @Mapping(target = "boxProductList", source = "boxProductDOList")
BoxBrand toBoxBrand(BoxBrandDO boxBrandDO); BoxBrand toBoxBrand(BoxBrandDO boxBrandDO);
@Mapping(target = "boxSpecDOList", ignore = true)
@Mapping(target = "sort", ignore = true)
@Mapping(target = "boxProductDOList", ignore = true) @Mapping(target = "boxProductDOList", ignore = true)
@Mapping(target = "version", ignore = true) @Mapping(target = "version", ignore = true)
@Mapping(target = "updatedAt", ignore = true) @Mapping(target = "updatedAt", ignore = true)
@ -25,6 +28,8 @@ public interface BoxBrandConvert {
@Mapping(target = "createdAt", ignore = true) @Mapping(target = "createdAt", ignore = true)
BoxBrandDO toBoxBrandDO(BoxBrandCreateCmd boxBrandCreateCmd); BoxBrandDO toBoxBrandDO(BoxBrandCreateCmd boxBrandCreateCmd);
@Mapping(target = "boxSpecDOList", ignore = true)
@Mapping(target = "sort", ignore = true)
@Mapping(target = "boxProductDOList", ignore = true) @Mapping(target = "boxProductDOList", ignore = true)
@Mapping(target = "version", ignore = true) @Mapping(target = "version", ignore = true)
@Mapping(target = "updatedAt", ignore = true) @Mapping(target = "updatedAt", ignore = true)

View File

@ -17,12 +17,14 @@ public interface BoxProductConvert {
BoxProduct toBoxProduct(BoxProductDO boxProductDO); BoxProduct toBoxProduct(BoxProductDO boxProductDO);
@Mapping(target = "sort", ignore = true)
@Mapping(target = "version", ignore = true) @Mapping(target = "version", ignore = true)
@Mapping(target = "updatedAt", ignore = true) @Mapping(target = "updatedAt", ignore = true)
@Mapping(target = "isDelete", ignore = true) @Mapping(target = "isDelete", ignore = true)
@Mapping(target = "createdAt", ignore = true) @Mapping(target = "createdAt", ignore = true)
BoxProductDO toBoxProductDO(BoxProductCreateCmd boxProductCreateCmd); BoxProductDO toBoxProductDO(BoxProductCreateCmd boxProductCreateCmd);
@Mapping(target = "sort", ignore = true)
@Mapping(target = "version", ignore = true) @Mapping(target = "version", ignore = true)
@Mapping(target = "updatedAt", ignore = true) @Mapping(target = "updatedAt", ignore = true)
@Mapping(target = "isDelete", ignore = true) @Mapping(target = "isDelete", ignore = true)

View File

@ -0,0 +1,32 @@
package com.xunhong.erp.turbo.biz.infrastructure.convert;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValueCheckStrategy;
/**
* @author shenyifei
*/
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface BoxSpecConvert {
BoxSpec toBoxSpec(BoxSpecDO boxSpecDO);
@Mapping(target = "version", ignore = true)
@Mapping(target = "updatedAt", ignore = true)
@Mapping(target = "isDelete", ignore = true)
@Mapping(target = "createdAt", ignore = true)
BoxSpecDO toBoxSpecDO(BoxSpecCreateCmd boxSpecCreateCmd);
@Mapping(target = "version", ignore = true)
@Mapping(target = "updatedAt", ignore = true)
@Mapping(target = "isDelete", ignore = true)
@Mapping(target = "createdAt", ignore = true)
void toBoxSpecDO(@MappingTarget BoxSpecDO boxSpecDO, BoxSpecUpdateCmd boxSpecUpdateCmd);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum; import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO; import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data; import lombok.Data;
@ -16,7 +17,7 @@ import java.util.List;
* @author shenyifei * @author shenyifei
*/ */
@Data @Data
@TableName(value = "box_brand") @TableName(value = "box_brand", autoResultMap = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class BoxBrandDO extends BaseDO<BoxBrandDO> { public class BoxBrandDO extends BaseDO<BoxBrandDO> {
@ -39,11 +40,17 @@ public class BoxBrandDO extends BaseDO<BoxBrandDO> {
private String image; private String image;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@TableField(value = "type") @TableField(value = "type")
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
/**
* 规格ID
*/
@TableField(value = "spec_ids", typeHandler = JacksonTypeHandler.class)
private List<Long> specIds;
/** /**
* 备注 * 备注
*/ */
@ -65,4 +72,7 @@ public class BoxBrandDO extends BaseDO<BoxBrandDO> {
@TableField(exist = false) @TableField(exist = false)
private List<BoxProductDO> boxProductDOList; private List<BoxProductDO> boxProductDOList;
@TableField(exist = false)
private List<BoxSpecDO> boxSpecDOList;
} }

View File

@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum; import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxProductSpecTypeEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO; import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -51,10 +50,16 @@ public class BoxProductDO extends BaseDO<BoxProductDO> {
private BigDecimal salePrice; private BigDecimal salePrice;
/** /**
* 规格1_2粒装2_4粒装 * 规格ID
*/ */
@TableField(value = "spec_type") @TableField(value = "spec_id")
private BoxProductSpecTypeEnum specType; private Long specId;
/**
* 规格名称
*/
@TableField(value = "spec_name")
private String specName;
/** /**
* 品牌ID * 品牌ID
@ -63,7 +68,7 @@ public class BoxProductDO extends BaseDO<BoxProductDO> {
private Long brandId; private Long brandId;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@TableField(value = "type") @TableField(value = "type")
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;

View File

@ -0,0 +1,52 @@
package com.xunhong.erp.turbo.biz.infrastructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* @author shenyifei
*/
@Data
@TableName(value = "box_spec")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecDO extends BaseDO<BoxSpecDO> {
/**
* 规格ID
*/
@TableId(value = "spec_id", type = IdType.ASSIGN_ID)
private Long specId;
/**
* 规格名称
*/
@TableField(value = "name")
private String name;
/**
* 排序号
*/
@TableField(value = "sort")
private BigDecimal sort;
/**
* 备注
*/
@TableField(value = "remark")
private String remark;
/**
* 状态1_启用0_禁用
*/
@TableField(value = "status")
private Boolean status;
}

View File

@ -57,10 +57,16 @@ public class OrderPackageDO extends BaseDO<OrderPackageDO> {
private BoxBrandTypeEnum boxBrandType; private BoxBrandTypeEnum boxBrandType;
/** /**
* 箱子分类ID * 箱子规格id
*/ */
@TableField(value = "box_category_id") @TableField(value = "box_spec_id")
private String boxCategoryId; private String boxSpecId;
/**
* 箱子规格名称
*/
@TableField(value = "box_spec_name")
private String boxSpecName;
/** /**
* 箱子产品ID * 箱子产品ID

View File

@ -31,10 +31,16 @@ public class ShipOrderPackageDO extends BaseDO<ShipOrderPackageDO> {
private Long shipOrderId; private Long shipOrderId;
/** /**
* 箱型 * 箱型规格id
*/ */
@TableField(value = "box_category") @TableField(value = "box_spec_id")
private String boxCategory; private String boxSpecId;
/**
* 箱型规格名称
*/
@TableField(value = "box_spec_name")
private String boxSpecName;
/** /**
* 箱号 * 箱号

View File

@ -18,12 +18,15 @@ import com.xunhong.erp.turbo.biz.domain.gateway.BoxBrandGateway;
import com.xunhong.erp.turbo.biz.infrastructure.convert.BoxBrandConvert; import com.xunhong.erp.turbo.biz.infrastructure.convert.BoxBrandConvert;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxBrandDO; import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxBrandDO;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxProductDO; import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxProductDO;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO;
import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxBrandMapper; import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxBrandMapper;
import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxProductMapper; import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxProductMapper;
import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxSpecMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
@ -37,6 +40,7 @@ public class BoxBrandGatewayImpl implements BoxBrandGateway {
private final BoxBrandMapper boxBrandMapper; private final BoxBrandMapper boxBrandMapper;
private final BoxBrandConvert boxBrandConvert; private final BoxBrandConvert boxBrandConvert;
private final BoxProductMapper boxProductMapper; private final BoxProductMapper boxProductMapper;
private final BoxSpecMapper boxSpecMapper;
@Override @Override
public BoxBrand save(BoxBrandCreateCmd boxBrandCreateCmd) { public BoxBrand save(BoxBrandCreateCmd boxBrandCreateCmd) {
@ -99,6 +103,16 @@ public class BoxBrandGatewayImpl implements BoxBrandGateway {
boxBrandDO.setBoxProductDOList(boxProductDOList.stream().filter(boxProductDO -> boxProductDO.getBrandId().equals(boxBrandDO.getBrandId())).toList()); boxBrandDO.setBoxProductDOList(boxProductDOList.stream().filter(boxProductDO -> boxProductDO.getBrandId().equals(boxBrandDO.getBrandId())).toList());
}); });
} }
List<Long> specIdList = boxBrandDOList.stream().map(BoxBrandDO::getSpecIds).flatMap(Collection::stream).toList();
if (CollUtil.isNotEmpty(specIdList)) {
LambdaQueryWrapper<BoxSpecDO> queryWrapper2 = Wrappers.lambdaQuery(BoxSpecDO.class);
queryWrapper2.in(BoxSpecDO::getSpecId, specIdList);
List<BoxSpecDO> boxSpecDOList = boxSpecMapper.selectList(queryWrapper2);
boxBrandDOList.forEach(boxBrandDO -> {
boxBrandDO.setBoxSpecDOList(boxSpecDOList.stream().filter(boxSpecDO -> boxBrandDO.getSpecIds().contains(boxSpecDO.getSpecId())).toList());
});
}
} }
return boxBrandDOList.stream().map(boxBrandConvert::toBoxBrand).toList(); return boxBrandDOList.stream().map(boxBrandConvert::toBoxBrand).toList();
@ -125,6 +139,11 @@ public class BoxBrandGatewayImpl implements BoxBrandGateway {
queryWrapper.last("limit 1"); queryWrapper.last("limit 1");
BoxBrandDO boxBrandDO = boxBrandMapper.selectOne(queryWrapper); BoxBrandDO boxBrandDO = boxBrandMapper.selectOne(queryWrapper);
if (Objects.nonNull(boxBrandDO)) {
boxBrandDO.setBoxSpecDOList(boxSpecMapper.selectList(Wrappers.lambdaQuery(BoxSpecDO.class).in(BoxSpecDO::getSpecId, boxBrandDO.getSpecIds())));
}
return boxBrandConvert.toBoxBrand(boxBrandDO); return boxBrandConvert.toBoxBrand(boxBrandDO);
} }

View File

@ -17,7 +17,9 @@ import com.xunhong.erp.turbo.biz.domain.entity.BoxProduct;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxProductGateway; import com.xunhong.erp.turbo.biz.domain.gateway.BoxProductGateway;
import com.xunhong.erp.turbo.biz.infrastructure.convert.BoxProductConvert; import com.xunhong.erp.turbo.biz.infrastructure.convert.BoxProductConvert;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxProductDO; import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxProductDO;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO;
import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxProductMapper; import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxProductMapper;
import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxSpecMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -34,10 +36,14 @@ import java.util.Optional;
public class BoxProductGatewayImpl implements BoxProductGateway { public class BoxProductGatewayImpl implements BoxProductGateway {
private final BoxProductMapper boxProductMapper; private final BoxProductMapper boxProductMapper;
private final BoxProductConvert boxProductConvert; private final BoxProductConvert boxProductConvert;
private final BoxSpecMapper boxSpecMapper;
@Override @Override
public BoxProduct save(BoxProductCreateCmd boxProductCreateCmd) { public BoxProduct save(BoxProductCreateCmd boxProductCreateCmd) {
BoxProductDO boxProductDO = boxProductConvert.toBoxProductDO(boxProductCreateCmd); BoxProductDO boxProductDO = boxProductConvert.toBoxProductDO(boxProductCreateCmd);
BoxSpecDO boxSpecDO = boxSpecMapper.selectById(boxProductDO.getSpecId());
boxProductDO.setSpecName(boxSpecDO.getName());
boxProductMapper.insert(boxProductDO); boxProductMapper.insert(boxProductDO);
return boxProductConvert.toBoxProduct(boxProductDO); return boxProductConvert.toBoxProduct(boxProductDO);
@ -47,7 +53,7 @@ public class BoxProductGatewayImpl implements BoxProductGateway {
public IPage<BoxProduct> page(BoxProductPageQry boxProductPageQry) { public IPage<BoxProduct> page(BoxProductPageQry boxProductPageQry) {
LambdaQueryWrapper<BoxProductDO> queryWrapper = Wrappers.lambdaQuery(BoxProductDO.class); LambdaQueryWrapper<BoxProductDO> queryWrapper = Wrappers.lambdaQuery(BoxProductDO.class);
queryWrapper.like(StrUtil.isNotBlank(boxProductPageQry.getName()), BoxProductDO::getName, boxProductPageQry.getName()); queryWrapper.like(StrUtil.isNotBlank(boxProductPageQry.getName()), BoxProductDO::getName, boxProductPageQry.getName());
queryWrapper.eq(Objects.nonNull(boxProductPageQry.getSpecType()), BoxProductDO::getSpecType, boxProductPageQry.getSpecType()); queryWrapper.eq(Objects.nonNull(boxProductPageQry.getSpecId()), BoxProductDO::getSpecId, boxProductPageQry.getSpecId());
queryWrapper.eq(Objects.nonNull(boxProductPageQry.getBrandId()), BoxProductDO::getBrandId, boxProductPageQry.getBrandId()); queryWrapper.eq(Objects.nonNull(boxProductPageQry.getBrandId()), BoxProductDO::getBrandId, boxProductPageQry.getBrandId());
queryWrapper.eq(Objects.nonNull(boxProductPageQry.getStatus()), BoxProductDO::getStatus, boxProductPageQry.getStatus()); queryWrapper.eq(Objects.nonNull(boxProductPageQry.getStatus()), BoxProductDO::getStatus, boxProductPageQry.getStatus());
queryWrapper.eq(Objects.nonNull(boxProductPageQry.getType()), BoxProductDO::getType, boxProductPageQry.getType()); queryWrapper.eq(Objects.nonNull(boxProductPageQry.getType()), BoxProductDO::getType, boxProductPageQry.getType());
@ -65,7 +71,7 @@ public class BoxProductGatewayImpl implements BoxProductGateway {
public List<BoxProduct> list(BoxProductListQry boxProductListQry) { public List<BoxProduct> list(BoxProductListQry boxProductListQry) {
LambdaQueryWrapper<BoxProductDO> queryWrapper = Wrappers.lambdaQuery(BoxProductDO.class); LambdaQueryWrapper<BoxProductDO> queryWrapper = Wrappers.lambdaQuery(BoxProductDO.class);
queryWrapper.like(StrUtil.isNotBlank(boxProductListQry.getName()), BoxProductDO::getName, boxProductListQry.getName()); queryWrapper.like(StrUtil.isNotBlank(boxProductListQry.getName()), BoxProductDO::getName, boxProductListQry.getName());
queryWrapper.eq(Objects.nonNull(boxProductListQry.getSpecType()), BoxProductDO::getSpecType, boxProductListQry.getSpecType()); queryWrapper.eq(Objects.nonNull(boxProductListQry.getSpecId()), BoxProductDO::getSpecId, boxProductListQry.getSpecId());
queryWrapper.eq(Objects.nonNull(boxProductListQry.getBrandId()), BoxProductDO::getBrandId, boxProductListQry.getBrandId()); queryWrapper.eq(Objects.nonNull(boxProductListQry.getBrandId()), BoxProductDO::getBrandId, boxProductListQry.getBrandId());
queryWrapper.eq(Objects.nonNull(boxProductListQry.getStatus()), BoxProductDO::getStatus, boxProductListQry.getStatus()); queryWrapper.eq(Objects.nonNull(boxProductListQry.getStatus()), BoxProductDO::getStatus, boxProductListQry.getStatus());
queryWrapper.eq(Objects.nonNull(boxProductListQry.getType()), BoxProductDO::getType, boxProductListQry.getType()); queryWrapper.eq(Objects.nonNull(boxProductListQry.getType()), BoxProductDO::getType, boxProductListQry.getType());
@ -85,6 +91,12 @@ public class BoxProductGatewayImpl implements BoxProductGateway {
BoxProductDO boxProductDO = boxProductMapper.selectOne(queryWrapper); BoxProductDO boxProductDO = boxProductMapper.selectOne(queryWrapper);
boxProductConvert.toBoxProductDO(boxProductDO, boxProductUpdateCmd); boxProductConvert.toBoxProductDO(boxProductDO, boxProductUpdateCmd);
if (!Objects.equals(boxProductDO.getSpecId(), boxProductUpdateCmd.getSpecId())) {
BoxSpecDO boxSpecDO = boxSpecMapper.selectById(boxProductUpdateCmd.getSpecId());
boxProductDO.setSpecName(boxSpecDO.getName());
}
boxProductMapper.updateById(boxProductDO); boxProductMapper.updateById(boxProductDO);
return boxProductConvert.toBoxProduct(boxProductDO); return boxProductConvert.toBoxProduct(boxProductDO);

View File

@ -0,0 +1,92 @@
package com.xunhong.erp.turbo.biz.infrastructure.gateway;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecShowQry;
import com.xunhong.erp.turbo.biz.domain.entity.BoxSpec;
import com.xunhong.erp.turbo.biz.domain.gateway.BoxSpecGateway;
import com.xunhong.erp.turbo.biz.infrastructure.convert.BoxSpecConvert;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO;
import com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxSpecMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author shenyifei
*/
@Repository
@RequiredArgsConstructor
public class BoxSpecGatewayImpl implements BoxSpecGateway {
private final BoxSpecMapper boxSpecMapper;
private final BoxSpecConvert boxSpecConvert;
@Override
public BoxSpec save(BoxSpecCreateCmd boxSpecCreateCmd) {
BoxSpecDO boxSpecDO = boxSpecConvert.toBoxSpecDO(boxSpecCreateCmd);
boxSpecMapper.insert(boxSpecDO);
return boxSpecConvert.toBoxSpec(boxSpecDO);
}
@Override
public IPage<BoxSpec> page(BoxSpecPageQry boxSpecPageQry) {
LambdaQueryWrapper<BoxSpecDO> queryWrapper = Wrappers.lambdaQuery(BoxSpecDO.class);
queryWrapper.orderByDesc(BoxSpecDO::getCreatedAt);
IPage<BoxSpecDO> page = new Page<>(boxSpecPageQry.getPageIndex(), boxSpecPageQry.getPageSize());
page = boxSpecMapper.selectPage(page, queryWrapper);
return page.convert(boxSpecConvert::toBoxSpec);
}
@Override
public List<BoxSpec> list(BoxSpecListQry boxSpecListQry) {
LambdaQueryWrapper<BoxSpecDO> queryWrapper = Wrappers.lambdaQuery(BoxSpecDO.class);
List<BoxSpecDO> boxSpecDOList = boxSpecMapper.selectList(queryWrapper);
return boxSpecDOList.stream().map(boxSpecConvert::toBoxSpec).toList();
}
@Override
public BoxSpec update(BoxSpecUpdateCmd boxSpecUpdateCmd) {
LambdaQueryWrapper<BoxSpecDO> queryWrapper = Wrappers.lambdaQuery(BoxSpecDO.class);
queryWrapper.eq(BoxSpecDO::getSpecId, boxSpecUpdateCmd.getSpecId());
queryWrapper.last("limit 1");
BoxSpecDO boxSpecDO = boxSpecMapper.selectOne(queryWrapper);
boxSpecConvert.toBoxSpecDO(boxSpecDO, boxSpecUpdateCmd);
boxSpecMapper.updateById(boxSpecDO);
return boxSpecConvert.toBoxSpec(boxSpecDO);
}
@Override
public BoxSpec show(BoxSpecShowQry boxSpecShowQry) {
LambdaQueryWrapper<BoxSpecDO> queryWrapper = Wrappers.lambdaQuery(BoxSpecDO.class);
queryWrapper.eq(BoxSpecDO::getSpecId, boxSpecShowQry.getSpecId());
queryWrapper.last("limit 1");
BoxSpecDO boxSpecDO = boxSpecMapper.selectOne(queryWrapper);
return boxSpecConvert.toBoxSpec(boxSpecDO);
}
@Override
public void destroy(BoxSpecDestroyCmd boxSpecDestroyCmd) {
LambdaQueryWrapper<BoxSpecDO> queryWrapper = Wrappers.lambdaQuery(BoxSpecDO.class);
queryWrapper.eq(BoxSpecDO::getSpecId, boxSpecDestroyCmd.getSpecId());
queryWrapper.last("limit 1");
BoxSpecDO boxSpecDO = boxSpecMapper.selectOne(queryWrapper);
boxSpecDO.deleteById();
}
}

View File

@ -525,7 +525,7 @@ public class PurchaseOrderGatewayImpl implements PurchaseOrderGateway {
// 按boxCategoryId和boxProductName分组包材信息 // 按boxCategoryId和boxProductName分组包材信息
Map<String, List<OrderPackageDO>> packageGroupByKey = orderPackageDOList.stream() Map<String, List<OrderPackageDO>> packageGroupByKey = orderPackageDOList.stream()
.collect(Collectors.groupingBy(p -> p.getBoxCategoryId() + "_" + p.getBoxProductName())); .collect(Collectors.groupingBy(p -> p.getBoxSpecId() + "_" + p.getBoxProductName()));
// 创建发货单包材信息 // 创建发货单包材信息
for (Map.Entry<String, List<OrderPackageDO>> entry : packageGroupByKey.entrySet()) { for (Map.Entry<String, List<OrderPackageDO>> entry : packageGroupByKey.entrySet()) {
@ -537,7 +537,8 @@ public class PurchaseOrderGatewayImpl implements PurchaseOrderGateway {
// 使用第一个包材的信息作为基础 // 使用第一个包材的信息作为基础
OrderPackageDO firstPackage = packages.get(0); OrderPackageDO firstPackage = packages.get(0);
shipOrderPackageDO.setBoxCategory(firstPackage.getBoxCategoryId()); shipOrderPackageDO.setBoxSpecId(firstPackage.getBoxSpecId());
shipOrderPackageDO.setBoxSpecName(firstPackage.getBoxSpecName());
shipOrderPackageDO.setBoxProduct(firstPackage.getBoxProductName()); shipOrderPackageDO.setBoxProduct(firstPackage.getBoxProductName());
// 使用第一个包材的销售价格作为单价 // 使用第一个包材的销售价格作为单价

View File

@ -0,0 +1,13 @@
package com.xunhong.erp.turbo.biz.infrastructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO;
import org.apache.ibatis.annotations.Mapper;
/**
* @author shenyifei
*/
@Mapper
public interface BoxSpecMapper extends BaseMapper<BoxSpecDO> {
}

View File

@ -9,6 +9,9 @@
<result property="name" column="name"/> <result property="name" column="name"/>
<result property="image" column="image"/> <result property="image" column="image"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="type" column="type"/>
<result property="specIds" column="spec_ids"
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="createdAt" column="created_at"/> <result property="createdAt" column="created_at"/>
<result property="createdAt" column="created_at"/> <result property="createdAt" column="created_at"/>

View File

@ -10,7 +10,8 @@
<result property="weight" column="weight"/> <result property="weight" column="weight"/>
<result property="costPrice" column="cost_price"/> <result property="costPrice" column="cost_price"/>
<result property="salePrice" column="sale_price"/> <result property="salePrice" column="sale_price"/>
<result property="specType" column="spec_type"/> <result property="specId" column="spec_id"/>
<result property="specName" column="spec_name"/>
<result property="brandId" column="brand_id"/> <result property="brandId" column="brand_id"/>
<result property="type" column="type"/> <result property="type" column="type"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxSpecMapper">
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO">
<result property="specId" column="spec_id"/>
<result property="name" column="name"/>
<result property="sort" column="sort"/>
<result property="remark" column="remark"/>
<result property="status" column="status"/>
<result property="createdAt" column="created_at"/>
<result property="createdAt" column="created_at"/>
<result property="updatedAt" column="updated_at"/>
<result property="isDelete" column="is_delete"/>
<result property="version" column="version"/>
</resultMap>
</mapper>

View File

@ -10,7 +10,8 @@
<result property="boxBrandId" column="box_brand_id"/> <result property="boxBrandId" column="box_brand_id"/>
<result property="boxBrandName" column="box_brand_name"/> <result property="boxBrandName" column="box_brand_name"/>
<result property="boxBrandImage" column="box_brand_image"/> <result property="boxBrandImage" column="box_brand_image"/>
<result property="boxCategoryId" column="box_category_id"/> <result property="boxSpecId" column="box_spec_id"/>
<result property="boxSpecName" column="box_spec_name"/>
<result property="boxProductId" column="box_product_id"/> <result property="boxProductId" column="box_product_id"/>
<result property="boxProductName" column="box_product_name"/> <result property="boxProductName" column="box_product_name"/>
<result property="boxProductWeight" column="box_product_weight"/> <result property="boxProductWeight" column="box_product_weight"/>

View File

@ -7,7 +7,8 @@
type="com.xunhong.erp.turbo.biz.infrastructure.entity.ShipOrderPackageDO"> type="com.xunhong.erp.turbo.biz.infrastructure.entity.ShipOrderPackageDO">
<result property="orderPackageId" column="order_package_id"/> <result property="orderPackageId" column="order_package_id"/>
<result property="shipOrderId" column="ship_order_id"/> <result property="shipOrderId" column="ship_order_id"/>
<result property="boxCategory" column="box_category"/> <result property="boxSpecId" column="box_spec_id"/>
<result property="boxSpecName" column="box_spec_name"/>
<result property="boxProduct" column="box_product"/> <result property="boxProduct" column="box_product"/>
<result property="quantity" column="quantity"/> <result property="quantity" column="quantity"/>
<result property="unitPrice" column="unit_price"/> <result property="unitPrice" column="unit_price"/>

View File

@ -0,0 +1,30 @@
package com.xunhong.erp.turbo.api.biz.api;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.BoxSpecUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.BoxSpecShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.BoxSpecVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import java.util.List;
/**
* @author shenyifei
*/
public interface BoxSpecServiceI {
BoxSpecVO create(BoxSpecCreateCmd boxSpecCreateCmd);
PageDTO<BoxSpecVO> page(BoxSpecPageQry boxSpecPageQry);
List<BoxSpecVO> list(BoxSpecListQry boxSpecListQry);
BoxSpecVO update(BoxSpecUpdateCmd boxSpecUpdateCmd);
BoxSpecVO show(BoxSpecShowQry boxSpecShowQry);
void destroy(BoxSpecDestroyCmd boxSpecDestroyCmd);
}

View File

@ -6,6 +6,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* @author shenyifei * @author shenyifei
*/ */
@ -32,6 +34,12 @@ public class BoxBrandCreateCmd extends Command {
@Schema(title = "品牌图片URL") @Schema(title = "品牌图片URL")
private String image; private String image;
/**
* 纸箱规格ID
*/
@Schema(title = "纸箱规格ID")
private List<Long> specIds;
/** /**
* 备注 * 备注
*/ */
@ -45,9 +53,9 @@ public class BoxBrandCreateCmd extends Command {
private Boolean status; private Boolean status;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒", requiredMode = Schema.RequiredMode.REQUIRED)
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
} }

View File

@ -1,7 +1,6 @@
package com.xunhong.erp.turbo.api.biz.dto.cmd; package com.xunhong.erp.turbo.api.biz.dto.cmd;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum; import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxProductSpecTypeEnum;
import com.xunhong.erp.turbo.base.dto.Command; import com.xunhong.erp.turbo.base.dto.Command;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@ -48,10 +47,16 @@ public class BoxProductCreateCmd extends Command {
private BigDecimal salePrice; private BigDecimal salePrice;
/** /**
* 规格1_2粒装2_4粒装 * 规格ID
*/ */
@Schema(title = "规格1_2粒装2_4粒装", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "规格ID", type = "string")
private BoxProductSpecTypeEnum specType; private Long specId;
/**
* 规格名称
*/
@Schema(title = "规格名称")
private String specName;
/** /**
* 品牌ID * 品牌ID
@ -72,9 +77,9 @@ public class BoxProductCreateCmd extends Command {
private Boolean status; private Boolean status;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒", requiredMode = Schema.RequiredMode.REQUIRED)
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
} }

View File

@ -0,0 +1,49 @@
package com.xunhong.erp.turbo.api.biz.dto.cmd;
import com.xunhong.erp.turbo.base.dto.Command;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* @author shenyifei
*/
@Data
@Schema(title = "纸箱规格创建")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecCreateCmd extends Command {
/**
* 规格ID
*/
@Schema(title = "规格ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
private Long specId;
/**
* 规格名称
*/
@Schema(title = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String name;
/**
* 排序号
*/
@Schema(title = "排序号", requiredMode = Schema.RequiredMode.REQUIRED)
private BigDecimal sort;
/**
* 备注
*/
@Schema(title = "备注")
private String remark;
/**
* 状态1_启用0_禁用
*/
@Schema(title = "状态1_启用0_禁用", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean status;
}

View File

@ -0,0 +1,19 @@
package com.xunhong.erp.turbo.api.biz.dto.cmd;
import com.xunhong.erp.turbo.base.dto.Command;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author shenyifei
*/
@Data
@Schema(title = "删除纸箱规格")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecDestroyCmd extends Command {
@Schema(title = "纸箱规格ID", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
private Long specId;
}

View File

@ -0,0 +1,18 @@
package com.xunhong.erp.turbo.api.biz.dto.cmd;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author shenyifei
*/
@Data
@Schema(title = "纸箱规格更新")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecUpdateCmd extends BoxSpecCreateCmd {
@Schema(title = "纸箱规格ID", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
private Long specId;
}

View File

@ -48,16 +48,22 @@ public class OrderPackage extends Command {
private String boxBrandImage; private String boxBrandImage;
/** /**
* 箱子品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 箱子品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "箱子品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "箱子品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒", requiredMode = Schema.RequiredMode.REQUIRED)
private BoxBrandTypeEnum boxBrandType; private BoxBrandTypeEnum boxBrandType;
/** /**
* 箱子分类ID * 箱子规格ID
*/ */
@Schema(title = "箱子分类ID", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "箱子规格ID", requiredMode = Schema.RequiredMode.REQUIRED)
private String boxCategoryId; private String boxSpecId;
/**
* 箱子规格名称
*/
@Schema(title = "箱子规格名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String boxSpecName;
/** /**
* 箱子产品ID * 箱子产品ID

View File

@ -28,11 +28,17 @@ public class ShipOrderPackage extends DTO {
@Schema(title = "发货单ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "发货单ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
private Long shipOrderId; private Long shipOrderId;
/**
* 箱型ID
*/
@Schema(title = "箱型ID")
private Long boxSpecId;
/** /**
* 箱型 * 箱型
*/ */
@Schema(title = "箱型") @Schema(title = "箱型")
private String boxCategory; private String boxSpecName;
/** /**
* 箱号 * 箱号

View File

@ -6,7 +6,7 @@ import lombok.RequiredArgsConstructor;
/** /**
* 品牌类型枚举 * 品牌类型枚举
* 1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 1_我方纸箱2_瓜农纸箱3_第三方纸箱;4_礼盒
*/ */
@Getter @Getter
@RequiredArgsConstructor @RequiredArgsConstructor
@ -24,7 +24,13 @@ public enum BoxBrandTypeEnum {
/** /**
* 第三方纸箱 * 第三方纸箱
*/ */
THIRD_PARTY_BOX(3, "第三方纸箱"); THIRD_PARTY_BOX(3, "第三方纸箱"),
/**
* 礼盒
*/
GIFT_BOX(4, "礼盒"),
;
@EnumValue @EnumValue
private final Integer code; private final Integer code;

View File

@ -1,20 +0,0 @@
package com.xunhong.erp.turbo.api.biz.dto.enums;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public enum BoxProductSpecTypeEnum {
/**
* 规格1_2粒装2_4粒装
*/
TWO_GRAIN(1, "1_2粒装"),
FOUR_GRAIN(2, "2_4粒装");
@EnumValue
private final int type;
private final String message;
}

View File

@ -24,9 +24,9 @@ public class BoxBrandListQry extends Query {
private Boolean withProduct; private Boolean withProduct;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱") @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒")
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
} }

View File

@ -18,9 +18,9 @@ public class BoxBrandPageQry extends PageQuery {
private Long brandId; private Long brandId;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱") @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒")
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
} }

View File

@ -1,7 +1,6 @@
package com.xunhong.erp.turbo.api.biz.dto.qry; package com.xunhong.erp.turbo.api.biz.dto.qry;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum; import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxProductSpecTypeEnum;
import com.xunhong.erp.turbo.base.dto.Query; import com.xunhong.erp.turbo.base.dto.Query;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@ -25,14 +24,14 @@ public class BoxProductListQry extends Query {
private String brandId; private String brandId;
/** /**
* 规格1_2粒装2_4粒装 * 规格ID
*/ */
@Schema(title = "规格1_2粒装2_4粒装") @Schema(title = "规格ID", type = "string")
private BoxProductSpecTypeEnum specType; private Long specId;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱") @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒")
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
} }

View File

@ -1,7 +1,6 @@
package com.xunhong.erp.turbo.api.biz.dto.qry; package com.xunhong.erp.turbo.api.biz.dto.qry;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum; import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxProductSpecTypeEnum;
import com.xunhong.erp.turbo.base.dto.PageQuery; import com.xunhong.erp.turbo.base.dto.PageQuery;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@ -25,15 +24,15 @@ public class BoxProductPageQry extends PageQuery {
private String brandId; private String brandId;
/** /**
* 规格1_2粒装2_4粒装 * 规格ID
*/ */
@Schema(title = "规格1_2粒装2_4粒装") @Schema(title = "规格ID", type = "string")
private BoxProductSpecTypeEnum specType; private Long specId;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱") @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒")
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
} }

View File

@ -0,0 +1,19 @@
package com.xunhong.erp.turbo.api.biz.dto.qry;
import com.xunhong.erp.turbo.base.dto.Query;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author shenyifei
*/
@Data
@Schema(title = "纸箱规格列表查询")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecListQry extends Query {
@Schema(title = "纸箱规格ID", type = "string")
private Long specId;
}

View File

@ -0,0 +1,19 @@
package com.xunhong.erp.turbo.api.biz.dto.qry;
import com.xunhong.erp.turbo.base.dto.PageQuery;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author shenyifei
*/
@Data
@Schema(title = "纸箱规格分页查询")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecPageQry extends PageQuery {
@Schema(title = "纸箱规格ID", type = "string")
private Long specId;
}

View File

@ -0,0 +1,19 @@
package com.xunhong.erp.turbo.api.biz.dto.qry;
import com.xunhong.erp.turbo.base.dto.Query;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author shenyifei
*/
@Data
@Schema(title = "纸箱规格查询")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecShowQry extends Query {
@Schema(title = "纸箱规格ID", type = "string")
private Long specId;
}

View File

@ -35,6 +35,12 @@ public class BoxBrandVO extends DTO {
@Schema(title = "品牌图片URL") @Schema(title = "品牌图片URL")
private String image; private String image;
/**
* 纸箱规格ID
*/
@Schema(title = "纸箱规格ID")
private List<Long> specIds;
/** /**
* 备注 * 备注
*/ */
@ -48,9 +54,9 @@ public class BoxBrandVO extends DTO {
private Boolean status; private Boolean status;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒", requiredMode = Schema.RequiredMode.REQUIRED)
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
/** /**
@ -59,6 +65,12 @@ public class BoxBrandVO extends DTO {
@Schema(title = "纸箱产品列表") @Schema(title = "纸箱产品列表")
private List<BoxProductVO> boxProductVOList; private List<BoxProductVO> boxProductVOList;
/**
* 纸箱规格列表
*/
@Schema(title = "纸箱规格列表")
private List<BoxSpecVO> boxSpecVOList;
/** /**
* 创建时间 * 创建时间
*/ */

View File

@ -2,7 +2,6 @@ package com.xunhong.erp.turbo.api.biz.dto.vo;
import com.alibaba.cola.dto.DTO; import com.alibaba.cola.dto.DTO;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum; import com.xunhong.erp.turbo.api.biz.dto.enums.BoxBrandTypeEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.BoxProductSpecTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -49,10 +48,16 @@ public class BoxProductVO extends DTO {
private BigDecimal salePrice; private BigDecimal salePrice;
/** /**
* 规格1_2粒装2_4粒装 * 规格ID
*/ */
@Schema(title = "规格1_2粒装2_4粒装", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "规格ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
private BoxProductSpecTypeEnum specType; private Long specId;
/**
* 规格名称
*/
@Schema(title = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String specName;
/** /**
* 品牌ID * 品牌ID
@ -61,9 +66,9 @@ public class BoxProductVO extends DTO {
private Long brandId; private Long brandId;
/** /**
* 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱 * 品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒
*/ */
@Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(title = "品牌类型1_我方纸箱2_瓜农纸箱3_第三方纸箱4_礼盒", requiredMode = Schema.RequiredMode.REQUIRED)
private BoxBrandTypeEnum type; private BoxBrandTypeEnum type;
/** /**

View File

@ -0,0 +1,56 @@
package com.xunhong.erp.turbo.api.biz.dto.vo;
import com.alibaba.cola.dto.DTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @author shenyifei
*/
@Data
@Schema(title = "纸箱规格")
@EqualsAndHashCode(callSuper = true)
public class BoxSpecVO extends DTO {
/**
* 规格ID
*/
@Schema(title = "规格ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
private Long specId;
/**
* 规格名称
*/
@Schema(title = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String name;
/**
* 排序号
*/
@Schema(title = "排序号", requiredMode = Schema.RequiredMode.REQUIRED)
private BigDecimal sort;
/**
* 备注
*/
@Schema(title = "备注")
private String remark;
/**
* 状态1_启用0_禁用
*/
@Schema(title = "状态1_启用0_禁用", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean status;
/**
* 创建时间
*/
@Schema(title = "创建时间")
private LocalDateTime createdAt;
}