From fb8419ef141e16b8ec8b1d9802fa0d5a46768794 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 20 九月 2023 08:24:21 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/mapper/WrkMastLocMapper.java | 16
src/main/java/com/zy/core/thread/LiftThread.java | 10
src/main/resources/mapper/WrkMastLogMapper.xml | 69 ++++
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 146 ++++++-
src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java | 2
src/main/resources/mapper/WrkMastMapper.xml | 2
src/main/java/com/zy/asrs/entity/WrkMastLog.java | 504 +++++++++++++++++++++++++++++
src/main/java/com/zy/asrs/domain/param/LiftOperatorParam.java | 6
src/main/webapp/views/lift.html | 25 +
src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java | 11
src/main/java/com/zy/asrs/controller/ShuttleController.java | 7
src/main/java/com/zy/core/enums/ShuttleTaskModeType.java | 1
src/main/java/com/zy/core/thread/NyShuttleThread.java | 61 +-
src/main/webapp/views/shuttle.html | 1
src/main/java/com/zy/core/thread/SiemensDevpThread.java | 23 -
src/main/java/com/zy/asrs/controller/LiftController.java | 89 ++++
16 files changed, 873 insertions(+), 100 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/LiftController.java b/src/main/java/com/zy/asrs/controller/LiftController.java
index 5af0336..a2199df 100644
--- a/src/main/java/com/zy/asrs/controller/LiftController.java
+++ b/src/main/java/com/zy/asrs/controller/LiftController.java
@@ -12,16 +12,19 @@
import com.zy.asrs.entity.BasLift;
import com.zy.asrs.service.BasLiftService;
import com.zy.common.service.CommonService;
+import com.zy.common.utils.NyLiftUtils;
import com.zy.common.utils.RedisUtil;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.LiftProtocolStatusType;
+import com.zy.core.enums.NyLiftTaskModelType;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.LiftSlave;
import com.zy.core.model.Task;
import com.zy.core.model.command.*;
import com.zy.core.model.protocol.LiftProtocol;
+import com.zy.core.model.protocol.LiftStaProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.LiftThread;
import lombok.extern.slf4j.Slf4j;
@@ -189,18 +192,86 @@
throw new CoolException("鎻愬崌鏈轰笉鍦ㄧ嚎");
}
- LiftAssignCommand assignCommand = new LiftAssignCommand();
- assignCommand.setLiftNo(liftSlave.getId().shortValue()); // 鎻愬崌鏈虹紪鍙�
- assignCommand.setTaskNo((short) commonService.getWorkNo(3));//鑾峰彇浠诲姟鍙�
- assignCommand.setTaskMode(param.getLiftTaskMode().shortValue());
- assignCommand.setAuto(false);//鎵嬪姩妯″紡
- assignCommand.setLev(param.getLev());//绉诲姩妤煎眰
+ if (param.getLiftTaskMode() == 1) {
+ //鎻愬崌鏈哄崌闄嶆ゼ灞�
+ int workNo = commonService.getWorkNo(3);//鑾峰彇浠诲姟鍙�
- if (MessageQueue.offer(SlaveType.Lift, liftSlave.getId(), new Task(3, assignCommand))) {
- return R.ok();
+ Integer startSta = null;
+ Integer targetSta = null;
+ for (LiftStaProtocol liftStaProtocol : liftThread.getLiftStaProtocols()) {
+ if (liftStaProtocol.getLev() == liftProtocol.getLev().intValue()) {
+ startSta = liftStaProtocol.getStaNo();
+ }
+
+ if (liftStaProtocol.getLev() == param.getLev()) {
+ targetSta = liftStaProtocol.getStaNo();
+ }
+ }
+
+ if (startSta == null || targetSta == null) {
+ throw new CoolException("璧风偣鎴栫洰鏍囩偣涓嶅瓨鍦�");
+ }
+
+ //鑾峰彇鎻愬崌鏈哄懡浠�
+ NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_CAR.id, startSta, targetSta, workNo);
+ ArrayList<NyLiftCommand> commands = new ArrayList<>();
+ commands.add(liftCommand);
+
+ //鎻愪氦鍒扮嚎绋嬪幓宸ヤ綔
+ LiftAssignCommand assignCommand = new LiftAssignCommand();
+ assignCommand.setCommands(commands);
+ assignCommand.setLiftNo(liftProtocol.getLiftNo());
+ assignCommand.setTaskNo((short) workNo);
+ assignCommand.setAuto(false);//鎵嬪姩妯″紡
+ assignCommand.setTaskMode(NyLiftTaskModelType.MOVE_CAR.id.shortValue());
+
+ if (MessageQueue.offer(SlaveType.Lift, liftSlave.getId(), new Task(3, assignCommand))) {
+ return R.ok();
+ } else {
+ throw new CoolException("鍛戒护涓嬪彂澶辫触");
+ }
+ } else if (param.getLiftTaskMode() == 2) {
+ //绉诲姩鎵樼洏
+ int workNo = commonService.getWorkNo(3);//鑾峰彇浠诲姟鍙�
+
+ Integer startSta = null;
+ Integer targetSta = null;
+ for (LiftStaProtocol liftStaProtocol : liftThread.getLiftStaProtocols()) {
+ if (liftStaProtocol.getStaNo() == param.getSourceStaNo()) {
+ startSta = liftStaProtocol.getStaNo();
+ }
+
+ if (liftStaProtocol.getLev() == param.getStaNo()) {
+ targetSta = liftStaProtocol.getStaNo();
+ }
+ }
+
+ if (startSta == null || targetSta == null) {
+ throw new CoolException("璧风偣鎴栫洰鏍囩偣涓嶅瓨鍦�");
+ }
+
+ //鑾峰彇鎻愬崌鏈哄懡浠�
+ NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_TRAY.id, startSta, targetSta, workNo);
+ ArrayList<NyLiftCommand> commands = new ArrayList<>();
+ commands.add(liftCommand);
+
+ //鎻愪氦鍒扮嚎绋嬪幓宸ヤ綔
+ LiftAssignCommand assignCommand = new LiftAssignCommand();
+ assignCommand.setCommands(commands);
+ assignCommand.setLiftNo(liftProtocol.getLiftNo());
+ assignCommand.setTaskNo((short) workNo);
+ assignCommand.setAuto(false);//鎵嬪姩妯″紡
+ assignCommand.setTaskMode(NyLiftTaskModelType.MOVE_TRAY.id.shortValue());
+
+ if (MessageQueue.offer(SlaveType.Lift, liftSlave.getId(), new Task(3, assignCommand))) {
+ return R.ok();
+ } else {
+ throw new CoolException("鍛戒护涓嬪彂澶辫触");
+ }
} else {
- throw new CoolException("鍛戒护涓嬪彂澶辫触");
+ throw new CoolException("鏈煡鍛戒护");
}
+
}
}
return R.error();
diff --git a/src/main/java/com/zy/asrs/controller/ShuttleController.java b/src/main/java/com/zy/asrs/controller/ShuttleController.java
index 2d24230..1ddba1b 100644
--- a/src/main/java/com/zy/asrs/controller/ShuttleController.java
+++ b/src/main/java/com/zy/asrs/controller/ShuttleController.java
@@ -21,6 +21,7 @@
import com.zy.common.utils.NyHttpUtils;
import com.zy.common.utils.NyShuttleOperaUtils;
import com.zy.common.utils.RedisUtil;
+import com.zy.common.utils.ShuttleDispatchUtils;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
import com.zy.core.cache.SlaveConnection;
@@ -62,6 +63,8 @@
private CommonService commonService;
@Autowired
private RedisUtil redisUtil;
+ @Autowired
+ private ShuttleDispatchUtils shuttleDispatchUtils;
@PostMapping("/table/shuttle/state")
@ManagerAuth(memo = "鍥涘悜绌挎杞︿俊鎭〃")
@@ -339,6 +342,10 @@
ArrayList<NyShuttleHttpCommand> commands = new ArrayList<>();
commands.add(suspendCommand);
assignCommand.setCommands(commands);
+ } else if (shuttleTaskModeType == ShuttleTaskModeType.MOVE_LOC_NO_WRK_MAST) {
+ //绉诲姩鍒扮洰鏍囧簱浣�(鐢熸垚绉诲姩浠诲姟)
+ shuttleDispatchUtils.dispatchShuttle(commonService.getWorkNo(3), param.getDistLocNo(), param.getShuttleNo());
+ return R.ok();
} else {
throw new CoolException("鏈煡鍛戒护");
}
diff --git a/src/main/java/com/zy/asrs/domain/param/LiftOperatorParam.java b/src/main/java/com/zy/asrs/domain/param/LiftOperatorParam.java
index 38e1353..ad1a70e 100644
--- a/src/main/java/com/zy/asrs/domain/param/LiftOperatorParam.java
+++ b/src/main/java/com/zy/asrs/domain/param/LiftOperatorParam.java
@@ -17,4 +17,10 @@
//鎻愬崌鏈烘ゼ灞�
private Integer lev;
+ //婧愮珯
+ private Integer sourceStaNo;
+
+ //鐩爣绔�
+ private Integer staNo;
+
}
diff --git a/src/main/java/com/zy/asrs/entity/WrkMastLog.java b/src/main/java/com/zy/asrs/entity/WrkMastLog.java
new file mode 100644
index 0000000..de47022
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/WrkMastLog.java
@@ -0,0 +1,504 @@
+package com.zy.asrs.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
+import com.zy.asrs.service.BasCrnpService;
+import com.zy.asrs.service.BasDevpService;
+import com.zy.asrs.service.LocMastService;
+import com.zy.asrs.service.WrkMastService;
+import com.zy.system.entity.User;
+import com.zy.system.service.UserService;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Data
+@TableName("asr_wrk_mast_log")
+public class WrkMastLog implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 缂栧彿
+ */
+ @ApiModelProperty(value= "缂栧彿")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 宸ヤ綔鍙�
+ */
+ @ApiModelProperty(value= "宸ヤ綔鍙�")
+ @TableField("wrk_no")
+ private Integer wrkNo;
+
+ @ApiModelProperty(value= "")
+ @TableField("inv_wh")
+ private String invWh;
+
+ @ApiModelProperty(value= "")
+ private Date ymd;
+
+ @ApiModelProperty(value= "")
+ private String mk;
+
+ @ApiModelProperty(value= "")
+ @TableField("whs_type")
+ private Integer whsType;
+
+ /**
+ * 宸ヤ綔鐘舵��
+ */
+ @ApiModelProperty(value= "宸ヤ綔鐘舵��")
+ @TableField("wrk_sts")
+ private Long wrkSts;
+
+ /**
+ * 鍏ュ嚭搴撶被鍨�
+ */
+ @ApiModelProperty(value= "鍏ュ嚭搴撶被鍨�")
+ @TableField("io_type")
+ private Integer ioType;
+
+ /**
+ * 鍫嗗灈鏈哄彿
+ */
+ @ApiModelProperty(value= "鍫嗗灈鏈哄彿")
+ @TableField("crn_no")
+ private Integer crnNo;
+
+ /**
+ * 绌挎杞�
+ */
+ @ApiModelProperty(value= "绌挎杞�")
+ @TableField("ste_no")
+ private Integer steNo;
+
+ /**
+ * 杈圭紭搴撲綅
+ */
+ @ApiModelProperty(value= "杈圭紭搴撲綅")
+ @TableField("out_most")
+ private Integer outMost;
+
+ @ApiModelProperty(value= "")
+ @TableField("sheet_no")
+ private String sheetNo;
+
+ /**
+ * 浼樺厛绾�
+ */
+ @ApiModelProperty(value= "浼樺厛绾�")
+ @TableField("io_pri")
+ private Double ioPri;
+
+ @ApiModelProperty(value= "")
+ @TableField("wrk_date")
+ private Date wrkDate;
+
+ /**
+ * 鐩爣搴撲綅
+ */
+ @ApiModelProperty(value= "鐩爣搴撲綅")
+ @TableField("loc_no")
+ private String locNo;
+
+ /**
+ * 鐩爣绔�
+ */
+ @ApiModelProperty(value= "鐩爣绔�")
+ @TableField("sta_no")
+ private Integer staNo;
+
+ /**
+ * 婧愮珯
+ */
+ @ApiModelProperty(value= "婧愮珯")
+ @TableField("source_sta_no")
+ private Integer sourceStaNo;
+
+ /**
+ * 婧愬簱浣�
+ */
+ @ApiModelProperty(value= "婧愬簱浣�")
+ @TableField("source_loc_no")
+ private String sourceLocNo;
+
+ @ApiModelProperty(value= "")
+ @TableField("loc_sts")
+ private String locSts;
+
+ /**
+ * 鎷f枡
+ */
+ @ApiModelProperty(value= "鎷f枡")
+ private String picking;
+
+ @ApiModelProperty(value= "")
+ @TableField("link_mis")
+ private String linkMis;
+
+ @ApiModelProperty(value= "")
+ @TableField("online_yn")
+ private String onlineYn;
+
+ @ApiModelProperty(value= "")
+ @TableField("upd_mk")
+ private String updMk;
+
+ /**
+ * 閫�鍑�
+ */
+ @ApiModelProperty(value= "閫�鍑�")
+ @TableField("exit_mk")
+ private String exitMk;
+
+ @ApiModelProperty(value= "")
+ @TableField("plt_type")
+ private Integer pltType;
+
+ /**
+ * 绌烘澘
+ */
+ @ApiModelProperty(value= "绌烘澘")
+ @TableField("empty_mk")
+ private String emptyMk;
+
+ /**
+ * 宸ヤ綔鏃堕棿
+ */
+ @ApiModelProperty(value= "宸ヤ綔鏃堕棿")
+ @TableField("io_time")
+ private Date ioTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("ctn_type")
+ private Integer ctnType;
+
+ @ApiModelProperty(value= "")
+ private String packed;
+
+ @ApiModelProperty(value= "")
+ @TableField("ove_mk")
+ private String oveMk;
+
+ @ApiModelProperty(value= "")
+ @TableField("mtn_type")
+ private Double mtnType;
+
+ @ApiModelProperty(value= "")
+ @TableField("user_no")
+ private String userNo;
+
+ /**
+ * 鍫嗗灈鏈哄惎鍔ㄦ椂闂�
+ */
+ @ApiModelProperty(value= "鍫嗗灈鏈哄惎鍔ㄦ椂闂�")
+ @TableField("crn_str_time")
+ private Date crnStrTime;
+
+ /**
+ * 鍫嗗灈鏈哄仠姝㈡椂闂�
+ */
+ @ApiModelProperty(value= "鍫嗗灈鏈哄仠姝㈡椂闂�")
+ @TableField("crn_end_time")
+ private Date crnEndTime;
+
+ /**
+ * 鎷f枡鏃堕棿
+ */
+ @ApiModelProperty(value= "鎷f枡鏃堕棿")
+ @TableField("plc_str_time")
+ private Date plcStrTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("crn_pos_time")
+ private Date crnPosTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("load_time")
+ private Double loadTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("exp_time")
+ private Double expTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("ref_wrkno")
+ private Double refWrkno;
+
+ @ApiModelProperty(value= "")
+ @TableField("ref_iotime")
+ private Date refIotime;
+
+ /**
+ * 淇敼浜哄憳
+ */
+ @ApiModelProperty(value= "淇敼浜哄憳")
+ @TableField("modi_user")
+ private Long modiUser;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @ApiModelProperty(value= "淇敼鏃堕棿")
+ @TableField("modi_time")
+ private Date modiTime;
+
+ /**
+ * 鍒涘缓鑰�
+ */
+ @ApiModelProperty(value= "鍒涘缓鑰�")
+ @TableField("appe_user")
+ private Long appeUser;
+
+ /**
+ * 娣诲姞鏃堕棿
+ */
+ @ApiModelProperty(value= "娣诲姞鏃堕棿")
+ @TableField("appe_time")
+ private Date appeTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("pause_mk")
+ private String pauseMk;
+
+ @ApiModelProperty(value= "")
+ @TableField("error_time")
+ private Date errorTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("error_memo")
+ private String errorMemo;
+
+ @ApiModelProperty(value= "")
+ @TableField("ctn_kind")
+ private Integer ctnKind;
+
+ @ApiModelProperty(value= "")
+ @TableField("manu_type")
+ private String manuType;
+
+ @ApiModelProperty(value= "")
+ @TableField("memo_m")
+ private String memoM;
+
+ @ApiModelProperty(value= "")
+ @TableField("sc_weight")
+ private Double scWeight;
+
+ @ApiModelProperty(value= "")
+ @TableField("log_mk")
+ private String logMk;
+
+ @ApiModelProperty(value= "")
+ @TableField("log_err_time")
+ private Date logErrTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("log_err_memo")
+ private String logErrMemo;
+
+ /**
+ * 鏉$爜
+ */
+ @ApiModelProperty(value= "鏉$爜")
+ private String barcode;
+
+ @ApiModelProperty(value= "")
+ @TableField("Pdc_type")
+ private String PdcType;
+
+ @ApiModelProperty(value= "")
+ @TableField("ctn_no")
+ private String ctnNo;
+
+ /**
+ * 婊℃澘
+ */
+ @ApiModelProperty(value= "婊℃澘")
+ @TableField("full_plt")
+ private String fullPlt;
+
+ /**
+ * 鍏堝叆鍝� / 鍙岄噸鍏ュ簱
+ */
+ @ApiModelProperty(value= "鍏堝叆鍝�")
+ @TableField("pre_have")
+ private String preHave;
+
+ /**
+ * 绌烘搷浣� / 鍙栬揣鏃犵
+ */
+ @ApiModelProperty(value= "绌烘搷浣�")
+ @TableField("take_none")
+ private String takeNone;
+
+ public WrkMastLog() {}
+
+ public String getWrkNo$(){
+ WrkMastService service = SpringUtils.getBean(WrkMastService.class);
+ WrkMast wrkMast = service.selectById(this.wrkNo);
+ if (!Cools.isEmpty(wrkMast)){
+ return String.valueOf(wrkMast.getWrkNo());
+ }
+ return null;
+ }
+
+ public String getYmd$(){
+ if (Cools.isEmpty(this.ymd)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ymd);
+ }
+
+ public String getCrnNo$(){
+ BasCrnpService service = SpringUtils.getBean(BasCrnpService.class);
+ BasCrnp basCrnp = service.selectById(this.crnNo);
+ if (!Cools.isEmpty(basCrnp)){
+ return String.valueOf(basCrnp.getCrnNo());
+ }
+ return null;
+ }
+
+ public String getWrkDate$(){
+ if (Cools.isEmpty(this.wrkDate)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.wrkDate);
+ }
+
+ public String getLocNo$(){
+ LocMastService service = SpringUtils.getBean(LocMastService.class);
+ LocMast locMast = service.selectById(this.locNo);
+ if (!Cools.isEmpty(locMast)){
+ return String.valueOf(locMast.getLocNo());
+ }
+ return null;
+ }
+
+ public String getStaNo$(){
+ BasDevpService service = SpringUtils.getBean(BasDevpService.class);
+ BasDevp basDevp = service.selectById(this.staNo);
+ if (!Cools.isEmpty(basDevp)){
+ return String.valueOf(basDevp.getDevNo());
+ }
+ return null;
+ }
+
+ public String getSourceStaNo$(){
+ BasDevpService service = SpringUtils.getBean(BasDevpService.class);
+ BasDevp basDevp = service.selectById(this.sourceStaNo);
+ if (!Cools.isEmpty(basDevp)){
+ return String.valueOf(basDevp.getDevNo());
+ }
+ return null;
+ }
+
+ public String getSourceLocNo$(){
+ LocMastService service = SpringUtils.getBean(LocMastService.class);
+ LocMast locMast = service.selectById(this.sourceLocNo);
+ if (!Cools.isEmpty(locMast)){
+ return String.valueOf(locMast.getLocNo());
+ }
+ return null;
+ }
+
+ public String getIoTime$(){
+ if (Cools.isEmpty(this.ioTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime);
+ }
+
+ public String getCrnStrTime$(){
+ if (Cools.isEmpty(this.crnStrTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.crnStrTime);
+ }
+
+ public String getCrnEndTime$(){
+ if (Cools.isEmpty(this.crnEndTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.crnEndTime);
+ }
+
+ public String getPlcStrTime$(){
+ if (Cools.isEmpty(this.plcStrTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.plcStrTime);
+ }
+
+ public String getCrnPosTime$(){
+ if (Cools.isEmpty(this.crnPosTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.crnPosTime);
+ }
+
+
+ public String getRefIotime$(){
+ if (Cools.isEmpty(this.refIotime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.refIotime);
+ }
+
+ public String getModiUser$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.selectById(this.modiUser);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getUsername());
+ }
+ return null;
+ }
+
+ public String getModiTime$(){
+ if (Cools.isEmpty(this.modiTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime);
+ }
+
+ public String getAppeUser$(){
+ UserService service = SpringUtils.getBean(UserService.class);
+ User user = service.selectById(this.appeUser);
+ if (!Cools.isEmpty(user)){
+ return String.valueOf(user.getUsername());
+ }
+ return null;
+ }
+
+ public String getAppeTime$(){
+ if (Cools.isEmpty(this.appeTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime);
+ }
+
+ public String getErrorTime$(){
+ if (Cools.isEmpty(this.errorTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.errorTime);
+ }
+
+ public String getLogErrTime$(){
+ if (Cools.isEmpty(this.logErrTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.logErrTime);
+ }
+
+
+}
diff --git a/src/main/java/com/zy/asrs/mapper/WrkMastLocMapper.java b/src/main/java/com/zy/asrs/mapper/WrkMastLocMapper.java
new file mode 100644
index 0000000..ae2b22e
--- /dev/null
+++ b/src/main/java/com/zy/asrs/mapper/WrkMastLocMapper.java
@@ -0,0 +1,16 @@
+package com.zy.asrs.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.zy.asrs.entity.WrkMastLog;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface WrkMastLocMapper extends BaseMapper<WrkMastLog> {
+
+ @Insert("insert into asr_wrk_mast_log select * from asr_wrk_mast where wrk_no=#{workNo}")
+ int save(Integer workNo);
+
+}
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 01078e7..bd38850 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -99,6 +99,9 @@
private ShuttleDispatchUtils shuttleDispatchUtils;
@Autowired
private RedisUtil redisUtil;
+ @Autowired
+ private WrkMastLocMapper wrkMastLocMapper;
+
/**
* 缁勬墭
@@ -928,6 +931,16 @@
if (shuttleProtocol.getToken() == wrkMast.getWrkNo()) {
//閲婃斁灏忚溅浠ょ墝
shuttleProtocol.setToken(0);
+ }
+ break;
+ case 111:
+ // 淇濆瓨宸ヤ綔涓绘。鍘嗗彶妗�
+ if (wrkMastLocMapper.save(wrkMast.getWrkNo()) <= 0) {
+ log.info("淇濆瓨宸ヤ綔鍘嗗彶妗workNo={0}]澶辫触", wrkMast.getWrkNo());
+ }
+ // 鍒犻櫎宸ヤ綔涓绘。
+ if (!wrkMastService.deleteById(wrkMast)) {
+ log.info("鍒犻櫎宸ヤ綔涓绘。[workNo={0}]澶辫触", wrkMast.getWrkNo());
}
break;
default:
@@ -2156,6 +2169,8 @@
continue;
}
+// this.shuttleMoveExecuteStepClearWrkMast(wrkMast);//娓呯悊111.灏忚溅绉诲姩瀹屾垚
+
}
}
@@ -2181,7 +2196,7 @@
}
//灏忚溅澶勪簬绌洪棽鐘舵��
- if (!shuttleProtocol.isIdleNoCharge()) {
+ if (!shuttleProtocol.isIdleNoCharge(wrkMast.getWrkNo())) {
return false;
}
@@ -2358,6 +2373,8 @@
wrkMast.setWrkSts(104L);//灏忚溅绉诲姩鍒版彁鍗囨満涓� 103.灏忚溅绉诲姩鑷崇珯鐐瑰畬鎴� ==> 104.灏忚溅杩佸叆鎻愬崌鏈轰腑
wrkMast.setModiTime(now);
+ wrkMast.setLiftNo(liftThread.getSlave().getId());//閿佸畾鎻愬崌鏈洪槻姝㈣鍗犵敤
+ liftProtocol.setToken(wrkMast.getShuttleNo());//鎻愬崌鏈轰护鐗岀粦瀹氬綋鍓嶅皬杞�
if (wrkMastMapper.updateById(wrkMast) > 0) {
//涓嬪彂浠诲姟
MessageQueue.offer(SlaveType.Shuttle, assignCommand.getShuttleNo().intValue(), new Task(3, assignCommand));
@@ -2552,15 +2569,6 @@
//灏忚溅绉诲姩鍒扮洰鏍囧簱浣嶄腑 109.灏忚溅杩佸嚭鎻愬崌鏈哄畬鎴� ==> 110.灏忚溅绉诲姩涓�
if (wrkMast.getWrkSts() == 109) {
- LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, wrkMast.getLiftNo());
- if (liftThread == null) {
- return false;
- }
- LiftProtocol liftProtocol = liftThread.getLiftProtocol();
- if (liftProtocol == null) {
- return false;
- }
-
//鑾峰彇鍥涘悜绌挎杞︾嚎绋�
NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo());
if (shuttleThread == null) {
@@ -2572,34 +2580,34 @@
}
//灏忚溅澶勪簬绌洪棽鐘舵��
- if (!shuttleProtocol.isIdleNoCharge()) {
+ if (!shuttleProtocol.isIdleNoCharge(wrkMast.getWrkNo())) {
return false;
}
//鍒ゆ柇灏忚溅浠ょ墝鏄惁涓哄綋鍓嶄换鍔�
- if (shuttleProtocol.getToken() != wrkMast.getWrkNo()) {
+ if (shuttleProtocol.getToken() != 0 && shuttleProtocol.getToken() != wrkMast.getWrkNo()) {
return false;
}
- //鑾峰彇鐩爣绔欏搴旂殑杈撻�佺珯鐐�
- BasDevp targetBasDevp = basDevpService.selectByLevAndLiftNo(Utils.getLev(wrkMast.getLocNo()), wrkMast.getLiftNo());
- if (targetBasDevp == null) {
- return false;//缂哄皯绔欑偣淇℃伅
- }
+// //鑾峰彇鐩爣绔欏搴旂殑杈撻�佺珯鐐�
+// BasDevp targetBasDevp = basDevpService.selectByLevAndLiftNo(Utils.getLev(wrkMast.getLocNo()), wrkMast.getLiftNo());
+// if (targetBasDevp == null) {
+// return false;//缂哄皯绔欑偣淇℃伅
+// }
+//
+// //鑾峰彇鎻愬崌鏈烘暟鎹�
+// BasLift basLift = basLiftService.selectById(targetBasDevp.getLiftNo());
+// if (basLift == null) {
+// return false;//娌℃湁鎻愬崌鏈烘暟鎹�
+// }
+// if (basLift.getPoint() == null) {
+// return false;//娌℃湁璁剧疆鎻愬崌鏈虹偣浣嶅潗鏍�
+// }
+// NavigateNode liftNode = new NavigateNode(basLift.getPoint$().getX(), basLift.getPoint$().getY());
+// liftNode.setZ(basLift.getPoint$().getZ());
- //鑾峰彇鎻愬崌鏈烘暟鎹�
- BasLift basLift = basLiftService.selectById(targetBasDevp.getLiftNo());
- if (basLift == null) {
- return false;//娌℃湁鎻愬崌鏈烘暟鎹�
- }
- if (basLift.getPoint() == null) {
- return false;//娌℃湁璁剧疆鎻愬崌鏈虹偣浣嶅潗鏍�
- }
- NavigateNode liftNode = new NavigateNode(basLift.getPoint$().getX(), basLift.getPoint$().getY());
- liftNode.setZ(basLift.getPoint$().getZ());
-
- //鑾峰彇灏忚溅浠庤緭閫佺珯鍒扮洰鏍囧簱浣嶅懡浠�
- NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleThread.getSlave().getId(), wrkMast.getWrkNo(), targetBasDevp.getLocNo(), wrkMast.getLocNo());
+ //鑾峰彇灏忚溅鍒扮洰鏍囧簱浣嶅懡浠�
+ NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleThread.getSlave().getId(), wrkMast.getWrkNo(), shuttleProtocol.getCurrentLocNo(), wrkMast.getLocNo());
if (result == null) {
return false;//璺緞璁$畻澶辫触
}
@@ -2616,7 +2624,20 @@
wrkMast.setWrkSts(110L);//灏忚溅绉诲姩鍒扮洰鏍囧簱浣嶄腑 109.灏忚溅杩佸嚭鎻愬崌鏈哄畬鎴� ==> 110.灏忚溅绉诲姩涓�
wrkMast.setLiftNo(null);//閲婃斁鎻愬崌鏈�
wrkMast.setModiTime(now);
- liftProtocol.setToken(0);//閲婃斁鎻愬崌鏈轰护鐗�
+
+ if (wrkMast.getLiftNo() != null) {
+ LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, wrkMast.getLiftNo());
+ if (liftThread == null) {
+ return false;
+ }
+ LiftProtocol liftProtocol = liftThread.getLiftProtocol();
+ if (liftProtocol == null) {
+ return false;
+ }
+ if (liftProtocol.getToken() == shuttleProtocol.getShuttleNo().intValue()) {
+ liftProtocol.setToken(0);//閲婃斁鎻愬崌鏈轰护鐗�
+ }
+ }
if (wrkMastMapper.updateById(wrkMast) > 0) {
//涓嬪彂浠诲姟
MessageQueue.offer(SlaveType.Shuttle, assignCommand.getShuttleNo().intValue(), new Task(3, assignCommand));
@@ -2626,6 +2647,69 @@
}
/**
+ * 灏忚溅杩佺Щ-娓呯悊111.灏忚溅绉诲姩瀹屾垚
+ */
+ private boolean shuttleMoveExecuteStepClearWrkMast(WrkMast wrkMast) {
+ if (wrkMast.getWrkSts() == 111) {
+ //鑾峰彇鍥涘悜绌挎杞︾嚎绋�
+ NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo());
+ if (shuttleThread == null) {
+ return false;
+ }
+ NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
+ if (shuttleProtocol == null) {
+ return false;
+ }
+
+ //灏忚溅澶勪簬绌洪棽鐘舵��
+ if (!shuttleProtocol.isIdleNoCharge(wrkMast.getWrkNo())) {
+ return false;
+ }
+
+ Object o = redisUtil.get("shuttle_wrk_no_" + shuttleProtocol.getTaskNo());
+ if (o != null) {
+ ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class);
+ ShuttleAssignCommand assignCommand = redisCommand.getAssignCommand();
+ int size = assignCommand.getCommands().size();
+ NyShuttleHttpCommand command = assignCommand.getCommands().get(size - 1);//鑾峰彇鏈�鍚庝竴娈靛懡浠�
+ if (!command.getComplete()) {
+ return false;//鏈�鍚庝竴娈靛懡浠よ繕鏈畬鎴愶紝涓嶅仛鎿嶄綔
+ }
+ NavigateMapData navigateMapData = new NavigateMapData(Utils.getLev(shuttleProtocol.getCurrentLocNo()));
+ navigateMapData.writeNavigateNodeToRedisMap(assignCommand.getNodes(), false);//瑙i攣璺緞
+
+ //鍒犻櫎redis
+ redisUtil.del("shuttle_wrk_no_" + redisCommand.getWrkNo());
+ }
+
+ // 淇濆瓨宸ヤ綔涓绘。鍘嗗彶妗�
+ if (wrkMastLocMapper.save(wrkMast.getWrkNo()) <= 0) {
+ log.info("淇濆瓨宸ヤ綔鍘嗗彶妗workNo={0}]澶辫触", wrkMast.getWrkNo());
+ }
+ // 鍒犻櫎宸ヤ綔涓绘。
+ if (!wrkMastService.deleteById(wrkMast)) {
+ log.info("鍒犻櫎宸ヤ綔涓绘。[workNo={0}]澶辫触", wrkMast.getWrkNo());
+ }
+
+ //璁剧疆鍥涘悜绌挎杞︿负绌洪棽鐘舵��
+ shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
+ //婧愬簱浣嶆竻闆�
+ shuttleProtocol.setSourceLocNo(null);
+ //鐩爣搴撲綅娓呴浂
+ shuttleProtocol.setLocNo(null);
+ //浠诲姟鎸囦护娓呴浂
+ shuttleProtocol.setAssignCommand(null);
+ //宸ヤ綔鍙锋竻闆�
+ shuttleProtocol.setTaskNo(0);
+ //娓呴櫎浠ょ墝
+ shuttleProtocol.setToken(0);
+ News.info("鍥涘悜绌挎杞﹀凡纭涓旂Щ鍔ㄤ换鍔″畬鎴愮姸鎬�,澶嶄綅銆傚洓鍚戠┛姊溅鍙�={}", shuttleProtocol.getShuttleNo());
+ }
+
+ return true;
+ }
+
+ /**
* 鍑哄叆搴撴ā寮忓垏鎹�
*/
public synchronized void outAndIn() {
diff --git a/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java b/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
index 917c4cd..8ed3392 100644
--- a/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
+++ b/src/main/java/com/zy/common/utils/ShuttleDispatchUtils.java
@@ -189,7 +189,7 @@
}
Integer staNo = null;
- if (Utils.getLev(locNo) == shuttleProtocol.getPoint().getZ()) {
+ if (Utils.getLev(locNo) != shuttleProtocol.getPoint().getZ()) {
//鐩爣搴撲綅鍜屽皬杞﹀簱浣嶅浜庝笉鍚屼竴妤煎眰锛岄渶瑕侀�氳繃鎻愬崌鏈鸿皟搴�
//鑾峰彇绌挎杞︽渶杩戜笖绌洪棽鐨勬彁鍗囨満杈撻�佺珯鐐�
BasDevp liftSta = this.getRecentLiftSta(shuttleNo);
diff --git a/src/main/java/com/zy/core/enums/ShuttleTaskModeType.java b/src/main/java/com/zy/core/enums/ShuttleTaskModeType.java
index 529423e..d4bfed8 100644
--- a/src/main/java/com/zy/core/enums/ShuttleTaskModeType.java
+++ b/src/main/java/com/zy/core/enums/ShuttleTaskModeType.java
@@ -25,6 +25,7 @@
SHUTTLE_LOC_TO_LOC(20, "搴撲綅绉昏浆"),
SHUTTLE_CONTROL(21, "灏忚溅绠″埗"),
SHUTTLE_CANCEL_CONTROL(22, "灏忚溅鍙栨秷绠″埗"),
+ MOVE_LOC_NO_WRK_MAST(23, "绉诲姩鍒扮洰鏍囧簱浣�(鐢熸垚绉诲姩浠诲姟)"),
;
public Integer id;
diff --git a/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java b/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
index b0661ba..a8f7fa4 100644
--- a/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
@@ -494,6 +494,17 @@
return res;
}
+ // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
+ public Boolean isIdleNoCharge(int taskNo) {
+ boolean res = this.free == ShuttleStatusType.IDLE.id
+ && !this.pakMk
+ && this.errState == 0
+ && (this.taskNo == 0 || this.taskNo == taskNo)
+ && this.protocolStatus == ShuttleProtocolStatusType.IDLE.id
+ ;
+ return res;
+ }
+
// 鏄惁婊¤冻鍏呯數鐘舵��
public Boolean isRequireCharge() {
if (this.free == null || this.pakMk == null || this.errState == null || this.taskNo == null) {
diff --git a/src/main/java/com/zy/core/thread/LiftThread.java b/src/main/java/com/zy/core/thread/LiftThread.java
index 971b4ff..816e9f4 100644
--- a/src/main/java/com/zy/core/thread/LiftThread.java
+++ b/src/main/java/com/zy/core/thread/LiftThread.java
@@ -141,7 +141,7 @@
private void readStatus() {
try {
//鑾峰彇鎻愬崌鏈烘暟鎹�
- OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB4.0", (short) 10);
+ OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB82.4.0", (short) 10);
if (result1.IsSuccess) {
if (null == liftProtocol) {
liftProtocol = new LiftProtocol();
@@ -154,7 +154,7 @@
//妯″紡
liftProtocol.setModel(status1[0]);
//蹇欓棽
- liftProtocol.setBusy(status1[1]);
+ liftProtocol.setBusy(!status1[1]);
//鍓嶈秴闄�
liftProtocol.setFrontOverrun(status1[4]);
//鍚庤秴闄�
@@ -220,7 +220,7 @@
Thread.sleep(200);
//鑾峰彇鎻愬崌鏈虹珯鐐规暟鎹�
- OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB14.0", (short) (10 * liftStaProtocols.size()));
+ OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB82.14.0", (short) (10 * liftStaProtocols.size()));
if (result1.IsSuccess) {
for (int i = 0; i < slave.getSta().size(); i++) {
LiftStaProtocol liftStaProtocol = liftStaProtocols.get(i);
@@ -233,7 +233,7 @@
//妯″紡
liftStaProtocol.setModel(status1[0]);
//蹇欓棽
- liftStaProtocol.setBusy(status1[1]);
+ liftStaProtocol.setBusy(!status1[1]);
//鏈夋墭鐩�
liftStaProtocol.setHasTray(status1[2]);
//鍓嶈秴闄�
@@ -273,7 +273,7 @@
command.setLiftNo(slave.getId().shortValue());
short[] array = getCommandArr(command);//鑾峰彇鍛戒护鎶ユ枃
- OperateResult result = siemensS7Net.Write("41088", array);
+ OperateResult result = siemensS7Net.Write("DB83.0", array);
if (result != null && result.IsSuccess) {
News.info("鎻愬崌鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
OutputQueue.LIFT.offer(MessageFormat.format("銆恵0}銆慬id:{1}] >>>>> 鍛戒护涓嬪彂锛� {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
diff --git a/src/main/java/com/zy/core/thread/NyShuttleThread.java b/src/main/java/com/zy/core/thread/NyShuttleThread.java
index 6ba944e..ab325f7 100644
--- a/src/main/java/com/zy/core/thread/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/NyShuttleThread.java
@@ -176,20 +176,6 @@
//灏忚溅澶勪簬杩愯涓紝灏嗘爣璁扮疆涓簍rue
if (shuttleProtocol.getFree() == 0) {
shuttleProtocol.setPakMk(true);
- }else {
- //灏忚溅澶勪簬绛夊緟纭涓旂┖闂茬姸鎬侊紝濡傛湁宸ヤ綔鍙峰垯娓呯┖璺緞
- if (shuttleProtocol.getTaskNo() != 0 && shuttleProtocol.getProtocolStatusType() == ShuttleProtocolStatusType.WAITING) {
- Object o = redisUtil.get("shuttle_wrk_no_" + shuttleProtocol.getTaskNo());
- if (o != null) {
- ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class);
- ShuttleAssignCommand assignCommand = redisCommand.getAssignCommand();
- NavigateMapData navigateMapData = new NavigateMapData(Utils.getLev(shuttleProtocol.getCurrentLocNo()));
- navigateMapData.writeNavigateNodeToRedisMap(assignCommand.getNodes(), false);//瑙i攣璺緞
-
- //鍒犻櫎redis
- redisUtil.del("shuttle_wrk_no_" + redisCommand.getWrkNo());
- }
- }
}
//灏嗗洓鍚戠┛姊溅鐘舵�佷繚瀛樿嚦鏁版嵁搴�
@@ -396,6 +382,23 @@
//涓婁竴鏉′换鍔℃湭瀹屾垚锛岀姝笅鍙戝懡浠�
return false;
}
+
+ //鍒ゆ柇鏄惁涓烘渶鍚庝竴鏉″懡浠や笖鍛戒护鎵ц瀹屾垚锛屾姏鍑虹瓑寰呯‘璁ょ姸鎬�
+ NyShuttleHttpCommand endCommand = commands.get(commands.size() - 1);
+ if (endCommand.getComplete()) {
+ //鍒犻櫎redis
+ redisUtil.del("shuttle_wrk_no_" + redisCommand.getWrkNo());
+
+ if (!assignCommand.getCharge()) {
+ //瀵逛富绾跨▼鎶涘嚭绛夊緟纭鐘舵�亀aiting
+ shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WAITING);
+ }else {
+ shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING_WAITING);
+ }
+ News.info("鍥涘悜绌挎杞︿换鍔℃墽琛屼笅鍙戝畬鎴愮瓑寰呮墽琛岀粨鏉燂紝绌挎杞﹀彿={}锛屼换鍔℃暟鎹�={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command));
+
+ return false;//绂佹鍐嶄笅鍙戝懡浠�
+ }
}
List<NavigateNode> nextNodes = null;//涓嬩竴姝ュ懡浠よ璧拌矾寰�
@@ -471,20 +474,21 @@
}else {
//宸叉墽琛屽畬鎴�
- //鏈�鍚庝竴娈靛懡浠や负绉诲姩鍛戒护锛屽垯鏆傜紦鍒犻櫎redis绛夊緟娓呴櫎璺緞鏃朵竴娆℃�у垹闄�
- //鏈�鍚庝竴娈靛懡浠や负涓嶆槸绉诲姩鍛戒护锛屽垯鍒犻櫎redis
- if (!command.getRequest().getBody().get("requestType").equals("move")) {
- //鍒犻櫎redis
- redisUtil.del("shuttle_wrk_no_" + redisCommand.getWrkNo());
- }
-
- if (!assignCommand.getCharge()) {
- //瀵逛富绾跨▼鎶涘嚭绛夊緟纭鐘舵�亀aiting
- shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WAITING);
- }else {
- shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING_WAITING);
- }
- News.info("鍥涘悜绌挎杞︿换鍔℃墽琛屼笅鍙戝畬鎴愮瓑寰呮墽琛岀粨鏉燂紝绌挎杞﹀彿={}锛屼换鍔℃暟鎹�={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command));
+ commandStep++;
+// //鏈�鍚庝竴娈靛懡浠や负绉诲姩鍛戒护锛屽垯鏆傜紦鍒犻櫎redis绛夊緟娓呴櫎璺緞鏃朵竴娆℃�у垹闄�
+// //鏈�鍚庝竴娈靛懡浠や负涓嶆槸绉诲姩鍛戒护锛屽垯鍒犻櫎redis
+// if (!command.getRequest().getBody().get("requestType").equals("move")) {
+// //鍒犻櫎redis
+// redisUtil.del("shuttle_wrk_no_" + redisCommand.getWrkNo());
+// }
+//
+// if (!assignCommand.getCharge()) {
+// //瀵逛富绾跨▼鎶涘嚭绛夊緟纭鐘舵�亀aiting
+// shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WAITING);
+// }else {
+// shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.CHARGING_WAITING);
+// }
+// News.info("鍥涘悜绌挎杞︿换鍔℃墽琛屼笅鍙戝畬鎴愮瓑寰呮墽琛岀粨鏉燂紝绌挎杞﹀彿={}锛屼换鍔℃暟鎹�={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command));
}
return true;
@@ -629,6 +633,7 @@
if (checkPathIsAvailable) {
return true;//鍙璧�
}
+ return false;
}else {
boolean checkPathIsAvailable2 = NavigateUtils.checkPathIsAvailable(nextNodes, shuttleProtocol.getShuttleNo().intValue(), Utils.getLev(shuttleProtocol.getCurrentLocNo()));
if (checkPathIsAvailable && checkPathIsAvailable2) {
diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index cf3791d..4d6efab 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -41,7 +41,7 @@
private SiemensS7Net siemensS7Net;
private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>();
private short heartBeatVal = 1;
- private int barcodeSize = 1;
+ private int barcodeSize = 9;
public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{
add(100);add(101);
add(102);add(103);
@@ -170,32 +170,15 @@
//璇绘潯鐮�
Thread.sleep(100);
- OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.200",(short)24);
+ OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB1000.200", (short) 72);
if (result2.IsSuccess) {
- for (int i = 0; i <= barcodeSize; i++) {
-// byte[] bytes = siemensS7Net.getByteTransform().TransByte(result2.Content, i * 8, 8);
-// String barcode = CommonUtils.bytesToBarcode(bytes);
+ for (int i = 0; i < barcodeSize; i++) {
String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
barcodeThread.setBarcode(barcode);
}
}
- }
-
- // 鍏呯數淇″彿浣�1
- Thread.sleep(50);
- OperateResultExOne<byte[]> result32 = siemensS7Net.Read("DB102.109", (short)1);
- if (result32.IsSuccess) {
- boolean[] status = siemensS7Net.getByteTransform().TransBool(result32.Content, 0, 1);
- charge0 = status[0]; //1:鍙互鍏呯數 0锛氬彲鑳界绾� 鍙兘鍦ㄥ厖鐢�
- }
- // 鍏呯數淇″彿浣�2
- Thread.sleep(50);
- OperateResultExOne<byte[]> result31 = siemensS7Net.Read("DB100.201", (short)1);
- if (result31.IsSuccess) {
- boolean[] status = siemensS7Net.getByteTransform().TransBool(result31.Content, 0, 1);
- charge1 = status[0];
}
// 澶栧舰妫�娴� - 102
diff --git a/src/main/resources/mapper/WrkMastLogMapper.xml b/src/main/resources/mapper/WrkMastLogMapper.xml
new file mode 100644
index 0000000..33f19d8
--- /dev/null
+++ b/src/main/resources/mapper/WrkMastLogMapper.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zy.asrs.mapper.WrkMastLogMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkMastLog">
+ <id column="id" property="id" />
+ <result column="wrk_no" property="wrkNo" />
+ <result column="inv_wh" property="invWh" />
+ <result column="ymd" property="ymd" />
+ <result column="mk" property="mk" />
+ <result column="whs_type" property="whsType" />
+ <result column="wrk_sts" property="wrkSts" />
+ <result column="io_type" property="ioType" />
+ <result column="crn_no" property="crnNo" />
+ <result column="ste_no" property="steNo" />
+ <result column="out_most" property="outMost" />
+ <result column="sheet_no" property="sheetNo" />
+ <result column="io_pri" property="ioPri" />
+ <result column="wrk_date" property="wrkDate" />
+ <result column="loc_no" property="locNo" />
+ <result column="sta_no" property="staNo" />
+ <result column="source_sta_no" property="sourceStaNo" />
+ <result column="source_loc_no" property="sourceLocNo" />
+ <result column="loc_sts" property="locSts" />
+ <result column="picking" property="picking" />
+ <result column="link_mis" property="linkMis" />
+ <result column="online_yn" property="onlineYn" />
+ <result column="upd_mk" property="updMk" />
+ <result column="exit_mk" property="exitMk" />
+ <result column="plt_type" property="pltType" />
+ <result column="empty_mk" property="emptyMk" />
+ <result column="io_time" property="ioTime" />
+ <result column="ctn_type" property="ctnType" />
+ <result column="packed" property="packed" />
+ <result column="ove_mk" property="oveMk" />
+ <result column="mtn_type" property="mtnType" />
+ <result column="user_no" property="userNo" />
+ <result column="crn_str_time" property="crnStrTime" />
+ <result column="crn_end_time" property="crnEndTime" />
+ <result column="plc_str_time" property="plcStrTime" />
+ <result column="crn_pos_time" property="crnPosTime" />
+ <result column="load_time" property="loadTime" />
+ <result column="exp_time" property="expTime" />
+ <result column="ref_wrkno" property="refWrkno" />
+ <result column="ref_iotime" property="refIotime" />
+ <result column="modi_user" property="modiUser" />
+ <result column="modi_time" property="modiTime" />
+ <result column="appe_user" property="appeUser" />
+ <result column="appe_time" property="appeTime" />
+ <result column="pause_mk" property="pauseMk" />
+ <result column="error_time" property="errorTime" />
+ <result column="error_memo" property="errorMemo" />
+ <result column="ctn_kind" property="ctnKind" />
+ <result column="manu_type" property="manuType" />
+ <result column="memo_m" property="memoM" />
+ <result column="sc_weight" property="scWeight" />
+ <result column="log_mk" property="logMk" />
+ <result column="log_err_time" property="logErrTime" />
+ <result column="log_err_memo" property="logErrMemo" />
+ <result column="barcode" property="barcode" />
+ <result column="Pdc_type" property="PdcType" />
+ <result column="ctn_no" property="ctnNo" />
+ <result column="full_plt" property="fullPlt" />
+ <result column="pre_have" property="preHave" />
+ <result column="take_none" property="takeNone" />
+ </resultMap>
+
+</mapper>
diff --git a/src/main/resources/mapper/WrkMastMapper.xml b/src/main/resources/mapper/WrkMastMapper.xml
index 466ae6d..0fa8d8a 100644
--- a/src/main/resources/mapper/WrkMastMapper.xml
+++ b/src/main/resources/mapper/WrkMastMapper.xml
@@ -195,7 +195,7 @@
<select id="selectShuttleMoveWrk" resultMap="BaseResultMap">
select * from dbo.asr_wrk_mast
where 1=1
- and wrk_sts in (101,103,105,107)
+ and wrk_sts in (101,103,105,107,109,111)
and io_type = 200
order by io_pri desc,io_time,wrk_no asc
</select>
diff --git a/src/main/webapp/views/lift.html b/src/main/webapp/views/lift.html
index 0de4eab..f6b281f 100644
--- a/src/main/webapp/views/lift.html
+++ b/src/main/webapp/views/lift.html
@@ -93,13 +93,28 @@
<div class="button-group">
<select id="liftLev">
<option value="1" selected>1F</option>
- <option value="3">2F</option>
- <option value="4">3F</option>
- <option value="5">4F</option>
- <option value="2">杈撻�佺嚎浣嶇疆</option>
+ <option value="2">2F</option>
+ <option value="3">3F</option>
+ <option value="4">4F</option>
+ <option value="5">5F</option>
+ <option value="6">6F</option>
+ <option value="7">7F</option>
+ <option value="8">8F</option>
+ <option value="9">9F</option>
+ <option value="10">10F</option>
</select>
<button class="item" onclick="liftOperator(1)">绉诲姩鎻愬崌鏈�</button>
- <button class="item" onclick="liftOperator(0)">澶嶄綅</button>
+
+ <div class="select-container-item">
+ <span>婧愮珯</span>
+ <label><input id="sourceStaNo" type="text" name="sourceStaNo" /></label>
+ </div>
+ <div class="select-container-item">
+ <span>鐩爣绔�</span>
+ <label><input id="staNo" type="text" name="staNo" /></label>
+ </div>
+ <button class="item" onclick="liftOperator(2)">绉诲姩鎵樼洏</button>
+<!-- <button class="item" onclick="liftOperator(0)">澶嶄綅</button>-->
</div>
</fieldset>
</div>
diff --git a/src/main/webapp/views/shuttle.html b/src/main/webapp/views/shuttle.html
index 1a882a4..34619db 100644
--- a/src/main/webapp/views/shuttle.html
+++ b/src/main/webapp/views/shuttle.html
@@ -120,6 +120,7 @@
<div style="margin-top: 10px;">
<button class="item" onclick="shuttleOperator(18)">鎼繍璐х墿</button>
<button class="item" onclick="shuttleOperator(14)">绉诲姩鍒扮洰鏍囧簱浣�</button>
+ <button class="item" onclick="shuttleOperator(23)">绉诲姩鍒扮洰鏍囧簱浣�(浠诲姟)</button>
<button class="item" onclick="shuttleOperator(16)">绉诲姩鍒版彁鍗囨満</button>
</div>
</div>
--
Gitblit v1.9.1