| | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>wcs</finalName> |
| | | <finalName>hcwcs</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.annotations.OpenApiLog; |
| | | import com.zy.common.model.MonitorParam; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private DeviceConfigService deviceConfigService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | |
| | | // 移库任务 |
| | | @PostMapping("/createLocMoveTask") |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 反馈任务执行结果 |
| | | @PostMapping("/stationStatus") |
| | | public R stationStatus(@RequestBody MonitorParam param){ |
| | | if(param == null || param.getStationIds().length == 0){ |
| | | return R.error("输入的参数为空"); |
| | | } |
| | | List<StationProtocol> basDevps = new ArrayList<>(); |
| | | Boolean flag = false; |
| | | // 获取输送站点数据 |
| | | ArrayList<StationProtocol> stationProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> stationList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig device : stationList) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, device.getDeviceNo()); |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | List<StationProtocol> stationProtocolList = stationThread.getStatus(); |
| | | if (stationProtocolList == null) { |
| | | continue; |
| | | } |
| | | for (StationProtocol stationProtocol : stationProtocolList) { |
| | | for (int i = 0; i < param.getStationIds().length; i++) { |
| | | if (stationProtocol.getStationId().equals(param.getStationIds()[i])){ |
| | | flag = true; |
| | | basDevps.add(stationProtocol); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(flag){ |
| | | return R.ok().add(basDevps); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | //上次重试时间 |
| | | private Long lastRetryTime = 0L; |
| | | |
| | | //重量 |
| | | private Double weight; |
| | | |
| | | } |
| | |
| | | //任务 |
| | | TASK_COMPLETE("task_complete", "任务完成"), |
| | | TASK_CANCEL("task_cancel", "任务取消"), |
| | | |
| | | ARRIVE_AT_THE_DESTINATION("task_arrive", "到达目的地"), |
| | | CRN_IN_TASK_RUN("crn_in_task_run", "堆垛机入库任务执行中"), |
| | | CRN_IN_TASK_COMPLETE("crn_in_task_complete", "堆垛机入库任务执行完成"), |
| | | CRN_OUT_TASK_RUN("crn_out_task_run", "堆垛机出库任务执行中"), |
| | |
| | | @Data |
| | | public class CreateInTaskParam { |
| | | |
| | | //wms任务号 |
| | | private String taskNo; |
| | | private String sourceStaNo; |
| | | |
| | | //源站 |
| | | private Integer sourceStaNo; |
| | | private String staNo; |
| | | |
| | | //目标站 |
| | | private Integer staNo; |
| | | private Integer crnNo; |
| | | |
| | | //目标库位 |
| | | private String locNo; |
| | | |
| | | //条码 |
| | | private Integer workNo; |
| | | |
| | | private String taskNo; |
| | | |
| | | private String barcode; |
| | | |
| | | //任务优先级 |
| | | private Integer taskPri; |
| | | |
| | | } |
| | |
| | | //任务优先级 |
| | | private Integer taskPri; |
| | | |
| | | //托盘码 |
| | | private String barcode; |
| | | } |
| | |
| | | private String taskNo; |
| | | |
| | | //出库库位 |
| | | private String sourceLocNo; |
| | | |
| | | //目标库位 |
| | | private String locNo; |
| | | |
| | | //任务优先级 |
| | |
| | | @TableField("max_out_task") |
| | | private Integer maxOutTask; |
| | | |
| | | /** |
| | | * 指定库位需要亮灯 |
| | | */ |
| | | @ApiModelProperty(value= "最大出库任务数") |
| | | @TableField("arr") |
| | | private String arr; |
| | | |
| | | public BasCrnp() {} |
| | | |
| | | public BasCrnp(Integer status,Integer wrkNo,String inEnable,String outEnable,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | |
| | | @TableField(value = "batch_seq") |
| | | private Integer batchSeq; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | @TableField(value = "weight") |
| | | private Double weight; |
| | | |
| | | public String getWrkSts$(){ |
| | | BasWrkStatusMapper mapper = SpringUtils.getBean(BasWrkStatusMapper.class); |
| | | BasWrkStatus entity = mapper.selectById(this.wrkSts); |
| | |
| | | continue; |
| | | } |
| | | NotifyDto notifyDto = (NotifyDto) object; |
| | | int id =notifyDto.getId().intValue(); |
| | | notifyDto.setId((Long.valueOf(id))); |
| | | |
| | | if (System.currentTimeMillis() - notifyDto.getLastRetryTime() < 1000 * notifyDto.getRetryTime()) { |
| | | continue; |
| | |
| | | |
| | | return null; |
| | | } |
| | | //将wms库位号转换成wcs库位号 |
| | | public static String WMSLocToWCSLoc(String locNo) { |
| | | String row = locNo.substring(0, 2); |
| | | int i = 0; |
| | | for (char c : row.toCharArray()) { |
| | | if (c == '0') { |
| | | i++; |
| | | }else { |
| | | break; |
| | | } |
| | | } |
| | | row = row.substring(i); |
| | | int j = 0; |
| | | String boy = locNo.substring(2, 5); |
| | | for (char c : boy.toCharArray()) { |
| | | if (c == '0') { |
| | | j++; |
| | | }else { |
| | | break; |
| | | } |
| | | } |
| | | boy = boy.substring(j); |
| | | int k = 0; |
| | | String lev = locNo.substring(5); |
| | | for (char c : lev.toCharArray()) { |
| | | if (c == '0') { |
| | | k++; |
| | | }else { |
| | | break; |
| | | } |
| | | } |
| | | lev = lev.substring(k); |
| | | return row + "-" + boy + "-" + lev; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MonitorParam { |
| | | Integer[] stationIds; |
| | | } |
| | |
| | | @Data |
| | | public class StartupDto { |
| | | |
| | | private Integer sourceStaNo; |
| | | |
| | | private Integer staNo; |
| | | |
| | | private Integer crnNo; |
| | | |
| | | private String locNo; |
| | | |
| | | private String taskNo; |
| | | private Integer workNo; |
| | | |
| | | private Integer taskNo; |
| | | |
| | | private String barcode; |
| | | |
| | | private Integer taskPri; |
| | | |
| | |
| | | import com.zy.common.utils.NavigateUtils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.enums.WrkIoType; |
| | | import com.zy.core.enums.WrkStsType; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.StationCommand; |
| | | import com.zy.core.thread.StationThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | if (!sourceCrnResult.getCrnNo().equals(targetCrnResult.getCrnNo())) { |
| | | throw new CoolException("源库位和目标库位不在同一巷道"); |
| | | } |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wms_wrk_no", param.getTaskNo())); |
| | | if (!wrkMasts.isEmpty()) { |
| | | throw new CoolException("已经生成改任务号任务="+param.getTaskNo()); |
| | | } |
| | | // 获取工作号 |
| | | int workNo = getWorkNo(WrkIoType.LOC_MOVE.id); |
| | | // 保存工作档 |
| | |
| | | //入库任务 |
| | | public WrkMast createInTask(CreateInTaskParam param) { |
| | | Date now = new Date(); |
| | | // String s = Utils.WMSLocToWCSLoc(param.getLocNo()); |
| | | LocMast locMast = locMastService.queryByLoc(param.getLocNo()); |
| | | if (null == locMast) { |
| | | throw new CoolException(param.getLocNo() + "目标库位不存在"); |
| | |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(WrkStsType.NEW_INBOUND.sts); // 工作状态:1.生成入库任务 |
| | | wrkMast.setWrkSts(WrkStsType.INBOUND_DEVICE_RUN.sts); // 工作状态:3.设备搬运中 |
| | | wrkMast.setIoType(WrkIoType.IN.id); // 入出库状态: 1.入库 |
| | | wrkMast.setIoPri(ioPri); |
| | | wrkMast.setLocNo(param.getLocNo()); // 目标库位 |
| | | wrkMast.setSourceStaNo(param.getSourceStaNo());//源站 |
| | | wrkMast.setStaNo(param.getStaNo());//目标站 |
| | | wrkMast.setWmsWrkNo(param.getTaskNo()); |
| | | wrkMast.setSourceStaNo(Integer.valueOf(param.getSourceStaNo()));//源站 |
| | | wrkMast.setStaNo(Integer.valueOf(param.getSourceStaNo()));//目标站 |
| | | wrkMast.setWmsWrkNo(String.valueOf(param.getTaskNo())); |
| | | wrkMast.setBarcode(param.getBarcode()); |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | wrkMast.getWrkNo(), Integer.valueOf(param.getSourceStaNo()), Integer.valueOf(param.getSourceStaNo()), 0); |
| | | |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(2, command)); |
| | | |
| | | if (findCrnResult.getCrnType().equals(SlaveType.Crn)) { |
| | | wrkMast.setCrnNo(findCrnResult.getCrnNo()); |
| | |
| | | //出库任务 |
| | | public boolean createOutTask(CreateOutTaskParam param) { |
| | | Date now = new Date(); |
| | | LocMast locMast = locMastService.queryByLoc(param.getLocNo()); |
| | | LocMast locMast = locMastService.queryByLoc(param.getSourceLocNo()); |
| | | if (null == locMast) { |
| | | throw new CoolException("源库位不存在"); |
| | | } |
| | |
| | | wrkMast.setIoType(WrkIoType.OUT.id); // 入出库状态: 101.出库 |
| | | wrkMast.setIoPri(ioPri); |
| | | wrkMast.setSourceLocNo(locMast.getLocNo()); // 源库位 |
| | | |
| | | if(!Cools.isEmpty(param.getLocNo())) { |
| | | //目标站点 |
| | | LocMast locMast1 = locMastService.queryByLoc(param.getLocNo()); |
| | | if (null == locMast1) { |
| | | throw new CoolException("源库位不存在"); |
| | | } |
| | | |
| | | if (!locMast1.getLocSts().equals("O")) { |
| | | throw new CoolException("目标库位不处于在库状态"); |
| | | } |
| | | wrkMast.setLocNo(locMast1.getLocNo()); //目标库位 |
| | | } |
| | | wrkMast.setSourceStaNo(sourceStationId);//源站 |
| | | wrkMast.setStaNo(staNo);//目标站 |
| | | wrkMast.setWmsWrkNo(param.getTaskNo()); |
| | |
| | | STATION_IN_EXECUTE_LIMIT("station_in_execute_limit_"), |
| | | STATION_OUT_EXECUTE_LIMIT("station_out_execute_limit_"), |
| | | STATION_OUT_EXECUTE_COMPLETE_LIMIT("station_out_execute_complete_limit_"), |
| | | STATION_OUT_EXECUTE_DESTINATION_LIMIT("station_out_execute_destination_limit_"), |
| | | CHECK_STATION_RUN_BLOCK_LIMIT_("check_station_run_block_limit_"), |
| | | CHECK_SHALLOW_LOC_STATUS_LIMIT("check_shallow_loc_status_limit_"), |
| | | GENERATE_ENABLE_IN_STATION_DATA_LIMIT("generate_enable_in_station_data_limit_"), |
| | |
| | | OUTBOUND_RUN(102, "设备搬运中"), |
| | | OUTBOUND_RUN_COMPLETE(103, "设备搬运完成"), |
| | | STATION_RUN(104, "站点运行中"), |
| | | ARRIVE_AT_THE_DESTINATION(105, "到达目的地"), |
| | | COMPLETE_OUTBOUND(109, "出库完成"), |
| | | SETTLE_OUTBOUND(110, "出库库存更新"), |
| | | |
| | |
| | | // 任务确认 0:未确认 1:已确认 |
| | | private Integer command = 0; |
| | | |
| | | private int index; |
| | | |
| | | private short value; |
| | | |
| | | private String locNo; |
| | | |
| | | } |
| | |
| | | */ |
| | | private Map<String, Object> extend; |
| | | |
| | | /** |
| | | * DB110.200 - DB110.398 data |
| | | */ |
| | | private short[] db110Data; |
| | | |
| | | public void setMode(Integer mode) { |
| | | this.mode = mode; |
| | | this.modeType = CrnModeType.get(mode); |
| | |
| | | */ |
| | | private Map<String, Object> extend; |
| | | |
| | | //异常 |
| | | private String systemWarning; |
| | | |
| | | @Override |
| | | public StationProtocol clone() { |
| | | try { |
| | |
| | | return zyCrnConnectApi.sendCommand(command); |
| | | } |
| | | |
| | | public CommandResponse sendCommand1(CrnCommand command) { |
| | | return zyCrnConnectApi.sendCommand1(command); |
| | | } |
| | | |
| | | public CommandResponse sendCommand2(CrnCommand command) { |
| | | return zyCrnConnectApi.sendCommand2(command); |
| | | } |
| | | |
| | | public CommandResponse sendCommand3(CrnCommand command) { |
| | | return zyCrnConnectApi.sendCommand3(command); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | CommandResponse sendCommand(CrnCommand command);//下发命令 |
| | | |
| | | CommandResponse sendCommand1(CrnCommand command); |
| | | |
| | | CommandResponse sendCommand2(CrnCommand command); |
| | | |
| | | CommandResponse sendCommand3(CrnCommand command); |
| | | } |
| | |
| | | |
| | | private Integer temp4; |
| | | |
| | | private Double weight; |
| | | |
| | | /** |
| | | * DB110.200 - DB110.398 data |
| | | */ |
| | | private short[] db110Data; |
| | | } |
| | |
| | | //条码 |
| | | private String barcode; |
| | | |
| | | private Float weight; |
| | | |
| | | } |
| | |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public CommandResponse sendCommand1(CrnCommand command) { |
| | | CommandResponse response = new CommandResponse(false); |
| | | if (command.getTaskMode().intValue() == CrnTaskModeType.LOC_MOVE.id) { |
| | | //取放货 |
| | | executor.submit(() -> commandTake(command)); |
| | | } else if (command.getTaskMode().intValue() == CrnTaskModeType.CRN_MOVE.id) { |
| | | //移动 |
| | | executor.submit(() -> commandMove(command)); |
| | | } else if (command.getTaskMode().intValue() == CrnTaskModeType.NONE.id) { |
| | | //复位 |
| | | executor.submit(() -> commandTaskComplete(command)); |
| | | } |
| | | response.setResult(true); |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public CommandResponse sendCommand2(CrnCommand command) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public CommandResponse sendCommand3(CrnCommand command) { |
| | | return null; |
| | | } |
| | | |
| | | private void commandTaskComplete(CrnCommand command) { |
| | | this.crnStatus.setTaskNo(0); |
| | | this.crnStatus.setStatus(CrnStatusType.IDLE.id); |
| | |
| | | import HslCommunication.Profinet.Siemens.SiemensPLCS; |
| | | import HslCommunication.Profinet.Siemens.SiemensS7Net; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasCrnpOpt; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.BasCrnpOptService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.model.CommandResponse; |
| | |
| | | boolean connected = false; |
| | | siemensNet = new SiemensS7Net(SiemensPLCS.S1200, deviceConfig.getIp()); |
| | | OperateResult connect = siemensNet.ConnectServer(); |
| | | if(connect.IsSuccess){ |
| | | if (connect.IsSuccess) { |
| | | connected = true; |
| | | OutputQueue.CRN.offer(MessageFormat.format( "【{0}】堆垛机plc连接成功 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), deviceConfig.getDeviceNo(), deviceConfig.getIp(), deviceConfig.getPort())); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】堆垛机plc连接成功 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), deviceConfig.getDeviceNo(), deviceConfig.getIp(), deviceConfig.getPort())); |
| | | News.info("堆垛机plc连接成功 ===>> [id:{}] [ip:{}] [port:{}]", deviceConfig.getDeviceNo(), deviceConfig.getIp(), deviceConfig.getPort()); |
| | | } else { |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】堆垛机plc连接失败!!! ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), deviceConfig.getDeviceNo(), deviceConfig.getIp(), deviceConfig.getPort())); |
| | |
| | | @Override |
| | | public ZyCrnStatusEntity getStatus() { |
| | | try { |
| | | OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 56); |
| | | OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 60); |
| | | if (result.IsSuccess) { |
| | | ZyCrnStatusEntity crnStatus = new ZyCrnStatusEntity(); |
| | | crnStatus.setCrnNo(deviceConfig.getDeviceNo()); |
| | |
| | | crnStatus.setYDistance((double) siemensNet.getByteTransform().TransSingle(result.Content, 44)); |
| | | crnStatus.setXDuration((double) siemensNet.getByteTransform().TransSingle(result.Content, 48)); |
| | | crnStatus.setYDuration((double) siemensNet.getByteTransform().TransSingle(result.Content, 52)); |
| | | crnStatus.setWeight((double) siemensNet.getByteTransform().TransSingle(result.Content, 56)); |
| | | |
| | | // 读取DB110.200 - DB110.398 |
| | | OperateResultExOne<byte[]> resultDb110 = siemensNet.Read("DB110.200", (short) 200); |
| | | if (resultDb110.IsSuccess) { |
| | | short[] db110Data = siemensNet.getByteTransform().TransInt16(resultDb110.Content, 0, 100); |
| | | crnStatus.setDb110Data(db110Data); |
| | | } |
| | | |
| | | return crnStatus; |
| | | } else { |
| | |
| | | } |
| | | |
| | | int writeAck = 0; |
| | | boolean commandResult = false; |
| | | do { |
| | | OperateResultExOne<byte[]> commandReadResult = siemensNet.Read("DB100.0", (short) 2); |
| | | if (commandReadResult.IsSuccess) { |
| | | short commandRead = siemensNet.getByteTransform().TransInt16(commandReadResult.Content, 0); |
| | | if (commandRead == 1) { |
| | | Thread.sleep(500); |
| | | }else { |
| | | commandResult = true; |
| | | OperateResult resultAck = siemensNet.Write("DB100.0", (short) 0); |
| | | if (resultAck.IsSuccess) { |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 2); |
| | | short ack = siemensNet.getByteTransform().TransInt16(resultRead.Content, 0); |
| | | if (ack != 0) { |
| | | writeAck++; |
| | | } else { |
| | | News.info("堆垛机命令下发[id:{}] >>>>> {}", command.getCrnNo(), "ack复位完成"); |
| | | break; |
| | | } |
| | | } |
| | | } while (writeAck < 5); |
| | | |
| | | if (!commandResult) { |
| | | response.setMessage("堆垛机命令下发[id:{}] >>>>> {}" + command.getCrnNo() + "任务状态位异常"); |
| | | return response; |
| | | } |
| | | |
| | | short[] array = new short[9]; |
| | | array[0] = (short) 0; |
| | |
| | | Thread.sleep(500); |
| | | } while (idx < 5); |
| | | |
| | | OperateResult confirmResult = siemensNet.Write("DB100.0", (short) 1); |
| | | OperateResult confirmResult = siemensNet.Write("DB100.18", (short) 1); |
| | | if (!confirmResult.IsSuccess) { |
| | | News.error("堆垛机写入确认数据失败 ===>> [id:{}]", command.getCrnNo()); |
| | | response.setMessage("堆垛机写入确认数据失败"); |
| | |
| | | response.setMessage("命令下发失败"); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(command.getLocNo())){ |
| | | OperateResult resultAck = siemensNet.Write("DB110." + command.getIndex() * 2, command.getValue()); |
| | | if (resultAck.IsSuccess) { |
| | | News.info("库位白色灯命令下发[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } else { |
| | | News.error("库位白色灯命令下发失败[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } |
| | | } |
| | | |
| | | return response; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public CommandResponse sendCommand1(CrnCommand command) { |
| | | CommandResponse response = new CommandResponse(false); |
| | | try { |
| | | if (null == command) { |
| | | News.error("堆垛机写入命令为空"); |
| | | response.setMessage("堆垛机写入命令为空"); |
| | | return response; |
| | | } |
| | | |
| | | int writeAck = 0; |
| | | do { |
| | | OperateResult resultAck = siemensNet.Write("DB100.0", (short) 0); |
| | | if (resultAck.IsSuccess) { |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 2); |
| | | short ack = siemensNet.getByteTransform().TransInt16(resultRead.Content, 0); |
| | | if (ack != 0) { |
| | | writeAck++; |
| | | } else { |
| | | News.info("堆垛机命令下发[id:{}] >>>>> {}", command.getCrnNo(), "ack复位完成"); |
| | | break; |
| | | } |
| | | } |
| | | } while (writeAck < 5); |
| | | |
| | | short[] array = new short[10]; |
| | | array[0] = (short) 1; |
| | | array[1] = command.getTaskNo().shortValue(); |
| | | array[2] = command.getTaskMode().shortValue(); |
| | | array[3] = command.getSourcePosX().shortValue(); |
| | | array[4] = command.getSourcePosY().shortValue(); |
| | | array[5] = command.getSourcePosZ().shortValue(); |
| | | array[6] = command.getDestinationPosX().shortValue(); |
| | | array[7] = command.getDestinationPosY().shortValue(); |
| | | array[8] = command.getDestinationPosZ().shortValue(); |
| | | array[9] = (short) 0; |
| | | |
| | | OperateResult result = siemensNet.Write("DB100.0", array); |
| | | if (!result.IsSuccess) { |
| | | response.setMessage("堆垛机命令下发[id:{}] >>>>> {}" + command.getCrnNo() + "任务状态位异常"); |
| | | return response; |
| | | } |
| | | |
| | | int idx = 0; |
| | | do { |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 20); |
| | | if (resultRead.IsSuccess) { |
| | | short taskNo = siemensNet.getByteTransform().TransInt16(resultRead.Content, 2); |
| | | short taskMode = siemensNet.getByteTransform().TransInt16(resultRead.Content, 4); |
| | | short sourcePosX = siemensNet.getByteTransform().TransInt16(resultRead.Content, 6); |
| | | short sourcePosY = siemensNet.getByteTransform().TransInt16(resultRead.Content, 8); |
| | | short sourcePosZ = siemensNet.getByteTransform().TransInt16(resultRead.Content, 10); |
| | | short destinationPosX = siemensNet.getByteTransform().TransInt16(resultRead.Content, 12); |
| | | short destinationPosY = siemensNet.getByteTransform().TransInt16(resultRead.Content, 14); |
| | | short destinationPosZ = siemensNet.getByteTransform().TransInt16(resultRead.Content, 16); |
| | | if (taskNo == 0 || taskMode == 0 || sourcePosX == 0 || sourcePosY == 0 || sourcePosZ == 0 || destinationPosX == 0 || destinationPosY == 0 || destinationPosZ == 0) { |
| | | result = siemensNet.Write("DB100.0", array); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | idx++; |
| | | Thread.sleep(500); |
| | | } while (idx < 5); |
| | | |
| | | if (result != null && result.IsSuccess) { |
| | | News.info("堆垛机命令下发[id:{}] >>>>> {}", command.getCrnNo(), JSON.toJSON(command)); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), command.getCrnNo(), JSON.toJSON(command))); |
| | | response.setResult(true); |
| | | response.setMessage("命令下发成功"); |
| | | } else { |
| | | News.error("写入堆垛机plc数据失败 ===>> [id:{}]", command.getCrnNo()); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}]", DateUtils.convert(new Date()), command.getCrnNo())); |
| | | response.setResult(false); |
| | | response.setMessage("命令下发失败"); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(command.getLocNo())){ |
| | | OperateResult resultAck = siemensNet.Write("DB110." + command.getIndex() * 2, command.getValue()); |
| | | if (resultAck.IsSuccess) { |
| | | Integer index = command.getIndex()*2 + 200; |
| | | OperateResult resultAck1 = siemensNet.Write("DB110." + index, command.getValue()); |
| | | if (resultAck1.IsSuccess) { |
| | | News.info("库位橙色按钮命令下发[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } else { |
| | | News.error("库位白色灯命令下发失败[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } |
| | | News.info("库位白色灯命令下发[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } else { |
| | | News.error("库位白色灯命令下发失败[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } |
| | | } |
| | | |
| | | return response; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public CommandResponse sendCommand2(CrnCommand command) { |
| | | CommandResponse response = new CommandResponse(false); |
| | | try { |
| | | if (null == command) { |
| | | News.error("堆垛机写入命令为空"); |
| | | response.setMessage("堆垛机写入命令为空"); |
| | | return response; |
| | | } |
| | | |
| | | |
| | | OperateResult resultAck = siemensNet.Write("DB110." + command.getIndex() * 2, command.getValue()); |
| | | if (resultAck.IsSuccess) { |
| | | News.info("库位白色灯命令下发[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } else { |
| | | News.error("库位白色灯命令下发失败[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } |
| | | return response; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | @Override |
| | | public CommandResponse sendCommand3(CrnCommand command) { |
| | | CommandResponse response = new CommandResponse(false); |
| | | try { |
| | | if (null == command) { |
| | | News.error("堆垛机写入命令为空"); |
| | | response.setMessage("堆垛机写入命令为空"); |
| | | return response; |
| | | } |
| | | Integer index = command.getIndex()*2 + 200; |
| | | OperateResult resultAck = siemensNet.Write("DB110." + index, command.getValue()); |
| | | if (resultAck.IsSuccess) { |
| | | News.info("库位橙色按钮命令下发[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } else { |
| | | News.error("库位白色灯命令下发失败[locNo:{}] >>>>> {}", command.getLocNo(), command.getValue()); |
| | | } |
| | | return response; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | @Override |
| | | public ZyDualCrnStatusEntity getStatus() { |
| | | try { |
| | | OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 66); |
| | | OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 56); |
| | | if (result.IsSuccess) { |
| | | ZyDualCrnStatusEntity crnStatus = new ZyDualCrnStatusEntity(); |
| | | crnStatus.setCrnNo(deviceConfig.getDeviceNo()); |
| | | crnStatus.setMode((int) siemensNet.getByteTransform().TransInt16(result.Content, 0)); |
| | | |
| | | //工位1 |
| | | crnStatus.setTaskNo((int) siemensNet.getByteTransform().TransInt16(result.Content, 2)); |
| | | crnStatus.setStatus((int) siemensNet.getByteTransform().TransInt16(result.Content, 4)); |
| | | crnStatus.setForkPos((int) siemensNet.getByteTransform().TransInt16(result.Content, 6)); |
| | | crnStatus.setLoaded((int) siemensNet.getByteTransform().TransInt16(result.Content, 8)); |
| | | crnStatus.setTaskReceive((int) siemensNet.getByteTransform().TransInt16(result.Content, 10)); |
| | | |
| | | //工位2 |
| | | crnStatus.setTaskNoTwo((int) siemensNet.getByteTransform().TransInt16(result.Content, 12)); |
| | | crnStatus.setStatusTwo((int) siemensNet.getByteTransform().TransInt16(result.Content, 14)); |
| | | crnStatus.setForkPosTwo((int) siemensNet.getByteTransform().TransInt16(result.Content, 16)); |
| | | crnStatus.setLoadedTwo((int) siemensNet.getByteTransform().TransInt16(result.Content, 18)); |
| | | crnStatus.setTaskReceiveTwo((int) siemensNet.getByteTransform().TransInt16(result.Content, 20)); |
| | | |
| | | crnStatus.setBay((int) siemensNet.getByteTransform().TransInt16(result.Content, 22)); |
| | | crnStatus.setLevel((int) siemensNet.getByteTransform().TransInt16(result.Content, 24)); |
| | | crnStatus.setLiftPos((int) siemensNet.getByteTransform().TransInt16(result.Content, 26)); |
| | | crnStatus.setWalkPos((int) siemensNet.getByteTransform().TransInt16(result.Content, 28)); |
| | | crnStatus.setAlarm((int) siemensNet.getByteTransform().TransInt16(result.Content, 30)); |
| | | crnStatus.setTemp1((int) siemensNet.getByteTransform().TransInt16(result.Content, 34)); |
| | | crnStatus.setTemp2((int) siemensNet.getByteTransform().TransInt16(result.Content, 36)); |
| | | crnStatus.setTemp3((int) siemensNet.getByteTransform().TransInt16(result.Content, 38)); |
| | | crnStatus.setTemp4((int) siemensNet.getByteTransform().TransInt16(result.Content, 40)); |
| | | crnStatus.setXSpeed((int) siemensNet.getByteTransform().TransInt16(result.Content, 42)); |
| | | crnStatus.setYSpeed((int) siemensNet.getByteTransform().TransInt16(result.Content, 44)); |
| | | crnStatus.setZSpeed((int) siemensNet.getByteTransform().TransInt16(result.Content, 46)); |
| | | crnStatus.setXDistance((int) siemensNet.getByteTransform().TransInt16(result.Content, 48)); |
| | | crnStatus.setYDistance((int) siemensNet.getByteTransform().TransInt16(result.Content, 50)); |
| | | crnStatus.setXDuration((int) siemensNet.getByteTransform().TransInt16(result.Content, 52)); |
| | | crnStatus.setYDuration((int) siemensNet.getByteTransform().TransInt16(result.Content, 54)); |
| | | crnStatus.setGoodsType((int) siemensNet.getByteTransform().TransInt16(result.Content, 56)); |
| | | crnStatus.setMode((int)siemensNet.getByteTransform().TransInt16(result.Content, 0)); |
| | | crnStatus.setTaskNo((int)siemensNet.getByteTransform().TransInt16(result.Content, 2)); |
| | | crnStatus.setStatus((int)siemensNet.getByteTransform().TransInt16(result.Content, 4)); |
| | | crnStatus.setBay((int)siemensNet.getByteTransform().TransInt16(result.Content, 6)); |
| | | crnStatus.setLevel((int)siemensNet.getByteTransform().TransInt16(result.Content, 8)); |
| | | crnStatus.setForkPos((int)siemensNet.getByteTransform().TransInt16(result.Content, 10)); |
| | | crnStatus.setLiftPos((int)siemensNet.getByteTransform().TransInt16(result.Content, 12)); |
| | | crnStatus.setWalkPos((int)siemensNet.getByteTransform().TransInt16(result.Content, 14)); |
| | | crnStatus.setLoaded((int)siemensNet.getByteTransform().TransInt16(result.Content, 16)); |
| | | crnStatus.setAlarm((int)siemensNet.getByteTransform().TransInt16(result.Content, 18)); |
| | | crnStatus.setTemp1((int)siemensNet.getByteTransform().TransInt16(result.Content, 20)); |
| | | crnStatus.setTemp2((int)siemensNet.getByteTransform().TransInt16(result.Content, 22)); |
| | | crnStatus.setTemp3((int)siemensNet.getByteTransform().TransInt16(result.Content, 24)); |
| | | crnStatus.setTemp4((int)siemensNet.getByteTransform().TransInt16(result.Content, 26)); |
| | | crnStatus.setXSpeed((int)siemensNet.getByteTransform().TransInt16(result.Content, 28)); |
| | | crnStatus.setYSpeed((int)siemensNet.getByteTransform().TransInt16(result.Content, 32)); |
| | | crnStatus.setZSpeed((int)siemensNet.getByteTransform().TransInt16(result.Content, 36)); |
| | | crnStatus.setXDistance((int) siemensNet.getByteTransform().TransSingle(result.Content, 40)); |
| | | crnStatus.setYDistance((int) siemensNet.getByteTransform().TransSingle(result.Content, 44)); |
| | | crnStatus.setXDuration((int) siemensNet.getByteTransform().TransSingle(result.Content, 48)); |
| | | crnStatus.setYDuration((int) siemensNet.getByteTransform().TransSingle(result.Content, 52)); |
| | | crnStatus.setWeight(siemensNet.getByteTransform().TransSingle(result.Content, 56)); |
| | | |
| | | String barcode = siemensNet.getByteTransform().TransString(result.Content, 58, 8, "UTF-8"); |
| | | crnStatus.setBarcode(barcode); |
| | |
| | | return response; |
| | | } |
| | | |
| | | int writeAck = 0; |
| | | do { |
| | | OperateResult resultAck = siemensNet.Write("DB100.0", (short) 0); |
| | | if (resultAck.IsSuccess){ |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 2); |
| | | short ack = siemensNet.getByteTransform().TransInt16(resultRead.Content, 0); |
| | | if (ack != 0) { |
| | | writeAck++; |
| | | }else { |
| | | // News.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), "ack复位完成"); |
| | | break; |
| | | } |
| | | } |
| | | }while (writeAck <5); |
| | | |
| | | String address = "DB100.0"; |
| | | if (command.getStation() == 1) { |
| | | //工位1 |
| | | address = "DB100.0"; |
| | | }else { |
| | | //工位2 |
| | | address = "DB100.18"; |
| | | } |
| | | |
| | | String confirmAddress = "DB100.16"; |
| | | if (command.getStation() == 1) { |
| | | //工位1 |
| | | confirmAddress = "DB100.16"; |
| | | }else { |
| | | //工位2 |
| | | confirmAddress = "DB100.34"; |
| | | } |
| | | String confirmAddress = "DB100.18"; |
| | | |
| | | short[] array = new short[9]; |
| | | array[0] = command.getTaskNo().shortValue(); |
| | | array[1] = command.getTaskMode().shortValue(); |
| | | array[2] = command.getSourcePosX().shortValue(); |
| | | array[3] = command.getSourcePosY().shortValue(); |
| | | array[4] = command.getSourcePosZ().shortValue(); |
| | | array[5] = command.getDestinationPosX().shortValue(); |
| | | array[6] = command.getDestinationPosY().shortValue(); |
| | | array[7] = command.getDestinationPosZ().shortValue(); |
| | | array[8] = (short) 0; |
| | | short[] array = new short[10]; |
| | | array[0] = 0; |
| | | array[1] = command.getTaskNo().shortValue(); |
| | | array[2] = command.getTaskMode().shortValue(); |
| | | array[3] = command.getSourcePosX().shortValue(); |
| | | array[4] = command.getSourcePosY().shortValue(); |
| | | array[5] = command.getSourcePosZ().shortValue(); |
| | | array[6] = command.getDestinationPosX().shortValue(); |
| | | array[7] = command.getDestinationPosY().shortValue(); |
| | | array[8] = command.getDestinationPosZ().shortValue(); |
| | | array[9] = (short) 0; |
| | | |
| | | OperateResult result = siemensNet.Write(address, array); |
| | | if (!result.IsSuccess) { |
| | |
| | | |
| | | int idx = 0; |
| | | do { |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read(address, (short) 18); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read(address, (short) 20); |
| | | if (resultRead.IsSuccess) { |
| | | short taskNo = siemensNet.getByteTransform().TransInt16(resultRead.Content, 2); |
| | | short taskMode = siemensNet.getByteTransform().TransInt16(resultRead.Content, 4); |
| | |
| | | if (result.IsSuccess) { |
| | | for (int i = 0; i < statusList.size(); i++) { |
| | | ZyStationStatusEntity statusEntity = statusList.get(i); // 站点编号 |
| | | statusEntity.setTaskNo((int) siemensNet.getByteTransform().TransInt16(result.Content, i * 8)); // 工作号 |
| | | statusEntity.setTaskNo(siemensNet.getByteTransform().TransInt32(result.Content, i * 8)); // 工作号 |
| | | statusEntity.setTargetStaNo((int) siemensNet.getByteTransform().TransInt16(result.Content, i * 8 + 4)); // 目标站 |
| | | |
| | | boolean[] status = siemensNet.getByteTransform().TransBool(result.Content, i * 8 + 6, 2); |
| | |
| | | statusEntity.setOutEnable(status[3]);// 可出 |
| | | statusEntity.setEmptyMk(status[4]); // 空板信号 |
| | | statusEntity.setFullPlt(status[5]); // 满托盘 |
| | | |
| | | if (statusEntity.getStationId()==1015){ |
| | | OperateResultExOne<byte[]> result1 = siemensNet.Read("DB101.3826", (short) (4)); |
| | | if (result1.IsSuccess) { |
| | | statusEntity.setWeight((double) siemensNet.getByteTransform().TransSingle(result1.Content, 0)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 条码扫描器 |
| | | OperateResultExOne<byte[]> result2 = siemensNet.Read("DB101.840", (short) (barcodeOriginList.size() * 8)); |
| | | OperateResultExOne<byte[]> result2 = siemensNet.Read("DB101.3760", (short) (barcodeOriginList.size() * 52)); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeOriginList.size(); i++) { |
| | | ZyStationStatusEntity barcodeEntity = findStatusEntityByBarcodeIdx(i + 1); |
| | | if (barcodeEntity == null) { |
| | | continue; |
| | | } |
| | | String barcode = siemensNet.getByteTransform().TransString(result2.Content, i * 8, 8, "UTF-8"); |
| | | String barcode = siemensNet.getByteTransform().TransString(result2.Content, i * 52, 52, "UTF-8"); |
| | | barcode = barcode.trim(); |
| | | barcodeEntity.setBarcode(barcode); |
| | | } |
| | | } |
| | | |
| | | // 报警信息 |
| | | OperateResultExOne<byte[]> result3 = siemensNet.Read("DB101.800", (short) (barcodeOriginList.size() * 3)); |
| | | OperateResultExOne<byte[]> result3 = siemensNet.Read("DB101.2400", (short) (barcodeOriginList.size() * 3)); |
| | | if (result3.IsSuccess) { |
| | | for (int i = 0; i < barcodeOriginList.size(); i++) { |
| | | ZyStationStatusEntity barcodeEntity = findStatusEntityByBarcodeIdx(i + 1); |
| | |
| | | } |
| | | |
| | | OperateResult write = null; |
| | | OperateResult write1 = null; |
| | | // 任务下发次数 |
| | | int writeCount = 0; |
| | | do { |
| | | short[] data = new short[2]; |
| | | data[0] = command.getTaskNo().shortValue(); |
| | | data[1] = command.getTargetStaNo().shortValue(); |
| | | // short[] data = new short[2]; |
| | | // data[0] = command.getTaskNo(); |
| | | // data[1] = command.getTargetStaNo().shortValue(); |
| | | |
| | | write = siemensNet.Write("DB100." + index * 4, data); |
| | | if (write.IsSuccess) { |
| | | write = siemensNet.Write("DB100." + index * 6, command.getTaskNo()); |
| | | write1 =siemensNet.Write("DB100." + (index * 6+4), command.getTargetStaNo().shortValue()); |
| | | if (write.IsSuccess&&write1.IsSuccess) { |
| | | log.error("写入输送线命令成功。站点编号={},站点数据={},写入次数={}", command.getStationId(), JSON.toJSON(command), |
| | | writeCount); |
| | | commandResponse.setResult(true); |
| | |
| | | |
| | | CreateInTaskParam taskParam = new CreateInTaskParam(); |
| | | taskParam.setTaskNo(String.valueOf(commonService.getWorkNo(WrkIoType.IN.id))); |
| | | taskParam.setSourceStaNo(stationId); |
| | | taskParam.setStaNo(targetStationId); |
| | | taskParam.setSourceStaNo(String.valueOf(stationId)); |
| | | taskParam.setStaNo(String.valueOf(targetStationId)); |
| | | taskParam.setLocNo(locMast.getLocNo()); |
| | | taskParam.setBarcode(stationProtocol.getBarcode()); |
| | | WrkMast wrkMast = commonService.createInTask(taskParam); |
| | |
| | | News.error("WMS入库请求失败,重新发起请求,barcode={},stationId={},response={}", barcode, |
| | | stationIdVal, response); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | continue; |
| | | } |
| | |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | CreateInTaskParam taskParam = new CreateInTaskParam(); |
| | | taskParam.setTaskNo(dto.getTaskNo()); |
| | | taskParam.setTaskNo(String.valueOf(dto.getTaskNo())); |
| | | taskParam.setLocNo(dto.getLocNo()); |
| | | taskParam.setTaskPri(dto.getTaskPri()); |
| | | taskParam.setBarcode(barcode); |
| | |
| | | News.error("WMS入库接口返回非200,重新发起请求,barcode={},stationId={},response={}", barcode, |
| | | stationIdVal, response); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | } |
| | | } else { |
| | |
| | | // 没有请求进行中,发起新的异步请求 |
| | | News.info("发起异步WMS入库请求,barcode={},stationId={}", barcode, stationIdVal); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | } |
| | | } |
| | |
| | | |
| | | wrkMast.setWrkSts(updateWrkSts); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setWeight(Cools.isEmpty(crnProtocol.getWeight()) ? 11.11 : crnProtocol.getWeight()); |
| | | wrkMast.setIoTime(new Date()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | CrnCommand resetCommand = crnThread.getResetCommand(crnProtocol.getCrnNo()); |
| | |
| | | stationOperateProcessUtils.stationInExecute(); |
| | | //执行输送站点出库任务 |
| | | stationOperateProcessUtils.stationOutExecute(); |
| | | //检测出库任务到达目的地 |
| | | stationOperateProcessUtils.arriveAtTheDestination(); |
| | | //检测输送站点出库任务执行完成 |
| | | stationOperateProcessUtils.stationOutExecuteFinish(); |
| | | |
| | |
| | | if (stationProtocol == null) { |
| | | continue; |
| | | } |
| | | String barcode = stationProtocol.getBarcode(); |
| | | |
| | | // 满足自动、有物、有工作号,生成入库数据 |
| | | if (stationProtocol.isAutoing() |
| | | && stationProtocol.isLoading() |
| | | && stationProtocol.getTaskNo() > 0) { |
| | | && stationProtocol.getTaskNo() == 0) { |
| | | if (Cools.isEmpty(stationProtocol.getBarcode())) { |
| | | continue; |
| | | } |
| | | //是否报警 |
| | | if (stationProtocol.getError()>0){ |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | 9991, 1015, 1013, 0); |
| | | stationProtocol.setSystemWarning(stationProtocol.getErrorMsg()); |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | continue; |
| | | } |
| | | |
| | | String[] split = barcode.split(","); |
| | | String bar = split[0]; |
| | | // 检测任务是否生成 |
| | | List<WrkMast> wrkMasts = wrkMastService |
| | | .selectList(new EntityWrapper<WrkMast>().eq("barcode", stationProtocol.getBarcode())); |
| | | .selectList(new EntityWrapper<WrkMast>().eq("barcode", bar)); |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | String barcode = stationProtocol.getBarcode(); |
| | | |
| | | Integer stationIdVal = stationProtocol.getStationId(); |
| | | |
| | | // 1. 首先查询是否有已完成的异步响应 |
| | |
| | | News.error("WMS入库请求失败,重新发起请求,barcode={},stationId={},response={}", barcode, |
| | | stationIdVal, response); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | // stationProtocol.setSys |
| | | continue; |
| | | } |
| | | |
| | |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | CreateInTaskParam taskParam = new CreateInTaskParam(); |
| | | taskParam.setTaskNo(dto.getTaskNo()); |
| | | taskParam.setTaskNo(String.valueOf(dto.getTaskNo())); |
| | | taskParam.setLocNo(dto.getLocNo()); |
| | | taskParam.setTaskPri(dto.getTaskPri()); |
| | | taskParam.setBarcode(barcode); |
| | | taskParam.setBarcode(dto.getBarcode()); |
| | | taskParam.setSourceStaNo(String.valueOf(dto.getSourceStaNo())); |
| | | taskParam.setStaNo(String.valueOf(dto.getStaNo())); |
| | | taskParam.setCrnNo(dto.getCrnNo()); |
| | | WrkMast wrkMast = commonService.createInTask(taskParam); |
| | | |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | wrkMast.getWrkNo(), stationId, stationId, 0); |
| | | wrkMast.getWrkNo(), dto.getSourceStaNo(), dto.getStaNo(), 0); |
| | | if (command == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败"); |
| | | continue; |
| | | } |
| | | stationProtocol.setSystemWarning(""); |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | } else { |
| | | |
| | | stationProtocol.setSystemWarning(jsonObject.getString("msg")); |
| | | StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, |
| | | 9991, 1015, 1013, 0); |
| | | MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); |
| | | // 接口返回非200,重新发起请求 |
| | | News.error("WMS入库接口返回非200,重新发起请求,barcode={},stationId={},response={}", barcode, |
| | | stationIdVal, response); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | } |
| | | } else { |
| | |
| | | // 没有请求进行中,发起新的异步请求 |
| | | News.info("发起异步WMS入库请求,barcode={},stationId={}", barcode, stationIdVal); |
| | | wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal, |
| | | stationProtocol.getPalletHeight()); |
| | | stationProtocol.getPalletHeight(),stationProtocol.getWeight()); |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2); |
| | | } |
| | | // 如果有请求进行中,等待下次循环再检查 |
| | |
| | | |
| | | CommandResponse sendCommand(CrnCommand command);//下发命令 |
| | | |
| | | CommandResponse sendCommand1(CrnCommand command); |
| | | |
| | | CommandResponse sendCommand2(CrnCommand command); |
| | | |
| | | CommandResponse sendCommand3(CrnCommand command); |
| | | } |
| | |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | | import com.zy.core.utils.WmsOperateUtils; |
| | | import com.zy.asrs.entity.BasCrnpErrLog; |
| | | import com.zy.asrs.service.BasCrnpErrLogService; |
| | | |
| | |
| | | private ZyCrnConnectDriver zyCrnConnectDriver; |
| | | private CrnProtocol crnProtocol; |
| | | private int deviceLogCollectTime = 200; |
| | | private List<Integer> lastReportedIndices = new ArrayList<>(); |
| | | |
| | | public ZySiemensCrnThread(DeviceConfig deviceConfig, RedisUtil redisUtil) { |
| | | this.deviceConfig = deviceConfig; |
| | |
| | | if (step == 2) { |
| | | sendCommand((CrnCommand) task.getData()); |
| | | } |
| | | if (step == 3) { |
| | | sendCommand1((CrnCommand) task.getData()); |
| | | } |
| | | if (step == 4) { |
| | | sendCommand2((CrnCommand) task.getData()); |
| | | } |
| | | if (step == 5) { |
| | | sendCommand3((CrnCommand) task.getData()); |
| | | } |
| | | |
| | | |
| | | Thread.sleep(100); |
| | | } catch (Exception e) { |
| | |
| | | crnProtocol.setYDistance(crnStatus.getYDistance()); |
| | | crnProtocol.setXDuration(crnStatus.getXDuration()); |
| | | crnProtocol.setYDuration(crnStatus.getYDuration()); |
| | | crnProtocol.setWeight(crnStatus.getWeight()); |
| | | crnProtocol.setDb110Data(crnStatus.getDb110Data()); |
| | | |
| | | // 上报堆垛机DB110状态数据 |
| | | short[] db110Data = crnProtocol.getDb110Data(); |
| | | List<Integer> currentIndices = new ArrayList<>(); |
| | | if (db110Data != null) { |
| | | for (int i = 0; i < db110Data.length; i++) { |
| | | if (db110Data[i] == 1) { |
| | | currentIndices.add(i); |
| | | } |
| | | } |
| | | } |
| | | //!currentIndices.equals(lastReportedIndices) |
| | | boolean changed = true; |
| | | |
| | | if (changed) { |
| | | try { |
| | | WmsOperateUtils wmsOperateUtils = SpringUtils.getBean(WmsOperateUtils.class); |
| | | if (wmsOperateUtils != null) { |
| | | wmsOperateUtils.reportCrnDb110Status(crnProtocol.getCrnNo(), currentIndices); |
| | | lastReportedIndices = new ArrayList<>(currentIndices); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("Report Crn Db110 Status Fail", e); |
| | | } |
| | | } |
| | | |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), deviceConfig.getDeviceNo())); |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public synchronized CommandResponse sendCommand1(CrnCommand command) { |
| | | this.crnProtocol.setLastCommandTime(System.currentTimeMillis()); |
| | | CommandResponse response = null; |
| | | try { |
| | | response = zyCrnConnectDriver.sendCommand1(command); |
| | | return response; |
| | | } finally { |
| | | String sourceLocNo = Utils.getLocNo(command.getSourcePosX(), command.getSourcePosY(), command.getSourcePosZ()); |
| | | String targetLocNo = Utils.getLocNo(command.getDestinationPosX(), command.getDestinationPosY(), command.getDestinationPosZ()); |
| | | BasCrnpOptService bean = SpringUtils.getBean(BasCrnpOptService.class); |
| | | ZyCrnStatusEntity statusEntity = zyCrnConnectDriver.getStatus(); |
| | | BasCrnpOpt basCrnpOpt = new BasCrnpOpt( |
| | | command.getTaskNo().intValue(), |
| | | command.getCrnNo(), |
| | | new Date(), |
| | | String.valueOf(command.getTaskMode()), |
| | | sourceLocNo, |
| | | targetLocNo, |
| | | null, |
| | | null, |
| | | null, |
| | | JSON.toJSONString(command), |
| | | JSON.toJSONString(statusEntity), |
| | | 1, |
| | | JSON.toJSONString(response) |
| | | ); |
| | | if (bean != null) { |
| | | bean.insert(basCrnpOpt); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 管理站点的白灯情况 |
| | | * 1(亮,闪烁,上位下发任务) |
| | | * 默认0(暗) |
| | | * @param command |
| | | * @return |
| | | */ |
| | | |
| | | @Override |
| | | public synchronized CommandResponse sendCommand2(CrnCommand command) { |
| | | this.crnProtocol.setLastCommandTime(System.currentTimeMillis()); |
| | | CommandResponse response = null; |
| | | try { |
| | | response = zyCrnConnectDriver.sendCommand2(command); |
| | | return response; |
| | | } finally { |
| | | String sourceLocNo = Utils.getLocNo(command.getSourcePosX(), command.getSourcePosY(), command.getSourcePosZ()); |
| | | String targetLocNo = Utils.getLocNo(command.getDestinationPosX(), command.getDestinationPosY(), command.getDestinationPosZ()); |
| | | BasCrnpOptService bean = SpringUtils.getBean(BasCrnpOptService.class); |
| | | ZyCrnStatusEntity statusEntity = zyCrnConnectDriver.getStatus(); |
| | | BasCrnpOpt basCrnpOpt = new BasCrnpOpt( |
| | | command.getTaskNo().intValue(), |
| | | command.getCrnNo(), |
| | | new Date(), |
| | | String.valueOf(command.getTaskMode()), |
| | | sourceLocNo, |
| | | targetLocNo, |
| | | null, |
| | | null, |
| | | null, |
| | | JSON.toJSONString(command), |
| | | JSON.toJSONString(statusEntity), |
| | | 1, |
| | | JSON.toJSONString(response) |
| | | ); |
| | | if (bean != null) { |
| | | bean.insert(basCrnpOpt); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 管理站点的黄色按钮状态及颜色 |
| | | * 1:人工按按钮确认 |
| | | * 2:上位机接收完成,运行给 |
| | | * 0:任务结束上位机清除状态 |
| | | * @param command |
| | | * @return |
| | | */ |
| | | @Override |
| | | public synchronized CommandResponse sendCommand3(CrnCommand command) { |
| | | this.crnProtocol.setLastCommandTime(System.currentTimeMillis()); |
| | | CommandResponse response = null; |
| | | try { |
| | | response = zyCrnConnectDriver.sendCommand3(command); |
| | | return response; |
| | | } finally { |
| | | String sourceLocNo = Utils.getLocNo(command.getSourcePosX(), command.getSourcePosY(), command.getSourcePosZ()); |
| | | String targetLocNo = Utils.getLocNo(command.getDestinationPosX(), command.getDestinationPosY(), command.getDestinationPosZ()); |
| | | BasCrnpOptService bean = SpringUtils.getBean(BasCrnpOptService.class); |
| | | ZyCrnStatusEntity statusEntity = zyCrnConnectDriver.getStatus(); |
| | | BasCrnpOpt basCrnpOpt = new BasCrnpOpt( |
| | | command.getTaskNo().intValue(), |
| | | command.getCrnNo(), |
| | | new Date(), |
| | | String.valueOf(command.getTaskMode()), |
| | | sourceLocNo, |
| | | targetLocNo, |
| | | null, |
| | | null, |
| | | null, |
| | | JSON.toJSONString(command), |
| | | JSON.toJSONString(statusEntity), |
| | | 1, |
| | | JSON.toJSONString(response) |
| | | ); |
| | | if (bean != null) { |
| | | bean.insert(basCrnpOpt); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (step == 2) { |
| | | sendCommand((StationCommand) task.getData()); |
| | | } |
| | | |
| | | Thread.sleep(100); |
| | | } catch (Exception e) { |
| | | log.error("StationProcess Fail", e); |
| | |
| | | import com.zy.core.model.protocol.StationProtocol; |
| | | import com.zy.core.thread.CrnThread; |
| | | import com.zy.core.thread.StationThread; |
| | | import lombok.Synchronized; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Component |
| | | public class CrnOperateProcessUtils { |
| | |
| | | } |
| | | } |
| | | |
| | | private synchronized void crnExecuteIn(BasCrnp basCrnp, CrnThread crnThread) { |
| | | @Synchronized |
| | | private void crnExecuteIn(BasCrnp basCrnp, CrnThread crnThread) { |
| | | CrnProtocol crnProtocol = crnThread.getStatus(); |
| | | if(crnProtocol == null){ |
| | | return; |
| | |
| | | String sourceLocNo = Utils.getLocNo(stationObjModel.getDeviceRow(), stationObjModel.getDeviceBay(), stationObjModel.getDeviceLev()); |
| | | |
| | | CrnCommand command = crnThread.getPickAndPutCommand(sourceLocNo, wrkMast.getLocNo(), wrkMast.getWrkNo(), crnNo); |
| | | |
| | | wrkMast.setWrkSts(WrkStsType.INBOUND_RUN.sts); |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | if (i>-1){ |
| | | command.setLocNo(wrkMast.getLocNo()); |
| | | command.setIndex(i); |
| | | command.setValue((short)1); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command)); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_IN_TASK_RUN, null); |
| | | News.info("堆垛机命令下发成功,堆垛机号={},任务数据={}", crnNo, JSON.toJSON(command)); |
| | |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | if (i>-1){ |
| | | command.setLocNo(wrkMast.getSourceLocNo()); |
| | | command.setIndex(i); |
| | | command.setValue((short)1); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command)); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_OUT_TASK_RUN, null); |
| | | News.info("堆垛机命令下发成功,堆垛机号={},任务数据={}", crnNo, JSON.toJSON(command)); |
| | |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | String locNo = wrkMast.getLocNo(); |
| | | if (i == -1) { |
| | | i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | } |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | if (i>-1){ |
| | | command.setLocNo(locNo); |
| | | command.setIndex(i); |
| | | command.setValue((short)1); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command)); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_TRANSFER_TASK_RUN, null); |
| | | News.info("堆垛机命令下发成功,堆垛机号={},任务数据={}", crnNo, JSON.toJSON(command)); |
| | |
| | | News.error("堆垛机处于等待确认且任务完成状态,但未找到工作档。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | continue; |
| | | } |
| | | |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = -1; |
| | | String locNo = ""; |
| | | Long updateWrkSts = null; |
| | | if(wrkMast.getWrkSts() == WrkStsType.INBOUND_RUN.sts){ |
| | | updateWrkSts = WrkStsType.COMPLETE_INBOUND.sts; |
| | | i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | locNo = wrkMast.getLocNo(); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnProtocol.getCrnNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_IN_TASK_COMPLETE, null); |
| | | }else if(wrkMast.getWrkSts() == WrkStsType.OUTBOUND_RUN.sts){ |
| | | updateWrkSts = WrkStsType.OUTBOUND_RUN_COMPLETE.sts; |
| | | i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnProtocol.getCrnNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_OUT_TASK_COMPLETE, null); |
| | | }else if(wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_RUN.sts){ |
| | | updateWrkSts = WrkStsType.COMPLETE_LOC_MOVE.sts; |
| | | i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | locNo = wrkMast.getLocNo(); |
| | | if(i==-1){ |
| | | i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | } |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnProtocol.getCrnNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_TRANSFER_TASK_COMPLETE, null); |
| | | }else{ |
| | | News.error("堆垛机处于等待确认且任务完成状态,但工作状态异常。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | |
| | | wrkMast.setWrkSts(updateWrkSts); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWeight(crnProtocol.getWeight()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | CrnCommand resetCommand = crnThread.getResetCommand(crnProtocol.getCrnNo()); |
| | | MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(2, resetCommand)); |
| | | if (i>-1){ |
| | | resetCommand.setLocNo(locNo); |
| | | resetCommand.setIndex(i); |
| | | resetCommand.setValue((short)0); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(3, resetCommand)); |
| | | News.info("堆垛机任务状态更新成功,堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | } |
| | | |
| | |
| | | String moveLocNo = dto.getLocNo(); |
| | | |
| | | CreateLocMoveTaskParam moveTaskParam = new CreateLocMoveTaskParam(); |
| | | moveTaskParam.setTaskNo(dto.getTaskNo()); |
| | | moveTaskParam.setTaskNo(String.valueOf(dto.getTaskNo())); |
| | | moveTaskParam.setSourceLocNo(shallowLocNo); |
| | | moveTaskParam.setLocNo(moveLocNo); |
| | | try { |
| | |
| | | wrkMast.setWrkSts(updateWrkSts); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWeight(300D); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | News.info("双工位堆垛机任务状态更新成功,堆垛机号={},工作号={}", basDualCrnp.getCrnNo(), taskNo); |
| | | } |
| | |
| | | String moveLocNo = dto.getLocNo(); |
| | | |
| | | CreateLocMoveTaskParam moveTaskParam = new CreateLocMoveTaskParam(); |
| | | moveTaskParam.setTaskNo(dto.getTaskNo()); |
| | | moveTaskParam.setTaskNo(String.valueOf(dto.getTaskNo())); |
| | | moveTaskParam.setSourceLocNo(shallowLocNo); |
| | | moveTaskParam.setLocNo(moveLocNo); |
| | | try { |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.entity.FindCrnNoResult; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.StationCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.StationProtocol; |
| | | import com.zy.core.thread.CrnThread; |
| | | import com.zy.core.thread.StationThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WmsOperateUtils wmsOperateUtils; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | |
| | | //执行输送站点入库任务 |
| | | public synchronized void stationInExecute() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if(stationThread == null){ |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | List<StationObjModel> list = basDevp.getBarcodeStationList$(); |
| | | for (StationObjModel entity : list) { |
| | | Integer stationId = entity.getStationId(); |
| | | if(!stationMap.containsKey(stationId)){ |
| | | if (!stationMap.containsKey(stationId)) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | Object lock = redisUtil.get(RedisKeyType.STATION_IN_EXECUTE_LIMIT.key + stationId); |
| | | if(lock != null){ |
| | | if (lock != null) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | StationCommand command = stationThread.getCommand(StationCommandType.MOVE, wrkMast.getWrkNo(), stationId, targetStationId, 0); |
| | | if(command == null){ |
| | | if (command == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}工作,获取输送线命令失败", wrkMast.getWrkNo()); |
| | | continue; |
| | | } |
| | |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", wrkMast.getCrnNo())); |
| | | if (basCrnp != null) { |
| | | outStationList = basCrnp.getOutStationList$(); |
| | | if(outStationList.isEmpty()){ |
| | | if (outStationList.isEmpty()) { |
| | | News.info("堆垛机:{} 出库站点未设置", basCrnp.getCrnNo()); |
| | | continue; |
| | | } |
| | |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", wrkMast.getDualCrnNo())); |
| | | if (basDualCrnp != null) { |
| | | outStationList = basDualCrnp.getOutStationList$(); |
| | | if(outStationList.isEmpty()){ |
| | | if (outStationList.isEmpty()) { |
| | | News.info("双工位堆垛机:{} 出库站点未设置", basDualCrnp.getCrnNo()); |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (StationObjModel stationObjModel : outStationList) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, stationObjModel.getDeviceNo()); |
| | | if(stationThread == null){ |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | && stationProtocol.getTaskNo() == 0 |
| | | ) { |
| | | StationCommand command = stationThread.getCommand(StationCommandType.MOVE, wrkMast.getWrkNo(), stationProtocol.getStationId(), wrkMast.getStaNo(), 0); |
| | | if(command == null){ |
| | | if (command == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败"); |
| | | continue; |
| | | } |
| | |
| | | News.info("输送站点出库命令下发成功,站点号={},工作号={},命令数据={}", stationProtocol.getStationId(), wrkMast.getWrkNo(), JSON.toJSONString(command)); |
| | | redisUtil.set(RedisKeyType.STATION_OUT_EXECUTE_LIMIT.key + stationProtocol.getStationId(), "lock", 5); |
| | | redisUtil.set(RedisKeyType.STATION_OUT_EXECUTE_COMPLETE_LIMIT.key + wrkMast.getWrkNo(), "lock", 60 * 5); |
| | | redisUtil.set(RedisKeyType.STATION_OUT_EXECUTE_DESTINATION_LIMIT.key + wrkMast.getWrkNo(), "lock", 60 * 5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //检测出库任务到达目的地 |
| | | public synchronized void arriveAtTheDestination() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN.sts)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | Integer wrkNo = wrkMast.getWrkNo(); |
| | | |
| | | // Object lock = redisUtil.get(RedisKeyType.STATION_OUT_EXECUTE_DESTINATION_LIMIT.key + wrkNo); |
| | | // if (lock != null) { |
| | | // continue; |
| | | // } |
| | | |
| | | boolean complete = false; |
| | | |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | List<StationProtocol> list = stationThread.getStatus(); |
| | | for (StationProtocol stationProtocol : list) { |
| | | if (stationProtocol.getTaskNo().equals(wrkNo)&&stationProtocol.getStationId().equals(wrkMast.getStaNo())) { |
| | | complete = true; |
| | | } |
| | | } |
| | | if (complete) { |
| | | //上报--到达目的地上报wms |
| | | notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.ARRIVE_AT_THE_DESTINATION, JSON.toJSONString(wrkMast)); |
| | | wrkMast.setWrkSts(WrkStsType.ARRIVE_AT_THE_DESTINATION.sts); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //检测库位橙色按钮信号 1:员工确认(常亮) 2 :上位机确认(闪烁)0 :熄灭 |
| | | public synchronized void locNo() { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(null); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if(crnThread == null){ |
| | | continue; |
| | | } |
| | | |
| | | CrnProtocol crnProtocol = crnThread.getStatus(); |
| | | if(crnProtocol == null){ |
| | | continue; |
| | | } |
| | | |
| | | |
| | | } |
| | | // List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.ARRIVE_AT_THE_DESTINATION.sts)); |
| | | // for (WrkMast wrkMast : wrkMasts) { |
| | | // Integer wrkNo = wrkMast.getWrkNo(); |
| | | // |
| | | // Object lock = redisUtil.get(RedisKeyType.STATION_OUT_EXECUTE_COMPLETE_LIMIT.key + wrkNo); |
| | | // if (lock != null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // boolean complete = false; |
| | | // |
| | | // StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, wrkMast.getStaNo()); |
| | | // if (stationThread == null) { |
| | | // continue; |
| | | // } |
| | | // List<StationProtocol> list = stationThread.getStatus(); |
| | | // for (StationProtocol stationProtocol : list) { |
| | | // if (stationProtocol.getTaskNo().equals(wrkNo)) { |
| | | // complete = true; |
| | | // } |
| | | // } |
| | | // if (complete) { |
| | | // //上报--到达目的地上报wms |
| | | // notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.ARRIVE_AT_THE_DESTINATION, JSON.toJSONString(wrkMast)); |
| | | // wrkMast.setWrkSts(WrkStsType.ARRIVE_AT_THE_DESTINATION.sts); |
| | | // wrkMast.setIoTime(new Date()); |
| | | // wrkMastService.updateById(wrkMast); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | //检测输送站点出库任务执行完成 |
| | | public synchronized void stationOutExecuteFinish() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN.sts)); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.ARRIVE_AT_THE_DESTINATION.sts)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | Integer wrkNo = wrkMast.getWrkNo(); |
| | | |
| | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if(stationThread == null){ |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | List<StationProtocol> list = stationThread.getStatus(); |
| | | for (StationProtocol stationProtocol : list) { |
| | | if(stationProtocol.isAutoing() |
| | | && stationProtocol.isLoading() |
| | | && stationProtocol.getTaskNo() > 0 |
| | | && stationProtocol.isRunBlock() |
| | | if (stationProtocol.isAutoing() |
| | | && stationProtocol.isLoading() |
| | | && stationProtocol.getTaskNo() > 0 |
| | | && stationProtocol.isRunBlock() |
| | | ) { |
| | | WrkMast wrkMast = wrkMastService.selectByWorkNo(stationProtocol.getTaskNo()); |
| | | if (wrkMast == null) { |
| | |
| | | } |
| | | |
| | | StationCommand command = stationThread.getCommand(StationCommandType.MOVE, wrkMast.getWrkNo(), stationProtocol.getStationId(), targetStationId, 0); |
| | | if(command == null){ |
| | | if (command == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}工作,获取输送线命令失败", wrkMast.getWrkNo()); |
| | | continue; |
| | | } |
| | |
| | | wrkMast.setCrnNo(crnNo); |
| | | } else if (findCrnNoResult.getCrnType().equals(SlaveType.DualCrn)) { |
| | | wrkMast.setDualCrnNo(crnNo); |
| | | }else { |
| | | } else { |
| | | throw new CoolException("未知设备类型"); |
| | | } |
| | | |
| | |
| | | } else { |
| | | News.error("请求WMS接口失败!!!response:{}", response); |
| | | } |
| | | }else { |
| | | } else { |
| | | //运行堵塞,重新计算路线 |
| | | StationCommand command = stationThread.getCommand(StationCommandType.MOVE, wrkMast.getWrkNo(), stationProtocol.getStationId(), wrkMast.getStaNo(), 0); |
| | | if(command == null){ |
| | | if (command == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败"); |
| | | continue; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasDualCrnp; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.BasDualCrnpService; |
| | | import com.zy.asrs.service.BasStationService; |
| | | import com.zy.asrs.service.HttpRequestLogService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.impl.LocMastServiceImpl; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.entity.FindCrnNoResult; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private LocMastServiceImpl locMastService; |
| | | |
| | | // 申请入库任务 |
| | | public synchronized String applyInTask(String barcode, Integer sourceStaNo, Integer locType1) { |
| | | public synchronized String applyInTask(String barcode, Integer sourceStaNo, Integer locType1,Double weight) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj == null) { |
| | | News.error("系统Config缓存失效"); |
| | | return null; |
| | | } |
| | | |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | |
| | | String wmsUrl = systemConfigMap.get("wmsSystemUri"); |
| | |
| | | requestParam.put("sourceStaNo", stationNo); |
| | | requestParam.put("locType1", locType1); |
| | | requestParam.put("row", Utils.getInTaskEnableRow(sourceStaNo)); |
| | | requestParam.put("ioType",1); |
| | | requestParam.put("weight", weight); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | |
| | | |
| | | /** |
| | | * 异步申请入库任务 - 非阻塞版本 |
| | | * 将请求提交到线程池异步执行,结果存储到Redis中 |
| | | * |
| | | * @param barcode 托盘码 |
| | | * @param sourceStaNo 站点编号 |
| | | * @param locType1 托盘高度 |
| | | */ |
| | | public void applyInTaskAsync(String barcode, Integer sourceStaNo, Integer locType1) { |
| | | public void applyInTaskAsync(String barcode, Integer sourceStaNo, Integer locType1,Double weight) { |
| | | String requestKey = RedisKeyType.ASYNC_WMS_IN_TASK_REQUEST.key + barcode + "_" + sourceStaNo; |
| | | String responseKey = RedisKeyType.ASYNC_WMS_IN_TASK_RESPONSE.key + barcode + "_" + sourceStaNo; |
| | | |
| | |
| | | // 提交异步任务 |
| | | new Thread(() -> { |
| | | try { |
| | | String response = applyInTask(barcode, sourceStaNo, locType1); |
| | | String response = applyInTask(barcode, sourceStaNo, locType1,weight); |
| | | if (response != null) { |
| | | // 存储响应结果,设置60秒超时 |
| | | redisUtil.set(responseKey, response, 60); |
| | | News.info("异步WMS入库请求完成,barcode={},stationId={},response={}", barcode, sourceStaNo, response); |
| | | News.info("异步WMS入库请求完成,barcode={},stationId={},response={},weight={}", barcode, sourceStaNo, response,weight); |
| | | } else { |
| | | // 请求失败,存储失败标记 |
| | | redisUtil.set(responseKey, "FAILED", 10); |
| | | News.error("异步WMS入库请求失败,barcode={},stationId={}", barcode, sourceStaNo); |
| | | News.error("异步WMS入库请求失败,barcode={},stationId={},weight={}", barcode, sourceStaNo,weight); |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("异步WMS入库请求异常,barcode={},stationId={},error={}", barcode, sourceStaNo, e.getMessage()); |
| | | News.error("异步WMS入库请求异常,barcode={},stationId={},error={},weight={}", barcode, sourceStaNo, e.getMessage(),weight); |
| | | redisUtil.set(responseKey, "ERROR:" + e.getMessage(), 10); |
| | | } finally { |
| | | // 清除请求进行中标记 |
| | |
| | | return response; |
| | | } |
| | | |
| | | // 上报堆垛机DB110状态数据 |
| | | public void reportCrnDb110Status(Integer crnNo, List<Integer> indices) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj == null) { |
| | | News.error("系统Config缓存失效"); |
| | | return; |
| | | } |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | |
| | | String wmsUrl = systemConfigMap.get("wmsSystemUri"); |
| | | if (wmsUrl == null) { |
| | | News.error("未配置WMS系统URI,配置文件Code编码:wmsSystemUri"); |
| | | return; |
| | | } |
| | | |
| | | String wmsSystemCrnStatusUrl = systemConfigMap.get("wmsSystemCrnStatusUrl"); |
| | | if (wmsSystemCrnStatusUrl == null) { |
| | | News.error("未配置WMS堆垛机状态上报接口地址,配置文件Code编码:wmsSystemCrnStatusUrl"); |
| | | return; |
| | | } |
| | | |
| | | String response = null; |
| | | int result = 0; |
| | | BasCrnp crnNo1 = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | if (crnNo1 == null) { |
| | | return; |
| | | } |
| | | // 根据indices下标从crnNo1的arr数组中取出对应值 |
| | | String[] split = crnNo1.getArr().split(","); |
| | | for (Integer idx : indices) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", split[idx])); |
| | | if (locMast == null||Cools.isEmpty(locMast.getBarcode())) { |
| | | News.info("没有查询到该库位或者没有找到该库位对应托盘码 :{}", split[idx]); |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setLocNo(locMast.getLocNo()); |
| | | command.setIndex(idx); |
| | | command.setValue((short)0); |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(5, command)); |
| | | continue; |
| | | } |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath(wmsSystemCrnStatusUrl) |
| | | .setJson(locMast.getBarcode()) |
| | | .setTimeout(30, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | if (response != null) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code") == 200) { |
| | | result = 1; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setLocNo(locMast.getLocNo()); |
| | | command.setIndex(idx); |
| | | command.setValue((short)2); |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(5, command)); |
| | | |
| | | News.info("请求WMS堆垛机状态上报接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemCrnStatusUrl, |
| | | JSON.toJSONString(locMast.getBarcode()), response); |
| | | } else { |
| | | News.info("请求WMS堆垛机状态上报接口失败,接口返回Code异常!!!url:{};request:{};response:{}", |
| | | wmsUrl + wmsSystemCrnStatusUrl, JSON.toJSONString(locMast.getBarcode()), response); |
| | | } |
| | | } else { |
| | | News.info("请求WMS堆垛机状态上报接口失败,接口未响应!!!url:{};request:{};response:{}", wmsUrl + wmsSystemCrnStatusUrl, |
| | | JSON.toJSONString(locMast.getBarcode()), response); |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("请求WMS堆垛机状态上报接口异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemCrnStatusUrl, |
| | | JSON.toJSONString(locMast.getBarcode()), response, e); |
| | | } finally { |
| | | HttpRequestLog httpRequestLog = new HttpRequestLog(); |
| | | httpRequestLog.setName(wmsUrl + wmsSystemCrnStatusUrl); |
| | | httpRequestLog.setRequest(JSON.toJSONString(locMast.getBarcode())); |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | validation-timeout: 3000 |
| | | connection-test-query: select 1 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | url: jdbc:mysql://127.0.0.1:3306/wcs?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://127.0.0.1:3306/hcwcs?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | mvc: |
| | |
| | | |
| | | #License相关配置 |
| | | license: |
| | | subject: crnWcsDev |
| | | subject: jxhcwcs |
| | | publicAlias: publicCert |
| | | storePass: public_zhongyang_123456789 |
| | | licensePath: license.lic |
| | |
| | | threadControlCount: 10 |
| | | liftType: lift |
| | | |
| | | mainProcessPlugin: FakeProcess |
| | | #mainProcessPlugin: FakeProcess |
| | | mainProcessPlugin: NormalProcess |
| | | |
| | | deviceLogStorage: |
| | | # 设备日志存储方式 mysql file |
| | |
| | | <result column="max_in_task" property="maxInTask" /> |
| | | <result column="max_out_task" property="maxOutTask" /> |
| | | <result column="deep_rows" property="deepRows" /> |
| | | <result column="arr" property="arr" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | <result column="system_msg" property="systemMsg" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="batch_seq" property="batchSeq" /> |
| | | <result column="weight" property="weight" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | var baseUrl = "/wcs"; |
| | | var baseUrl = "/hcwcs"; |
| | | |
| | | // 赋值 |
| | | function setVal(el, val) { |
| | |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title>浙江中扬 - 自动化立体仓库 - WCS</title> |
| | | <title>WCS</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | |
| | | <!-- 头部 --> |
| | | <div class="layui-header"> |
| | | <div class="layui-logo"> |
| | | <img src="../static/images/zy-logo-dark.png" style="display: inline-block; width: 60%;height: auto"> |
| | | <!-- <img src="../static/images/zy-logo-dark.png" style="display: inline-block; width: 60%;height: auto">--> |
| | | <!-- <span style="margin-top: 0; letter-spacing: 10px">中扬立库</span>--> |
| | | <!-- <img src="../static/image/logo.svg"/>--> |
| | | <!-- <cite>中扬 - Zoneyung</cite>--> |
| | |
| | | <!-- 主体部分 --> |
| | | <div class="layui-body"></div> |
| | | <!-- 底部 --> |
| | | <div class="layui-footer layui-text"> |
| | | copyright © 2026 浙江中扬立库技术有限公司 all rights reserved. |
| | | <span class="pull-right" id="system-version">Version loading...</span> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | |
| | | <input id="locType" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:80%;"> |
| | | <label class="layui-form-label">托盘码:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="barcode" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |