打印编码需求变更

This commit is contained in:
zc
2026-06-15 18:03:06 +08:00
parent 2c7e05cbad
commit 6355059ee3
12 changed files with 760 additions and 0 deletions

View File

@@ -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<PrintInfoDO> {
}

View File

@@ -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<PrintDO> {
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<PrintInfoDO> printInfoList;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<PrintResp, PrintResp, PrintQuery, PrintReq> {
List<PrintInfoResp> getInfo(Long id);
}

View File

@@ -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<PrintMapper, PrintDO, PrintResp, PrintResp, PrintQuery, PrintReq> implements PrintService {
private final PrintInfoMapper printInfoMapper;
@Override
public List<PrintInfoResp> getInfo(Long id) {
PrintDO printDO = baseMapper.selectById(id);
List<PrintInfoDO> printInfoRespList = printInfoMapper.selectList(new QueryWrapper<PrintInfoDO>()
.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()));
}
}