19 changed files with 1172 additions and 93 deletions
@ -0,0 +1,28 @@ |
|||||
|
package com.galaxis.rcs.common.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 容器信息(lcc_bas_container) |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LccBasContainer implements Serializable { |
||||
|
/** 环境ID */ |
||||
|
private Long envId; |
||||
|
/** 容器条码 */ |
||||
|
private String lpn; |
||||
|
/** 容器类型 */ |
||||
|
private String containerType; |
||||
|
/** 是否激活 */ |
||||
|
private Boolean isActive; |
||||
|
/** 创建时间 */ |
||||
|
private Date createAt; |
||||
|
/** 创建人 */ |
||||
|
private String createBy; |
||||
|
/** 更新时间 */ |
||||
|
private Date updateAt; |
||||
|
/** 更新人 */ |
||||
|
private String updateBy; |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
package com.galaxis.rcs.common.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 执行器信息(lcc_bas_executor) |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LccBasExecutor implements Serializable { |
||||
|
/** 环境ID */ |
||||
|
private Long envId; |
||||
|
/** 执行器ID */ |
||||
|
private String executorId; |
||||
|
/** 仿真车所在楼层 */ |
||||
|
private String virtualFloorCode; |
||||
|
/** 仿真车所在XYZ */ |
||||
|
private String virtualLocationAt; |
||||
|
/** 仿真车配置详情 */ |
||||
|
private String virtualExecutorPayload; |
||||
|
/** 是否激活 */ |
||||
|
private Boolean isActive; |
||||
|
/** 创建时间 */ |
||||
|
private Date createAt; |
||||
|
/** 创建人 */ |
||||
|
private String createBy; |
||||
|
/** 更新时间 */ |
||||
|
private Date updateAt; |
||||
|
/** 更新人 */ |
||||
|
private String updateBy; |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.galaxis.rcs.common.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 库存位置(lcc_bas_location) |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LccBasLocation implements Serializable { |
||||
|
/** 环境ID */ |
||||
|
private Long envId; |
||||
|
/** 位置编码 */ |
||||
|
private String locCode; |
||||
|
/** 位置类型_gstore_rack_executor */ |
||||
|
private String locType; |
||||
|
/** 路径点编码 */ |
||||
|
private String wayPoint; |
||||
|
/** 货位相对于路径方向 */ |
||||
|
private String locDirection; |
||||
|
/** 楼层数据 */ |
||||
|
private String catalogCode; |
||||
|
/** 位置编码 */ |
||||
|
private String rack; |
||||
|
/** 货架列 */ |
||||
|
private Integer bay; |
||||
|
/** 货架层 */ |
||||
|
private Integer level; |
||||
|
/** 货架格 */ |
||||
|
private Integer cell; |
||||
|
/** 是否锁定 */ |
||||
|
private Integer isLock; |
||||
|
/** 是否冻结 */ |
||||
|
private Integer isFrozen; |
||||
|
/** 创建时间 */ |
||||
|
private Date createAt; |
||||
|
/** 创建人 */ |
||||
|
private String createBy; |
||||
|
/** 更新时间 */ |
||||
|
private Date updateAt; |
||||
|
/** 更新人 */ |
||||
|
private String updateBy; |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.galaxis.rcs.common.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 库存账页(lcc_inv_ledger) |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LccInvLedger implements Serializable { |
||||
|
/** 环境ID */ |
||||
|
private Long envId; |
||||
|
/** 业务单据ID */ |
||||
|
private Long bizTaskId; |
||||
|
/** 账页号 */ |
||||
|
private Long ledgerId; |
||||
|
/** 账页类型 */ |
||||
|
private String ledgerType; |
||||
|
/** 账页原因 */ |
||||
|
private String ledgerRemark; |
||||
|
/** 托盘条码 */ |
||||
|
private String lpn; |
||||
|
/** 库存改变数量 */ |
||||
|
private Integer qtyChange; |
||||
|
/** 入库占用改变数量 */ |
||||
|
private Integer qtyInChange; |
||||
|
/** 出库占用改变数量 */ |
||||
|
private Integer qtyOutChange; |
||||
|
/** 改变后堆叠层号从0开始 */ |
||||
|
private Integer layerIndex; |
||||
|
/** 改变前库存位置 */ |
||||
|
private String locCode; |
||||
|
/** 改变后库存数量 */ |
||||
|
private Integer qty; |
||||
|
/** 改变后入库占用数量 */ |
||||
|
private Integer qtyIn; |
||||
|
/** 改变后出库占用数量 */ |
||||
|
private Integer qtyOut; |
||||
|
/** 创建时间 */ |
||||
|
private Date createAt; |
||||
|
/** 创建人 */ |
||||
|
private String createBy; |
||||
|
/** 更新时间 */ |
||||
|
private Date updateAt; |
||||
|
/** 更新人 */ |
||||
|
private String updateBy; |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.galaxis.rcs.common.entity; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 库存(lcc_inv_lpn) |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LccInvLpn implements Serializable { |
||||
|
/** 环境ID */ |
||||
|
private Long envId; |
||||
|
/** 托盘条码 */ |
||||
|
private String lpn; |
||||
|
/** 库存位置 */ |
||||
|
private String locCode; |
||||
|
/** 堆叠层号从0开始 */ |
||||
|
private Integer layerIndex; |
||||
|
/** 库存数量 */ |
||||
|
private Integer qty; |
||||
|
/** 入库占用数量 */ |
||||
|
private Integer qtyIn; |
||||
|
/** 出库占用数量 */ |
||||
|
private Integer qtyOut; |
||||
|
/** 创建时间 */ |
||||
|
private Date createAt; |
||||
|
/** 创建人 */ |
||||
|
private String createBy; |
||||
|
/** 更新时间 */ |
||||
|
private Date updateAt; |
||||
|
/** 更新人 */ |
||||
|
private String updateBy; |
||||
|
} |
||||
@ -0,0 +1,71 @@ |
|||||
|
package com.galaxis.rcs.common.query; |
||||
|
|
||||
|
import static com.querydsl.core.types.PathMetadataFactory.*; |
||||
|
import com.querydsl.core.types.dsl.*; |
||||
|
import com.querydsl.core.types.*; |
||||
|
import com.querydsl.sql.*; |
||||
|
import java.sql.Types; |
||||
|
import com.galaxis.rcs.common.entity.LccBasContainer; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 容器信息(lcc_bas_container) |
||||
|
*/ |
||||
|
@SuppressWarnings("ALL") |
||||
|
public class QLccBasContainer extends RelationalPathBase<LccBasContainer> { |
||||
|
/** lcc_bas_container表 */ |
||||
|
public static final QLccBasContainer lccBasContainer = new QLccBasContainer("lcc_bas_container"); |
||||
|
|
||||
|
/** 环境ID */ |
||||
|
public final NumberPath<Long> envId = createNumber("envId", Long.class); |
||||
|
/** 容器条码 */ |
||||
|
public final StringPath lpn = createString("lpn"); |
||||
|
/** 容器类型 */ |
||||
|
public final StringPath containerType = createString("containerType"); |
||||
|
/** 是否激活 */ |
||||
|
public final BooleanPath isActive = createBoolean("isActive"); |
||||
|
/** 创建时间 */ |
||||
|
public final DateTimePath<Date> createAt = createDateTime("createAt", Date.class); |
||||
|
/** 创建人 */ |
||||
|
public final StringPath createBy = createString("createBy"); |
||||
|
/** 更新时间 */ |
||||
|
public final DateTimePath<Date> updateAt = createDateTime("updateAt", Date.class); |
||||
|
/** 更新人 */ |
||||
|
public final StringPath updateBy = createString("updateBy"); |
||||
|
|
||||
|
public QLccBasContainer(String variable) { |
||||
|
super(LccBasContainer.class, forVariable(variable), "rcs2_tw_zhanghui", "lcc_bas_container"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasContainer(String variable, String schema, String table) { |
||||
|
super(LccBasContainer.class, forVariable(variable), schema, table); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasContainer(String variable, String schema) { |
||||
|
super(LccBasContainer.class, forVariable(variable), schema, "lcc_bas_container"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasContainer(Path<? extends LccBasContainer> path) { |
||||
|
super(path.getType(), path.getMetadata(), "rcs2_tw_zhanghui", "lcc_bas_container"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasContainer(PathMetadata metadata) { |
||||
|
super(LccBasContainer.class, metadata, "rcs2_tw_zhanghui", "lcc_bas_container"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
private void addMetadata() { |
||||
|
addMetadata(envId, ColumnMetadata.named("env_id").withIndex(1).ofType(Types.BIGINT).withSize(19)); |
||||
|
addMetadata(lpn, ColumnMetadata.named("lpn").withIndex(2).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(containerType, ColumnMetadata.named("container_type").withIndex(3).ofType(Types.VARCHAR).withSize(20)); |
||||
|
addMetadata(isActive, ColumnMetadata.named("is_active").withIndex(4).ofType(Types.BIT).withSize(3)); |
||||
|
addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(5).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(6).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(7).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(8).ofType(Types.VARCHAR).withSize(50)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,77 @@ |
|||||
|
package com.galaxis.rcs.common.query; |
||||
|
|
||||
|
import static com.querydsl.core.types.PathMetadataFactory.*; |
||||
|
import com.querydsl.core.types.dsl.*; |
||||
|
import com.querydsl.core.types.*; |
||||
|
import com.querydsl.sql.*; |
||||
|
import java.sql.Types; |
||||
|
import com.galaxis.rcs.common.entity.LccBasExecutor; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 执行器信息(lcc_bas_executor) |
||||
|
*/ |
||||
|
@SuppressWarnings("ALL") |
||||
|
public class QLccBasExecutor extends RelationalPathBase<LccBasExecutor> { |
||||
|
/** lcc_bas_executor表 */ |
||||
|
public static final QLccBasExecutor lccBasExecutor = new QLccBasExecutor("lcc_bas_executor"); |
||||
|
|
||||
|
/** 环境ID */ |
||||
|
public final NumberPath<Long> envId = createNumber("envId", Long.class); |
||||
|
/** 执行器ID */ |
||||
|
public final StringPath executorId = createString("executorId"); |
||||
|
/** 仿真车所在楼层 */ |
||||
|
public final StringPath virtualFloorCode = createString("virtualFloorCode"); |
||||
|
/** 仿真车所在XYZ */ |
||||
|
public final StringPath virtualLocationAt = createString("virtualLocationAt"); |
||||
|
/** 仿真车配置详情 */ |
||||
|
public final StringPath virtualExecutorPayload = createString("virtualExecutorPayload"); |
||||
|
/** 是否激活 */ |
||||
|
public final BooleanPath isActive = createBoolean("isActive"); |
||||
|
/** 创建时间 */ |
||||
|
public final DateTimePath<Date> createAt = createDateTime("createAt", Date.class); |
||||
|
/** 创建人 */ |
||||
|
public final StringPath createBy = createString("createBy"); |
||||
|
/** 更新时间 */ |
||||
|
public final DateTimePath<Date> updateAt = createDateTime("updateAt", Date.class); |
||||
|
/** 更新人 */ |
||||
|
public final StringPath updateBy = createString("updateBy"); |
||||
|
|
||||
|
public QLccBasExecutor(String variable) { |
||||
|
super(LccBasExecutor.class, forVariable(variable), "rcs2_tw_zhanghui", "lcc_bas_executor"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasExecutor(String variable, String schema, String table) { |
||||
|
super(LccBasExecutor.class, forVariable(variable), schema, table); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasExecutor(String variable, String schema) { |
||||
|
super(LccBasExecutor.class, forVariable(variable), schema, "lcc_bas_executor"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasExecutor(Path<? extends LccBasExecutor> path) { |
||||
|
super(path.getType(), path.getMetadata(), "rcs2_tw_zhanghui", "lcc_bas_executor"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasExecutor(PathMetadata metadata) { |
||||
|
super(LccBasExecutor.class, metadata, "rcs2_tw_zhanghui", "lcc_bas_executor"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
private void addMetadata() { |
||||
|
addMetadata(envId, ColumnMetadata.named("env_id").withIndex(1).ofType(Types.BIGINT).withSize(19)); |
||||
|
addMetadata(executorId, ColumnMetadata.named("executor_id").withIndex(2).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(virtualFloorCode, ColumnMetadata.named("virtual_floor_code").withIndex(3).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(virtualLocationAt, ColumnMetadata.named("virtual_location_at").withIndex(4).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(virtualExecutorPayload, ColumnMetadata.named("virtual_executor_payload").withIndex(5).ofType(Types.VARCHAR).withSize(3000)); |
||||
|
addMetadata(isActive, ColumnMetadata.named("is_active").withIndex(6).ofType(Types.BIT).withSize(3)); |
||||
|
addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(7).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(8).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(9).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(10).ofType(Types.VARCHAR).withSize(50)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
package com.galaxis.rcs.common.query; |
||||
|
|
||||
|
import static com.querydsl.core.types.PathMetadataFactory.*; |
||||
|
import com.querydsl.core.types.dsl.*; |
||||
|
import com.querydsl.core.types.*; |
||||
|
import com.querydsl.sql.*; |
||||
|
import java.sql.Types; |
||||
|
import com.galaxis.rcs.common.entity.LccBasLocation; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 库存位置(lcc_bas_location) |
||||
|
*/ |
||||
|
@SuppressWarnings("ALL") |
||||
|
public class QLccBasLocation extends RelationalPathBase<LccBasLocation> { |
||||
|
/** lcc_bas_location表 */ |
||||
|
public static final QLccBasLocation lccBasLocation = new QLccBasLocation("lcc_bas_location"); |
||||
|
|
||||
|
/** 环境ID */ |
||||
|
public final NumberPath<Long> envId = createNumber("envId", Long.class); |
||||
|
/** 位置编码 */ |
||||
|
public final StringPath locCode = createString("locCode"); |
||||
|
/** 位置类型_gstore_rack_executor */ |
||||
|
public final StringPath locType = createString("locType"); |
||||
|
/** 路径点编码 */ |
||||
|
public final StringPath wayPoint = createString("wayPoint"); |
||||
|
/** 货位相对于路径方向 */ |
||||
|
public final StringPath locDirection = createString("locDirection"); |
||||
|
/** 楼层数据 */ |
||||
|
public final StringPath catalogCode = createString("catalogCode"); |
||||
|
/** 位置编码 */ |
||||
|
public final StringPath rack = createString("rack"); |
||||
|
/** 货架列 */ |
||||
|
public final NumberPath<Integer> bay = createNumber("bay", Integer.class); |
||||
|
/** 货架层 */ |
||||
|
public final NumberPath<Integer> level = createNumber("level", Integer.class); |
||||
|
/** 货架格 */ |
||||
|
public final NumberPath<Integer> cell = createNumber("cell", Integer.class); |
||||
|
/** 是否锁定 */ |
||||
|
public final NumberPath<Integer> isLock = createNumber("isLock", Integer.class); |
||||
|
/** 是否冻结 */ |
||||
|
public final NumberPath<Integer> isFrozen = createNumber("isFrozen", Integer.class); |
||||
|
/** 创建时间 */ |
||||
|
public final DateTimePath<Date> createAt = createDateTime("createAt", Date.class); |
||||
|
/** 创建人 */ |
||||
|
public final StringPath createBy = createString("createBy"); |
||||
|
/** 更新时间 */ |
||||
|
public final DateTimePath<Date> updateAt = createDateTime("updateAt", Date.class); |
||||
|
/** 更新人 */ |
||||
|
public final StringPath updateBy = createString("updateBy"); |
||||
|
|
||||
|
public QLccBasLocation(String variable) { |
||||
|
super(LccBasLocation.class, forVariable(variable), "rcs2_tw_zhanghui", "lcc_bas_location"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasLocation(String variable, String schema, String table) { |
||||
|
super(LccBasLocation.class, forVariable(variable), schema, table); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasLocation(String variable, String schema) { |
||||
|
super(LccBasLocation.class, forVariable(variable), schema, "lcc_bas_location"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasLocation(Path<? extends LccBasLocation> path) { |
||||
|
super(path.getType(), path.getMetadata(), "rcs2_tw_zhanghui", "lcc_bas_location"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccBasLocation(PathMetadata metadata) { |
||||
|
super(LccBasLocation.class, metadata, "rcs2_tw_zhanghui", "lcc_bas_location"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
private void addMetadata() { |
||||
|
addMetadata(envId, ColumnMetadata.named("env_id").withIndex(1).ofType(Types.BIGINT).withSize(19)); |
||||
|
addMetadata(locCode, ColumnMetadata.named("loc_code").withIndex(2).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(locType, ColumnMetadata.named("loc_type").withIndex(3).ofType(Types.VARCHAR).withSize(20)); |
||||
|
addMetadata(wayPoint, ColumnMetadata.named("way_point").withIndex(4).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(locDirection, ColumnMetadata.named("loc_direction").withIndex(5).ofType(Types.VARCHAR).withSize(10)); |
||||
|
addMetadata(catalogCode, ColumnMetadata.named("catalog_code").withIndex(6).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(rack, ColumnMetadata.named("rack").withIndex(7).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(bay, ColumnMetadata.named("bay").withIndex(8).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(level, ColumnMetadata.named("level").withIndex(9).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(cell, ColumnMetadata.named("cell").withIndex(10).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(isLock, ColumnMetadata.named("is_lock").withIndex(11).ofType(Types.TINYINT).withSize(3)); |
||||
|
addMetadata(isFrozen, ColumnMetadata.named("is_frozen").withIndex(12).ofType(Types.TINYINT).withSize(3)); |
||||
|
addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(13).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(14).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(15).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(16).ofType(Types.VARCHAR).withSize(50)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,101 @@ |
|||||
|
package com.galaxis.rcs.common.query; |
||||
|
|
||||
|
import static com.querydsl.core.types.PathMetadataFactory.*; |
||||
|
import com.querydsl.core.types.dsl.*; |
||||
|
import com.querydsl.core.types.*; |
||||
|
import com.querydsl.sql.*; |
||||
|
import java.sql.Types; |
||||
|
import com.galaxis.rcs.common.entity.LccInvLedger; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 库存账页(lcc_inv_ledger) |
||||
|
*/ |
||||
|
@SuppressWarnings("ALL") |
||||
|
public class QLccInvLedger extends RelationalPathBase<LccInvLedger> { |
||||
|
/** lcc_inv_ledger表 */ |
||||
|
public static final QLccInvLedger lccInvLedger = new QLccInvLedger("lcc_inv_ledger"); |
||||
|
|
||||
|
/** 环境ID */ |
||||
|
public final NumberPath<Long> envId = createNumber("envId", Long.class); |
||||
|
/** 业务单据ID */ |
||||
|
public final NumberPath<Long> bizTaskId = createNumber("bizTaskId", Long.class); |
||||
|
/** 账页号 */ |
||||
|
public final NumberPath<Long> ledgerId = createNumber("ledgerId", Long.class); |
||||
|
/** 账页类型 */ |
||||
|
public final StringPath ledgerType = createString("ledgerType"); |
||||
|
/** 账页原因 */ |
||||
|
public final StringPath ledgerRemark = createString("ledgerRemark"); |
||||
|
/** 托盘条码 */ |
||||
|
public final StringPath lpn = createString("lpn"); |
||||
|
/** 库存改变数量 */ |
||||
|
public final NumberPath<Integer> qtyChange = createNumber("qtyChange", Integer.class); |
||||
|
/** 入库占用改变数量 */ |
||||
|
public final NumberPath<Integer> qtyInChange = createNumber("qtyInChange", Integer.class); |
||||
|
/** 出库占用改变数量 */ |
||||
|
public final NumberPath<Integer> qtyOutChange = createNumber("qtyOutChange", Integer.class); |
||||
|
/** 改变后堆叠层号从0开始 */ |
||||
|
public final NumberPath<Integer> layerIndex = createNumber("layerIndex", Integer.class); |
||||
|
/** 改变前库存位置 */ |
||||
|
public final StringPath locCode = createString("locCode"); |
||||
|
/** 改变后库存数量 */ |
||||
|
public final NumberPath<Integer> qty = createNumber("qty", Integer.class); |
||||
|
/** 改变后入库占用数量 */ |
||||
|
public final NumberPath<Integer> qtyIn = createNumber("qtyIn", Integer.class); |
||||
|
/** 改变后出库占用数量 */ |
||||
|
public final NumberPath<Integer> qtyOut = createNumber("qtyOut", Integer.class); |
||||
|
/** 创建时间 */ |
||||
|
public final DateTimePath<Date> createAt = createDateTime("createAt", Date.class); |
||||
|
/** 创建人 */ |
||||
|
public final StringPath createBy = createString("createBy"); |
||||
|
/** 更新时间 */ |
||||
|
public final DateTimePath<Date> updateAt = createDateTime("updateAt", Date.class); |
||||
|
/** 更新人 */ |
||||
|
public final StringPath updateBy = createString("updateBy"); |
||||
|
|
||||
|
public QLccInvLedger(String variable) { |
||||
|
super(LccInvLedger.class, forVariable(variable), "rcs2_tw_zhanghui", "lcc_inv_ledger"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLedger(String variable, String schema, String table) { |
||||
|
super(LccInvLedger.class, forVariable(variable), schema, table); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLedger(String variable, String schema) { |
||||
|
super(LccInvLedger.class, forVariable(variable), schema, "lcc_inv_ledger"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLedger(Path<? extends LccInvLedger> path) { |
||||
|
super(path.getType(), path.getMetadata(), "rcs2_tw_zhanghui", "lcc_inv_ledger"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLedger(PathMetadata metadata) { |
||||
|
super(LccInvLedger.class, metadata, "rcs2_tw_zhanghui", "lcc_inv_ledger"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
private void addMetadata() { |
||||
|
addMetadata(envId, ColumnMetadata.named("env_id").withIndex(1).ofType(Types.BIGINT).withSize(19)); |
||||
|
addMetadata(bizTaskId, ColumnMetadata.named("biz_task_id").withIndex(2).ofType(Types.BIGINT).withSize(19)); |
||||
|
addMetadata(ledgerId, ColumnMetadata.named("ledger_id").withIndex(3).ofType(Types.BIGINT).withSize(19)); |
||||
|
addMetadata(ledgerType, ColumnMetadata.named("ledger_type").withIndex(4).ofType(Types.VARCHAR).withSize(20)); |
||||
|
addMetadata(ledgerRemark, ColumnMetadata.named("ledger_remark").withIndex(5).ofType(Types.VARCHAR).withSize(200)); |
||||
|
addMetadata(lpn, ColumnMetadata.named("lpn").withIndex(6).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(qtyChange, ColumnMetadata.named("qty_change").withIndex(7).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(qtyInChange, ColumnMetadata.named("qty_in_change").withIndex(8).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(qtyOutChange, ColumnMetadata.named("qty_out_change").withIndex(9).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(layerIndex, ColumnMetadata.named("layer_index").withIndex(10).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(locCode, ColumnMetadata.named("loc_code").withIndex(11).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(qty, ColumnMetadata.named("qty").withIndex(12).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(qtyIn, ColumnMetadata.named("qty_in").withIndex(13).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(qtyOut, ColumnMetadata.named("qty_out").withIndex(14).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(15).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(16).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(17).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(18).ofType(Types.VARCHAR).withSize(50)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
package com.galaxis.rcs.common.query; |
||||
|
|
||||
|
import static com.querydsl.core.types.PathMetadataFactory.*; |
||||
|
import com.querydsl.core.types.dsl.*; |
||||
|
import com.querydsl.core.types.*; |
||||
|
import com.querydsl.sql.*; |
||||
|
import java.sql.Types; |
||||
|
import com.galaxis.rcs.common.entity.LccInvLpn; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 库存(lcc_inv_lpn) |
||||
|
*/ |
||||
|
@SuppressWarnings("ALL") |
||||
|
public class QLccInvLpn extends RelationalPathBase<LccInvLpn> { |
||||
|
/** lcc_inv_lpn表 */ |
||||
|
public static final QLccInvLpn lccInvLpn = new QLccInvLpn("lcc_inv_lpn"); |
||||
|
|
||||
|
/** 环境ID */ |
||||
|
public final NumberPath<Long> envId = createNumber("envId", Long.class); |
||||
|
/** 托盘条码 */ |
||||
|
public final StringPath lpn = createString("lpn"); |
||||
|
/** 库存位置 */ |
||||
|
public final StringPath locCode = createString("locCode"); |
||||
|
/** 堆叠层号从0开始 */ |
||||
|
public final NumberPath<Integer> layerIndex = createNumber("layerIndex", Integer.class); |
||||
|
/** 库存数量 */ |
||||
|
public final NumberPath<Integer> qty = createNumber("qty", Integer.class); |
||||
|
/** 入库占用数量 */ |
||||
|
public final NumberPath<Integer> qtyIn = createNumber("qtyIn", Integer.class); |
||||
|
/** 出库占用数量 */ |
||||
|
public final NumberPath<Integer> qtyOut = createNumber("qtyOut", Integer.class); |
||||
|
/** 创建时间 */ |
||||
|
public final DateTimePath<Date> createAt = createDateTime("createAt", Date.class); |
||||
|
/** 创建人 */ |
||||
|
public final StringPath createBy = createString("createBy"); |
||||
|
/** 更新时间 */ |
||||
|
public final DateTimePath<Date> updateAt = createDateTime("updateAt", Date.class); |
||||
|
/** 更新人 */ |
||||
|
public final StringPath updateBy = createString("updateBy"); |
||||
|
|
||||
|
public QLccInvLpn(String variable) { |
||||
|
super(LccInvLpn.class, forVariable(variable), "rcs2_tw_zhanghui", "lcc_inv_lpn"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLpn(String variable, String schema, String table) { |
||||
|
super(LccInvLpn.class, forVariable(variable), schema, table); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLpn(String variable, String schema) { |
||||
|
super(LccInvLpn.class, forVariable(variable), schema, "lcc_inv_lpn"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLpn(Path<? extends LccInvLpn> path) { |
||||
|
super(path.getType(), path.getMetadata(), "rcs2_tw_zhanghui", "lcc_inv_lpn"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
public QLccInvLpn(PathMetadata metadata) { |
||||
|
super(LccInvLpn.class, metadata, "rcs2_tw_zhanghui", "lcc_inv_lpn"); |
||||
|
addMetadata(); |
||||
|
} |
||||
|
|
||||
|
private void addMetadata() { |
||||
|
addMetadata(envId, ColumnMetadata.named("env_id").withIndex(1).ofType(Types.BIGINT).withSize(19)); |
||||
|
addMetadata(lpn, ColumnMetadata.named("lpn").withIndex(2).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(locCode, ColumnMetadata.named("loc_code").withIndex(3).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(layerIndex, ColumnMetadata.named("layer_index").withIndex(4).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(qty, ColumnMetadata.named("qty").withIndex(5).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(qtyIn, ColumnMetadata.named("qty_in").withIndex(6).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(qtyOut, ColumnMetadata.named("qty_out").withIndex(7).ofType(Types.INTEGER).withSize(10)); |
||||
|
addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(8).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(9).ofType(Types.VARCHAR).withSize(50)); |
||||
|
addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(10).ofType(Types.TIMESTAMP)); |
||||
|
addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(11).ofType(Types.VARCHAR).withSize(50)); |
||||
|
} |
||||
|
} |
||||
@ -1,4 +1,170 @@ |
|||||
package com.galaxis.rcs.inv; |
package com.galaxis.rcs.inv; |
||||
|
|
||||
|
import com.galaxis.rcs.common.entity.LccInvLpn; |
||||
|
import com.querydsl.core.util.StringUtils; |
||||
|
import org.clever.data.jdbc.DaoFactory; |
||||
|
import org.clever.data.jdbc.QueryDSL; |
||||
|
|
||||
|
import java.sql.Date; |
||||
|
|
||||
|
import static com.galaxis.rcs.common.query.QLccInvLpn.lccInvLpn; |
||||
|
import static com.galaxis.rcs.common.query.QLccInvLedger.lccInvLedger; |
||||
|
|
||||
public class InvManager { |
public class InvManager { |
||||
|
private static final QueryDSL queryDSL = DaoFactory.getQueryDSL(); |
||||
|
|
||||
|
/** |
||||
|
* 记录库存 |
||||
|
* @param envId 环境ID |
||||
|
* @param lpn 容器号 |
||||
|
* @param locCode 库位号 |
||||
|
* @param layerIndex 堆叠层 |
||||
|
* @param qty 数量 >0 增加数量 <0 减数量 |
||||
|
* @param qtyIn 入库数量 >0 减数量 <0 减数量 |
||||
|
* @param qtyOut 出库数量 >0 减数量 <0 减数量 |
||||
|
*/ |
||||
|
public static void invSave(Long envId, String lpn, String locCode, Integer layerIndex, int qty, int qtyIn, int qtyOut) { |
||||
|
if (envId == null || envId <= 0 |
||||
|
|| lpn == null || StringUtils.isNullOrEmpty(lpn) || lpn.equals("N/A") |
||||
|
|| locCode == null || StringUtils.isNullOrEmpty(locCode) || locCode.equals("N/A") |
||||
|
|| layerIndex == null || layerIndex < 0) { |
||||
|
throw new RuntimeException("库存记录时,关键参数值不对"); |
||||
|
} |
||||
|
if (qty == 0 && qtyIn == 0 && qtyOut == 0) { |
||||
|
throw new RuntimeException("库存记录时,变化数量不能都为0"); |
||||
|
} |
||||
|
if (qtyIn != 0 && qtyOut != 0) { |
||||
|
throw new RuntimeException("库存记录时,不能同时为入库和出库"); |
||||
|
} |
||||
|
if (qty > 1 || qty < -1) { |
||||
|
throw new RuntimeException("库存记录时,数量变化值只能为0、1、-1"); |
||||
|
} |
||||
|
if (qtyIn > 1 || qtyIn < -1) { |
||||
|
throw new RuntimeException("库存记录时,预占数量变化值只能为0、1、-1"); |
||||
|
} |
||||
|
if (qtyOut > 1 || qtyOut < -1) { |
||||
|
throw new RuntimeException("库存记录时,预扣数量变化值只能为0、1、-1"); |
||||
|
} |
||||
|
if (qty == 1 && qtyIn == 1) { |
||||
|
throw new RuntimeException("库存记录时,数量增加时不能增加预占数量"); |
||||
|
} |
||||
|
if (qty == -1 && qtyOut == 1) { |
||||
|
throw new RuntimeException("库存记录时,数量扣减时不能对其增加预扣"); |
||||
|
} |
||||
|
|
||||
|
LccInvLpn lccInvLpnData = queryDSL.select(lccInvLpn) |
||||
|
.from(lccInvLpn) |
||||
|
.where(lccInvLpn.envId.eq(envId).and(lccInvLpn.locCode.eq(locCode)).and(lccInvLpn.lpn.eq(lpn))) |
||||
|
.fetchFirst(); |
||||
|
|
||||
|
if (lccInvLpnData != null) { |
||||
|
if ((lccInvLpnData.getQty() == 1 && qtyIn > 0) || (lccInvLpnData.getQty() == 1 && qty > 0)) { |
||||
|
throw new RuntimeException("库存记录时,当前货位有货, 不能放货或者准备放货"); |
||||
|
} else if ((lccInvLpnData.getQty() == 0 && qtyOut > 0) || (lccInvLpnData.getQty() == 0 && qty < 0)) { |
||||
|
throw new RuntimeException("库存记录时,当前货位无货, 不能取货或者准备取货"); |
||||
|
} else if (lccInvLpnData.getQtyIn() > 0 && qtyIn > 0) { |
||||
|
throw new RuntimeException("库存记录时,当前货位有预占, 不能准备放货"); |
||||
|
} else if (lccInvLpnData.getQtyOut() > 0 && qtyOut > 0) { |
||||
|
throw new RuntimeException("库存记录时,当前货位有预扣, 不能准备取货"); |
||||
|
} |
||||
|
} else { |
||||
|
if (qty < 0 || qtyIn < 0 || qtyOut < 0) { |
||||
|
throw new RuntimeException("没有找到原始库存,不能扣减数量"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
queryDSL.beginTX(status -> { |
||||
|
if (lccInvLpnData != null) { |
||||
|
queryDSL.update(lccInvLpn) |
||||
|
.set(lccInvLpn.qty, lccInvLpn.qty.add(qty)) |
||||
|
.set(lccInvLpn.qtyIn, lccInvLpn.qtyIn.add(qtyIn)) |
||||
|
.set(lccInvLpn.qtyOut, lccInvLpn.qtyOut.add(qtyOut)) |
||||
|
.set(lccInvLpn.layerIndex, layerIndex) |
||||
|
// .set(lccInvLpn.updateAt, )
|
||||
|
.where(lccInvLpn.envId.eq(envId).and(lccInvLpn.locCode.eq(locCode)).and(lccInvLpn.lpn.eq(lpn))) |
||||
|
.execute(); |
||||
|
// 记录账页
|
||||
|
queryDSL.insert(lccInvLedger) |
||||
|
.set(lccInvLedger.envId, envId) |
||||
|
.set(lccInvLedger.lpn, lpn) |
||||
|
.set(lccInvLedger.locCode, locCode) |
||||
|
.set(lccInvLedger.layerIndex, layerIndex) |
||||
|
.set(lccInvLedger.qtyChange, qty) |
||||
|
.set(lccInvLedger.qtyInChange, qtyIn) |
||||
|
.set(lccInvLedger.qtyOutChange, qtyOut) |
||||
|
.set(lccInvLedger.qty, lccInvLpnData.getQty() + qty) |
||||
|
.set(lccInvLedger.qtyIn, lccInvLpnData.getQtyIn() + qtyIn) |
||||
|
.set(lccInvLedger.qtyOut, lccInvLpnData.getQtyOut() + qtyOut) |
||||
|
.set(lccInvLedger.ledgerType, "记账") |
||||
|
.set(lccInvLedger.ledgerRemark, "N/A") |
||||
|
.execute(); |
||||
|
} else { |
||||
|
queryDSL.insert(lccInvLpn) |
||||
|
.set(lccInvLpn.envId, envId) |
||||
|
.set(lccInvLpn.lpn, lpn) |
||||
|
.set(lccInvLpn.locCode, locCode) |
||||
|
.set(lccInvLpn.layerIndex, layerIndex) |
||||
|
.set(lccInvLpn.qty, qty) |
||||
|
.set(lccInvLpn.qtyIn, qtyIn) |
||||
|
.set(lccInvLpn.qtyOut, qtyOut) |
||||
|
.execute(); |
||||
|
// 记录账页
|
||||
|
queryDSL.insert(lccInvLedger) |
||||
|
.set(lccInvLedger.envId, envId) |
||||
|
.set(lccInvLedger.lpn, lpn) |
||||
|
.set(lccInvLedger.locCode, locCode) |
||||
|
.set(lccInvLedger.layerIndex, layerIndex) |
||||
|
.set(lccInvLedger.qtyChange, qty) |
||||
|
.set(lccInvLedger.qtyInChange, qtyIn) |
||||
|
.set(lccInvLedger.qtyOutChange, qtyOut) |
||||
|
.set(lccInvLedger.qty, qty) |
||||
|
.set(lccInvLedger.qtyIn, qtyIn) |
||||
|
.set(lccInvLedger.qtyOut, qtyOut) |
||||
|
.set(lccInvLedger.ledgerType, "记账") |
||||
|
.set(lccInvLedger.ledgerRemark, "N/A") |
||||
|
.execute(); |
||||
|
} |
||||
|
// 删除所有数量预占预扣都为0的库存
|
||||
|
queryDSL.delete(lccInvLpn).where(lccInvLpn.qty.eq(0).and(lccInvLpn.qtyIn.eq(0)).and(lccInvLpn.qtyOut.eq(0))).execute(); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 记录库存 |
||||
|
* @param envId 环境ID |
||||
|
* @param lpn 容器号 |
||||
|
* @param locCode 库位号 |
||||
|
* @param qty 数量 >0 减数量 <0 减数量 |
||||
|
* @param qtyIn 入库数量 >0 减数量 <0 减数量 |
||||
|
* @param qtyOut 出库数量 >0 减数量 <0 减数量 |
||||
|
*/ |
||||
|
public static void invSave(Long envId, String lpn, String locCode, int qty, int qtyIn, int qtyOut) { |
||||
|
invSave(envId, lpn, locCode, 0, qty, qtyIn, qtyOut); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存库存 |
||||
|
* @param envId 环境ID |
||||
|
* @param lpn 容器号 |
||||
|
* @param locCode 库位号 |
||||
|
* @param layerIndex 堆叠层 |
||||
|
* @param qty 数量 >0 减数量 <0 减数量 |
||||
|
*/ |
||||
|
public static void invSave(Long envId, String lpn, String locCode, int layerIndex, int qty) { |
||||
|
invSave(envId, lpn, locCode, layerIndex, qty, 0, 0); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存库存 |
||||
|
* @param envId 环境ID |
||||
|
* @param lpn 容器号 |
||||
|
* @param locCode 库位号 |
||||
|
* @param qty 数量 >0 减数量 <0 减数量 |
||||
|
*/ |
||||
|
public static void invSave(Long envId, String lpn, String locCode, int qty) { |
||||
|
invSave(envId, lpn, locCode, 0, qty, 0, 0); |
||||
|
} |
||||
|
|
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue