diff --git a/wms-module-system/src/main/java/top/wms/admin/print/mapper/PrintInfoMapper.java b/wms-module-system/src/main/java/top/wms/admin/print/mapper/PrintInfoMapper.java new file mode 100644 index 0000000..9f320a0 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/mapper/PrintInfoMapper.java @@ -0,0 +1,16 @@ +package top.wms.admin.print.mapper; + +import org.springframework.stereotype.Repository; +import top.continew.starter.data.mp.base.BaseMapper; +import top.wms.admin.print.model.entity.PrintInfoDO; + +/** + * 打印记录 Mapper + * + * @author zc + * @since 2026/06/15 16:57 + */ +@Repository +public interface PrintInfoMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/mapper/PrintMapper.java b/wms-module-system/src/main/java/top/wms/admin/print/mapper/PrintMapper.java new file mode 100644 index 0000000..9083e88 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/mapper/PrintMapper.java @@ -0,0 +1,16 @@ +package top.wms.admin.print.mapper; + +import top.continew.starter.data.mp.base.BaseMapper; +import top.wms.admin.print.model.entity.PrintDO; +import org.springframework.stereotype.Repository; + +/** + * 打印记录 Mapper + * + * @author zc + * @since 2026/06/15 16:57 + */ +@Repository +public interface PrintMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/model/entity/PrintDO.java b/wms-module-system/src/main/java/top/wms/admin/print/model/entity/PrintDO.java new file mode 100644 index 0000000..3dc6ccf --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/model/entity/PrintDO.java @@ -0,0 +1,68 @@ +package top.wms.admin.print.model.entity; + +import lombok.Data; + +import com.baomidou.mybatisplus.annotation.TableName; + +import top.wms.admin.common.model.entity.BaseDO; + +import java.io.Serial; + +/** + * 打印记录实体 + * + * @author zc + * @since 2026/06/15 16:57 + */ +@Data +@TableName("sys_print") +public class PrintDO extends BaseDO { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 物料编码 + */ + private String encoding; + + /** + * 打印编码 + */ + private String encodingPrint; + + /** + * 物料名称 + */ + private String materialName; + + /** + * 打印名称 + */ + private String materialNamePrint; + + /** + * 任务工单号 + */ + private String orderNo; + + /** + * 任务工单id + */ + private Long workerOrderId; + + /** + * 批次 + */ + private String batch; + + /** + * 标签数量 + */ + private Integer labelCount; + + /** + * 打印类型 0:明细标签打印 1:整体标签打印 + */ + private Integer labelType; +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/model/entity/PrintInfoDO.java b/wms-module-system/src/main/java/top/wms/admin/print/model/entity/PrintInfoDO.java new file mode 100644 index 0000000..20b1a78 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/model/entity/PrintInfoDO.java @@ -0,0 +1,86 @@ +package top.wms.admin.print.model.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 打印记录详情实体 + * + * @author zc + * @since 2026/06/15 16:58 + */ +@Data +@TableName("sys_print_info") +public class PrintInfoDO implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + private Long id; + + private Long printId; + + /** + * 打印编码 + */ + private String encodingPrint; + + /** + * 检验签字 + */ + private String inspectionSignature; + + /** + * 标记号 + */ + private String mark; + + /** + * 打印名称 + */ + private String materialNamePrint; + + /** + * 包装签字 + */ + private String packingSignature; + + /** + * 生产日期 + */ + private String productionDate; + + /** + * 二维码数据 + */ + private String qrCodeData; + + /** + * 批次 + */ + private String batch; + + /** + * 标重 + */ + private BigDecimal totalCalculatedWeight; + + /** + * 数量 + */ + private Integer totalCount; + + /** + * 实重 + */ + private BigDecimal totalWeight; + + /** + * 任务工单ID + */ + private Long workerOrderId; +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/model/query/PrintQuery.java b/wms-module-system/src/main/java/top/wms/admin/print/model/query/PrintQuery.java new file mode 100644 index 0000000..2c961c8 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/model/query/PrintQuery.java @@ -0,0 +1,82 @@ +package top.wms.admin.print.model.query; + +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import top.continew.starter.data.core.annotation.Query; +import top.continew.starter.data.core.enums.QueryType; + +import java.io.Serial; +import java.io.Serializable; +import java.time.*; + +/** + * 打印记录查询条件 + * + * @author zc + * @since 2026/06/15 16:57 + */ +@Data +@Schema(description = "打印记录查询条件") +public class PrintQuery implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 打印编码 + */ + @Schema(description = "打印编码") + @Query(type = QueryType.EQ) + private String encodingPrint; + + /** + * 物料名称 + */ + @Schema(description = "物料名称") + @Query(type = QueryType.EQ) + private String materialName; + + /** + * 打印名称 + */ + @Schema(description = "打印名称") + @Query(type = QueryType.EQ) + private String materialNamePrint; + + /** + * 任务工单号 + */ + @Schema(description = "任务工单号") + @Query(type = QueryType.EQ) + private String orderNo; + + /** + * 任务工单id + */ + @Schema(description = "任务工单id") + @Query(type = QueryType.EQ) + private Long workerOrderId; + + /** + * 批次 + */ + @Schema(description = "批次") + @Query(type = QueryType.EQ) + private String batch; + + /** + * 创建人 + */ + @Schema(description = "创建人") + @Query(type = QueryType.EQ) + private Long createUser; + + /** + * 创建时间 + */ + @Schema(description = "创建时间") + @Query(type = QueryType.EQ) + private LocalDateTime createTime; +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/model/req/PrintInfoReq.java b/wms-module-system/src/main/java/top/wms/admin/print/model/req/PrintInfoReq.java new file mode 100644 index 0000000..1e5839d --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/model/req/PrintInfoReq.java @@ -0,0 +1,109 @@ +package top.wms.admin.print.model.req; + +import jakarta.validation.constraints.*; + +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import org.hibernate.validator.constraints.Length; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 创建或修改打印记录详情参数 + * + * @author zc + * @since 2026/06/15 17:03 + */ +@Data +@Schema(description = "创建或修改打印记录详情参数") +public class PrintInfoReq implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 打印编码 + */ + @Schema(description = "打印编码") + @Length(max = 255, message = "打印编码长度不能超过 {max} 个字符") + private String encodingPrint; + + /** + * 检验签字 + */ + @Schema(description = "检验签字") + @Length(max = 25, message = "检验签字长度不能超过 {max} 个字符") + private String inspectionSignature; + + /** + * 标记号 + */ + @Schema(description = "标记号") + @Length(max = 25, message = "标记号长度不能超过 {max} 个字符") + private String mark; + + /** + * 打印名称 + */ + @Schema(description = "打印名称") + @NotBlank(message = "打印名称不能为空") + @Length(max = 255, message = "打印名称长度不能超过 {max} 个字符") + private String materialNamePrint; + + /** + * 包装签字 + */ + @Schema(description = "包装签字") + @Length(max = 25, message = "包装签字长度不能超过 {max} 个字符") + private String packingSignature; + + /** + * 生产日期 + */ + @Schema(description = "生产日期") + @Length(max = 50, message = "生产日期长度不能超过 {max} 个字符") + private String productionDate; + + /** + * 二维码数据 + */ + @Schema(description = "二维码数据") + @Length(max = 500, message = "二维码数据长度不能超过 {max} 个字符") + private String qrCodeData; + + /** + * 批次 + */ + @Schema(description = "批次") + @NotBlank(message = "批次不能为空") + @Length(max = 255, message = "批次长度不能超过 {max} 个字符") + private String batch; + + /** + * 标重 + */ + @Schema(description = "标重") + private BigDecimal totalCalculatedWeight; + + /** + * 数量 + */ + @Schema(description = "数量") + private Integer totalCount; + + /** + * 实重 + */ + @Schema(description = "实重") + private BigDecimal totalWeight; + + /** + * 任务工单ID + */ + @Schema(description = "任务工单ID") + private Long workerOrderId; +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/model/req/PrintReq.java b/wms-module-system/src/main/java/top/wms/admin/print/model/req/PrintReq.java new file mode 100644 index 0000000..394b850 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/model/req/PrintReq.java @@ -0,0 +1,88 @@ +package top.wms.admin.print.model.req; + +import jakarta.validation.constraints.*; + +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import top.wms.admin.print.model.entity.PrintInfoDO; + +import java.io.Serial; +import java.io.Serializable; +import java.time.*; +import java.util.List; + +/** + * 创建或修改打印记录参数 + * + * @author zc + * @since 2026/06/15 17:04 + */ +@Data +@Schema(description = "创建或修改打印记录参数") +public class PrintReq implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 物料编码 + */ + @Schema(description = "物料编码") + private String encoding; + + /** + * 打印编码 + */ + @Schema(description = "打印编码") + private String encodingPrint; + + /** + * 物料名称 + */ + @Schema(description = "物料名称") + @NotBlank(message = "物料名称不能为空") + private String materialName; + + /** + * 打印名称 + */ + @Schema(description = "打印名称") + private String materialNamePrint; + + /** + * 任务工单号 + */ + @Schema(description = "任务工单号") + @NotBlank(message = "任务工单号不能为空") + private String orderNo; + + /** + * 任务工单id + */ + @Schema(description = "任务工单id") + @NotNull(message = "任务工单id不能为空") + private Long workerOrderId; + + /** + * 批次 + */ + @Schema(description = "批次") + @NotBlank(message = "批次不能为空") + private String batch; + + /** + * 标签数量 + */ + @Schema(description = "标签数量") + private Integer labelCount; + + /** + * 打印类型 0:明细标签打印 1:整体标签打印 + */ + @Schema(description = "打印类型 0:明细标签打印 1:整体标签打印") + private Integer labelType; + + private List printInfoList; +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/model/resp/PrintInfoResp.java b/wms-module-system/src/main/java/top/wms/admin/print/model/resp/PrintInfoResp.java new file mode 100644 index 0000000..845fe9c --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/model/resp/PrintInfoResp.java @@ -0,0 +1,97 @@ +package top.wms.admin.print.model.resp; + +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 打印记录详情信息 + * + * @author zc + * @since 2026/06/15 17:08 + */ +@Data +@Schema(description = "打印记录详情信息") +public class PrintInfoResp implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + private Long id; + + /** + * 打印编码 + */ + @Schema(description = "打印编码") + private String encodingPrint; + + /** + * 检验签字 + */ + @Schema(description = "检验签字") + private String inspectionSignature; + + /** + * 标记号 + */ + @Schema(description = "标记号") + private String mark; + + /** + * 打印名称 + */ + @Schema(description = "打印名称") + private String materialNamePrint; + + /** + * 包装签字 + */ + @Schema(description = "包装签字") + private String packingSignature; + + /** + * 生产日期 + */ + @Schema(description = "生产日期") + private String productionDate; + + /** + * 二维码数据 + */ + @Schema(description = "二维码数据") + private String qrCodeData; + + /** + * 批次 + */ + @Schema(description = "批次") + private String batch; + + /** + * 标重 + */ + @Schema(description = "标重") + private BigDecimal totalCalculatedWeight; + + /** + * 数量 + */ + @Schema(description = "数量") + private Integer totalCount; + + /** + * 实重 + */ + @Schema(description = "实重") + private BigDecimal totalWeight; + + /** + * 任务工单ID + */ + @Schema(description = "任务工单ID") + private Long workerOrderId; +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/model/resp/PrintResp.java b/wms-module-system/src/main/java/top/wms/admin/print/model/resp/PrintResp.java new file mode 100644 index 0000000..09ba69a --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/model/resp/PrintResp.java @@ -0,0 +1,90 @@ +package top.wms.admin.print.model.resp; + +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import top.wms.admin.common.model.resp.BaseDetailResp; + +import java.io.Serial; +import java.time.*; + +/** + * 打印记录信息 + * + * @author zc + * @since 2026/06/15 16:57 + */ +@Data +@Schema(description = "打印记录信息") +public class PrintResp extends BaseDetailResp { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 物料编码 + */ + @Schema(description = "物料编码") + private String encoding; + + /** + * 打印编码 + */ + @Schema(description = "打印编码") + private String encodingPrint; + + /** + * 物料名称 + */ + @Schema(description = "物料名称") + private String materialName; + + /** + * 打印名称 + */ + @Schema(description = "打印名称") + private String materialNamePrint; + + /** + * 任务工单号 + */ + @Schema(description = "任务工单号") + private String orderNo; + + /** + * 任务工单id + */ + @Schema(description = "任务工单id") + private Long workerOrderId; + + /** + * 批次 + */ + @Schema(description = "批次") + private String batch; + + /** + * 标签数量 + */ + @Schema(description = "标签数量") + private Integer labelCount; + + /** + * 打印类型 0:明细标签打印 1:整体标签打印 + */ + @Schema(description = "打印类型 0:明细标签打印 1:整体标签打印") + private Integer labelType; + + /** + * 修改人 + */ + @Schema(description = "修改人") + private Long updateUser; + + /** + * 修改时间 + */ + @Schema(description = "修改时间") + private LocalDateTime updateTime; +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/service/PrintService.java b/wms-module-system/src/main/java/top/wms/admin/print/service/PrintService.java new file mode 100644 index 0000000..d0e1373 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/service/PrintService.java @@ -0,0 +1,20 @@ +package top.wms.admin.print.service; + +import top.continew.starter.extension.crud.service.BaseService; +import top.wms.admin.print.model.query.PrintQuery; +import top.wms.admin.print.model.req.PrintReq; +import top.wms.admin.print.model.resp.PrintInfoResp; +import top.wms.admin.print.model.resp.PrintResp; + +import java.util.List; + +/** + * 打印记录业务接口 + * + * @author zc + * @since 2026/06/15 16:57 + */ +public interface PrintService extends BaseService { + + List getInfo(Long id); +} \ No newline at end of file diff --git a/wms-module-system/src/main/java/top/wms/admin/print/service/impl/PrintServiceImpl.java b/wms-module-system/src/main/java/top/wms/admin/print/service/impl/PrintServiceImpl.java new file mode 100644 index 0000000..1b957f8 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/print/service/impl/PrintServiceImpl.java @@ -0,0 +1,51 @@ +package top.wms.admin.print.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.RequiredArgsConstructor; + +import org.springframework.stereotype.Service; + +import top.continew.starter.extension.crud.service.BaseServiceImpl; +import top.wms.admin.print.mapper.PrintInfoMapper; +import top.wms.admin.print.mapper.PrintMapper; +import top.wms.admin.print.model.entity.PrintDO; +import top.wms.admin.print.model.entity.PrintInfoDO; +import top.wms.admin.print.model.query.PrintQuery; +import top.wms.admin.print.model.req.PrintReq; +import top.wms.admin.print.model.resp.PrintInfoResp; +import top.wms.admin.print.model.resp.PrintResp; +import top.wms.admin.print.service.PrintService; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 打印记录业务实现 + * + * @author zc + * @since 2026/06/15 16:57 + */ +@Service +@RequiredArgsConstructor +public class PrintServiceImpl extends BaseServiceImpl implements PrintService { + + private final PrintInfoMapper printInfoMapper; + + @Override + public List getInfo(Long id) { + PrintDO printDO = baseMapper.selectById(id); + List printInfoRespList = printInfoMapper.selectList(new QueryWrapper() + .eq("worker_order_id", printDO.getWorkerOrderId())); + return BeanUtil.copyToList(printInfoRespList, PrintInfoResp.class); + } + + @Override + public void afterAdd(PrintReq req, PrintDO printDO) { + printInfoMapper.insertBatch(req.getPrintInfoList() + .stream() + .peek(item -> item.setPrintId(printDO.getId())) + .collect(Collectors.toList())); + } + +} \ No newline at end of file diff --git a/wms-webapi/src/main/java/top/wms/admin/controller/print/PrintController.java b/wms-webapi/src/main/java/top/wms/admin/controller/print/PrintController.java new file mode 100644 index 0000000..8b3510a --- /dev/null +++ b/wms-webapi/src/main/java/top/wms/admin/controller/print/PrintController.java @@ -0,0 +1,37 @@ +package top.wms.admin.controller.print; + +import top.continew.starter.extension.crud.enums.Api; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.*; + +import lombok.RequiredArgsConstructor; +import top.continew.starter.extension.crud.annotation.CrudRequestMapping; +import top.wms.admin.common.controller.BaseController; +import top.wms.admin.print.model.query.PrintQuery; +import top.wms.admin.print.model.req.PrintReq; +import top.wms.admin.print.model.resp.PrintInfoResp; +import top.wms.admin.print.model.resp.PrintResp; +import top.wms.admin.print.service.PrintService; + +import java.util.List; + +/** + * 打印记录管理 API + * + * @author zc + * @since 2026/06/15 16:57 + */ +@Tag(name = "打印记录管理 API") +@RestController +@RequiredArgsConstructor +@CrudRequestMapping(value = "/print/print", api = {Api.PAGE, Api.ADD, Api.DELETE}) +public class PrintController extends BaseController { + + @GetMapping("/{id}") + public List get(@PathVariable Long id) { + return baseService.getInfo(id); + } + +} \ No newline at end of file