src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -67,10 +67,14 @@ wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); } else { if (entry.getKey().equals("loc_no")) { wrapper.eq(entry.getKey(), val); }else { wrapper.like(entry.getKey(), val); } } } } @RequestMapping(value = "/locMast/update/auth") @ManagerAuth(memo = "åºä½ä¿®æ¹") src/main/java/com/zy/asrs/entity/BasCrnp.java
@@ -1,5 +1,6 @@ package com.zy.asrs.entity; import com.alibaba.fastjson.JSONArray; import com.core.common.Cools; import com.zy.core.model.StationObjModel; import com.baomidou.mybatisplus.annotations.TableId; @@ -184,4 +185,17 @@ return list; } public List<List<Integer>> getControlRows$(){ List<List<Integer>> rowList = new ArrayList<>(); if(Cools.isEmpty(this.controlRows)){ return rowList; } JSONArray list = JSON.parseArray(this.controlRows); for (Object o : list) { List<Integer> rows = JSON.parseArray(JSON.toJSONString(o), Integer.class); rowList.add(rows); } return rowList; } } src/main/java/com/zy/asrs/task/WrkMastScheduler.java
@@ -157,6 +157,7 @@ } locMast.setLocSts("F"); locMast.setBarcode(wrkMast.getBarcode()); locMast.setModiTime(new Date()); boolean result = locMastService.updateById(locMast); if (!result) { @@ -165,6 +166,7 @@ } sourceLocMast.setLocSts("O"); sourceLocMast.setBarcode(""); sourceLocMast.setModiTime(new Date()); boolean result2 = locMastService.updateById(sourceLocMast); if (!result2) { src/main/java/com/zy/asrs/utils/Utils.java
@@ -1,6 +1,7 @@ package com.zy.asrs.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; @@ -167,12 +168,11 @@ List<WrkMast> currentCrnTask = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", currentCircleTaskCrnNo)); if (currentCrnTask.size() <= 1) { if (basCrnp != null) { String controlRowsStr = basCrnp.getControlRows(); if(!Cools.isEmpty(controlRowsStr)){ List<Integer> rows = JSON.parseArray(controlRowsStr, Integer.class); List<List<Integer>> rowList = basCrnp.getControlRows$(); for (List<Integer> rows : rowList) { list.addAll(rows); wrapper.ne("crn_no", currentCircleTaskCrnNo); } wrapper.ne("crn_no", currentCircleTaskCrnNo); } } } @@ -215,19 +215,16 @@ enabledCrnps.sort(Comparator.comparingInt(o -> map.getOrDefault(o.getCrnNo(), 0))); for (BasCrnp basCrnp : enabledCrnps) { String controlRowsStr = basCrnp.getControlRows(); if (Cools.isEmpty(controlRowsStr)) { continue; } List<Integer> rows = JSON.parseArray(controlRowsStr, Integer.class); List<List<Integer>> rowList = basCrnp.getControlRows$(); for (List<Integer> rows : rowList) { list.addAll(rows); } } }catch (Exception e){ e.printStackTrace(); } return list; } public static Map<String, Object> convertObjectToMap(Object obj) { Map<String, Object> map = new HashMap<>(); @@ -243,4 +240,100 @@ } return map; } //è·åæ·±åºä½æå· public static List<Integer> getDeepRowList() { List<Integer> rowList = new ArrayList<>(); BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class); if (basCrnpService == null) { return rowList; } List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>()); for (BasCrnp basCrnp : basCrnps) { String deepRowsStr = basCrnp.getDeepRows(); if(!Cools.isEmpty(deepRowsStr)){ List<Integer> rows = JSON.parseArray(deepRowsStr, Integer.class); rowList.addAll(rows); } } return rowList; } //è·åæµ åºä½æå· public static Integer getShallowRowByDeepRow(Integer deepRow) { BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class); if (basCrnpService == null) { return null; } List<Integer> deepRowList = getDeepRowList(); if (!deepRowList.contains(deepRow)) { return null; } List<Integer> controlRowList = null; List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); for (BasCrnp basCrnp : basCrnps) { List<List<Integer>> rowList = basCrnp.getControlRows$(); for (List<Integer> rows : rowList) { if (rows.contains(deepRow)) { controlRowList = rows; break; } } if (controlRowList != null) { break; } } for (Integer row : controlRowList) { if (deepRow.equals(row)) { continue; } return row; } return null; } //è·åæ·±åºä½æå· public static Integer getDeepRowByShallowRow(Integer shallowRow) { BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class); if (basCrnpService == null) { return null; } List<Integer> controlRowList = null; List<Integer> deepRowList = null; List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); for (BasCrnp basCrnp : basCrnps) { List<List<Integer>> rowList = basCrnp.getControlRows$(); for (List<Integer> rows : rowList) { if (rows.contains(shallowRow)) { controlRowList = rows; deepRowList = JSON.parseArray(basCrnp.getDeepRows(), Integer.class); break; } } if (controlRowList != null) { break; } } if (deepRowList == null) { return null; } for (Integer row : controlRowList) { if (!deepRowList.contains(row)) { continue; } return row; } return null; } } src/main/java/com/zy/common/model/StartupDto.java
@@ -7,7 +7,7 @@ private String locNo; private Integer taskNo; private String taskNo; private Integer taskPri; src/main/java/com/zy/common/service/CommonService.java
@@ -1,6 +1,7 @@ package com.zy.common.service; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.common.Cools; import com.core.exception.CoolException; @@ -164,6 +165,7 @@ wrkMast.setLocNo(param.getLocNo()); // ç®æ åºä½ wrkMast.setCrnNo(crnNo); wrkMast.setWmsWrkNo(param.getTaskNo()); wrkMast.setBarcode(sourceLocMast.getBarcode()); wrkMast.setAppeTime(now); wrkMast.setModiTime(now); boolean res = wrkMastService.insert(wrkMast); @@ -310,16 +312,13 @@ public Integer findCrnNoByLocNo(String locNo) { List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); for (BasCrnp basCrnp : basCrnps) { String controlRows = basCrnp.getControlRows(); if (Cools.isEmpty(controlRows)) { continue; } List<Integer> rowList = JSON.parseArray(controlRows, Integer.class); if(rowList.contains(Utils.getRow(locNo))) { List<List<Integer>> rowList = basCrnp.getControlRows$(); for (List<Integer> rows : rowList) { if(rows.contains(Utils.getRow(locNo))) { return basCrnp.getCrnNo(); } } } return null; } src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -34,6 +34,7 @@ STATION_IN_EXECUTE_LIMIT("station_in_execute_limit_"), STATION_OUT_EXECUTE_LIMIT("station_out_execute_limit_"), CHECK_STATION_RUN_BLOCK_LIMIT_("check_station_run_block_limit_"), CHECK_SHALLOW_LOC_STATUS_LIMIT("check_shallow_loc_status_limit_"), CURRENT_CIRCLE_TASK_CRN_NO("current_circle_task_crn_no_"), AI_CHAT_HISTORY("ai_chat_history_"), src/main/java/com/zy/core/plugin/FakeProcess.java
@@ -8,10 +8,8 @@ import com.zy.asrs.domain.param.CreateOutTaskParam; import com.zy.asrs.entity.*; import com.zy.asrs.service.*; import com.zy.asrs.utils.Utils; import com.zy.common.model.StartupDto; import com.zy.common.service.CommonService; import com.zy.common.utils.HttpHandler; import com.zy.common.utils.RedisUtil; import com.zy.core.News; import com.zy.core.cache.MessageQueue; @@ -27,6 +25,7 @@ import com.zy.core.thread.StationThread; import com.zy.core.utils.CrnOperateProcessUtils; import com.zy.core.utils.StationOperateProcessUtils; import com.zy.core.utils.WmsOperateUtils; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; import lombok.extern.slf4j.Slf4j; @@ -64,7 +63,7 @@ @Autowired private StationOperateProcessUtils stationOperateProcessUtils; @Autowired private HttpRequestLogService httpRequestLogService; private WmsOperateUtils wmsOperateUtils; @Override public void run() { @@ -372,55 +371,19 @@ continue; } String wmsUrl = null; Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); if (wmsSystemUriConfig != null) { wmsUrl = wmsSystemUriConfig.getValue(); } if(wmsUrl == null){ News.error("æªé ç½®WMSç³»ç»URIï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemUri"); return; } String wmsSystemInUrl = null; Config wmsSystemInUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemInUrl")); if (wmsSystemInUrlConfig != null) { wmsSystemInUrl = wmsSystemInUrlConfig.getValue(); } if(wmsSystemInUrlConfig == null){ News.error("æªé ç½®WMSå ¥åºæ¥å£å°åï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemInUrl"); return; } Object lock = redisUtil.get(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId); if (lock != null) { continue; } redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 5); HashMap<String, Object> requestParam = new HashMap<>(); String response = null; try { requestParam.put("barcode", stationProtocol.getBarcode()); requestParam.put("sourceStaNo", stationProtocol.getStationId()); requestParam.put("locType1", stationProtocol.getPalletHeight()); requestParam.put("row", Utils.getInTaskEnableRow()); response = new HttpHandler.Builder() .setUri(wmsUrl) .setPath(wmsSystemInUrl) .setJson(JSON.toJSONString(requestParam)) .build() .doPost(); String response = wmsOperateUtils.applyInTask(stationProtocol.getBarcode(), stationProtocol.getStationId(), stationProtocol.getPalletHeight()); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { StartupDto dto = jsonObject.getObject("data", StartupDto.class); CreateInTaskParam taskParam = new CreateInTaskParam(); taskParam.setTaskNo(String.valueOf(dto.getTaskNo())); taskParam.setTaskNo(dto.getTaskNo()); taskParam.setLocNo(dto.getLocNo()); taskParam.setTaskPri(dto.getTaskPri()); taskParam.setBarcode(stationProtocol.getBarcode()); @@ -432,19 +395,6 @@ continue; } MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); News.info("请æ±WMSæ¥å£æåï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); } else { News.error("请æ±WMSæ¥å£å¤±è´¥ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); } } catch (Exception e) { News.error("请æ±WMSæ¥å£å¼å¸¸ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response, e); } finally { HttpRequestLog httpRequestLog = new HttpRequestLog(); httpRequestLog.setName(wmsUrl + wmsSystemInUrl); httpRequestLog.setRequest(JSON.toJSONString(requestParam)); httpRequestLog.setResponse(response); httpRequestLog.setCreateTime(new Date()); httpRequestLogService.insert(httpRequestLog); } } } src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
@@ -1,7 +1,10 @@ package com.zy.core.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.exception.CoolException; import com.zy.asrs.domain.param.CreateLocMoveTaskParam; import com.zy.asrs.entity.BasCrnp; import com.zy.asrs.entity.LocMast; import com.zy.asrs.entity.WrkMast; @@ -9,6 +12,8 @@ import com.zy.asrs.service.LocMastService; import com.zy.asrs.service.WrkMastService; import com.zy.asrs.utils.Utils; import com.zy.common.model.StartupDto; import com.zy.common.service.CommonService; import com.zy.common.utils.RedisUtil; import com.zy.core.News; import com.zy.core.cache.MessageQueue; @@ -17,7 +22,6 @@ import com.zy.core.model.StationObjModel; import com.zy.core.model.Task; import com.zy.core.model.command.CrnCommand; import com.zy.core.model.command.StationCommand; import com.zy.core.model.protocol.CrnProtocol; import com.zy.core.model.protocol.StationProtocol; import com.zy.core.thread.CrnThread; @@ -40,6 +44,10 @@ private LocMastService locMastService; @Autowired private RedisUtil redisUtil; @Autowired private WmsOperateUtils wmsOperateUtils; @Autowired private CommonService commonService; //å ¥åºåº ===>> å åæºå ¥åºåºä½ä¸ä¸å public synchronized void crnIoExecute() { @@ -170,6 +178,13 @@ continue; } //æ£æµæµ åºä½ç¶æ boolean checkStatus = checkShallowLocStatus(locMast.getLocNo(), wrkMast.getWrkNo()); if (!checkStatus) { News.taskInfo(wrkMast.getWrkNo(), "å æµ åºä½å µå¡æ æ³æ§è¡"); continue; } String sourceLocNo = Utils.getLocNo(stationObjModel.getDeviceRow(), stationObjModel.getDeviceBay(), stationObjModel.getDeviceLev()); CrnCommand command = crnThread.getPickAndPutCommand(sourceLocNo, wrkMast.getLocNo(), wrkMast.getWrkNo(), crnNo); @@ -248,6 +263,13 @@ if (!locMast.getLocSts().equals("R")) { News.taskInfo(wrkMast.getWrkNo(), "æºåºä½:{} ç¶æå¼å¸¸", wrkMast.getSourceLocNo()); continue; } //æ£æµæµ åºä½ç¶æ boolean checkStatus = checkShallowLocStatus(locMast.getLocNo(), wrkMast.getWrkNo()); if (!checkStatus) { News.taskInfo(wrkMast.getWrkNo(), "å æµ åºä½å µå¡æ æ³æ§è¡"); continue; } @@ -376,4 +398,52 @@ } } //æ£æµæµ åºä½ç¶æ public synchronized boolean checkShallowLocStatus(String locNo, Integer taskNo) { Object lock = redisUtil.get(RedisKeyType.CHECK_SHALLOW_LOC_STATUS_LIMIT.key + taskNo); if (lock != null) { return false; } redisUtil.set(RedisKeyType.CHECK_SHALLOW_LOC_STATUS_LIMIT.key + taskNo, "lock", 5); Integer shallowRow = Utils.getShallowRowByDeepRow(Utils.getRow(locNo)); if (shallowRow == null) { return true; } String shallowLocNo = Utils.getLocNo(shallowRow, Utils.getBay(locNo), Utils.getLev(locNo)); LocMast shallowLocMast = locMastService.queryByLoc(shallowLocNo); if (shallowLocMast == null) { News.taskInfo(taskNo, "æµ åºä½:{} æ°æ®ä¸åå¨", shallowLocNo); return false; } if (shallowLocMast.getLocSts().equals("O")) { return true; } if (shallowLocMast.getLocSts().equals("F")) { //æµ åºä½ç¶ææè´§,ç³è¯·æ´æ¢åºä½ String response = wmsOperateUtils.applyChangeLocNo(shallowLocNo); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { StartupDto dto = jsonObject.getObject("data", StartupDto.class); String moveLocNo = dto.getLocNo(); CreateLocMoveTaskParam moveTaskParam = new CreateLocMoveTaskParam(); moveTaskParam.setTaskNo(dto.getTaskNo()); moveTaskParam.setSourceLocNo(shallowLocNo); moveTaskParam.setLocNo(moveLocNo); try { boolean result = commonService.createLocMoveTask(moveTaskParam); } catch (CoolException e) { News.taskInfo(taskNo, e.getMessage()); } } else { News.error("请æ±WMSç³è¯·æ´æ¢åºä½æ¥å£å¤±è´¥ï¼ï¼ï¼responseï¼{}", response); } } return false; } } src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -3,14 +3,10 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.common.Cools; import com.zy.asrs.domain.param.CreateInTaskParam; import com.zy.asrs.entity.*; import com.zy.asrs.service.*; import com.zy.asrs.utils.Utils; import com.zy.common.model.StartupDto; import com.zy.common.service.CommonService; import com.zy.common.utils.HttpHandler; import com.zy.common.utils.RedisUtil; import com.zy.core.News; import com.zy.core.cache.MessageQueue; @@ -23,8 +19,6 @@ import com.zy.core.model.command.StationCommand; import com.zy.core.model.protocol.StationProtocol; import com.zy.core.thread.StationThread; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -44,11 +38,9 @@ @Autowired private RedisUtil redisUtil; @Autowired private ConfigService configService; @Autowired private HttpRequestLogService httpRequestLogService; @Autowired private LocMastService locMastService; @Autowired private WmsOperateUtils wmsOperateUtils; //æ§è¡è¾éç«ç¹å ¥åºä»»å¡ public synchronized void stationInExecute() { @@ -220,28 +212,6 @@ //æ£æµè¾éç«ç¹æ¯å¦è¿è¡å µå¡ public synchronized void checkStationRunBlock() { String wmsUrl = null; Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); if (wmsSystemUriConfig != null) { wmsUrl = wmsSystemUriConfig.getValue(); } if(wmsUrl == null){ News.error("æªé ç½®WMSç³»ç»URIï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemUri"); return; } String wmsSystemReassignInTaskUrl = null; Config wmsSystemReassignInTaskUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemReassignInTaskUrl")); if (wmsSystemReassignInTaskUrlConfig != null) { wmsSystemReassignInTaskUrl = wmsSystemReassignInTaskUrlConfig.getValue(); } if(wmsSystemReassignInTaskUrl == null){ News.error("æªé ç½®WMSä»»å¡éæ°åé å ¥åºåºä½æ¥å£å°åï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemReassignInTaskUrl"); return; } List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); for (BasDevp basDevp : basDevps) { StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); @@ -276,19 +246,7 @@ if (runBlockReassignLocStationList.contains(stationProtocol.getStationId())) { //ç«ç¹å¤äºéæ°åé åºä½åºå //è¿è¡å µå¡ï¼éæ°ç³è¯·ä»»å¡ HashMap<String, Object> requestParam = new HashMap<>(); String response = null; try { requestParam.put("taskNo", wrkMast.getWmsWrkNo()); requestParam.put("row", Utils.getInTaskEnableRow(new ArrayList<>(basDevp.getDevpNo()))); response = new HttpHandler.Builder() .setUri(wmsUrl) .setPath(wmsSystemReassignInTaskUrl) .setJson(JSON.toJSONString(requestParam)) .build() .doPost(); String response = wmsOperateUtils.applyReassignTaskLocNo(wrkMast.getWrkNo()); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { StartupDto dto = jsonObject.getObject("data", StartupDto.class); @@ -353,19 +311,8 @@ if (wrkMastService.updateById(wrkMast)) { MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); } News.info("请æ±WMSæ¥å£æåï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); } else { News.error("请æ±WMSæ¥å£å¤±è´¥ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); } } catch (Exception e) { News.error("请æ±WMSæ¥å£å¼å¸¸ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼ responseï¼{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response, e); } finally { HttpRequestLog httpRequestLog = new HttpRequestLog(); httpRequestLog.setName(wmsUrl + wmsSystemReassignInTaskUrl); httpRequestLog.setRequest(JSON.toJSONString(requestParam)); httpRequestLog.setResponse(response); httpRequestLog.setCreateTime(new Date()); httpRequestLogService.insert(httpRequestLog); News.error("请æ±WMSæ¥å£å¤±è´¥ï¼ï¼ï¼responseï¼{}", response); } }else { //è¿è¡å µå¡ï¼éæ°è®¡ç®è·¯çº¿ src/main/java/com/zy/core/utils/WmsOperateUtils.java
New file @@ -0,0 +1,217 @@ package com.zy.core.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.common.Cools; import com.core.exception.CoolException; import com.zy.asrs.entity.BasCrnp; import com.zy.asrs.entity.HttpRequestLog; import com.zy.asrs.entity.WrkMast; import com.zy.asrs.service.BasCrnpService; import com.zy.asrs.service.HttpRequestLogService; import com.zy.asrs.service.WrkMastService; import com.zy.asrs.utils.Utils; import com.zy.common.service.CommonService; import com.zy.common.utils.HttpHandler; import com.zy.core.News; import com.zy.system.entity.Config; import com.zy.system.service.ConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; @Component public class WmsOperateUtils { @Autowired private ConfigService configService; @Autowired private HttpRequestLogService httpRequestLogService; @Autowired private WrkMastService wrkMastService; @Autowired private CommonService commonService; @Autowired private BasCrnpService basCrnpService; //ç³è¯·å ¥åºä»»å¡ public synchronized String applyInTask(String barcode, Integer sourceStaNo, Integer locType1) { String wmsUrl = null; Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); if (wmsSystemUriConfig != null) { wmsUrl = wmsSystemUriConfig.getValue(); } if (wmsUrl == null) { News.error("æªé ç½®WMSç³»ç»URIï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemUri"); return null; } String wmsSystemInUrl = null; Config wmsSystemInUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemInUrl")); if (wmsSystemInUrlConfig != null) { wmsSystemInUrl = wmsSystemInUrlConfig.getValue(); } if(wmsSystemInUrlConfig == null){ News.error("æªé ç½®WMSå ¥åºæ¥å£å°åï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemInUrl"); return null; } HashMap<String, Object> requestParam = new HashMap<>(); String response = null; try { requestParam.put("barcode", barcode); requestParam.put("sourceStaNo", sourceStaNo); requestParam.put("locType1", locType1); requestParam.put("row", Utils.getInTaskEnableRow()); response = new HttpHandler.Builder() .setUri(wmsUrl) .setPath(wmsSystemInUrl) .setJson(JSON.toJSONString(requestParam)) .build() .doPost(); News.info("请æ±WMSæ¥å£æåï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); } catch (Exception e) { News.error("请æ±WMSæ¥å£å¼å¸¸ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response, e); } finally { HttpRequestLog httpRequestLog = new HttpRequestLog(); httpRequestLog.setName(wmsUrl + wmsSystemInUrl); httpRequestLog.setRequest(JSON.toJSONString(requestParam)); httpRequestLog.setResponse(response); httpRequestLog.setCreateTime(new Date()); httpRequestLogService.insert(httpRequestLog); } return response; } //ç³è¯·ä»»å¡éæ°åé åºä½ public synchronized String applyReassignTaskLocNo(Integer taskNo) { String wmsUrl = null; Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); if (wmsSystemUriConfig != null) { wmsUrl = wmsSystemUriConfig.getValue(); } if (wmsUrl == null) { News.error("æªé ç½®WMSç³»ç»URIï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemUri"); return null; } String wmsSystemReassignInTaskUrl = null; Config wmsSystemReassignInTaskUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemReassignInTaskUrl")); if (wmsSystemReassignInTaskUrlConfig != null) { wmsSystemReassignInTaskUrl = wmsSystemReassignInTaskUrlConfig.getValue(); } if(wmsSystemReassignInTaskUrl == null){ News.error("æªé ç½®WMSä»»å¡éæ°åé å ¥åºåºä½æ¥å£å°åï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemReassignInTaskUrl"); return null; } WrkMast wrkMast = wrkMastService.selectByWorkNo(taskNo); if (wrkMast == null) { News.info("æ æ³æ¾å°å¯¹åºä»»å¡ï¼å·¥ä½å·={}", taskNo); return null; } HashMap<String, Object> requestParam = new HashMap<>(); String response = null; try { requestParam.put("taskNo", wrkMast.getWmsWrkNo()); requestParam.put("row", Utils.getInTaskEnableRow(new ArrayList<>(wrkMast.getCrnNo()))); response = new HttpHandler.Builder() .setUri(wmsUrl) .setPath(wmsSystemReassignInTaskUrl) .setJson(JSON.toJSONString(requestParam)) .build() .doPost(); News.info("请æ±WMSæ¥å£æåï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); } catch (Exception e) { News.error("请æ±WMSæ¥å£å¼å¸¸ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼ responseï¼{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response, e); } finally { HttpRequestLog httpRequestLog = new HttpRequestLog(); httpRequestLog.setName(wmsUrl + wmsSystemReassignInTaskUrl); httpRequestLog.setRequest(JSON.toJSONString(requestParam)); httpRequestLog.setResponse(response); httpRequestLog.setCreateTime(new Date()); httpRequestLogService.insert(httpRequestLog); } return response; } //ç³è¯·å¨åºåºä½æ´æ¢åºä½ public synchronized String applyChangeLocNo(String locNo) { String wmsUrl = null; Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); if (wmsSystemUriConfig != null) { wmsUrl = wmsSystemUriConfig.getValue(); } if (wmsUrl == null) { News.error("æªé ç½®WMSç³»ç»URIï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemUri"); return null; } String wmsSystemChangeLocNoUrl = null; Config wmsSystemChangeLocNoUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemChangeLocNoUrl")); if (wmsSystemChangeLocNoUrlConfig != null) { wmsSystemChangeLocNoUrl = wmsSystemChangeLocNoUrlConfig.getValue(); } if(wmsSystemChangeLocNoUrl == null){ News.error("æªé ç½®ç³è¯·å¨åºåºä½æ´æ¢åºä½æ¥å£å°åï¼é ç½®æä»¶Codeç¼ç ï¼wmsSystemChangeLocNoUrl"); return null; } Integer crnNo = commonService.findCrnNoByLocNo(locNo); if (crnNo == null) { return null; } BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo)); if (basCrnp == null) { return null; } List<Integer> crnRows = new ArrayList<>(); List<List<Integer>> rowList = basCrnp.getControlRows$(); for (List<Integer> list : rowList) { crnRows.addAll(list); } HashMap<String, Object> requestParam = new HashMap<>(); String response = null; try { requestParam.put("locNo", locNo); requestParam.put("row", crnRows); response = new HttpHandler.Builder() .setUri(wmsUrl) .setPath(wmsSystemChangeLocNoUrl) .setJson(JSON.toJSONString(requestParam)) .build() .doPost(); News.info("请æ±WMSæ¥å£æåï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response); return response; } catch (Exception e) { News.error("请æ±WMSæ¥å£å¼å¸¸ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response, e); } finally { HttpRequestLog httpRequestLog = new HttpRequestLog(); httpRequestLog.setName(wmsUrl + wmsSystemChangeLocNoUrl); httpRequestLog.setRequest(JSON.toJSONString(requestParam)); httpRequestLog.setResponse(response); httpRequestLog.setCreateTime(new Date()); httpRequestLogService.insert(httpRequestLog); } return null; } } src/main/resources/docs/WCSÍⲿHTTP API½Ó¿ÚV1.1.docxBinary files differ
src/main/resources/mapper/LocMastMapper.xml
@@ -35,6 +35,6 @@ </select> <select id="getLevList" resultType="java.lang.Integer"> select distinct lev1 from asr_loc_mast select distinct lev1 from asr_loc_mast order by lev1 asc </select> </mapper> src/main/webapp/static/js/wrkMastLog/wrkMastLog.js
@@ -21,6 +21,7 @@ cellMinWidth: 50, cols: [[ {field: 'wrkNo', align: 'center',title: 'å·¥ä½å·',event: 'wrkNo', sort: true} ,{field: 'wmsWrkNo', align: 'center',title: 'WMSå·¥ä½å·'} ,{field: 'appeTime$', align: 'center',title: '工使¶é´', width:160, sort: true} ,{field: 'wrkSts$', align: 'center',title: 'å·¥ä½ç¶æ', width:160} ,{field: 'ioType$', align: 'center',title: 'å ¥åºåºç±»å', width:160} src/main/webapp/views/wrkMastLog/wrkMastLog.html
@@ -19,6 +19,11 @@ </div> </div> <div class="layui-inline"> <div class="layui-input-inline"> <input class="layui-input" type="text" name="wms_wrk_no" placeholder="WMSå·¥ä½å·" autocomplete="off"> </div> </div> <div class="layui-inline"> <div class="layui-input-inline cool-auto-complete"> <input id="wrkSts" class="layui-input" name="wrk_sts" type="text" placeholder="请è¾å ¥" autocomplete="off" style="display: none"> <input id="wrkSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="å·¥ä½ç¶æ" onfocus=this.blur()>