Browse Source
- 新增 DeviceManager 类,实现设备相关数据查询方法 - 添加 QueryExecutorReq、QueryInvLedgerReq、QueryInvLpnReq、QueryLocationReq 等请求模型类 - 实现 locations 和 vehicles 页面的查询功能,包括表单输入和表格展示 - 优化页面样式,添加查询按钮和数据加载状态显示master
5 changed files with 138 additions and 0 deletions
@ -0,0 +1,82 @@ |
|||
package com.yvan.workbench.controller; |
|||
|
|||
import com.galaxis.rcs.common.entity.LccBasExecutor; |
|||
import com.galaxis.rcs.common.entity.LccBasLocation; |
|||
import com.galaxis.rcs.common.entity.LccInvLedger; |
|||
import com.querydsl.sql.SQLQuery; |
|||
import com.yvan.workbench.model.request.QueryExecutorReq; |
|||
import com.yvan.workbench.model.request.QueryInvLedgerReq; |
|||
import com.yvan.workbench.model.request.QueryInvLpnReq; |
|||
import com.yvan.workbench.model.request.QueryLocationReq; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.clever.core.model.request.QueryByPage; |
|||
import org.clever.core.model.request.page.Page; |
|||
import org.clever.data.jdbc.DaoFactory; |
|||
import org.clever.data.jdbc.QueryDSL; |
|||
import org.clever.data.jdbc.querydsl.utils.QueryDslUtils; |
|||
|
|||
import java.util.LinkedHashMap; |
|||
import java.util.List; |
|||
|
|||
import static com.galaxis.rcs.common.query.QLccBasContainer.lccBasContainer; |
|||
import static com.galaxis.rcs.common.query.QLccBasExecutor.lccBasExecutor; |
|||
import static com.galaxis.rcs.common.query.QLccBasLocation.lccBasLocation; |
|||
import static com.galaxis.rcs.common.query.QLccInvLedger.lccInvLedger; |
|||
import static com.galaxis.rcs.common.query.QLccInvLpn.lccInvLpn; |
|||
|
|||
/** |
|||
* 作者:lizw <br/> |
|||
* 创建时间:2025/07/03 14:33 <br/> |
|||
*/ |
|||
public class DeviceManager { |
|||
private static final QueryDSL QUERY_DSL = DaoFactory.getQueryDSL(); |
|||
|
|||
public static List<LccBasLocation> queryLocation(QueryLocationReq req) { |
|||
SQLQuery<LccBasLocation> query = QUERY_DSL.selectFrom(lccBasLocation).orderBy(lccBasLocation.locCode.asc()); |
|||
if (StringUtils.isNotBlank(req.getLocCode())) { |
|||
query.where(lccBasLocation.locCode.eq(req.getLocCode().trim())); |
|||
} |
|||
return query.fetch(); |
|||
} |
|||
|
|||
public static List<LccBasExecutor> queryExecutor(QueryExecutorReq req) { |
|||
SQLQuery<LccBasExecutor> query = QUERY_DSL.selectFrom(lccBasExecutor).orderBy(lccBasExecutor.executorId.asc()); |
|||
if (StringUtils.isNotBlank(req.getVirtualFloorCode())) { |
|||
query.where(lccBasExecutor.executorId.eq(req.getVirtualFloorCode().trim())); |
|||
} |
|||
if (req.getIsActive() != null) { |
|||
query.where(lccBasExecutor.isActive.eq(req.getIsActive())); |
|||
} |
|||
return query.fetch(); |
|||
} |
|||
|
|||
public static Page<LinkedHashMap<String, Object>> queryInvLpn(QueryInvLpnReq req) { |
|||
SQLQuery<LinkedHashMap<String, Object>> query = QUERY_DSL.select(QueryDslUtils.linkedMap(lccInvLpn, lccBasLocation, lccBasContainer)) |
|||
.from(lccInvLpn) |
|||
.innerJoin(lccBasLocation).on( |
|||
lccInvLpn.locCode.eq(lccBasLocation.locCode).and( |
|||
lccBasLocation.envId.eq(lccBasLocation.envId) |
|||
) |
|||
) |
|||
.innerJoin(lccBasContainer).on( |
|||
lccInvLpn.lpn.eq(lccInvLpn.lpn).and( |
|||
lccBasContainer.envId.eq(lccInvLpn.envId) |
|||
) |
|||
).orderBy(lccInvLpn.lpn.asc()); |
|||
if (StringUtils.isNotBlank(req.getLpn())) { |
|||
query.where(lccInvLpn.lpn.eq(req.getLpn().trim())); |
|||
} |
|||
if (StringUtils.isNotBlank(req.getLocCode())) { |
|||
query.where(lccInvLpn.locCode.eq(req.getLocCode().trim())); |
|||
} |
|||
return QueryDslUtils.queryByPage(query, QueryByPage.getCurrent()); |
|||
} |
|||
|
|||
public static Page<LccInvLedger> queryInvLedger(QueryInvLedgerReq req) { |
|||
SQLQuery<LccInvLedger> query = QUERY_DSL.selectFrom(lccInvLedger).orderBy(lccInvLedger.ledgerId.asc()); |
|||
if (StringUtils.isNotBlank(req.getLpn())) { |
|||
query.where(lccInvLedger.lpn.eq(req.getLpn().trim())); |
|||
} |
|||
return QueryDslUtils.queryByPage(query, QueryByPage.getCurrent()); |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package com.yvan.workbench.model.request; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 作者:lizw <br/> |
|||
* 创建时间:2025/07/03 14:43 <br/> |
|||
*/ |
|||
@Data |
|||
public class QueryExecutorReq { |
|||
/** 仿真车所在楼层 */ |
|||
private String virtualFloorCode; |
|||
/** 是否激活 */ |
|||
private Boolean isActive; |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
package com.yvan.workbench.model.request; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 作者:lizw <br/> |
|||
* 创建时间:2025/07/03 14:58 <br/> |
|||
*/ |
|||
@Data |
|||
public class QueryInvLedgerReq { |
|||
/** 托盘条码 */ |
|||
private String lpn; |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package com.yvan.workbench.model.request; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 作者:lizw <br/> |
|||
* 创建时间:2025/07/03 14:48 <br/> |
|||
*/ |
|||
@Data |
|||
public class QueryInvLpnReq { |
|||
/** 托盘条码 */ |
|||
private String lpn; |
|||
/** 库存位置 */ |
|||
private String locCode; |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
package com.yvan.workbench.model.request; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 作者:lizw <br/> |
|||
* 创建时间:2025/07/03 14:38 <br/> |
|||
*/ |
|||
@Data |
|||
public class QueryLocationReq { |
|||
/** 位置编码 */ |
|||
private String locCode; |
|||
} |
|||
Loading…
Reference in new issue