From 707f8db2227a6031f230e35895ea1c5f7ff03bd6 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 18 十二月 2025 14:43:52 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java | 12 ++
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java | 18 ---
src/main/java/com/zy/core/utils/StationOperateProcessUtils.java | 165 +++++++++++++++++++++-----------
src/main/webapp/static/js/basDevp/basDevp.js | 9 +
src/main/java/com/zy/asrs/entity/BasDevp.java | 20 ++++
src/main/resources/mapper/LocMastMapper.xml | 24 ----
src/main/java/com/zy/asrs/mapper/LocMastMapper.java | 6 -
src/main/webapp/views/basDevp/basDevp.html | 6 +
src/main/java/com/zy/asrs/service/LocMastService.java | 6 -
src/main/resources/mapper/BasDevpMapper.xml | 1
src/main/resources/map/上海临港哥斯拉项目.xlsx | 0
11 files changed, 151 insertions(+), 116 deletions(-)
diff --git a/src/main/java/com/zy/asrs/entity/BasDevp.java b/src/main/java/com/zy/asrs/entity/BasDevp.java
index 3e5a10d..cafa3fd 100644
--- a/src/main/java/com/zy/asrs/entity/BasDevp.java
+++ b/src/main/java/com/zy/asrs/entity/BasDevp.java
@@ -106,6 +106,13 @@
@TableField("out_station_list")
private String outStationList;
+ /**
+ * 杩愯鍫靛閲嶆柊鍒嗛厤搴撲綅绔欑偣鏁版嵁
+ */
+ @ApiModelProperty(value= "杩愯鍫靛閲嶆柊鍒嗛厤搴撲綅绔欑偣鏁版嵁")
+ @TableField("run_block_reassign_loc_station_list")
+ private String runBlockReassignLocStationList;
+
public BasDevp() {}
public BasDevp(Integer devpNo,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,String stationList,String barcodeStationList,String inStationList,String outStationList) {
@@ -209,4 +216,17 @@
return list;
}
+ public List<StationObjModel> getRunBlockReassignLocStationList$(){
+ List<StationObjModel> list = new ArrayList<>();
+ if (Cools.isEmpty(this.runBlockReassignLocStationList)){
+ return list;
+ }
+
+ List<StationObjModel> jsonList = JSON.parseArray(this.runBlockReassignLocStationList, StationObjModel.class);
+ for (StationObjModel json : jsonList){
+ list.add(json);
+ }
+ return list;
+ }
+
}
diff --git a/src/main/java/com/zy/asrs/mapper/LocMastMapper.java b/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
index 1588dd6..399c24e 100644
--- a/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -14,13 +14,7 @@
LocMast queryByLoc(String locNo);
- LocMast queryByQrCode(String qrCodeValue);
-
List<LocMast> selectLocByLev(Integer lev);
-
- List<LocMast> selectEmptyLocNos(@Param("locNos") List<String> locNos);
-
- List<LocMast> selectNotEmptyLocNos(@Param("locNos") List<String> locNos);
//鏌ヨ鎵�鏈夋ゼ灞�
List<Integer> getLevList();
diff --git a/src/main/java/com/zy/asrs/service/LocMastService.java b/src/main/java/com/zy/asrs/service/LocMastService.java
index 92edc4c..6c7d271 100644
--- a/src/main/java/com/zy/asrs/service/LocMastService.java
+++ b/src/main/java/com/zy/asrs/service/LocMastService.java
@@ -9,14 +9,8 @@
LocMast queryByLoc(String locNo);
- LocMast queryByQrCode(String qrCodeValue);
-
//鏌ヨ鎸囧畾妤煎眰鐨勫簱浣嶆暟鎹�
List<LocMast> selectLocByLev(Integer lev);
-
- List<LocMast> selectEmptyLocNos(List<String> locNos);
-
- List<LocMast> selectNotEmptyLocNos(List<String> locNos);
//鏌ヨ鎵�鏈夋ゼ灞�
List<Integer> getLevList();
diff --git a/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
index 84f3c58..714f947 100644
--- a/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -19,26 +19,8 @@
}
@Override
- public LocMast queryByQrCode(String qrCodeValue) {
- return this.baseMapper.queryByQrCode(qrCodeValue);
- }
-
- @Override
public List<LocMast> selectLocByLev(Integer lev) {
return this.baseMapper.selectLocByLev(lev);
- }
-
- @Override
- public List<LocMast> selectEmptyLocNos(List<String> locNos) {
- return this.baseMapper.selectEmptyLocNos(locNos);
- }
-
- @Override
- public List<LocMast> selectNotEmptyLocNos(List<String> locNos) {
- if (locNos.isEmpty()) {
- return new ArrayList<LocMast>();
- }
- return this.baseMapper.selectNotEmptyLocNos(locNos);
}
@Override
diff --git a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
index 0aea24a..7d1b449 100644
--- a/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
+++ b/src/main/java/com/zy/core/network/fake/ZyStationFakeConnect.java
@@ -14,6 +14,7 @@
import com.zy.core.network.api.ZyStationConnectApi;
import com.zy.core.network.entity.ZyStationStatusEntity;
+import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -293,7 +294,16 @@
}
if (!checkTaskNoInArea(taskNo)) {
- if (System.currentTimeMillis() - executeTime > 1000 * 10) {
+ boolean fakeAllowCheckBlock = true;
+ Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
+ if (systemConfigMapObj != null) {
+ HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj;
+ if (!systemConfigMap.get("fakeAllowCheckBlock").equals("Y")) {
+ fakeAllowCheckBlock = false;
+ }
+ }
+
+ if (fakeAllowCheckBlock && System.currentTimeMillis() - executeTime > 1000 * 10) {
//璁ゅ畾鍫靛
boolean result = runBlockStation(taskNo, currentStationId, taskNo, currentStationId);
if(!result) {
diff --git a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
index fc0878c..5c31a55 100644
--- a/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
+++ b/src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -5,14 +5,8 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.zy.asrs.domain.param.CreateInTaskParam;
-import com.zy.asrs.entity.BasCrnp;
-import com.zy.asrs.entity.BasDevp;
-import com.zy.asrs.entity.HttpRequestLog;
-import com.zy.asrs.entity.WrkMast;
-import com.zy.asrs.service.BasCrnpService;
-import com.zy.asrs.service.BasDevpService;
-import com.zy.asrs.service.HttpRequestLogService;
-import com.zy.asrs.service.WrkMastService;
+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;
@@ -53,6 +47,8 @@
private ConfigService configService;
@Autowired
private HttpRequestLogService httpRequestLogService;
+ @Autowired
+ private LocMastService locMastService;
//鎵ц杈撻�佺珯鐐瑰叆搴撲换鍔�
public synchronized void stationInExecute() {
@@ -253,6 +249,11 @@
continue;
}
+ List<Integer> runBlockReassignLocStationList = new ArrayList<>();
+ for (StationObjModel stationObjModel : basDevp.getRunBlockReassignLocStationList$()) {
+ runBlockReassignLocStationList.add(stationObjModel.getStationId());
+ }
+
List<StationProtocol> list = stationThread.getStatus();
for (StationProtocol stationProtocol : list) {
if(stationProtocol.isAutoing()
@@ -260,7 +261,6 @@
&& stationProtocol.getTaskNo() > 0
&& stationProtocol.isRunBlock()
) {
- //杩愯鍫靛锛岄噸鏂扮敵璇蜂换鍔�
WrkMast wrkMast = wrkMastService.selectByWorkNo(stationProtocol.getTaskNo());
if (wrkMast == null) {
News.info("杈撻�佺珯鐐瑰彿={} 杩愯闃诲锛屼絾鏃犳硶鎵惧埌瀵瑰簲浠诲姟锛屽伐浣滃彿={}", stationProtocol.getStationId(), stationProtocol.getTaskNo());
@@ -271,61 +271,112 @@
if (lock != null) {
continue;
}
-
redisUtil.set(RedisKeyType.CHECK_STATION_RUN_BLOCK_LIMIT_.key + stationProtocol.getTaskNo(), "lock", 15);
- HashMap<String, Object> requestParam = new HashMap<>();
- String response = null;
- try {
- requestParam.put("taskNo", wrkMast.getWmsWrkNo());
- requestParam.put("row", Utils.getInTaskEnableRow(new ArrayList<>(basDevp.getDevpNo())));
+ if (runBlockReassignLocStationList.contains(stationProtocol.getStationId())) {
+ //绔欑偣澶勪簬閲嶆柊鍒嗛厤搴撲綅鍖哄煙
+ //杩愯鍫靛锛岄噸鏂扮敵璇蜂换鍔�
- response = new HttpHandler.Builder()
- .setUri(wmsUrl)
- .setPath(wmsSystemReassignInTaskUrl)
- .setJson(JSON.toJSONString(requestParam))
- .build()
- .doPost();
- JSONObject jsonObject = JSON.parseObject(response);
- if (jsonObject.getInteger("code").equals(200)) {
- StartupDto dto = jsonObject.getObject("data", StartupDto.class);
+ HashMap<String, Object> requestParam = new HashMap<>();
+ String response = null;
+ try {
+ requestParam.put("taskNo", wrkMast.getWmsWrkNo());
+ requestParam.put("row", Utils.getInTaskEnableRow(new ArrayList<>(basDevp.getDevpNo())));
- String locNo = dto.getLocNo();
- //鏇存柊鏁版嵁
- wrkMast.setLocNo(locNo);
- wrkMastService.updateById(wrkMast);
+ response = new HttpHandler.Builder()
+ .setUri(wmsUrl)
+ .setPath(wmsSystemReassignInTaskUrl)
+ .setJson(JSON.toJSONString(requestParam))
+ .build()
+ .doPost();
+ JSONObject jsonObject = JSON.parseObject(response);
+ if (jsonObject.getInteger("code").equals(200)) {
+ StartupDto dto = jsonObject.getObject("data", StartupDto.class);
- Integer crnNo = commonService.findCrnNoByLocNo(locNo);
- if (crnNo == null) {
- News.taskInfo(wrkMast.getWrkNo(), "鏈尮閰嶅埌鍫嗗灈鏈�");
- continue;
+ String sourceLocNo = wrkMast.getLocNo();
+ String locNo = dto.getLocNo();
+
+ LocMast sourceLocMast = locMastService.queryByLoc(sourceLocNo);
+ if (sourceLocMast == null) {
+ News.taskInfo(wrkMast.getWrkNo(), "搴撲綅鍙�:{} 婧愬簱浣嶄俊鎭笉瀛樺湪", sourceLocNo);
+ continue;
+ }
+
+ if (!sourceLocMast.getLocSts().equals("S")) {
+ News.taskInfo(wrkMast.getWrkNo(), "搴撲綅鍙�:{} 婧愬簱浣嶇姸鎬佷笉澶勪簬鍏ュ簱棰勭害", sourceLocNo);
+ continue;
+ }
+
+ LocMast locMast = locMastService.queryByLoc(locNo);
+ if (locMast == null) {
+ News.taskInfo(wrkMast.getWrkNo(), "搴撲綅鍙�:{} 鐩爣搴撲綅淇℃伅涓嶅瓨鍦�", locNo);
+ continue;
+ }
+
+ if (!locMast.getLocSts().equals("O")) {
+ News.taskInfo(wrkMast.getWrkNo(), "搴撲綅鍙�:{} 鐩爣搴撲綅鐘舵�佷笉澶勪簬绌哄簱浣�", locNo);
+ continue;
+ }
+
+ Integer crnNo = commonService.findCrnNoByLocNo(locNo);
+ if (crnNo == null) {
+ News.taskInfo(wrkMast.getWrkNo(), "鏈尮閰嶅埌鍫嗗灈鏈�");
+ continue;
+ }
+
+ Integer targetStationId = commonService.findInStationId(crnNo, stationProtocol.getStationId());
+ if (targetStationId == null) {
+ News.taskInfo(wrkMast.getWrkNo(), "鎼滅储鍏ュ簱绔欑偣澶辫触");
+ continue;
+ }
+
+ StationCommand command = stationThread.getMoveCommand(wrkMast.getWrkNo(), stationProtocol.getStationId(), targetStationId, 0);
+ if(command == null){
+ News.taskInfo(wrkMast.getWrkNo(), "鑾峰彇杈撻�佺嚎鍛戒护澶辫触");
+ continue;
+ }
+
+ //鏇存柊婧愬簱浣�
+ sourceLocMast.setLocSts("O");
+ sourceLocMast.setModiTime(new Date());
+ locMastService.updateById(sourceLocMast);
+
+ //鏇存柊鐩爣搴撲綅
+ locMast.setLocSts("S");
+ locMast.setModiTime(new Date());
+ locMastService.updateById(locMast);
+
+ //鏇存柊宸ヤ綔妗f暟鎹�
+ wrkMast.setLocNo(locNo);
+ wrkMast.setCrnNo(crnNo);
+ wrkMast.setStaNo(targetStationId);
+ if (wrkMastService.updateById(wrkMast)) {
+ MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
+ }
+ News.info("璇锋眰WMS鎺ュ彛鎴愬姛锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
+ } else {
+ News.error("璇锋眰WMS鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
}
-
- Integer targetStationId = commonService.findInStationId(crnNo, stationProtocol.getStationId());
- if (targetStationId == null) {
- News.taskInfo(wrkMast.getWrkNo(), "鎼滅储鍏ュ簱绔欑偣澶辫触");
- continue;
- }
-
- StationCommand command = stationThread.getMoveCommand(wrkMast.getWrkNo(), stationProtocol.getStationId(), targetStationId, 0);
- if(command == null){
- News.taskInfo(wrkMast.getWrkNo(), "鑾峰彇杈撻�佺嚎鍛戒护澶辫触");
- continue;
- }
- MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
- News.info("璇锋眰WMS鎺ュ彛鎴愬姛锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
- } else {
- News.error("璇锋眰WMS鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response);
+ } catch (Exception e) {
+ News.error("璇锋眰WMS鎺ュ彛寮傚父锛侊紒锛乽rl锛歿}锛況equest锛歿}锛� 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);
}
- } catch (Exception e) {
- News.error("璇锋眰WMS鎺ュ彛寮傚父锛侊紒锛乽rl锛歿}锛況equest锛歿}锛� 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);
+ }else {
+ //杩愯鍫靛锛岄噸鏂拌绠楄矾绾�
+ StationCommand command = stationThread.getMoveCommand(wrkMast.getWrkNo(), stationProtocol.getStationId(), wrkMast.getStaNo(), 0);
+ if(command == null){
+ News.taskInfo(wrkMast.getWrkNo(), "鑾峰彇杈撻�佺嚎鍛戒护澶辫触");
+ continue;
+ }
+
+ MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
+ News.info("杈撻�佺珯鐐瑰牭濉炲悗閲嶆柊璁$畻璺緞鍛戒护涓嬪彂鎴愬姛锛岀珯鐐瑰彿={}锛屽伐浣滃彿={}锛屽懡浠ゆ暟鎹�={}", stationProtocol.getStationId(), wrkMast.getWrkNo(), JSON.toJSONString(command));
}
}
}
diff --git "a/src/main/resources/map/\344\270\212\346\265\267\344\270\264\346\270\257\345\223\245\346\226\257\346\213\211\351\241\271\347\233\256.xlsx" "b/src/main/resources/map/\344\270\212\346\265\267\344\270\264\346\270\257\345\223\245\346\226\257\346\213\211\351\241\271\347\233\256.xlsx"
index ae51733..755e030 100644
--- "a/src/main/resources/map/\344\270\212\346\265\267\344\270\264\346\270\257\345\223\245\346\226\257\346\213\211\351\241\271\347\233\256.xlsx"
+++ "b/src/main/resources/map/\344\270\212\346\265\267\344\270\264\346\270\257\345\223\245\346\226\257\346\213\211\351\241\271\347\233\256.xlsx"
Binary files differ
diff --git a/src/main/resources/mapper/BasDevpMapper.xml b/src/main/resources/mapper/BasDevpMapper.xml
index 584d18a..d6c01b5 100644
--- a/src/main/resources/mapper/BasDevpMapper.xml
+++ b/src/main/resources/mapper/BasDevpMapper.xml
@@ -16,6 +16,7 @@
<result column="barcode_station_list" property="barcodeStationList" />
<result column="in_station_list" property="inStationList" />
<result column="out_station_list" property="outStationList" />
+ <result column="run_block_reassign_loc_station_list" property="runBlockReassignLocStationList" />
</resultMap>
diff --git a/src/main/resources/mapper/LocMastMapper.xml b/src/main/resources/mapper/LocMastMapper.xml
index c0da5d5..a5cab45 100644
--- a/src/main/resources/mapper/LocMastMapper.xml
+++ b/src/main/resources/mapper/LocMastMapper.xml
@@ -30,32 +30,8 @@
select * from asr_loc_mast where loc_no = #{locNo} limit 0,1
</select>
- <select id="queryByQrCode" resultMap="BaseResultMap">
- select * from asr_loc_mast where qr_code_value = #{qrCodeValue} limit 0,1
- </select>
-
<select id="selectLocByLev" resultMap="BaseResultMap">
SELECT * FROM asr_loc_mast WHERE lev1 = #{lev}
- </select>
-
- <select id="selectEmptyLocNos" resultMap="BaseResultMap">
- select * from asr_loc_mast
- where loc_no in
- <foreach item="loc" collection="locNos" index="index" separator="," open="(" close=")">
- #{loc}
- </foreach>
- and loc_sts = 'O'
- order by row1
- </select>
-
- <select id="selectNotEmptyLocNos" resultMap="BaseResultMap">
- select * from asr_loc_mast
- where loc_no in
- <foreach item="loc" collection="locNos" index="index" separator="," open="(" close=")">
- #{loc}
- </foreach>
- and loc_sts not in ('O')
- order by row1
</select>
<select id="getLevList" resultType="java.lang.Integer">
diff --git a/src/main/webapp/static/js/basDevp/basDevp.js b/src/main/webapp/static/js/basDevp/basDevp.js
index 6bfbc6a..f323842 100644
--- a/src/main/webapp/static/js/basDevp/basDevp.js
+++ b/src/main/webapp/static/js/basDevp/basDevp.js
@@ -28,15 +28,16 @@
{ field: "id", align: "center", title: "缂栧彿" },
{ field: "devpNo", align: "center", title: "璁惧缂栧彿" },
{ field: "status$", align: "center", title: "鐘舵��" },
- { field: "createBy", align: "center", title: "鍒涘缓浜哄憳" },
- { field: "createTime$", align: "center", title: "鍒涘缓鏃堕棿" },
- { field: "updateBy", align: "center", title: "淇敼浜哄憳" },
- { field: "updateTime$", align: "center", title: "淇敼鏃堕棿" },
+ // { field: "createBy", align: "center", title: "鍒涘缓浜哄憳" },
+ // { field: "createTime$", align: "center", title: "鍒涘缓鏃堕棿" },
+ // { field: "updateBy", align: "center", title: "淇敼浜哄憳" },
+ // { field: "updateTime$", align: "center", title: "淇敼鏃堕棿" },
{ field: "memo", align: "center", title: "澶囨敞" },
{ field: "stationList", align: "center", title: "绔欑偣鏁版嵁" },
{ field: "barcodeStationList", align: "center", title: "鏉$爜绔欑偣鏁版嵁" },
{ field: "inStationList", align: "center", title: "鍏ュ簱绔欑偣鏁版嵁" },
{ field: "outStationList", align: "center", title: "鍑哄簱绔欑偣鏁版嵁" },
+ { field: "runBlockReassignLocStationList", align: "center", title: "杩愯鍫靛閲嶆柊鍒嗛厤搴撲綅绔欑偣鏁版嵁" },
{
fixed: "right",
diff --git a/src/main/webapp/views/basDevp/basDevp.html b/src/main/webapp/views/basDevp/basDevp.html
index 868ac11..98bb472 100644
--- a/src/main/webapp/views/basDevp/basDevp.html
+++ b/src/main/webapp/views/basDevp/basDevp.html
@@ -143,6 +143,12 @@
<input class="layui-input" name="outStationList" placeholder="璇疯緭鍏ュ嚭搴撶珯鐐规暟鎹�">
</div>
</div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">杩愯鍫靛閲嶆柊鍒嗛厤搴撲綅绔欑偣鏁版嵁: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="runBlockReassignLocStationList" placeholder="璇疯緭鍏ヨ繍琛屽牭濉為噸鏂板垎閰嶅簱浣嶇珯鐐规暟鎹�">
+ </div>
+ </div>
</div>
</div>
--
Gitblit v1.9.1