New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.RgvStatusType; |
| | | import com.zy.asrs.domain.param.RgvOperatorParam; |
| | | import com.zy.asrs.domain.vo.RgvMsgTableVo; |
| | | import com.zy.asrs.domain.vo.RgvStateTableVo; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.mapper.BasRgvErrMapper; |
| | | import com.zy.asrs.service.BasRgvService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.RgvModeType; |
| | | import com.zy.core.enums.RgvTaskModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.RgvSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.RgvThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * RGV接口 |
| | | * Created by vincent on 2020-06-01 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/rgv") |
| | | public class RgvController { |
| | | |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private BasRgvErrMapper basRgvErrMapper; |
| | | @Autowired |
| | | private BasRgvService basRgvService; |
| | | |
| | | @PostMapping("/table/rgv/state") |
| | | @ManagerAuth(memo = "RGV信息表") |
| | | public R rgvStateTable(){ |
| | | List<RgvStateTableVo> list = new ArrayList<>(); |
| | | List<BasRgv> rgvs = basRgvService.selectList(new EntityWrapper<BasRgv>().orderBy("rgv_no")); |
| | | for (BasRgv basRgv : rgvs) { |
| | | // 表格行 |
| | | RgvStateTableVo vo = new RgvStateTableVo(); |
| | | vo.setRgvNo(basRgv.getRgvNo()); // RGV号 |
| | | list.add(vo); |
| | | // 获取RGV信息 |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basRgv.getRgvNo()); |
| | | if (rgvThread == null) { |
| | | continue; |
| | | } |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | vo.setStatusType(rgvProtocol.modeType.desc); // 模式状态 |
| | | vo.setStatus(rgvProtocol.getStatusType().desc); // 状态 |
| | | vo.setWorkNo1(rgvProtocol.getTaskNo1()); // 工位1任务号 |
| | | vo.setStatus1(rgvProtocol.getStatusType1().desc); // 工位1状态 |
| | | vo.setLoading1(rgvProtocol.getLoaded1()==1?"有物":"无物"); // 工位1有物 |
| | | vo.setRgvPos(rgvProtocol.getRgvPos()); |
| | | vo.setRgvPos1(rgvProtocol.getRgvPosI()); |
| | | vo.setWalkPos(rgvProtocol.getWalkPos()==1?"在定位":"不在定位"); |
| | | vo.setPakMk(rgvThread.isPakMk()?"无锁":"锁定"); |
| | | // vo.setWorkNo2(rgvProtocol.getTaskNo2()); // 工位2任务号 |
| | | // vo.setStatus2(rgvProtocol.getStatusType2().desc); // 工位2状态 |
| | | // vo.setLoading2(rgvProtocol.getLoaded2()==1?"有物":"无物"); // 工位2有物 |
| | | |
| | | vo.setWarnCode(String.valueOf(rgvProtocol.getAlarm())); |
| | | if (rgvProtocol.getAlarm() > 0) { |
| | | BasRgvErr rgvErr = basRgvErrMapper.selectById(rgvProtocol.getAlarm()); |
| | | vo.setAlarm(rgvErr==null?"未知异常":rgvErr.getErrName()); |
| | | } |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/table/rgv/msg") |
| | | @ManagerAuth(memo = "RGV数据表") |
| | | public R rgvMsgTable(){ |
| | | List<RgvMsgTableVo> list = new ArrayList<>(); |
| | | List<BasRgv> rgvs = basRgvService.selectList(new EntityWrapper<BasRgv>().orderBy("rgv_no")); |
| | | for (BasRgv basRgv : rgvs) { |
| | | // 表格行 |
| | | RgvMsgTableVo vo = new RgvMsgTableVo(); |
| | | vo.setRgvNo(basRgv.getRgvNo()); // RGV号 |
| | | list.add(vo); |
| | | // 获取RGV信息 |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basRgv.getRgvNo()); |
| | | if (rgvThread == null) { |
| | | continue; |
| | | } |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | vo.setWorkNo(rgvProtocol.getTaskNo1()); // 任务号 |
| | | if (rgvProtocol.getTaskNo1()>0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(rgvProtocol.getTaskNo1()); |
| | | if (wrkMast != null) { |
| | | vo.setStatus(RgvStatusType.process(wrkMast.getIoType()).getDesc()); // 模式状态 |
| | | vo.setSourceStaNo(wrkMast.getSourceStaNo$()); // 源站 |
| | | vo.setStaNo(wrkMast.getStaNo$()); // 目标站 |
| | | vo.setSourceLocNo(wrkMast.getSourceLocNo()); // 源库位 |
| | | vo.setLocNo(wrkMast.getLocNo()); // 目标库位 |
| | | } |
| | | } else { |
| | | vo.setStatus(rgvProtocol.modeType.equals(RgvModeType.AUTO)? rgvProtocol.modeType.desc: RgvModeType.HAND.desc); // 模式状态 |
| | | } |
| | | vo.setXspeed(rgvProtocol.getXSpeed()); // 走行速度(m/min) |
| | | vo.setXdistance(rgvProtocol.getXDistance()); // 走行距离(Km) |
| | | vo.setXduration(rgvProtocol.getXDuration()); // 走行时长(H) |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/output/site") |
| | | @ManagerAuth(memo = "RGV报文日志输出") |
| | | public R rgvOutput(){ |
| | | StringBuilder str = new StringBuilder(); |
| | | String s; |
| | | int i = 0; |
| | | while((s = OutputQueue.RGV.poll()) != null && i <=10) { |
| | | str.append("\n").append(s); |
| | | i++; |
| | | } |
| | | return R.ok().add(str.toString()); |
| | | } |
| | | |
| | | /****************************************************************/ |
| | | /************************** 手动操作 ******************************/ |
| | | /****************************************************************/ |
| | | |
| | | @ManagerAuth(memo = "取放货") |
| | | @PostMapping("/operator/put") |
| | | public R rgvFetchPut(RgvOperatorParam param){ |
| | | RgvCommand command = new RgvCommand(); |
| | | command.setRgvNo(param.getRgvNo()); // RGV编号 |
| | | command.setAckFinish1((short) 0); // 任务完成确认位 |
| | | command.setTaskNo1((short) 0); // 工作号 |
| | | command.setTaskMode1(RgvTaskModeType.FETCH_PUT); // 任务模式: 取放货 |
| | | command.setSourceStaNo1(param.getSourceStaNo()); // 源站 |
| | | command.setDestinationStaNo1(param.getStaNo()); // 目标站 |
| | | command.setCommand((short) 0); |
| | | |
| | | return rgvControl(command)? R.ok(): R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "取货") |
| | | @PostMapping("/operator/take") |
| | | public R rgvFetch(RgvOperatorParam param){ |
| | | RgvCommand command = new RgvCommand(); |
| | | command.setRgvNo(param.getRgvNo()); // RGV编号 |
| | | command.setAckFinish1((short) 0); // 任务完成确认位 |
| | | command.setTaskNo1((short) 0); // 工作号 |
| | | command.setTaskMode1(RgvTaskModeType.FETCH); // 任务模式: 取货 |
| | | command.setSourceStaNo1(param.getSourceStaNo()); // 源站 |
| | | command.setDestinationStaNo1(param.getStaNo()); // 目标站 |
| | | command.setCommand((short) 0); |
| | | |
| | | return rgvControl(command)? R.ok(): R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "放货") |
| | | @PostMapping("/operator/stockMove") |
| | | public R rgvPut(RgvOperatorParam param){ |
| | | RgvCommand command = new RgvCommand(); |
| | | command.setRgvNo(param.getRgvNo()); // RGV编号 |
| | | command.setAckFinish1((short) 0); // 任务完成确认位 |
| | | command.setTaskNo1((short) 0); // 工作号 |
| | | command.setTaskMode1(RgvTaskModeType.PUT); // 任务模式: 放货 |
| | | command.setSourceStaNo1(param.getSourceStaNo()); // 源站 |
| | | command.setDestinationStaNo1(param.getStaNo()); // 目标站 |
| | | command.setCommand((short) 0); |
| | | |
| | | return rgvControl(command)? R.ok(): R.error(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ManagerAuth(memo = "任务完成") |
| | | @PostMapping("/operator/taskComplete") |
| | | public R rgvTaskComplete(RgvOperatorParam param){ |
| | | RgvCommand command = new RgvCommand(); |
| | | command.setRgvNo(param.getRgvNo()); // RGV编号 |
| | | command.setAckFinish1((short) 1); // 任务完成确认位 |
| | | command.setTaskNo1((short) 0); // 工作号 |
| | | command.setTaskMode1(RgvTaskModeType.NONE); // 任务模式 |
| | | command.setSourceStaNo1((short) 0); // 源站 |
| | | command.setDestinationStaNo1((short) 0); // 目标站 |
| | | command.setCommand((short) 0); |
| | | |
| | | return rgvControl(command)? R.ok(): R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "清除命令") |
| | | @PostMapping("/operator/clearCommand") |
| | | public R rgvClearCommand(RgvOperatorParam param){ |
| | | if (param.getRgvNo() == null) { |
| | | throw new CoolException("请选择RGV号"); |
| | | } |
| | | RgvCommand command = new RgvCommand(); |
| | | command.setRgvNo(param.getRgvNo()); // RGV编号 |
| | | command.setAckFinish1((short) 0); // 任务完成确认位 |
| | | command.setTaskNo1((short) 0); // 工作号 |
| | | command.setTaskMode1(RgvTaskModeType.NONE); // 任务模式 |
| | | command.setSourceStaNo1((short) 0); // 源站 |
| | | command.setDestinationStaNo1((short) 0); // 目标站 |
| | | command.setCommand((short) 0); |
| | | |
| | | return rgvControl(command)? R.ok(): R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "手动复位") |
| | | @PostMapping("/operator/handleReset") |
| | | public R handleReset(RgvOperatorParam param) throws Exception { |
| | | if (param.getRgvNo() == null) { |
| | | throw new CoolException("请选择RGV"); |
| | | } |
| | | // 获取RGV缓存 |
| | | for (RgvSlave rgv : slaveProperties.getRgv()) { |
| | | // 获取RGV信息 |
| | | if (param.getRgvNo().equals(rgv.getId())) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId()); |
| | | if (rgvThread == null) { |
| | | throw new CoolException("RGV不在线"); |
| | | } |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | throw new CoolException("RGV不在线"); |
| | | } |
| | | RgvCommand Command = new RgvCommand(); |
| | | Command.setRgvNo(rgv.getId()); // RGV编号 |
| | | Command.setTaskMode1(RgvTaskModeType.NONE); |
| | | Command.setAckFinish1((short) 0); // 任务完成确认位 |
| | | Command.setCommand((short) 0); // 任务完成确认位 |
| | | // 延时发送 |
| | | Thread.sleep(1000L); |
| | | if (MessageQueue.offer(SlaveType.Rgv, rgv.getId(), new Task(4, Command))) { |
| | | return R.ok(); |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.error(); |
| | | } |
| | | |
| | | private boolean rgvControl(RgvCommand command){ |
| | | if (command.getRgvNo() == null) { |
| | | throw new CoolException("请选择RGV"); |
| | | } |
| | | for (RgvSlave rgv : slaveProperties.getRgv()) { |
| | | // 获取RGV信息 |
| | | if (command.getRgvNo().equals(rgv.getId())) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId()); |
| | | if (rgvThread == null) { |
| | | throw new CoolException("RGV不在线"); |
| | | } |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | throw new CoolException("RGV不在线"); |
| | | } |
| | | if (MessageQueue.offer(SlaveType.Rgv, rgv.getId(), new Task(4, command))) { |
| | | return true; |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | /** |
| | | * RGV状态枚举 |
| | | */ |
| | | public enum RgvStatusType { |
| | | |
| | | // 入库 |
| | | MACHINE_PAKIN("入库"), |
| | | // 出库 |
| | | MACHINE_PAKOUT("出库"), |
| | | // 异常 |
| | | MACHINE_ERROR("异常"), |
| | | // 自动 |
| | | MACHINE_AUTO("自动"), |
| | | // 非自动/手动 |
| | | MACHINE_UN_AUTO("非自动"), |
| | | ; |
| | | |
| | | private String desc; |
| | | RgvStatusType(String desc){ |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public void setDesc(String desc) { |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static RgvStatusType process(Integer ioType){ |
| | | if (ioType>100) { |
| | | return MACHINE_PAKOUT; |
| | | } else if (ioType < 100 && ioType!=3 && ioType!=6 && ioType!=11) { |
| | | return MACHINE_PAKIN; |
| | | } else { |
| | | return MACHINE_ERROR; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class RgvOperatorParam { |
| | | |
| | | // RGV号 |
| | | private Integer rgvNo; |
| | | |
| | | // 工位1源站 |
| | | private Short sourceStaNo; |
| | | |
| | | // 工位1目标站 |
| | | private Short staNo; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import com.zy.asrs.utils.Utils; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class RgvMsgTableVo { |
| | | |
| | | // RGV号 |
| | | private Integer rgvNo; |
| | | |
| | | // 工作号 |
| | | private Short workNo = 0; |
| | | |
| | | // 状态 |
| | | private String status = "-"; |
| | | |
| | | // 源站 |
| | | private String sourceStaNo = "-"; |
| | | |
| | | // 目标站 |
| | | private String staNo = "-"; |
| | | |
| | | // 源库位 |
| | | private String sourceLocNo = "-"; |
| | | |
| | | // 目标库位 |
| | | private String locNo = "-"; |
| | | |
| | | // 异常 |
| | | private String error = ""; |
| | | |
| | | // 原点 |
| | | private String origin = ""; |
| | | |
| | | // 命令 |
| | | private String command = ""; |
| | | |
| | | // 走行速度(m/min) |
| | | private Float xspeed = 0.0F; |
| | | |
| | | // 走行距离(Km) |
| | | private Float xdistance = 0.0F; |
| | | |
| | | // 走行时长(H) |
| | | private Float xduration = 0.0F; |
| | | |
| | | public void setXspeed(Float xspeed) { |
| | | this.xspeed = Utils.scale(xspeed); |
| | | } |
| | | |
| | | public void setXdistance(Float xdistance) { |
| | | this.xdistance = Utils.scale(xdistance); |
| | | } |
| | | |
| | | public void setXduration(Float xduration) { |
| | | this.xduration = Utils.scale(xduration); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class RgvStateTableVo { |
| | | |
| | | // RGV号 |
| | | private Integer RgvNo; |
| | | |
| | | // 模式 |
| | | private String statusType = "-"; |
| | | |
| | | // 状态 |
| | | private String status = "-"; |
| | | |
| | | // 任务号 |
| | | private Short workNo1 = 0; |
| | | |
| | | // 状态 |
| | | private String status1 = "-"; |
| | | |
| | | // 有物 |
| | | private String loading1 = "-"; |
| | | |
| | | // RGV位置 |
| | | private Short RgvPos = 0; |
| | | |
| | | // 走行定位 |
| | | private String walkPos = "-"; |
| | | |
| | | // 任务号 |
| | | private Short workNo2 = 0; |
| | | |
| | | // 状态 |
| | | private String status2 = "-"; |
| | | |
| | | // 有物 |
| | | private String loading2 = "-"; |
| | | |
| | | //异常 |
| | | private String warnCode; |
| | | |
| | | // 异常码描述 |
| | | private String alarm = "-"; |
| | | private Integer RgvPos1 = 0; |
| | | |
| | | private String pakMk="-"; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_bas_rgv") |
| | | public class BasRgv implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * RGV编号 |
| | | */ |
| | | @ApiModelProperty(value= "RGV编号") |
| | | @TableId(value = "rgv_no", type = IdType.INPUT) |
| | | @TableField("rgv_no") |
| | | private Integer rgvNo; |
| | | |
| | | /** |
| | | * 可入 |
| | | */ |
| | | @ApiModelProperty(value= "可入") |
| | | @TableField("in_enable") |
| | | private Integer inEnable; |
| | | |
| | | /** |
| | | * 可出 |
| | | */ |
| | | @ApiModelProperty(value= "可出") |
| | | @TableField("out_enable") |
| | | private Integer outEnable; |
| | | |
| | | /** |
| | | * 作业态 |
| | | */ |
| | | @ApiModelProperty(value= "作业态") |
| | | @TableField("rgv_sts") |
| | | private Integer rgvSts; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | @ApiModelProperty(value= "任务号") |
| | | @TableField("wrk_no1") |
| | | private Integer wrkNo1; |
| | | |
| | | /** |
| | | * 堆垛机号 |
| | | */ |
| | | @ApiModelProperty(value= "堆垛机号") |
| | | @TableField("wrk_no2") |
| | | private Integer wrkNo2; |
| | | |
| | | /** |
| | | * 错误码 |
| | | */ |
| | | @ApiModelProperty(value= "错误码") |
| | | @TableField("rgv_err") |
| | | private Long rgvErr; |
| | | |
| | | /** |
| | | * 标记 |
| | | */ |
| | | @ApiModelProperty(value= "标记") |
| | | @TableField("pak_mk") |
| | | private String pakMk; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public BasRgv() {} |
| | | |
| | | public BasRgv(Integer rgvNo,Integer inEnable,Integer outEnable,Integer rgvSts,Integer wrkNo1,Integer wrkNo2,Long rgvErr,String pakMk,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.rgvNo = rgvNo; |
| | | this.inEnable = inEnable; |
| | | this.outEnable = outEnable; |
| | | this.rgvSts = rgvSts; |
| | | this.wrkNo1 = wrkNo1; |
| | | this.wrkNo2 = wrkNo2; |
| | | this.rgvErr = rgvErr; |
| | | this.pakMk = pakMk; |
| | | this.status = status; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // BasRgv basRgv = new BasRgv( |
| | | // null, // RGV编号[非空] |
| | | // null, // 可入 |
| | | // null, // 可出 |
| | | // null, // 作业态 |
| | | // null, // 任务号 |
| | | // null, // 堆垛机号 |
| | | // null, // 错误码 |
| | | // null, // 标记 |
| | | // null, // 状态 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_bas_rgv_err") |
| | | public class BasRgvErr implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 异常码 |
| | | */ |
| | | @ApiModelProperty(value= "异常码") |
| | | @TableId(value = "error_code", type = IdType.INPUT) |
| | | @TableField("error_code") |
| | | private Long errorCode; |
| | | |
| | | /** |
| | | * 异常 |
| | | */ |
| | | @ApiModelProperty(value= "异常") |
| | | @TableField("err_name") |
| | | private String errName; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | public BasRgvErr() {} |
| | | |
| | | public BasRgvErr(Long errorCode,String errName,Long modiUser,Date modiTime,Long appeUser,Date appeTime) { |
| | | this.errorCode = errorCode; |
| | | this.errName = errName; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | } |
| | | |
| | | // BasRgvErr basRgvErr = new BasRgvErr( |
| | | // null, // 异常码[非空] |
| | | // null, // 异常 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 添加人员 |
| | | // null // 添加时间 |
| | | // ); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_bas_rgv_opt") |
| | | public class BasRgvOpt implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | @ApiModelProperty(value= "任务号") |
| | | @TableField("wrk_no1") |
| | | private Integer wrkNo1; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("wrk_no2") |
| | | private Integer wrkNo2; |
| | | |
| | | /** |
| | | * 穿梭车 |
| | | */ |
| | | @ApiModelProperty(value= "穿梭车") |
| | | @TableField("rgv_no") |
| | | private Integer rgvNo; |
| | | |
| | | /** |
| | | * 下发时间 |
| | | */ |
| | | @ApiModelProperty(value= "下发时间") |
| | | @TableField("send_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date sendTime; |
| | | |
| | | /** |
| | | * 作业 |
| | | */ |
| | | @ApiModelProperty(value= "作业") |
| | | private String mode; |
| | | |
| | | /** |
| | | * 源排 |
| | | */ |
| | | @ApiModelProperty(value= "源排") |
| | | @TableField("source_row") |
| | | private Integer sourceRow; |
| | | |
| | | /** |
| | | * 源列 |
| | | */ |
| | | @ApiModelProperty(value= "源列") |
| | | @TableField("source_bay") |
| | | private Integer sourceBay; |
| | | |
| | | /** |
| | | * 源层 |
| | | */ |
| | | @ApiModelProperty(value= "源层") |
| | | @TableField("source_lev") |
| | | private Integer sourceLev; |
| | | |
| | | /** |
| | | * 源站 |
| | | */ |
| | | @ApiModelProperty(value= "源站") |
| | | @TableField("source_sta") |
| | | private Integer sourceSta; |
| | | |
| | | /** |
| | | * 目标排 |
| | | */ |
| | | @ApiModelProperty(value= "目标排") |
| | | @TableField("pos_row") |
| | | private Integer posRow; |
| | | |
| | | /** |
| | | * 目标列 |
| | | */ |
| | | @ApiModelProperty(value= "目标列") |
| | | @TableField("pos_bay") |
| | | private Integer posBay; |
| | | |
| | | /** |
| | | * 目标层 |
| | | */ |
| | | @ApiModelProperty(value= "目标层") |
| | | @TableField("pos_lev") |
| | | private Integer posLev; |
| | | |
| | | /** |
| | | * 目标站 |
| | | */ |
| | | @ApiModelProperty(value= "目标站") |
| | | @TableField("pos_sta") |
| | | private Integer posSta; |
| | | |
| | | /** |
| | | * 响应结果 1: 正常 0: 失败 |
| | | */ |
| | | @ApiModelProperty(value= "响应结果 1: 正常 0: 失败 ") |
| | | private Integer response; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | public BasRgvOpt() {} |
| | | |
| | | public BasRgvOpt(Integer wrkNo1,Integer wrkNo2,Integer rgvNo,Date sendTime,String mode,Integer sourceRow,Integer sourceBay,Integer sourceLev,Integer sourceSta,Integer posRow,Integer posBay,Integer posLev,Integer posSta,Integer response,Date updateTime,Long updateBy,String memo) { |
| | | this.wrkNo1 = wrkNo1; |
| | | this.wrkNo2 = wrkNo2; |
| | | this.rgvNo = rgvNo; |
| | | this.sendTime = sendTime; |
| | | this.mode = mode; |
| | | this.sourceRow = sourceRow; |
| | | this.sourceBay = sourceBay; |
| | | this.sourceLev = sourceLev; |
| | | this.sourceSta = sourceSta; |
| | | this.posRow = posRow; |
| | | this.posBay = posBay; |
| | | this.posLev = posLev; |
| | | this.posSta = posSta; |
| | | this.response = response; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public BasRgvOpt(Integer wrkNo1, Integer wrkNo2, Integer rgvNo, Date sendTime, String mode, Integer sourceSta, Integer posSta, Integer sourceRow, Integer posRow, Integer response, Date updateTime, Long updateBy) { |
| | | this.wrkNo1 = wrkNo1; |
| | | this.wrkNo2 = wrkNo2; |
| | | this.rgvNo = rgvNo; |
| | | this.sendTime = sendTime; |
| | | this.mode = mode; |
| | | this.sourceSta = sourceSta; |
| | | this.posSta = posSta; |
| | | this.sourceRow = sourceRow; |
| | | this.posRow = posRow; |
| | | this.response = response; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | // BasRgvOpt basRgvOpt = new BasRgvOpt( |
| | | // null, // 任务号 |
| | | // null, // |
| | | // null, // 穿梭车 |
| | | // null, // 下发时间 |
| | | // null, // 作业 |
| | | // null, // 源排 |
| | | // null, // 源列 |
| | | // null, // 源层 |
| | | // null, // 源站 |
| | | // null, // 目标排 |
| | | // null, // 目标列 |
| | | // null, // 目标层 |
| | | // null, // 目标站 |
| | | // null, // 响应结果 |
| | | // null, // 修改时间 |
| | | // null, // 修改人员 |
| | | // null, // 备注 |
| | | |
| | | // ); |
| | | |
| | | public String getSendTime$(){ |
| | | if (Cools.isEmpty(this.sendTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.sendTime); |
| | | } |
| | | |
| | | public String getResponse$(){ |
| | | if (null == this.response){ return null; } |
| | | switch (this.response){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "失败"; |
| | | default: |
| | | return String.valueOf(this.response); |
| | | } |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_wrk_mast_log") |
| | | public class WrkMastLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工作号 |
| | | */ |
| | | @ApiModelProperty(value= "工作号") |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("inv_wh") |
| | | private String invWh; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date ymd; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String mk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("whs_type") |
| | | private Integer whsType; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @ApiModelProperty(value= "工作状态") |
| | | @TableField("wrk_sts") |
| | | private Integer wrkSts; |
| | | |
| | | /** |
| | | * 入出库类型 |
| | | */ |
| | | @ApiModelProperty(value= "入出库类型") |
| | | @TableField("io_type") |
| | | private Integer ioType; |
| | | |
| | | /** |
| | | * 堆垛机号 |
| | | */ |
| | | @ApiModelProperty(value= "堆垛机号") |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("sheet_no") |
| | | private String sheetNo; |
| | | |
| | | /** |
| | | * 优先级 |
| | | */ |
| | | @ApiModelProperty(value= "优先级") |
| | | @TableField("io_pri") |
| | | private Double ioPri; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("wrk_date") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | 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; |
| | | |
| | | /** |
| | | * 拣料(checkBox) |
| | | */ |
| | | @ApiModelProperty(value= "拣料(checkBox)") |
| | | 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; |
| | | |
| | | /** |
| | | * 退出(checkBox) |
| | | */ |
| | | @ApiModelProperty(value= "退出(checkBox)") |
| | | @TableField("exit_mk") |
| | | private String exitMk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("plt_type") |
| | | private Integer pltType; |
| | | |
| | | /** |
| | | * 空板(checkBox) |
| | | */ |
| | | @ApiModelProperty(value= "空板(checkBox)") |
| | | @TableField("empty_mk") |
| | | private String emptyMk; |
| | | |
| | | /** |
| | | * 工作时间 |
| | | */ |
| | | @ApiModelProperty(value= "工作时间") |
| | | @TableField("io_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | 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") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date crnStrTime; |
| | | |
| | | /** |
| | | * 堆垛机停止时间 |
| | | */ |
| | | @ApiModelProperty(value= "堆垛机停止时间") |
| | | @TableField("crn_end_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date crnEndTime; |
| | | |
| | | /** |
| | | * 拣料时间 |
| | | */ |
| | | @ApiModelProperty(value= "拣料时间") |
| | | @TableField("plc_str_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date plcStrTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("crn_pos_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | 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") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date refIotime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value= "创建者") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("pause_mk") |
| | | private String pauseMk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("error_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | 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") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | 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; |
| | | |
| | | /** |
| | | * 满板(checkBox) |
| | | */ |
| | | @ApiModelProperty(value= "满板(checkBox)") |
| | | @TableField("full_plt") |
| | | private String fullPlt; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("pre_have") |
| | | private String preHave; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("take_none") |
| | | private String takeNone; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("line_number") |
| | | private Long lineNumber; |
| | | |
| | | public WrkMastLog() {} |
| | | |
| | | public WrkMastLog(Integer wrkNo,String invWh,Date ymd,String mk,Integer whsType,Integer wrkSts,Integer ioType,Integer crnNo,String sheetNo,Double ioPri,Date wrkDate,String locNo,Integer staNo,Integer sourceStaNo,String sourceLocNo,String locSts,String picking,String linkMis,String onlineYn,String updMk,String exitMk,Integer pltType,String emptyMk,Date ioTime,Integer ctnType,String packed,String oveMk,Double mtnType,String userNo,Date crnStrTime,Date crnEndTime,Date plcStrTime,Date crnPosTime,Double loadTime,Double expTime,Double refWrkno,Date refIotime,Long modiUser,Date modiTime,Long appeUser,Date appeTime,String pauseMk,Date errorTime,String errorMemo,Integer ctnKind,String manuType,String memoM,Double scWeight,String logMk,Date logErrTime,String logErrMemo,String barcode,String PdcType,String ctnNo,String fullPlt,String preHave,String takeNone,Long lineNumber) { |
| | | this.wrkNo = wrkNo; |
| | | this.invWh = invWh; |
| | | this.ymd = ymd; |
| | | this.mk = mk; |
| | | this.whsType = whsType; |
| | | this.wrkSts = wrkSts; |
| | | this.ioType = ioType; |
| | | this.crnNo = crnNo; |
| | | this.sheetNo = sheetNo; |
| | | this.ioPri = ioPri; |
| | | this.wrkDate = wrkDate; |
| | | this.locNo = locNo; |
| | | this.staNo = staNo; |
| | | this.sourceStaNo = sourceStaNo; |
| | | this.sourceLocNo = sourceLocNo; |
| | | this.locSts = locSts; |
| | | this.picking = picking; |
| | | this.linkMis = linkMis; |
| | | this.onlineYn = onlineYn; |
| | | this.updMk = updMk; |
| | | this.exitMk = exitMk; |
| | | this.pltType = pltType; |
| | | this.emptyMk = emptyMk; |
| | | this.ioTime = ioTime; |
| | | this.ctnType = ctnType; |
| | | this.packed = packed; |
| | | this.oveMk = oveMk; |
| | | this.mtnType = mtnType; |
| | | this.userNo = userNo; |
| | | this.crnStrTime = crnStrTime; |
| | | this.crnEndTime = crnEndTime; |
| | | this.plcStrTime = plcStrTime; |
| | | this.crnPosTime = crnPosTime; |
| | | this.loadTime = loadTime; |
| | | this.expTime = expTime; |
| | | this.refWrkno = refWrkno; |
| | | this.refIotime = refIotime; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | this.pauseMk = pauseMk; |
| | | this.errorTime = errorTime; |
| | | this.errorMemo = errorMemo; |
| | | this.ctnKind = ctnKind; |
| | | this.manuType = manuType; |
| | | this.memoM = memoM; |
| | | this.scWeight = scWeight; |
| | | this.logMk = logMk; |
| | | this.logErrTime = logErrTime; |
| | | this.logErrMemo = logErrMemo; |
| | | this.barcode = barcode; |
| | | this.PdcType = PdcType; |
| | | this.ctnNo = ctnNo; |
| | | this.fullPlt = fullPlt; |
| | | this.preHave = preHave; |
| | | this.takeNone = takeNone; |
| | | this.lineNumber = lineNumber; |
| | | } |
| | | |
| | | // WrkMastLog wrkMastLog = new WrkMastLog( |
| | | // null, // 工作号[非空] |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // 工作状态 |
| | | // null, // 入出库类型 |
| | | // null, // 堆垛机号 |
| | | // null, // |
| | | // null, // 优先级 |
| | | // null, // |
| | | // null, // 目标库位 |
| | | // null, // 目标站 |
| | | // null, // 源站 |
| | | // null, // 源库位 |
| | | // null, // |
| | | // null, // 拣料(checkBox) |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // 退出(checkBox) |
| | | // null, // |
| | | // null, // 空板(checkBox) |
| | | // null, // 工作时间 |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // 堆垛机启动时间 |
| | | // null, // 堆垛机停止时间 |
| | | // null, // 拣料时间 |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 创建者 |
| | | // null, // 添加时间 |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // 条码 |
| | | // null, // |
| | | // null, // |
| | | // null, // 满板(checkBox) |
| | | // null, // |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasRgvErrMapper extends BaseMapper<BasRgvErr> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasRgvMapper extends BaseMapper<BasRgv> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasRgvOptMapper extends BaseMapper<BasRgvOpt> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WrkMastLogMapper extends BaseMapper<WrkMastLog> { |
| | | |
| | | @Insert("insert into asr_wrk_mast_log select * from asr_wrk_mast where wrk_no=#{workNo}") |
| | | int save(Integer workNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasRgvErrService extends IService<BasRgvErr> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasRgvOptService extends IService<BasRgvOpt> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasRgvService extends IService<BasRgv> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface WrkMastLogService extends IService<WrkMastLog> { |
| | | |
| | | boolean save(Integer workNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasRgvErrMapper; |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.zy.asrs.service.BasRgvErrService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basRgvErrService") |
| | | public class BasRgvErrServiceImpl extends ServiceImpl<BasRgvErrMapper, BasRgvErr> implements BasRgvErrService { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasRgvOptMapper; |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.zy.asrs.service.BasRgvOptService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basRgvOptService") |
| | | public class BasRgvOptServiceImpl extends ServiceImpl<BasRgvOptMapper, BasRgvOpt> implements BasRgvOptService { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.BasRgvMapper; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.asrs.service.BasRgvService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basRgvService") |
| | | public class BasRgvServiceImpl extends ServiceImpl<BasRgvMapper, BasRgv> implements BasRgvService { |
| | | |
| | | } |
| | |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.*; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WrkMastLogService wrkMastLogService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | if (inSta.getStaNo() == 1005) { |
| | | //检测是否有出库任务 |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 101, 103, 107) |
| | | .in("sta_no", 1003, 1007) |
| | | ); |
| | | if (!wrkMasts.isEmpty()) { |
| | | News.error(""+mark+" - 4"+" - 1003站入库,检测存在出库任务,等待出库任务执行完成,托盘码={}", barcode); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | try { |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | if (wrkMast.getStaNo() == 1003 || wrkMast.getStaNo() == 1007) { |
| | | //检测是否有入库任务 |
| | | List<WrkMast> inWrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 1, 53, 57) |
| | | .in("source_sta_no", 1005) |
| | | ); |
| | | if (!inWrkMasts.isEmpty()) { |
| | | News.error("" + mark + " - 2" + " - 检测存在入库任务,等待入库任务执行完成再出库,工作号={}" + wrkMast.getWrkNo()); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | // // 入出库模式判断 |
| | | // if (devpThread.ioMode != IoModeType.PAKOUT_MODE) { continue; } |
| | | // if (wrkMast.getStaNo() == 204 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) { |
| | |
| | | * 执行对工作档的完成操作 |
| | | */ |
| | | public synchronized void storeFinished(Integer mark) { |
| | | |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 入出库模式切换函数 |
| | | */ |
| | | public synchronized void ioConvert() { |
| | | try { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | // RGV ===>> 执行对RGV操作 |
| | | public synchronized void rgvExecute(Integer mark) { |
| | | ArrayList<Integer> list = new ArrayList<Integer>(){{add(1090);add(1091);}}; |
| | | for (Integer staNo : list) { |
| | | Integer devpId = null; |
| | | Integer rgvStaNo = null; |
| | | if (staNo == 1090) { |
| | | devpId = 1; |
| | | rgvStaNo = 1091; |
| | | }else { |
| | | devpId = 2; |
| | | rgvStaNo = 1090; |
| | | } |
| | | |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | if (inSta.getStaNo() == 2) { |
| | | continue; |
| | | } |
| | | WrkMast pakout = wrkMastMapper.selectWorkingPakout(inSta.getStaNo()); |
| | | switch (inSta.getStaNo()) { |
| | | case 101://1F |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf2F = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | && !devpThread.getStation().get(inSta.getStaNo() + 1).isLoading() |
| | | && devpThread.getStation().get(inSta.getStaNo() + 1).getWorkNo() == 0) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf2F = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf2F = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | } |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devpId); |
| | | if (devpThread == null) { |
| | | continue; |
| | | } |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.getWorkNo() > 0 |
| | | ) { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("wrk_no", staProtocol.getWorkNo())); |
| | | if (wrkMast.getWrkSts() == 201) { |
| | | continue; |
| | | } |
| | | |
| | | } |
| | | RgvCommand command = new RgvCommand(); |
| | | command.setRgvNo(1); // RGV编号 |
| | | command.setAckFinish1((short) 0); // 任务完成确认位 |
| | | command.setTaskNo1(wrkMast.getWrkNo().shortValue()); // 工作号 |
| | | command.setTaskMode1(RgvTaskModeType.FETCH_PUT); // 任务模式: 取放货 |
| | | command.setSourceStaNo1(staNo.shortValue()); // 源站 |
| | | command.setDestinationStaNo1(rgvStaNo.shortValue()); // 目标站 |
| | | command.setCommand((short) 0); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public synchronized void outOfDevp(Integer mark) { |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastMapper.selectPick(); |
| | | if (wrkMasts.size()!=0){ |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行outOfDevp"); |
| | | } |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | if (basDevpService.selectCount(new EntityWrapper<BasDevp>().eq("wrk_no", wrkMast.getWrkNo())) == 0) { |
| | | wrkMast.setCtnNo("Y"); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | News.error(""+mark+" - 1"+" - 修改{}工作档失败,ctn_no", wrkMast.getWrkNo()); |
| | | boolean result = MessageQueue.offer(SlaveType.Rgv, 1, new Task(4, command)); |
| | | if (!result) { |
| | | throw new CoolException("RGV指令下发失败"); |
| | | } |
| | | |
| | | wrkMast.setWrkSts(201L);//201.RGV搬运中 |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | } |
| | | News.infoNoLog(""+mark+" - 0"+" - outOfDevp执行完成"); |
| | | } |
| | | |
| | | |
| | | public synchronized void autoEmptyOut() { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | Integer autoOutSite = 12; |
| | | //如果站点可出禁用,则不生成空盘出库任务 |
| | | StaProtocol staProtocol = devpThread.getStation().get(autoOutSite); |
| | | if (staProtocol == null) { |
| | | return; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() //自动 |
| | | && !staProtocol.isLoading() //无物 |
| | | && staProtocol.isOutEnable() //可出信号 |
| | | && staProtocol.getWorkNo() == 0 |
| | | ) { |
| | | WrkMast pakoutEmpty = wrkMastMapper.selectPakoutEmpty(autoOutSite); |
| | | if (null != pakoutEmpty) { |
| | | return; |
| | | // RGV ===>> 执行对RGV工作档的完成操作 |
| | | public synchronized void rgvFinished(Integer mark) { |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | // 获取RGV信息 |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | if (rgvThread == null) { |
| | | continue; |
| | | } |
| | | try { |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/auto/emptyOut/v1") |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | JSONObject data = (JSONObject) jsonObject.get("data"); |
| | | News.info((String) data.get("msg")); |
| | | |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | // 状态:等待确认 并且 任务完成位 = 1 |
| | | if (rgvProtocol.statusType == RgvStatusType.WAITING && rgvProtocol.getTaskNo1() != 0) { |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行对RGV工作档的完成操作"); |
| | | // 获取入库待确认工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep3(rgvProtocol.getTaskNo1().intValue()); |
| | | if (wrkMast == null) { |
| | | News.error(""+mark+" - 1"+" - RGV处于等待确认且任务完成状态,但未找到工作档。RGV号={},工作号={}", rgvSlave.getId(), rgvProtocol.getTaskNo1()); |
| | | continue; |
| | | } |
| | | |
| | | if (Cools.isEmpty(wrkMast.getMemo())) { |
| | | News.error(""+mark+" - 1"+" - RGV处于等待确认且任务完成状态,但工作档数据异常。RGV号={},工作号={}", rgvSlave.getId(), rgvProtocol.getTaskNo1()); |
| | | continue; |
| | | } |
| | | |
| | | Integer devpId = null; |
| | | Integer devpStaNo = null; |
| | | String locNo = null; |
| | | if (wrkMast.getIoType() < 100) { |
| | | //入库 |
| | | wrkMast.setWrkSts(2L); |
| | | devpId = 1; |
| | | devpStaNo = 1090; |
| | | locNo = wrkMast.getLocNo(); |
| | | }else { |
| | | //出库 |
| | | wrkMast.setWrkSts(15L); |
| | | devpId = 2; |
| | | devpStaNo = 1091; |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | } |
| | | |
| | | // 获取入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devpId); |
| | | StaProtocol staProtocol = devpThread.getStation().get(devpStaNo); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1","", response); |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.getWorkNo() == 0 |
| | | ) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", locNo)); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); |
| | | staProtocol.setPalletSize(locMast.getLocType2()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpId, new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | wrkMast.setModiTime(now); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | } |
| | | } |
| | | News.infoNoLog(""+mark+" - 0"+" - 对工作档的完成操作执行完成"); |
| | | } |
| | | |
| | | public synchronized void autoEmptyIn() { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | Integer autoInSite = 12; |
| | | StaProtocol staProtocol = devpThread.getStation().get(autoInSite); |
| | | if (staProtocol == null) { |
| | | return; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() //自动 |
| | | && staProtocol.isLoading() //有物 |
| | | && staProtocol.isInEnable() //可入信号 |
| | | && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) //工作号为0或者工作号是9991~9999(输送机留用) |
| | | ) { |
| | | |
| | | try { |
| | | LocTypeDto locTypeDto = new LocTypeDto((short) 1, (short) 1, (short) 1); |
| | | |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/auto/emptyIn/v1") |
| | | .setJson(JSON.toJSONString(locTypeDto)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | News.info((String) jsonObject.get("msg")); |
| | | } else { |
| | | News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyIn/v1", JSON.toJSONString(locTypeDto), response); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | } |
| | | // /** |
| | | // * 入出库模式切换函数 |
| | | // */ |
| | | // public synchronized void ioConvert() { |
| | | // try { |
| | | // // 根据输送线plc遍历 |
| | | // for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | // |
| | | // for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | // if (inSta.getStaNo() == 2) { |
| | | // continue; |
| | | // } |
| | | // WrkMast pakout = wrkMastMapper.selectWorkingPakout(inSta.getStaNo()); |
| | | // switch (inSta.getStaNo()) { |
| | | // case 101://1F |
| | | // if (pakout != null) { |
| | | // if (devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) { |
| | | // // 出库切换中 |
| | | // devpThread.ioModeOf2F = IoModeType.PAKOUT_BOOTING; |
| | | // WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); |
| | | // if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() |
| | | // && !devpThread.getStation().get(inSta.getStaNo() + 1).isLoading() |
| | | // && devpThread.getStation().get(inSta.getStaNo() + 1).getWorkNo() == 0) { |
| | | // // 出库模式 |
| | | // devpThread.ioModeOf2F = IoModeType.PAKOUT_MODE; |
| | | // } |
| | | // } |
| | | // } else { |
| | | // // 入库模式 |
| | | // devpThread.ioModeOf2F = IoModeType.PAKIN_MODE; |
| | | // } |
| | | // break; |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // |
| | | // |
| | | // } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.zy.asrs.service.WrkMastLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("wrkMastLogService") |
| | | public class WrkMastLogServiceImpl extends ServiceImpl<WrkMastLogMapper, WrkMastLog> implements WrkMastLogService { |
| | | |
| | | @Override |
| | | public boolean save(Integer workNo) { |
| | | return this.baseMapper.save(workNo) > 0; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.common; |
| | | |
| | | import com.core.generators.CoolGenerator; |
| | | import com.core.generators.constant.SqlOsType; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-04 |
| | |
| | | // generator.password="xltys1995"; |
| | | // generator.table="sys_host"; |
| | | // sqlserver |
| | | generator.url="192.168.3.208:1433;databasename=cool"; |
| | | generator.url="127.0.0.1:1433;databasename=ytflasrs"; |
| | | generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="asr_wrk_detl"; |
| | | generator.table="asr_wrk_mast_log"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.build(); |
| | | } |
| | |
| | | // 其他 ===>> LED显示器复位,显示默认信息 |
| | | mainService.ledReset(10); |
| | | |
| | | mainService.outOfDevp(11); |
| | | |
| | | //空托盘自动出库 |
| | | // mainService.autoEmptyOut(); |
| | | // //空托盘自动入库 |
| | | // mainService.autoEmptyIn(); |
| | | |
| | | // 其他 ===>> 入出库模式切换 |
| | | i++; |
| | | if (i > 1) { |
| | | mainService.ioConvert(); |
| | | i = 0; |
| | | } |
| | | // RGV ===>> 执行对RGV操作 |
| | | mainService.rgvExecute(11); |
| | | // RGV ===>> 执行对RGV工作档的完成操作 |
| | | mainService.rgvFinished(12); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
New file |
| | |
| | | package com.zy.core; |
| | | |
| | | public interface RgvThread2 extends ThreadHandler{ |
| | | |
| | | void setPakMk(boolean lock); |
| | | } |
| | |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.RgvSlave; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | for (Slave crn : slaveProperties.getCrn()) { |
| | | MessageQueue.init(SlaveType.Crn, crn); |
| | | } |
| | | // 初始化Rgv小车mq |
| | | for (Slave rgv : slaveProperties.getRgv()) { |
| | | MessageQueue.init(SlaveType.Rgv, rgv); |
| | | } |
| | | // 初始化输送线mq |
| | | for (Slave devp : slaveProperties.getDevp()) { |
| | | MessageQueue.init(SlaveType.Devp, devp); |
| | |
| | | map.put(crnThread, thread); |
| | | SlaveConnection.put(SlaveType.Crn, crn.getId(), crnThread); |
| | | } |
| | | // 初始化RGV线程 |
| | | log.info("初始化RGV线程..................................................."); |
| | | for (RgvSlave rgv : slaveProperties.getRgv()) { |
| | | RgvThread rgvThread = new RgvThread(rgv); |
| | | new Thread((Runnable) rgvThread).start(); |
| | | SlaveConnection.put(SlaveType.Rgv, rgv.getId(), rgvThread); |
| | | } |
| | | // 初始化输送线线程 |
| | | News.info("初始化输送线线程..................................................."); |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | private static final Map<Integer, ConcurrentLinkedQueue<Task>> SCALE_EXCHANGE = new ConcurrentHashMap<>(); |
| | | // 台车mq交换机 |
| | | private static final Map<Integer, ConcurrentLinkedQueue<Task>> CAR_EXCHANGE = new ConcurrentHashMap<>(); |
| | | private static final Map<Integer, LinkedBlockingQueue<Task>> RGV_EXCHANGE = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * mq 交换机初始化 |
| | |
| | | switch (type) { |
| | | case Crn: |
| | | CRN_EXCHANGE.put(slave.getId(), new LinkedBlockingQueue<>(1)); |
| | | break; |
| | | case Rgv: |
| | | RGV_EXCHANGE.put(slave.getId(), new LinkedBlockingQueue<>(1)); |
| | | break; |
| | | case Devp: |
| | | DEVP_EXCHANGE.put(slave.getId(), new ConcurrentLinkedQueue<>()); |
| | |
| | | switch (type) { |
| | | case Crn: |
| | | return CRN_EXCHANGE.get(id).offer(task); |
| | | case Rgv: |
| | | return RGV_EXCHANGE.get(id).offer(task); |
| | | case Devp: |
| | | return DEVP_EXCHANGE.get(id).offer(task); |
| | | case Barcode: |
| | |
| | | switch (type) { |
| | | case Crn: |
| | | return CRN_EXCHANGE.get(id).poll(); |
| | | case Rgv: |
| | | return RGV_EXCHANGE.get(id).poll(); |
| | | case Devp: |
| | | return DEVP_EXCHANGE.get(id).poll(); |
| | | case Barcode: |
| | |
| | | switch (type) { |
| | | case Crn: |
| | | return CRN_EXCHANGE.get(id).peek(); |
| | | case Rgv: |
| | | return RGV_EXCHANGE.get(id).peek(); |
| | | case Devp: |
| | | return DEVP_EXCHANGE.get(id).peek(); |
| | | case Barcode: |
| | |
| | | public static void clear(SlaveType type, Integer id){ |
| | | switch (type) { |
| | | case Crn: |
| | | |
| | | CRN_EXCHANGE.get(id).clear(); |
| | | break; |
| | | case Rgv: |
| | | RGV_EXCHANGE.get(id).clear(); |
| | | break; |
| | | case Devp: |
| | | DEVP_EXCHANGE.get(id).clear(); |
| | | break; |
| | |
| | | public static ArrayBlockingQueue<String> DEVP = new ArrayBlockingQueue<>(32); |
| | | // 条码器输出日志 |
| | | public static ArrayBlockingQueue<JSONObject> BARCODE = new ArrayBlockingQueue<>(32); |
| | | // rgv输出日志 |
| | | public static ArrayBlockingQueue<String> RGV = new ArrayBlockingQueue<>(32); |
| | | } |
New file |
| | |
| | | package com.zy.core.enums; |
| | | |
| | | public enum RgvModeType { |
| | | |
| | | NONE(-1, "离线"), |
| | | STOP(0, "关机"), |
| | | HAND(1, "手动"), |
| | | HALF_AUTO(2, "半自动"), |
| | | AUTO(3, "自动"), |
| | | AUTO2(100, "其它"), |
| | | ; |
| | | |
| | | public Integer id; |
| | | public String desc; |
| | | RgvModeType(Integer id, String desc) { |
| | | this.id = id; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static RgvModeType get(Short id) { |
| | | if (null == id) { |
| | | return null; |
| | | } |
| | | for (RgvModeType type : RgvModeType.values()) { |
| | | if (type.id.equals(id.intValue())) { |
| | | return type; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static RgvModeType get(RgvModeType type) { |
| | | if (null == type) { |
| | | return null; |
| | | } |
| | | for (RgvModeType rgvModeType : RgvModeType.values()) { |
| | | if (rgvModeType == type) { |
| | | return rgvModeType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.core.enums; |
| | | |
| | | public enum RgvStatusType { |
| | | |
| | | NONE(-1, "离线"), |
| | | IDLE(0, "空闲"), |
| | | WORKING(1, "作业中"), |
| | | SOS(2, "报警"), |
| | | WORKING1(3, "作业中"), |
| | | FETCHING(11, "取货中"), |
| | | PUTTING(12, "放货中"), |
| | | WAITING(90, "任务完成等待WCS确认"), |
| | | FETCHWAITING(91, "取货任务完成等待WCS确认"), |
| | | ; |
| | | |
| | | public Integer id; |
| | | public String desc; |
| | | RgvStatusType(Integer id, String desc) { |
| | | this.id = id; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static RgvStatusType get(Short id) { |
| | | if (null == id) { |
| | | return null; |
| | | } |
| | | for (RgvStatusType type : RgvStatusType.values()) { |
| | | if (type.id.equals(id.intValue())) { |
| | | return type; |
| | | } |
| | | } |
| | | return NONE; |
| | | } |
| | | |
| | | public static RgvStatusType get(RgvStatusType type) { |
| | | if (null == type) { |
| | | return null; |
| | | } |
| | | for (RgvStatusType rgvStatusType : RgvStatusType.values()) { |
| | | if (rgvStatusType == type) { |
| | | return rgvStatusType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.core.enums; |
| | | |
| | | public enum RgvTaskModeType { |
| | | |
| | | NONE(0), // 无 |
| | | FETCH(1), // 取货 |
| | | PUT(2), // 放货 |
| | | FETCH_PUT(3), // 取放货 |
| | | X_MOVE(4), // 站位移转 |
| | | // Y_MOVE(5), // 站位移转 |
| | | // XY_MOVE(6), // 站位移转 |
| | | GO_ORIGIN(7), // 回原点 |
| | | // BACK_ORIGIN(8), // 回反原点 |
| | | // CLEAR(9), // 清错 |
| | | ; |
| | | |
| | | public Integer id; |
| | | RgvTaskModeType(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | |
| | | public static RgvTaskModeType get(Short id) { |
| | | if (null == id) { |
| | | return null; |
| | | } |
| | | for (RgvTaskModeType type : RgvTaskModeType.values()) { |
| | | if (type.id.equals(id.intValue())) { |
| | | return type; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static RgvTaskModeType get(RgvTaskModeType type) { |
| | | if (null == type) { |
| | | return null; |
| | | } |
| | | for (RgvTaskModeType rgvTaskModeType : RgvTaskModeType.values()) { |
| | | if (rgvTaskModeType == type) { |
| | | return rgvTaskModeType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | Led, |
| | | Scale, |
| | | Car, |
| | | Rgv |
| | | ; |
| | | |
| | | public static SlaveType findInstance(String s){ |
New file |
| | |
| | | package com.zy.core.model; |
| | | |
| | | import com.zy.core.Slave; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | public class RgvSlave extends Slave { |
| | | |
| | | private Integer rack; |
| | | |
| | | private Integer slot; |
| | | |
| | | private Integer offset; |
| | | |
| | | private Boolean demo; |
| | | |
| | | // RGV入库源站点 |
| | | private List<RgvStn> rgvInSStn = new ArrayList<>(); |
| | | |
| | | // RGV出库源站点 |
| | | private List<RgvStn> rgvOutSStn = new ArrayList<>(); |
| | | |
| | | // RGV叠盘 |
| | | private List<RgvStn> rgvEmptyInSStn = new ArrayList<>(); |
| | | |
| | | // RGV空板入库 |
| | | private List<RgvStn> rgvEmptyOutSStn = new ArrayList<>(); |
| | | |
| | | // RGV出库目标站点 |
| | | private List<RgvStn> rgvDestStn = new ArrayList<>(); |
| | | |
| | | @Data |
| | | public static class RgvStn { |
| | | |
| | | // 输送线plc编号 |
| | | private Integer devpPlcId; |
| | | |
| | | // RGV站点编号 |
| | | private Integer staNo; |
| | | |
| | | // // 排 |
| | | // private Integer row; |
| | | // |
| | | // // 列 |
| | | // private Integer bay; |
| | | // |
| | | // // 层 |
| | | // private Integer lev; |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.core.model.command; |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.zy.core.enums.RgvTaskModeType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * RGV命令报文 |
| | | */ |
| | | @Data |
| | | public class RgvCommand { |
| | | |
| | | // Rgv编号 |
| | | private Integer rgvNo = 0; |
| | | |
| | | // 工位1任务完成确认位 |
| | | private Short ackFinish1 = 0; |
| | | |
| | | // 工位1任务号 |
| | | private Short taskNo1 = 0; |
| | | |
| | | /** |
| | | * 任务模式: |
| | | * 0 = 无 |
| | | * 1 = 取货 |
| | | * 2 = 放货 |
| | | * 3 = 取放货 |
| | | */ |
| | | private Short taskMode1 = 0; |
| | | |
| | | @JSONField(serialize = false) |
| | | private RgvTaskModeType taskModeType1; |
| | | |
| | | /* |
| | | 工位1源站 |
| | | */ |
| | | private Short sourceStaNo1 = 0; |
| | | |
| | | /* |
| | | 工位1目标站 |
| | | */ |
| | | private Short destinationStaNo1 = 0; |
| | | |
| | | /** |
| | | * 任务模式: |
| | | * 0 = 未确认 |
| | | * 1 = 任务确认 |
| | | */ |
| | | private Short command = 0; |
| | | |
| | | public void setTaskMode1(Short taskMode1){ |
| | | this.taskMode1 = taskMode1; |
| | | this.taskModeType1 = RgvTaskModeType.get(taskModeType1); |
| | | } |
| | | |
| | | public void setTaskMode1(RgvTaskModeType type1) { |
| | | this.taskModeType1 = type1; |
| | | this.taskMode1 = RgvTaskModeType.get(type1).id.shortValue(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.core.model.protocol; |
| | | |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.core.enums.RgvModeType; |
| | | import com.zy.core.enums.RgvStatusType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class RgvProtocol implements Cloneable{ |
| | | |
| | | private Integer RgvNo; |
| | | |
| | | /** |
| | | * 1 = 手动模式 |
| | | * 2 = 自动模式 |
| | | * 3 = 电脑模式 |
| | | */ |
| | | public Short mode; |
| | | |
| | | public RgvModeType modeType; |
| | | |
| | | /** |
| | | * RGV当前状态 |
| | | * 0:空闲,无任务 |
| | | * 1:作业中 |
| | | * 2:报警 |
| | | */ |
| | | public Short status; |
| | | |
| | | /** |
| | | * 状态枚举 |
| | | */ |
| | | public RgvStatusType statusType; |
| | | |
| | | /** |
| | | * 工位1任务号 |
| | | */ |
| | | public Short taskNo1 = 0; |
| | | |
| | | /** |
| | | * RGV工位1当前状态 |
| | | * 0:空闲,无任务 |
| | | * 11:取货中 |
| | | * 12:放货中 |
| | | * 10:任务完成等待WCS确认 |
| | | */ |
| | | public Short status1; |
| | | |
| | | /** |
| | | * 状态枚举 |
| | | */ |
| | | public RgvStatusType statusType1; |
| | | |
| | | /** |
| | | * 工位1有物 |
| | | */ |
| | | public Short loaded1; |
| | | |
| | | /** |
| | | * RGV当前位置 |
| | | */ |
| | | public Short RgvPos; |
| | | |
| | | /** |
| | | * 走行在定位 |
| | | * 0 = 在定位 |
| | | * 1 = 不在定位 |
| | | */ |
| | | public Short walkPos; |
| | | |
| | | ////////////////////// 工位2定义 ////////////////////////////////////////////////// |
| | | // /** |
| | | // * 工位2任务号 |
| | | // */ |
| | | // public Short taskNo2 = 0; |
| | | // |
| | | // /** |
| | | // * RGV工位2当前状态 |
| | | // * 0:空闲,无任务 |
| | | // * 11:取货中 |
| | | // * 12:放货中 |
| | | // * 10:任务完成等待WCS确认 |
| | | // */ |
| | | // public Short status2; |
| | | // |
| | | // /** |
| | | // * 状态枚举 |
| | | // */ |
| | | // public RgvStatusType statusType2; |
| | | // |
| | | // /** |
| | | // * 工位2有物 |
| | | // */ |
| | | // public Short loaded2; |
| | | /////////////////////////////////////////////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * 异常码 |
| | | */ |
| | | public Short alarm; |
| | | |
| | | /** |
| | | * 心跳指令 1-2每秒切换一次 |
| | | */ |
| | | public Short heart; |
| | | |
| | | private Short temp1; |
| | | |
| | | private Short temp2; |
| | | |
| | | private Short temp3; |
| | | |
| | | private Short temp4; |
| | | |
| | | private Short temp5; |
| | | |
| | | /** |
| | | * X行走行速度m/min |
| | | */ |
| | | private Float xSpeed; |
| | | |
| | | /** |
| | | * 堆垛机累计走行距离km |
| | | */ |
| | | public Float xDistance; |
| | | |
| | | /** |
| | | * 堆垛机累计走行时长h |
| | | */ |
| | | public Float xDuration; |
| | | |
| | | public void setMode(Short mode) { |
| | | this.mode = mode; |
| | | this.modeType = RgvModeType.get(mode); |
| | | } |
| | | |
| | | public void setMode(RgvModeType type) { |
| | | this.modeType = type; |
| | | this.mode = RgvModeType.get(type).id.shortValue(); |
| | | } |
| | | |
| | | public void setStatus(Short status){ |
| | | this.status = status; |
| | | this.statusType = RgvStatusType.get(status); |
| | | } |
| | | |
| | | public void setStatus(RgvStatusType type){ |
| | | this.statusType = type; |
| | | this.status = RgvStatusType.get(type).id.shortValue(); |
| | | } |
| | | |
| | | public void setStatus1(Short status1){ |
| | | this.status1 = status1; |
| | | this.statusType1 = RgvStatusType.get(status1); |
| | | } |
| | | |
| | | public void setStatus1(RgvStatusType type1){ |
| | | this.statusType1 = type1; |
| | | this.status1 = RgvStatusType.get(type1).id.shortValue(); |
| | | } |
| | | |
| | | // public void setStatus2(Short status2){ |
| | | // this.status2 = status2; |
| | | // this.statusType2 = RgvStatusType.get(status2); |
| | | // } |
| | | // |
| | | // public void setStatus2(RgvStatusType type2){ |
| | | // this.statusType2 = type2; |
| | | // this.status2 = RgvStatusType.get(type2).id.shortValue(); |
| | | // } |
| | | |
| | | /** |
| | | * 最近一次入出库类型 |
| | | * I:入库 |
| | | * O:出库 |
| | | */ |
| | | private String lastIo = "I"; |
| | | |
| | | |
| | | public BasRgv toSqlModel(BasRgv basRgv){ |
| | | if (alarm!=null) { |
| | | basRgv.setRgvErr(alarm.longValue()); |
| | | } |
| | | basRgv.setWrkNo1(taskNo1.intValue()); |
| | | // basRgv.setWrkNo2(taskNo2.intValue()); |
| | | return basRgv; |
| | | } |
| | | |
| | | public void setxSpeed(Short xSpeed) { |
| | | this.xSpeed = Float.valueOf(xSpeed); |
| | | } |
| | | |
| | | public void setxDistance(Short xDistance) { |
| | | this.xDistance = Float.valueOf(xDistance); |
| | | } |
| | | |
| | | public void setxDuration(Short xDuration) { |
| | | this.xDuration = Float.valueOf(xDuration); |
| | | } |
| | | |
| | | public Integer getRgvPosI(){ |
| | | //需要根据现场改造 根据读到的值获取对应站点位置 |
| | | Map<Short,Integer> map = new HashMap<>(); |
| | | map.put((short) 1,100);map.put((short) 2,101); |
| | | map.put((short) 3,106);map.put((short) 4,107); |
| | | map.put((short) 5,112);map.put((short) 6,113); |
| | | map.put((short) 7,124); map.put((short) 8,119); |
| | | map.put((short) 9,149);map.put((short) 10,153); |
| | | map.put((short) 11,157);map.put((short) 12,161); |
| | | if (RgvPos==null) return 0; |
| | | |
| | | return map.get(RgvPos); |
| | | } |
| | | |
| | | @Override |
| | | public RgvProtocol clone() { |
| | | try { |
| | | return (RgvProtocol) super.clone(); |
| | | } catch (CloneNotSupportedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.RgvSlave; |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | |
| | | private List<Slave> car = new ArrayList<>(); |
| | | |
| | | private List<RgvSlave> rgv = new ArrayList<>(); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.core.thread; |
| | | |
| | | import HslCommunication.Core.Types.OperateResult; |
| | | import HslCommunication.Core.Types.OperateResultExOne; |
| | | import HslCommunication.Profinet.Siemens.SiemensPLCS; |
| | | import HslCommunication.Profinet.Siemens.SiemensS7Net; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.zy.asrs.service.BasRgvOptService; |
| | | import com.zy.asrs.service.BasRgvService; |
| | | import com.zy.common.utils.News; |
| | | import com.zy.core.RgvThread2; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.enums.RgvStatusType; |
| | | import com.zy.core.enums.RgvTaskModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.RgvSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * RGV线程 |
| | | * Created by vincent on 2022/11/29 |
| | | */ |
| | | @Data |
| | | @Slf4j |
| | | public class RgvThread implements Runnable, RgvThread2 { |
| | | |
| | | private SiemensS7Net siemensNet; |
| | | private RgvSlave slave; |
| | | private RgvProtocol rgvProtocol; |
| | | /** |
| | | * 工位1复位信号 |
| | | */ |
| | | private boolean resetFlag1 = false; |
| | | |
| | | //锁定标记 |
| | | private boolean PakMk = true; |
| | | |
| | | public RgvThread(RgvSlave slave) { |
| | | this.slave = slave; |
| | | } |
| | | |
| | | @Override |
| | | @SuppressWarnings("InfiniteLoopStatement") |
| | | public void run() { |
| | | this.connect(); |
| | | while (true) { |
| | | try { |
| | | int step = 1; |
| | | Task task = MessageQueue.poll(SlaveType.Rgv, slave.getId()); |
| | | if (task != null) { |
| | | step = task.getStep(); |
| | | } |
| | | switch (step) { |
| | | // 读数据 |
| | | case 1: |
| | | readStatus(); |
| | | break; |
| | | //工位1写入数据 |
| | | case 4: |
| | | write1((RgvCommand) task.getData()); |
| | | break; |
| | | // 复位 |
| | | case 3: |
| | | RgvCommand command = (RgvCommand) task.getData(); |
| | | if (null == command) { |
| | | command = new RgvCommand(); |
| | | } |
| | | command.setRgvNo(slave.getId()); // RGV编号 |
| | | command.setTaskNo1((short) 0); // 工作号 |
| | | command.setAckFinish1((short) 1); // 任务完成确认位 |
| | | command.setTaskMode1(RgvTaskModeType.NONE); // 任务模式 |
| | | command.setSourceStaNo1((short)0); // 源站 |
| | | command.setDestinationStaNo1((short)0); // 目标站 |
| | | command.setCommand((short)0); |
| | | write1(command); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | Thread.sleep(500); |
| | | } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化RGV状态 |
| | | */ |
| | | private void initRgv() { |
| | | if (null == rgvProtocol) { |
| | | rgvProtocol = new RgvProtocol(); |
| | | } |
| | | rgvProtocol.setMode((short) -1); |
| | | rgvProtocol.setStatus((short)-1); |
| | | rgvProtocol.setTaskNo1((short)0); |
| | | rgvProtocol.setStatus1((short)-1); |
| | | rgvProtocol.setLoaded1((short)0); |
| | | rgvProtocol.setWalkPos((short)0); |
| | | rgvProtocol.setRgvPos((short)0); |
| | | rgvProtocol.setAlarm((short)0); |
| | | rgvProtocol.setxSpeed((short) 0); |
| | | rgvProtocol.setxDistance((short) 0); |
| | | rgvProtocol.setxDuration((short) 0); |
| | | } |
| | | |
| | | @Override |
| | | public boolean connect() { |
| | | boolean result = false; |
| | | siemensNet = new SiemensS7Net(SiemensPLCS.S1200, slave.getIp()); |
| | | siemensNet.setRack(slave.getRack().byteValue()); |
| | | siemensNet.setSlot(slave.getSlot().byteValue()); |
| | | OperateResult connect = siemensNet.ConnectServer(); |
| | | if(connect.IsSuccess){ |
| | | result = true; |
| | | OutputQueue.RGV.offer(MessageFormat.format( "【{0}】RGV plc连接成功 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | log.info("RGV plc连接成功 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | } else { |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】RGV plc连接失败!!! ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | log.error("RGV plc连接失败!!! ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | initRgv(); |
| | | } |
| | | // siemensNet.ConnectClose(); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 读取状态 |
| | | */ |
| | | private void readStatus(){ |
| | | try { |
| | | OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 30); |
| | | if (result.IsSuccess) { |
| | | if (null == rgvProtocol || rgvProtocol.getRgvNo() == null) { |
| | | rgvProtocol = new RgvProtocol(); |
| | | rgvProtocol.setRgvNo(slave.getId()); |
| | | } |
| | | rgvProtocol.setMode(siemensNet.getByteTransform().TransInt16(result.Content, 0)); |
| | | rgvProtocol.setStatus(siemensNet.getByteTransform().TransInt16(result.Content, 2)); |
| | | rgvProtocol.setTaskNo1(siemensNet.getByteTransform().TransInt16(result.Content, 4)); |
| | | rgvProtocol.setStatus1(siemensNet.getByteTransform().TransInt16(result.Content, 6)); |
| | | rgvProtocol.setLoaded1(siemensNet.getByteTransform().TransInt16(result.Content, 8)); |
| | | rgvProtocol.setRgvPos(siemensNet.getByteTransform().TransInt16(result.Content, 10)); |
| | | rgvProtocol.setWalkPos(siemensNet.getByteTransform().TransInt16(result.Content, 12)); |
| | | rgvProtocol.setAlarm(siemensNet.getByteTransform().TransInt16(result.Content, 14)); |
| | | // rgvProtocol.setStatus2(siemensNet.getByteTransform().TransInt16(result.Content, 16)); |
| | | rgvProtocol.setxSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 18)); |
| | | // rgvProtocol.setAlarm(siemensNet.getByteTransform().TransInt16(result.Content, 20)); |
| | | rgvProtocol.setxDistance(siemensNet.getByteTransform().TransInt16(result.Content, 22)); |
| | | // rgvProtocol.setTemp1(siemensNet.getByteTransform().TransInt16(result.Content, 24)); |
| | | rgvProtocol.setTemp2(siemensNet.getByteTransform().TransInt16(result.Content, 26)); |
| | | // rgvProtocol.setTemp3(siemensNet.getByteTransform().TransInt16(result.Content, 28)); |
| | | // rgvProtocol.setTemp4(siemensNet.getByteTransform().TransInt16(result.Content, 30)); |
| | | // rgvProtocol.setTemp5(siemensNet.getByteTransform().TransInt16(result.Content, 32)); |
| | | // rgvProtocol.setxSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 28)); |
| | | // rgvProtocol.setxDistance(siemensNet.getByteTransform().TransInt16(result.Content, 40)); |
| | | // rgvProtocol.setxDuration(siemensNet.getByteTransform().TransInt16(result.Content, 48)); |
| | | |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功", DateUtils.convert(new Date()), slave.getId())); |
| | | |
| | | // 工位1复位信号 |
| | | if (rgvProtocol.getStatusType1().equals(RgvStatusType.WAITING) |
| | | || rgvProtocol.getStatusType1().equals(RgvStatusType.FETCHWAITING)) { |
| | | if (resetFlag1) { |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | | rgvCommand.setAckFinish1((short)1); |
| | | if (write(rgvCommand)) { |
| | | resetFlag1 = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | try { |
| | | // 根据实时信息更新数据库 |
| | | BasRgvService basRgvService = SpringUtils.getBean(BasRgvService.class); |
| | | BasRgv basRgv = new BasRgv(); |
| | | basRgv.setRgvNo(slave.getId()); |
| | | basRgv.setRgvSts((int)rgvProtocol.getMode()); |
| | | if (!basRgvService.updateById(rgvProtocol.toSqlModel(basRgv))){ |
| | | log.error("RGV plc数据库更新失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | } |
| | | } catch (Exception ignore){ |
| | | System.out.println(ignore); |
| | | } |
| | | |
| | | } else { |
| | | initRgv(); |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】读取RGV plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot())); |
| | | // log.error("读取RGV plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】读取RGV plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort())); |
| | | // log.error("读取RGV plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | initRgv(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 工位1、2同时写入数据 |
| | | */ |
| | | private boolean write(RgvCommand command) throws InterruptedException { |
| | | if (null == command) { |
| | | log.error("RGV写入命令为空"); |
| | | return false; |
| | | } |
| | | // convertRow(command); |
| | | command.setRgvNo(slave.getId()); |
| | | short[] array = new short[11]; |
| | | array[0] = command.getAckFinish1(); |
| | | array[1] = command.getTaskNo1(); |
| | | array[2] = command.getTaskMode1(); |
| | | array[3] = command.getSourceStaNo1(); |
| | | array[4] = command.getDestinationStaNo1(); |
| | | // array[0] = command.getAckFinish1(); |
| | | // array[1] = command.getTaskNo1(); |
| | | // array[2] = command.getTaskMode1(); |
| | | // array[3] = command.getSourceStaNo1(); |
| | | // array[4] = command.getDestinationStaNo1(); |
| | | // array[5] = command.getAckFinish2(); |
| | | // array[6] = command.getTaskNo2(); |
| | | // array[7] = command.getTaskMode2(); |
| | | // array[8] = command.getSourceStaNo2(); |
| | | // array[9] = command.getDestinationStaNo2(); |
| | | // array[10] = command.getCommand(); |
| | | OperateResult result = siemensNet.Write("DB100.0", array); |
| | | |
| | | // if (command.getAckFinish1() == 0 && command.getAckFinish2() == 0) { |
| | | // short commandFinish = 3; //工位1、2任务同时写入 |
| | | // Thread.sleep(100L); |
| | | // result = siemensNet.Write("DB100.20", commandFinish); |
| | | // } |
| | | |
| | | try { |
| | | // 日志记录 |
| | | BasRgvOptService bean = SpringUtils.getBean(BasRgvOptService.class); |
| | | BasRgvOpt basRgvOpt = new BasRgvOpt( |
| | | command.getTaskNo1().intValue(), |
| | | null, |
| | | command.getRgvNo(), |
| | | new Date(), |
| | | command.getTaskModeType1().toString(), |
| | | command.getSourceStaNo1().intValue(), |
| | | command.getDestinationStaNo1().intValue(), |
| | | null, |
| | | null, |
| | | null, |
| | | new Date(), |
| | | null |
| | | ); |
| | | bean.insert(basRgvOpt); |
| | | } catch (Exception ignore) {} |
| | | |
| | | if (result != null && result.IsSuccess) { |
| | | Thread.sleep(200); |
| | | this.readStatus(); |
| | | log.info("RGV 命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | return true; |
| | | } else { |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】写入RGV plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort())); |
| | | log.error("写入RGV plc数据失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 工位1写入数据 |
| | | */ |
| | | private boolean write1(RgvCommand command) throws InterruptedException { |
| | | if (null == command) { |
| | | log.error("RGV写入命令为空"); |
| | | return false; |
| | | } |
| | | |
| | | OperateResultExOne<byte[]> result3 = siemensNet.Read("DB100.0", (short) 12); |
| | | OperateResultExOne<byte[]> result4 = siemensNet.Read("DB100.10", (short) 2); |
| | | if (result3.IsSuccess){ |
| | | RgvCommand one = new RgvCommand(); |
| | | // one.setAckFinish1(siemensNet.getByteTransform().TransInt16(resultRead.Content, 0)); |
| | | one.setTaskNo1(siemensNet.getByteTransform().TransInt16(result3.Content, 2)); |
| | | one.setTaskMode1(siemensNet.getByteTransform().TransInt16(result3.Content, 4)); |
| | | one.setSourceStaNo1(siemensNet.getByteTransform().TransInt16(result3.Content, 6)); |
| | | one.setDestinationStaNo1(siemensNet.getByteTransform().TransInt16(result3.Content, 8)); |
| | | one.setCommand(siemensNet.getByteTransform().TransInt16(result4.Content, 0)); |
| | | |
| | | News.error("RGV命令下发前读取状态[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | } |
| | | |
| | | |
| | | OperateResult result8 = siemensNet.Write("DB100.10", (short) 0); |
| | | if (result8.IsSuccess){ |
| | | News.error("下发前把车子确认位置为0"); |
| | | } |
| | | |
| | | // siemensNet.Write("DB100.20", command.getCommand()); |
| | | |
| | | command.setRgvNo(slave.getId()); |
| | | short[] array = new short[5]; |
| | | array[0] = command.getAckFinish1(); |
| | | array[1] = command.getTaskNo1(); |
| | | array[2] = command.getTaskMode1(); |
| | | array[3] = command.getSourceStaNo1(); |
| | | array[4] = command.getDestinationStaNo1(); |
| | | // siemensNet.Write("DB100.10", command.getCommand()); |
| | | |
| | | OperateResult result = siemensNet.Write("DB100.0", array); |
| | | |
| | | if (!result.IsSuccess){ |
| | | News.error("写入RGVplc数据失败,重新添加任务到队列 ===> [id:{}],{}",slave.getId(),JSON.toJSON(command)); |
| | | MessageQueue.offer(SlaveType.Rgv,slave.getId(),new Task(4,command)); |
| | | Thread.sleep(100); |
| | | readStatus(); |
| | | return false; |
| | | } |
| | | |
| | | //RGV任务写入后,回读一次,看是否成功 |
| | | Thread.sleep(400); |
| | | try { |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 12); |
| | | if (resultRead.IsSuccess){ |
| | | RgvCommand one = new RgvCommand(); |
| | | // one.setAckFinish1(siemensNet.getByteTransform().TransInt16(resultRead.Content, 0)); |
| | | one.setTaskNo1(siemensNet.getByteTransform().TransInt16(resultRead.Content, 2)); |
| | | one.setTaskMode1(siemensNet.getByteTransform().TransInt16(resultRead.Content, 4)); |
| | | one.setSourceStaNo1(siemensNet.getByteTransform().TransInt16(resultRead.Content, 6)); |
| | | one.setDestinationStaNo1(siemensNet.getByteTransform().TransInt16(resultRead.Content, 8)); |
| | | if ( |
| | | !command.getTaskNo1().equals(one.getTaskNo1()) || |
| | | !command.getTaskMode1().equals(one.getTaskMode1()) || |
| | | !command.getSourceStaNo1().equals(one.getSourceStaNo1()) || |
| | | !command.getDestinationStaNo1().equals(one.getDestinationStaNo1()) |
| | | ){ |
| | | try{ |
| | | News.error("RGV命令地址写入后回读失败[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | }catch (Exception e){ |
| | | try{ |
| | | News.error("日志打印失败:===>>参数one报错 [id:{}],{}", slave.getId(), JSON.toJSON(command),JSON.toJSON(resultRead)); |
| | | }catch (Exception e1){ |
| | | News.error("日志打印失败:===>> [id:{}],{}", slave.getId(), JSON.toJSON(command)); |
| | | } |
| | | } |
| | | News.error("Rgv命令回读失败后,重新添加任务到队列 ===>> [id:{}],{}", slave.getId(), JSON.toJSON(command)); |
| | | MessageQueue.offer(SlaveType.Rgv, slave.getId(), new Task(4, command)); |
| | | Thread.sleep(100); |
| | | readStatus(); |
| | | return false; |
| | | }else { |
| | | News.info("RGV命令地址写入后回读成功[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | News.error("RGV命令地址写入后回读出错"); |
| | | } |
| | | |
| | | if (command.getAckFinish1() == 0) { |
| | | if (result.IsSuccess) { |
| | | Thread.sleep(300); |
| | | //任务下发次数 |
| | | int writeCount2 = 0; |
| | | |
| | | do { |
| | | writeCount2++; |
| | | short commandFinish = (short) 1; |
| | | result = siemensNet.Write("DB100.10", commandFinish); |
| | | if(result.IsSuccess){ |
| | | //RGV任务写入后,回读一次,看是否成功 |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.10", (short) 2); |
| | | if (resultRead.IsSuccess) { |
| | | commandFinish=siemensNet.getByteTransform().TransInt16(resultRead.Content, 0); |
| | | if (commandFinish != 1){ |
| | | News.error("RGV任务确认位"+commandFinish+"写入数据与回读数据不一致!"+"循环执行次数:"+writeCount2+"次"); |
| | | }else{ |
| | | //任务命令写入成功 |
| | | News.info("RGV任务确认位"+commandFinish+"回读成功!"+"循环执行次数:"+writeCount2+"次"); |
| | | break; |
| | | } |
| | | }else { |
| | | News.error("RGV任务确认位"+commandFinish+"回读失败!"+"循环执行次数:"+writeCount2+"次"); |
| | | } |
| | | } else { |
| | | News.error("RGV任务确认位"+commandFinish+"写入失败!"+"循环执行次数:"+writeCount2+"次"); |
| | | } |
| | | }while (writeCount2<5); |
| | | } |
| | | } |
| | | |
| | | // if (command.getAckFinish1() == 0) { |
| | | // short commandFinish = 1; //工位1任务写入 |
| | | // Thread.sleep(200); |
| | | // result = siemensNet.Write("DB100.10", commandFinish); |
| | | // } |
| | | |
| | | try { |
| | | // 日志记录 |
| | | BasRgvOptService bean = SpringUtils.getBean(BasRgvOptService.class); |
| | | BasRgvOpt basRgvOpt = new BasRgvOpt( |
| | | command.getTaskNo1().intValue(), |
| | | null, |
| | | command.getRgvNo(), |
| | | new Date(), |
| | | command.getTaskModeType1().toString(), |
| | | command.getSourceStaNo1().intValue(), |
| | | command.getDestinationStaNo1().intValue(), |
| | | null, |
| | | null, |
| | | null, |
| | | new Date(), |
| | | null |
| | | ); |
| | | bean.insert(basRgvOpt); |
| | | } catch (Exception ignore) { |
| | | log.error(ignore.getMessage()); |
| | | } |
| | | |
| | | if (result != null && result.IsSuccess) { |
| | | Thread.sleep(200); |
| | | this.readStatus(); |
| | | log.info("RGV 工位1命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command)); |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 工位1命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | return true; |
| | | } else { |
| | | OutputQueue.RGV.offer(MessageFormat.format("【{0}】写入RGV plc工位1数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort())); |
| | | log.error("写入RGV plc工位1数据失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void close() { |
| | | siemensNet.ConnectClose(); |
| | | } |
| | | |
| | | /******************************************************************************************/ |
| | | /**************************************** 测试专用 *****************************************/ |
| | | /*****************************************************************************************/ |
| | | public static void main(String[] args) throws InterruptedException { |
| | | RgvSlave slave = new RgvSlave(); |
| | | slave.setId(1); |
| | | slave.setIp("192.168.6.9"); |
| | | slave.setRack(0); |
| | | slave.setSlot(0); |
| | | RgvThread rgvThread = new RgvThread(slave); |
| | | rgvThread.connect(); |
| | | rgvThread.readStatus(); |
| | | System.out.println(JSON.toJSONString(rgvThread.rgvProtocol)); |
| | | Thread.sleep(3000L); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | private void readStatus(){ |
| | | try { |
| | | OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 56); |
| | | OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 58); |
| | | if (result.IsSuccess) { |
| | | if (null == crnProtocol) { |
| | | crnProtocol = new CrnProtocol(); |
| | |
| | | name: @pom.build.finalName@ |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=lfdasrsMem |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=ytflasrs |
| | | username: sa |
| | | password: sa@123 |
| | |
| | | row: 25 |
| | | bay: 1 |
| | | lev: 1 |
| | | # RGV穿梭车1 |
| | | rgv[0]: |
| | | id: 1 |
| | | ip: 172.17.60.82 |
| | | port: 502 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 输送线1 |
| | | devp[0]: |
| | | id: 1 |
New file |
| | |
| | | <?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.BasRgvErrMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasRgvErr"> |
| | | <result column="error_code" property="errorCode" /> |
| | | <result column="err_name" property="errName" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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.BasRgvMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasRgv"> |
| | | <result column="rgv_no" property="rgvNo" /> |
| | | <result column="in_enable" property="inEnable" /> |
| | | <result column="out_enable" property="outEnable" /> |
| | | <result column="rgv_sts" property="rgvSts" /> |
| | | <result column="wrk_no1" property="wrkNo1" /> |
| | | <result column="wrk_no2" property="wrkNo2" /> |
| | | <result column="rgv_err" property="rgvErr" /> |
| | | <result column="pak_mk" property="pakMk" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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.BasRgvOptMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasRgvOpt"> |
| | | <id column="id" property="id" /> |
| | | <result column="wrk_no1" property="wrkNo1" /> |
| | | <result column="wrk_no2" property="wrkNo2" /> |
| | | <result column="rgv_no" property="rgvNo" /> |
| | | <result column="send_time" property="sendTime" /> |
| | | <result column="mode" property="mode" /> |
| | | <result column="source_row" property="sourceRow" /> |
| | | <result column="source_bay" property="sourceBay" /> |
| | | <result column="source_lev" property="sourceLev" /> |
| | | <result column="source_sta" property="sourceSta" /> |
| | | <result column="pos_row" property="posRow" /> |
| | | <result column="pos_bay" property="posBay" /> |
| | | <result column="pos_lev" property="posLev" /> |
| | | <result column="pos_sta" property="posSta" /> |
| | | <result column="response" property="response" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="memo" property="memo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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="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" /> |
| | | <result column="line_number" property="lineNumber" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | body { |
| | | background-color: #6CA7A8; |
| | | } |
| | | .button-window { |
| | | float: left; |
| | | width: 100%; |
| | | height: 100%; |
| | | padding: 10px; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0 0 0 .3); |
| | | } |
| | | /* -------------------- 第一模块 -------------------- */ |
| | | .log-board { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | height: 28%; |
| | | } |
| | | |
| | | /* 左 */ |
| | | .command-log { |
| | | float: left; |
| | | height: 100%; |
| | | width: 20%; |
| | | text-align: center; |
| | | } |
| | | .command-log h2 { |
| | | padding: 10px; |
| | | } |
| | | .rgv-command-item { |
| | | padding: 4px 0; |
| | | } |
| | | .rgv-command-item label { |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | vertical-align: middle; |
| | | } |
| | | .rgv-command-item span { |
| | | display: inline-block; |
| | | width: 20px; |
| | | height: 20px; |
| | | background-color: #2e9926; |
| | | border-radius: 5px; |
| | | vertical-align: middle; |
| | | } |
| | | .rgv-command-item input { |
| | | vertical-align: middle; |
| | | outline: none; |
| | | width: 60%; |
| | | } |
| | | |
| | | /* 右 */ |
| | | .rgv-state { |
| | | float: left; |
| | | height: 100%; |
| | | width: 100%; |
| | | overflow: auto; |
| | | } |
| | | /* 堆垛机状态表 */ |
| | | #rgv-state-table { |
| | | font-size: 12px; |
| | | border-collapse: collapse; |
| | | margin: 0 auto; |
| | | text-align: center; |
| | | } |
| | | #rgv-state-table td, #rgv-state-table th { |
| | | border: 1px solid #cad9ea; |
| | | color: #666; |
| | | height: 25px; |
| | | } |
| | | #rgv-state-table thead th { |
| | | background-color: #CCE8EB; |
| | | width: 300px; |
| | | } |
| | | #rgv-state-table tr:nth-child(odd) { |
| | | background: #fff; |
| | | } |
| | | #rgv-state-table tr:nth-child(even) { |
| | | background: #F5FAFA; |
| | | } |
| | | |
| | | /* -------------------- 第二模块 -------------------- */ |
| | | .rgv-msg { |
| | | /*overflow: auto;*/ |
| | | margin-top: 10px; |
| | | height: 23%; |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | } |
| | | /* 堆垛机状态信息表 */ |
| | | #rgv-msg-table { |
| | | font-size: 12px; |
| | | border-collapse: collapse; |
| | | margin: 0 auto; |
| | | text-align: center; |
| | | } |
| | | #rgv-msg-table td, #rgv-msg-table th { |
| | | border: 1px solid #f1f1f1; |
| | | color: #666; |
| | | height: 30px; |
| | | } |
| | | #rgv-msg-table thead th { |
| | | background-color: #fff; |
| | | width: 400px; |
| | | } |
| | | #rgv-msg-table tr:nth-child(odd) { |
| | | background: #fff; |
| | | } |
| | | #rgv-msg-table tr:nth-child(even) { |
| | | background: #fff; |
| | | } |
| | | |
| | | /* -------------------- 第三模块 -------------------- */ |
| | | .rgv-operation { |
| | | position: relative; |
| | | margin-top: 10px; |
| | | height: 25%; |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | } |
| | | |
| | | /* 任务设备选择框 */ |
| | | .task-select { |
| | | height: 50%; |
| | | overflow: hidden; |
| | | padding: 20px 0 10px 20px; |
| | | } |
| | | .operator-item { |
| | | display: inline-block; |
| | | height: 100%; |
| | | width: 20%; |
| | | text-align: center; |
| | | position: relative; |
| | | vertical-align: middle; |
| | | padding: 10px 0px 10px 50px; |
| | | } |
| | | .operator-item .select-title { |
| | | display: inline-block; |
| | | position: absolute; |
| | | top: -11px; |
| | | left: 50%; |
| | | transform: translate(-50%, 0); |
| | | background-color: #fff; |
| | | color: #2e95d3; |
| | | font-size: 12px; |
| | | border: 1px solid #8d8d8d; |
| | | border-radius: 5px; |
| | | padding: 5px; |
| | | z-index: 999; |
| | | } |
| | | .operator-item .select-container { |
| | | padding: 10px 0; |
| | | height: 100%; |
| | | border: 1px solid #8d8d8d; |
| | | border-radius: 5px; |
| | | } |
| | | #rgv-select .select-container label { |
| | | display: inline-block; |
| | | padding: 0 20px; |
| | | vertical-align: middle; margin-top:-2px; margin-bottom:1px; |
| | | |
| | | } |
| | | .select-container input { |
| | | display: inline-block; |
| | | font-size: 12px; |
| | | vertical-align: middle; margin-top:-2px; margin-bottom:1px; |
| | | } |
| | | .select-container-item { |
| | | display: inline-block; |
| | | margin: 0px auto; |
| | | padding: 0; |
| | | } |
| | | .select-container-item input { |
| | | height: 20px; |
| | | border: 1px solid #8D8D8D; |
| | | border-radius: 3px; |
| | | width: 80px; |
| | | outline: none; |
| | | } |
| | | |
| | | /* 任务作业选择框 */ |
| | | .task-operator { |
| | | height: 50%; |
| | | overflow: hidden; |
| | | padding: 0 20px 10px 20px; |
| | | } |
| | | .task-operator fieldset { |
| | | padding: 15px 20px 5px 50px; |
| | | border-width: 1px; |
| | | border-style: solid; |
| | | height: 100%; |
| | | } |
| | | .task-operator legend { |
| | | margin-left: 20px; |
| | | padding: 0 10px; |
| | | font-size: 16px; |
| | | font-weight: 300; |
| | | } |
| | | button.item { |
| | | border: 1px solid #333; |
| | | font-size: 13px; |
| | | padding: 1px 1px 1px 1px; |
| | | width: 100px; |
| | | height: 40px; |
| | | outline: none; |
| | | cursor: pointer; |
| | | color: #333; |
| | | background-color: transparent; |
| | | margin-right: 5px; |
| | | border-radius: 5px; |
| | | } |
| | | button.item:hover { |
| | | background-color: #333; |
| | | color: #fff; |
| | | } |
| | | |
| | | /* 手动操作遮罩 */ |
| | | .rgv-operation-shade { |
| | | position: absolute; |
| | | height: 100%; |
| | | width: 100%; |
| | | z-index: 1000; |
| | | text-align: center; |
| | | padding: 80px 0; |
| | | } |
| | | .rgv-operation-shade-span { |
| | | font-size: xx-large; |
| | | font-weight: bold; |
| | | color: red; |
| | | } |
| | | |
| | | /* -------------------- 第四模块 -------------------- */ |
| | | .rgv-output-board { |
| | | margin-top: 10px; |
| | | height: 15%; |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | } |
| | | #rgv-output { |
| | | border-left: none; |
| | | border-right: none; |
| | | border-top: 1px solid #9d9d9d; |
| | | border-bottom: 1px solid #333; |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow: auto; |
| | | resize:none; |
| | | color: #666; |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basRgv', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basRgv/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'rgvNo', align: 'center',title: 'RGV编号'} |
| | | ,{field: 'inEnable', align: 'center',title: '可入'} |
| | | ,{field: 'outEnable', align: 'center',title: '可出'} |
| | | ,{field: 'rgvSts', align: 'center',title: '作业态'} |
| | | ,{field: 'wrkNo1', align: 'center',title: '任务号'} |
| | | ,{field: 'wrkNo2', align: 'center',title: '堆垛机号'} |
| | | ,{field: 'rgvErr', align: 'center',title: '错误码'} |
| | | ,{field: 'pakMk', 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: 'memo', align: 'center',title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(basRgv)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(basRgv)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.rgvNo; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'basRgv': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgv/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(basRgv)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.rgvNo]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgv/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgv/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['updateTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basRgvErr', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basRgvErr/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'errorCode', align: 'center',title: '异常码'} |
| | | ,{field: 'errName', align: 'center',title: '异常'} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'appeUser$', align: 'center',title: '添加人员'} |
| | | ,{field: 'appeTime$', align: 'center',title: '添加时间'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(basRgvErr)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(basRgvErr)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.errorCode; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'basRgvErr': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgvErr/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(basRgvErr)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.errorCode]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgvErr/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgvErr/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['modiTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['appeTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basRgvOpt', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basRgvOpt/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'wrkNo1', align: 'center',title: '任务号'} |
| | | ,{field: 'wrkNo2', align: 'center',title: ''} |
| | | ,{field: 'rgvNo', align: 'center',title: '穿梭车'} |
| | | ,{field: 'sendTime$', align: 'center',title: '下发时间'} |
| | | ,{field: 'mode', align: 'center',title: '作业'} |
| | | ,{field: 'sourceRow', align: 'center',title: '源排'} |
| | | ,{field: 'sourceBay', align: 'center',title: '源列'} |
| | | ,{field: 'sourceLev', align: 'center',title: '源层'} |
| | | ,{field: 'sourceSta', align: 'center',title: '源站'} |
| | | ,{field: 'posRow', align: 'center',title: '目标排'} |
| | | ,{field: 'posBay', align: 'center',title: '目标列'} |
| | | ,{field: 'posLev', align: 'center',title: '目标层'} |
| | | ,{field: 'posSta', align: 'center',title: '目标站'} |
| | | ,{field: 'response$', align: 'center',title: '响应结果'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'id', align: 'center',title: ''} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(basRgvOpt)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(basRgvOpt)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'basRgvOpt': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgvOpt/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(basRgvOpt)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgvOpt/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/basRgvOpt/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#sendTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['sendTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['updateTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#wrkMastLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/wrkMastLog/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: '编号'} |
| | | ,{field: 'wrkNo$', align: 'center',title: '工作号'} |
| | | ,{field: 'invWh', align: 'center',title: ''} |
| | | ,{field: 'ymd$', align: 'center',title: ''} |
| | | ,{field: 'mk', align: 'center',title: ''} |
| | | ,{field: 'whsType', align: 'center',title: ''} |
| | | ,{field: 'wrkSts$', align: 'center',title: '工作状态'} |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型'} |
| | | ,{field: 'crnNo$', align: 'center',title: '堆垛机号'} |
| | | ,{field: 'sheetNo', align: 'center',title: ''} |
| | | ,{field: 'ioPri', align: 'center',title: '优先级'} |
| | | ,{field: 'wrkDate$', align: 'center',title: ''} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceStaNo$', align: 'center',title: '源站'} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locSts', align: 'center',title: ''} |
| | | ,{field: 'picking', align: 'center',title: '拣料(checkBox)'} |
| | | ,{field: 'linkMis', align: 'center',title: ''} |
| | | ,{field: 'onlineYn', align: 'center',title: ''} |
| | | ,{field: 'updMk', align: 'center',title: ''} |
| | | ,{field: 'exitMk', align: 'center',title: '退出(checkBox)'} |
| | | ,{field: 'pltType', align: 'center',title: ''} |
| | | ,{field: 'emptyMk', align: 'center',title: '空板(checkBox)'} |
| | | ,{field: 'ioTime$', align: 'center',title: '工作时间'} |
| | | ,{field: 'ctnType', align: 'center',title: ''} |
| | | ,{field: 'packed', align: 'center',title: ''} |
| | | ,{field: 'oveMk', align: 'center',title: ''} |
| | | ,{field: 'mtnType', align: 'center',title: ''} |
| | | ,{field: 'userNo', align: 'center',title: ''} |
| | | ,{field: 'crnStrTime$', align: 'center',title: '堆垛机启动时间'} |
| | | ,{field: 'crnEndTime$', align: 'center',title: '堆垛机停止时间'} |
| | | ,{field: 'plcStrTime$', align: 'center',title: '拣料时间'} |
| | | ,{field: 'crnPosTime$', align: 'center',title: ''} |
| | | ,{field: 'loadTime', align: 'center',title: ''} |
| | | ,{field: 'expTime', align: 'center',title: ''} |
| | | ,{field: 'refWrkno', align: 'center',title: ''} |
| | | ,{field: 'refIotime$', align: 'center',title: ''} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'appeUser$', align: 'center',title: '创建者'} |
| | | ,{field: 'appeTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'pauseMk', align: 'center',title: ''} |
| | | ,{field: 'errorTime$', align: 'center',title: ''} |
| | | ,{field: 'errorMemo', align: 'center',title: ''} |
| | | ,{field: 'ctnKind', align: 'center',title: ''} |
| | | ,{field: 'manuType', align: 'center',title: ''} |
| | | ,{field: 'memoM', align: 'center',title: ''} |
| | | ,{field: 'scWeight', align: 'center',title: ''} |
| | | ,{field: 'logMk', align: 'center',title: ''} |
| | | ,{field: 'logErrTime$', align: 'center',title: ''} |
| | | ,{field: 'logErrMemo', align: 'center',title: ''} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'PdcType', align: 'center',title: ''} |
| | | ,{field: 'ctnNo', align: 'center',title: ''} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板(checkBox)'} |
| | | ,{field: 'preHave', align: 'center',title: ''} |
| | | ,{field: 'takeNone', align: 'center',title: ''} |
| | | ,{field: 'lineNumber', align: 'center',title: ''} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(wrkMastLog)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(wrkMastLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'wrkMastLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastLog/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(wrkMastLog)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastLog/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastLog/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#ymd\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['ymd\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#wrkDate\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['wrkDate\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#ioTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['ioTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnStrTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['crnStrTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnEndTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['crnEndTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#plcStrTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['plcStrTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#crnPosTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['crnPosTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#refIotime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['refIotime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['modiTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['appeTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#errorTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['errorTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#logErrTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['logErrTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| | |
| | | <li><a id="console" onclick="nav(this.id)" class="nav-select" href="#">主控图</a></li> |
| | | <li><a id="pipeline" onclick="nav(this.id)" class="nav-unselect" href="#">输送设备</a></li> |
| | | <li><a id="crn" onclick="nav(this.id)" class="nav-unselect" href="#">堆垛机</a></li> |
| | | <li><a id="rgv" onclick="nav(this.id)" class="nav-unselect" href="#">RGV</a></li> |
| | | </ul> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>RGV监控管理</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
| | | <link rel="stylesheet" type="text/css" href="../static/css/normalize.css"> |
| | | <link rel="stylesheet" type="text/css" href="../static/css/common.css"> |
| | | <link rel="stylesheet" type="text/css" href="../static/css/rgv.css"> |
| | | <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/js/layer/layer.js"></script> |
| | | <style> |
| | | .demoBtn { |
| | | vertical-align: middle; |
| | | width: 20%; |
| | | height: 25px; |
| | | left: 0; |
| | | top: 0; |
| | | text-shadow: inherit; |
| | | font-size: 15px; |
| | | margin-left: 5px; |
| | | margin-right: 5px; |
| | | display: inline-block; |
| | | background-color: #FF5722; |
| | | border: none; |
| | | color: #FFF; |
| | | box-shadow: 1px 1px 5px #B6B6B6; |
| | | border-radius: 3px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .demoBtn:hover { |
| | | opacity: 0.8 |
| | | } |
| | | .demoBtn:focus { |
| | | outline: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div style="padding: 10px;height: 100%;float: left;width: 6%"> |
| | | <div class="button-window"></div> |
| | | </div> |
| | | <div style="height: 100%;padding-left: 6%"> |
| | | <div style="padding: 10px;height: 100%"> |
| | | <!-- 日志监控板 --> |
| | | <div class="log-board"> |
| | | <!-- 执行命令 --> |
| | | |
| | | <!-- 执行命令 --> |
| | | <!--<div class="command-log">--> |
| | | <!-- <h3>执行中的命令</h3>--> |
| | | <!-- <div class="crn-command-item">--> |
| | | <!-- <label>1#</label>--> |
| | | <!-- <button id="demoBtn-1" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>--> |
| | | <!-- <!– <span> </span>–>--> |
| | | <!-- <input id="crn1" disabled="disabled">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="crn-command-item">--> |
| | | <!-- <label>2#</label>--> |
| | | <!-- <button id="demoBtn-2" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>--> |
| | | <!-- <!– <span> </span>–>--> |
| | | <!-- <input id="crn2" disabled="disabled">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="crn-command-item">--> |
| | | <!-- <label>3#</label>--> |
| | | <!-- <button id="demoBtn-3" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>--> |
| | | <!-- <!– <span> </span>–>--> |
| | | <!-- <input id="crn3" disabled="disabled">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="crn-command-item">--> |
| | | <!-- <label>4#</label>--> |
| | | <!-- <button id="demoBtn-4" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>--> |
| | | <!-- <!– <span> </span>–>--> |
| | | <!-- <input id="crn4" disabled="disabled">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="crn-command-item">--> |
| | | <!-- <label>5#</label>--> |
| | | <!-- <button id="demoBtn-5" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>--> |
| | | <!-- <!– <span> </span>–>--> |
| | | <!-- <input id="crn5" disabled="disabled">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- RGV状态位信息 --> |
| | | <div class="rgv-state"> |
| | | <table id="rgv-state-table"> |
| | | <thead> |
| | | <tr> |
| | | <th>RGV</th> |
| | | <th>当前模式</th> |
| | | <th>当前状态</th> |
| | | <th>任务号</th> |
| | | <th>工作状态</th> |
| | | <th>有物</th> |
| | | <th>RGV位置</th> |
| | | <th>走行定位</th> |
| | | <!-- <th>任务号2</th>--> |
| | | <!-- <th>状态2</th>--> |
| | | <!-- <th>有物2</th>--> |
| | | <th>故障代码</th> |
| | | <th>故障描述</th> |
| | | <th>锁定状态</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | <!-- RGV状态 --> |
| | | <div class="rgv-msg"> |
| | | <table id="rgv-msg-table"> |
| | | <thead> |
| | | <tr> |
| | | <th>RGV</th> |
| | | <th>工作号</th> |
| | | <th>状态</th> |
| | | <th>源站</th> |
| | | <th>目标站</th> |
| | | <th>源库位</th> |
| | | <th>目标库位</th> |
| | | <!-- <th>走行速度(m/min)</th>--> |
| | | <!-- <th>升降速度(m/min)</th>--> |
| | | <!-- <th>叉牙速度(m/min)</th>--> |
| | | <!-- <th>走行距离(Km)</th>--> |
| | | <!-- <th>升降距离(Km)</th>--> |
| | | <!-- <th>走行时长(H)</th>--> |
| | | <!-- <th>升降时长(H)</th>--> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | <!-- 手动操作 --> |
| | | <div class="rgv-operation"> |
| | | |
| | | <!-- 遮罩层 --> |
| | | <div class="rgv-operation-shade"> |
| | | <span class="rgv-operation-shade-span"> |
| | | WCS 系统运行中,请停止后操作 |
| | | </span> |
| | | </div> |
| | | |
| | | <!-- 设备任务选择 --> |
| | | <div class="task-select"> |
| | | <!-- 堆垛机选择 --> |
| | | <div id="rgv-select" class="operator-item" style="width: 55%"> |
| | | <span class="select-title">RGV号</span> |
| | | <div class="select-container" style="padding: 20px 0;"> |
| | | <label><input type="radio" name="rgvSelect" value="1" checked> 1号RGV</label> |
| | | </div> |
| | | </div> |
| | | <!-- 源站/源库位 选择 --> |
| | | <div id="source-select" class="operator-item"> |
| | | <span class="select-title">源站</span> |
| | | <div class="select-container"> |
| | | <div class="select-container-item"> |
| | | <span>工位1源站</span> |
| | | <label><input id="sourceStaNo" type="number" name="points" min="0" /></label> |
| | | </div> |
| | | <!-- <div class="select-container-item">--> |
| | | <!-- <span>排</span>--> |
| | | <!-- <label><input id="sourceRow" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="select-container-item">--> |
| | | <!-- <span>工位2源站</span>--> |
| | | <!-- <label><input id="sourceBay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="select-container-item">--> |
| | | <!-- <span>层</span>--> |
| | | <!-- <label><input id="sourceLev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | <!-- 目标站/目标库位 选择 --> |
| | | <div id="target-select" class="operator-item"> |
| | | <span class="select-title">目标站</span> |
| | | <div class="select-container"> |
| | | <div class="select-container-item"> |
| | | <span>工位1目标站</span> |
| | | <label><input id="staNo" type="number" name="points" min="0" /></label> |
| | | </div> |
| | | <!-- <div class="select-container-item">--> |
| | | <!-- <span>排</span>--> |
| | | <!-- <label><input id="row" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="select-container-item">--> |
| | | <!-- <span>工位2目标站</span>--> |
| | | <!-- <label><input id="bay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="select-container-item">--> |
| | | <!-- <span>层</span>--> |
| | | <!-- <label><input id="lev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 设备任务操作 --> |
| | | <div class="task-operator"> |
| | | <fieldset> |
| | | <legend>手动操作</legend> |
| | | <div class="button-group"> |
| | | <button class="item" onclick="put()">取放货</button> |
| | | <!-- <button class="item" onclick="take()">取货</button>--> |
| | | <!-- <button class="item" onclick="stockMove()">放货</button>--> |
| | | <!-- <button class="item" onclick="siteMove()">站到站</button>--> |
| | | <!-- <button class="item" onclick="bacOrigin()">回原点</button>--> |
| | | <!-- <button class="item" onclick="reverseOrigin()">反原点</button>--> |
| | | <!-- <button class="item" onclick="coorMove()">坐标移行</button>--> |
| | | <button class="item" onclick="taskComplete()">任务完成</button> |
| | | <!-- <button class="item" onclick="lock()">解锁</button>--> |
| | | <!-- <button class="item" onclick="pause()">暂停</button>--> |
| | | <!-- <button class="item" onclick="boot()">启动</button>--> |
| | | <!-- <button class="item" onclick="clearCommand()">清除命令</button>--> |
| | | <!-- <button class="item" onclick="handleReset()">复位</button>--> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 堆垛机日志输出 --> |
| | | <div class="rgv-output-board"> |
| | | <textarea id="rgv-output"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | <script> |
| | | // 空白行数 |
| | | var rgvStateTableBlankRows = 0; |
| | | var rgvMsgTableBlankRows = 0; |
| | | // 实际行数 |
| | | var rgvStateTableFullRows = 0; |
| | | var rgvMsgTableFullRows = 0; |
| | | // 初始化 |
| | | var rgvOutputDom = document.getElementById("rgv-output"); |
| | | $(document).ready(function() { |
| | | // getCommandLog(); |
| | | initRgvStateTable(); |
| | | getRgvStateInfo(); |
| | | initRgvMsgTable(); |
| | | getRgvMsgInfo(); |
| | | operatorBlockShow(); |
| | | }); |
| | | // 数据更新 |
| | | setInterval(function () { |
| | | getRgvStateInfo(); |
| | | getRgvMsgInfo(); |
| | | // getCommandLog(); |
| | | },1000); |
| | | setInterval(function () { |
| | | getRgvOutput(); |
| | | operatorBlockShow(); |
| | | // initDemo(); |
| | | },500); |
| | | |
| | | // 判断手动操作模块是否可用 |
| | | function operatorBlockShow() { |
| | | if (parent.systemRunning) { |
| | | $('.rgv-operation').css("opacity", "0.5"); |
| | | $('.rgv-operation-shade').show(); |
| | | $('.rgv-operation-shade-span').show(); |
| | | } else { |
| | | $('.rgv-operation').css("opacity", "1"); |
| | | $('.rgv-operation-shade').hide(); |
| | | $('.rgv-operation-shade-span').hide(); |
| | | } |
| | | } |
| | | |
| | | // 获取RGV执行中的命令 |
| | | function getCommandLog() { |
| | | $.ajax({ |
| | | url: baseUrl + "/rgv/command/ongoing", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var commands = res.data; |
| | | for (var i=0; i<commands.length;i++){ |
| | | $("#rgv"+commands[i].rgvNo).val(commands[i].command); |
| | | } |
| | | } else if (res.code === 403) { |
| | | window.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 堆垛机信息表获取 ---- 表一 |
| | | function getRgvStateInfo() { |
| | | var tableEl = $('#rgv-state-table'); |
| | | $.ajax({ |
| | | url: baseUrl+ "/rgv/table/rgv/state", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | console.log(res) |
| | | if (res.code === 200){ |
| | | var table = res.data; |
| | | if (table.length > rgvStateTableBlankRows && table.length !== rgvStateTableFullRows) { |
| | | initRgvStateTable(table.length-rgvStateTableBlankRows); |
| | | rgvStateTableFullRows = table.length; |
| | | } |
| | | for (var i=1;i<=table.length;i++){ |
| | | var tr = tableEl.find("tr").eq(i); |
| | | setVal(tr.children("td").eq(0), table[i-1].rgvNo); |
| | | setVal(tr.children("td").eq(1), table[i-1].statusType); |
| | | setVal(tr.children("td").eq(2), table[i-1].status); |
| | | setVal(tr.children("td").eq(3), table[i-1].workNo1); |
| | | setVal(tr.children("td").eq(4), table[i-1].status1); |
| | | setVal(tr.children("td").eq(5), table[i-1].loading1); |
| | | setVal(tr.children("td").eq(6), table[i-1].rgvPos1); |
| | | setVal(tr.children("td").eq(7), table[i-1].walkPos); |
| | | // setVal(tr.children("td").eq(8), table[i-1].workNo2); |
| | | // setVal(tr.children("td").eq(9), table[i-1].status2); |
| | | // setVal(tr.children("td").eq(10), table[i-1].loading2); |
| | | setVal(tr.children("td").eq(8), table[i-1].warnCode); |
| | | setVal(tr.children("td").eq(9), table[i-1].alarm); |
| | | setVal(tr.children("td").eq(10), table[i-1].pakMk); |
| | | } |
| | | } else if (res.code === 403){ |
| | | window.location.href = baseUrl+"/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 堆垛机数据表获取 ---- 表二 |
| | | function getRgvMsgInfo() { |
| | | var tableEl = $('#rgv-msg-table'); |
| | | $.ajax({ |
| | | url: baseUrl+ "/rgv/table/rgv/msg", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var table = res.data; |
| | | if (table.length > rgvStateTableBlankRows && table.length !== rgvMsgTableFullRows) { |
| | | initRgvStateTable(table.length-rgvStateTableBlankRows); |
| | | rgvMsgTableFullRows = table.length; |
| | | } |
| | | for (var i=1;i<=table.length;i++){ |
| | | var tr = tableEl.find("tr").eq(i); |
| | | setVal(tr.children("td").eq(0), table[i-1].rgvNo); |
| | | setVal(tr.children("td").eq(1), table[i-1].workNo); |
| | | setVal(tr.children("td").eq(2), table[i-1].status); |
| | | setVal(tr.children("td").eq(3), table[i-1].sourceStaNo); |
| | | setVal(tr.children("td").eq(4), table[i-1].staNo); |
| | | setVal(tr.children("td").eq(5), table[i-1].sourceLocNo); |
| | | setVal(tr.children("td").eq(6), table[i-1].locNo); |
| | | // setVal(tr.children("td").eq(7), table[i-1].xspeed); |
| | | // setVal(tr.children("td").eq(8), table[i-1].yspeed); |
| | | // setVal(tr.children("td").eq(9), table[i-1].zspeed); |
| | | // setVal(tr.children("td").eq(10), table[i-1].xdistance); |
| | | // setVal(tr.children("td").eq(11), table[i-1].ydistance); |
| | | // setVal(tr.children("td").eq(12), table[i-1].xduration); |
| | | // setVal(tr.children("td").eq(13), table[i-1].yduration); |
| | | } |
| | | } else if (res.code === 403){ |
| | | window.location.href = baseUrl+"/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 堆垛机手动操作区 ----------------------------------------------------------------------- |
| | | |
| | | function getReqParam() { |
| | | var rgvNo = $('input[name="rgvSelect"]:checked').val(); |
| | | var sourceStaNo = $('#sourceStaNo').val(); |
| | | var sourceRow = $('#sourceRow').val(); |
| | | var sourceBay = $('#sourceBay').val(); |
| | | var sourceLev = $('#sourceLev').val(); |
| | | var staNo = $('#staNo').val(); |
| | | var row = $('#row').val(); |
| | | var bay = $('#bay').val(); |
| | | var lev = $('#lev').val(); |
| | | return { |
| | | rgvNo: rgvNo, |
| | | sourceStaNo: sourceStaNo, |
| | | sourceRow: sourceRow, |
| | | sourceBay: sourceBay, |
| | | sourceLev: sourceLev, |
| | | staNo: staNo, |
| | | row: row, |
| | | bay: bay, |
| | | lev: lev |
| | | }; |
| | | } |
| | | |
| | | // 入库 |
| | | function put() { |
| | | http.post(baseUrl+"/rgv/operator/put", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 出库 |
| | | function take() { |
| | | http.post(baseUrl+"/rgv/operator/take", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 库位转移 |
| | | function stockMove() { |
| | | http.post(baseUrl+"/rgv/operator/stockMove", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 站到站 |
| | | function siteMove() { |
| | | http.post(baseUrl+"/rgv/operator/siteMove", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 坐标移动 |
| | | function coorMove() { |
| | | http.post(baseUrl+"/rgv/operator/coorMove", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 回原点 |
| | | function bacOrigin() { |
| | | http.post(baseUrl+"/rgv/operator/bacOrigin", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 回原点 |
| | | function reverseOrigin() { |
| | | http.post(baseUrl+"/rgv/operator/reverseOrigin", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 任务完成 |
| | | function taskComplete() { |
| | | http.post(baseUrl+"/rgv/operator/taskComplete", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | function lock() { |
| | | http.post(baseUrl+"/rgv/lock", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 暂停 |
| | | function pause() { |
| | | http.post(baseUrl+"/rgv/operator/pause", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 启动 |
| | | function boot() { |
| | | http.post(baseUrl+"/rgv/operator/boot", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 清除命令 |
| | | function clearCommand() { |
| | | http.post(baseUrl+"/rgv/operator/clearCommand", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 手动复位 |
| | | function handleReset() { |
| | | http.post(baseUrl+"/rgv/operator/handleReset", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 输送设备日志输出 ----------------------------------------------------------------------- |
| | | function getRgvOutput() { |
| | | $.ajax({ |
| | | url: baseUrl + "/rgv/output/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | rgvOutput(res.data); |
| | | } else if (res.code === 403) { |
| | | window.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // ------------------------------------------------------------------------------------------------ |
| | | |
| | | // 堆垛机信息表获取 ----- 表一 |
| | | function initRgvStateTable(row) { |
| | | var line; |
| | | if (row === undefined){ |
| | | var one = $('#rgv-state-table thead').height(); |
| | | var total = $('.rgv-state').height(); |
| | | var count = total / one; |
| | | count = parseInt(count) - 1; |
| | | rgvStateTableBlankRows = count; |
| | | line = count; |
| | | } else { |
| | | line = row; |
| | | } |
| | | var html = ""; |
| | | for (var i = 0; i < line; i ++){ |
| | | html += " <tr>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " </tr>\n"; |
| | | } |
| | | $('#rgv-state-table tbody').after(html); |
| | | } |
| | | |
| | | // 堆垛机数据表获取 ----- 表二 |
| | | function initRgvMsgTable(row) { |
| | | var line; |
| | | if (row === undefined){ |
| | | var one = $('#rgv-msg-table thead').height(); |
| | | var total = $('.rgv-msg').height(); |
| | | var count = total / one; |
| | | count = parseInt(count) - 1; |
| | | rgvMsgTableBlankRows = count; |
| | | line = count; |
| | | } else { |
| | | line = row; |
| | | } |
| | | var html = ""; |
| | | for (var i = 0; i < line; i ++){ |
| | | html += " <tr>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " </tr>\n"; |
| | | } |
| | | $('#rgv-msg-table tbody').after(html); |
| | | } |
| | | |
| | | // 日志输出框 |
| | | function rgvOutput(content){ |
| | | rgvOutputDom.value += content; |
| | | rgvOutputDom.scrollTop = rgvOutputDom.scrollHeight; |
| | | } |
| | | |
| | | </script> |
| | | </html> |