feat: 定义子卷包装关系批量新增契约
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package cn.code.nl.module.lms.controller.admin.subpackagerelation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 子卷包装关系批量新增单条数据 Request VO")
|
||||
@Data
|
||||
public class SubPackageRelationBatchCreateItemReqVO {
|
||||
|
||||
/** 客户端唯一标识 */
|
||||
@Schema(description = "客户端唯一标识")
|
||||
private String clientKey;
|
||||
|
||||
/** 木箱唯一码 */
|
||||
@Schema(description = "木箱唯一码")
|
||||
private String packageBoxSn;
|
||||
|
||||
/** 木箱料号 */
|
||||
@Schema(description = "木箱料号")
|
||||
private String boxType;
|
||||
|
||||
/** 木箱长度 */
|
||||
@Schema(description = "木箱长度")
|
||||
private String boxLength;
|
||||
|
||||
/** 木箱宽度 */
|
||||
@Schema(description = "木箱宽度")
|
||||
private String boxWidth;
|
||||
|
||||
/** 木箱高度 */
|
||||
@Schema(description = "木箱高度")
|
||||
private String boxHigh;
|
||||
|
||||
/** 保质期 */
|
||||
@Schema(description = "保质期")
|
||||
private String qualityGuaranPeriod;
|
||||
|
||||
/** 入库日期 */
|
||||
@Schema(description = "入库日期")
|
||||
private String dateOfFgInbound;
|
||||
|
||||
/** 子卷号 */
|
||||
@Schema(description = "子卷号")
|
||||
private String containerName;
|
||||
|
||||
/** 状态 */
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.code.nl.module.lms.controller.admin.subpackagerelation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 子卷包装关系批量新增 Request VO")
|
||||
@Data
|
||||
public class SubPackageRelationBatchCreateReqVO {
|
||||
|
||||
/** 批量新增数据 */
|
||||
@Schema(description = "批量新增数据")
|
||||
@NotEmpty(message = "批量新增数据不能为空")
|
||||
private List<SubPackageRelationBatchCreateItemReqVO> items;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.code.nl.module.lms.controller.admin.subpackagerelation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 子卷包装关系批量新增 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SubPackageRelationBatchCreateRespVO {
|
||||
|
||||
/** 成功数量 */
|
||||
@Schema(description = "成功数量")
|
||||
private Integer successCount;
|
||||
|
||||
/** 失败数量 */
|
||||
@Schema(description = "失败数量")
|
||||
private Integer failureCount;
|
||||
|
||||
/** 失败数据 */
|
||||
@Schema(description = "失败数据")
|
||||
private List<Failure> failures;
|
||||
|
||||
/**
|
||||
* 批量新增失败数据
|
||||
*/
|
||||
@Schema(description = "批量新增失败数据")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class Failure {
|
||||
|
||||
/** 客户端唯一标识 */
|
||||
@Schema(description = "客户端唯一标识")
|
||||
private String clientKey;
|
||||
|
||||
/** 数据行号 */
|
||||
@Schema(description = "数据行号")
|
||||
private Integer rowIndex;
|
||||
|
||||
/** 错误编码 */
|
||||
@Schema(description = "错误编码")
|
||||
private String errorCode;
|
||||
|
||||
/** 错误信息 */
|
||||
@Schema(description = "错误信息")
|
||||
private String message;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,4 +30,11 @@ public interface BoxTypeMapper extends BaseMapperX<BoxTypeDO> {
|
||||
return selectOne(BoxTypeDO::getBoxType, boxType);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 根据木箱料号集合查询木箱类型
|
||||
*/
|
||||
default List<BoxTypeDO> selectListByBoxTypes(Collection<String> boxTypes) {
|
||||
return selectList(BoxTypeDO::getBoxType, boxTypes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.code.nl.module.lms.dal.mysql.subpackagerelation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
@@ -31,4 +32,13 @@ public interface SubPackageRelationMapper extends BaseMapperX<SubPackageRelation
|
||||
.orderByDesc(SubPackageRelationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 根据木箱唯一码和木箱料号统计子卷包装关系数量
|
||||
*/
|
||||
default Long selectCountByPackageBoxSnAndBoxType(String packageBoxSn, String boxType) {
|
||||
return selectCount(new LambdaQueryWrapper<SubPackageRelationDO>()
|
||||
.eq(SubPackageRelationDO::getPackageBoxSn, packageBoxSn)
|
||||
.eq(SubPackageRelationDO::getBoxType, boxType));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user