From b7fa285a43a66f3d466b24ccf1f5d83cc167df43 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期五, 24 五月 2024 11:11:34 +0800 Subject: [PATCH] # 工作档搜索优化 --- src/main/java/com/zy/common/service/AgvCommonService.java | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/common/service/AgvCommonService.java b/src/main/java/com/zy/common/service/AgvCommonService.java index ccf1f43..605d373 100644 --- a/src/main/java/com/zy/common/service/AgvCommonService.java +++ b/src/main/java/com/zy/common/service/AgvCommonService.java @@ -31,6 +31,8 @@ private MatService matService; @Autowired private LocRuleService locRuleService; + @Autowired + AgvBasDevpService agvBasDevpService; public int getWorkNo(Integer wrkMk) { AgvWrkLastno wrkLastno = agvWrkLastnoService.selectById(wrkMk); @@ -233,6 +235,59 @@ .eq("floor",floor) .eq("loc_type1",type)); } + /** + * 妫�绱㈠簱浣嶅彿 + * @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿 + */ + public AgvBasDevp getDevpNo(int type, int floor) { + // 鐩爣搴撲綅 + AgvBasDevp basDevp = null; + // 寮�濮嬫煡鎵惧簱浣� ==============================>> + basDevp = getDevpNoRule(type,floor); + if (basDevp != null) { + return basDevp; + } + + //鎵句笉鍒板簱浣嶏紝鎶涘嚭寮傚父 + throw new CoolException("璇ユゼ灞傛病鏈夌┖鎺ラ┏浣�"); + } + + /** + * 妫�绱㈠簱浣嶅彿 + * @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿 + */ + public AgvBasDevp getDevpNo(int type, int floor, String auto) { + // 鐩爣搴撲綅 + AgvBasDevp basDevp = null; + + // 寮�濮嬫煡鎵惧簱浣� ==============================>> + basDevp = getDevpNoAuto(type,floor,auto); + if (basDevp != null) { + return basDevp; + } + + //鎵句笉鍒板簱浣嶏紝鎶涘嚭寮傚父 + throw new CoolException("璇ユゼ灞傛病鏈夌┖鎺ラ┏浣�"); + } + + //闅忔満鍙栦竴涓揣浣� + private AgvBasDevp getDevpNoRule(int type,int floor){ + return agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>() + .eq("loc_sts","O") + .eq("floor",floor) + .eq("loc_type1",type) + .like("dev_no","DB")); + } + + //闅忔満鍙栦竴涓揣浣� + private AgvBasDevp getDevpNoAuto(int type,int floor,String auto){ + return agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>() + .eq("loc_sts","O") + .eq("floor",floor) + .eq("loc_type1",type) + .eq("autoing",auto) + .like("dev_no","DB")); + } } -- Gitblit v1.9.1