| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.service.DeviceErrorService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | |
| | | |
| | | public TaskWrk() {} |
| | | |
| | | public TaskWrk(WrkMast wrkMast) { |
| | | Date now = new Date(); |
| | | |
| | | taskNo = wrkMast.getWrkNo().toString(); |
| | | wrkNo = wrkMast.getWrkNo(); |
| | | status = TaskStatusType.RECEIVE.id; |
| | | createTime = now; |
| | | modiTime = now; |
| | | assignTime = now; |
| | | modiUser = wrkMast.getModiUser(); |
| | | ioPri = 1; |
| | | ioType = 1; |
| | | barcode = wrkMast.getBarcode(); |
| | | crnNo = wrkMast.getCrnNo(); |
| | | wrkSts = 1; |
| | | startPoint = wrkMast.getSourceStaNo().toString() ;//起点 |
| | | targetPoint = wrkMast.getStaNo().toString();//终点 |
| | | originStartPoint = wrkMast.getSourceStaNo().toString();//原始起点 |
| | | originTargetPoint = wrkMast.getStaNo().toString();//原始终点 |
| | | memo = wrkMast.getMemo(); |
| | | } |
| | | |
| | | public TaskWrk(String taskNo,Integer status,Integer wrkNo,Date createTime,Integer ioType,String startPoint,String targetPoint,Long modiUser,Date modiTime,String memo,String barcode,Date assignTime,Date executeTime,Date completeTime,Date cancelTime,Integer wrkSts,Integer crnNo,Integer commandStep,Integer transferMark,String originStartPoint,String originTargetPoint,Integer ioPri,Double scWeight) { |
| | | this.taskNo = taskNo; |
| | | this.status = status; |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.logErrTime); |
| | | } |
| | | |
| | | public Integer getStaNoSou$() { |
| | | switch (sourceStaNo){ |
| | | case 118: |
| | | case 121: |
| | | case 122: |
| | | case 218: |
| | | case 221: |
| | | case 222: |
| | | return sourceStaNo+1; |
| | | } |
| | | return staNo; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CarryParam { |
| | | //工作号 |
| | | private String taskNo; |
| | | |
| | | //入出库类型 |
| | | private Integer ioType; |
| | | |
| | | //优先级 |
| | | private Integer taskPriority; |
| | | |
| | | //容器编码 |
| | | private String barcode; |
| | | |
| | | //起点 |
| | | private String startPoint; |
| | | |
| | | //目标点 |
| | | private String targetPoint; |
| | | |
| | | //备注 |
| | | private String meno; |
| | | |
| | | public void updateLocNo(){ |
| | | startPoint = getPut(startPoint); |
| | | targetPoint = getPut(targetPoint); |
| | | } |
| | | public void updateIoTyoe(Integer ioTypeOld){ |
| | | switch (ioTypeOld){ |
| | | case 1: |
| | | this.ioType = 2; |
| | | break; |
| | | case 2: |
| | | this.ioType = 3; |
| | | break; |
| | | case 3: |
| | | this.ioType = 1; |
| | | break; |
| | | default: |
| | | this.ioType = 3; |
| | | } |
| | | } |
| | | |
| | | public String getPut(String point){ |
| | | String[] split = point.split("-"); |
| | | if (split.length == 5){ |
| | | // String locNo = String.format("%02d", ) + |
| | | // String.format("%03d", split[3]) + |
| | | // String.format("%02d", split[4]); |
| | | return split[2]+"0"+split[3]+split[4]; |
| | | } else { |
| | | return point; |
| | | } |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count){ |
| | | if (msg.length() == count){ |
| | | return msg; |
| | | } else if (msg.length() > count){ |
| | | return msg.substring(0, 16); |
| | | } else { |
| | | StringBuilder msgBuilder = new StringBuilder(msg); |
| | | for (int i = 0; i<count-msg.length(); i++){ |
| | | msgBuilder.insert(0,"0"); |
| | | } |
| | | return msgBuilder.toString(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public interface TaskWrkMapper extends BaseMapper<TaskWrk> { |
| | | TaskWrk selectByWrkNo(Integer wrkNo); |
| | | TaskWrk selectByTaskNo(Integer taskNo); |
| | | |
| | | int saveToHistory();//将任务转历史日志 |
| | | } |
| | |
| | | |
| | | public interface TaskWrkService extends IService<TaskWrk> { |
| | | |
| | | // TaskWrk selectByWrkNo(Integer wrkNo); |
| | | TaskWrk selectByWrkNo(Integer wrkNo); |
| | | TaskWrk selectByTaskNo(Integer taskNo); |
| | | int saveToHistory();//将任务转历史日志 |
| | | // int saveToHistoryD(String taskNo);//将任务转历史日志 |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.controller.TaskWrkController; |
| | | import com.zy.asrs.domain.enums.LedErrorAreaType; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.*; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.MatDto; |
| | | import com.zy.common.model.SearchLocParam; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.CollectionUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.News; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.*; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.*; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.protocol.*; |
| | | 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 com.zy.system.entity.license.LicenseVerify; |
| | |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 立体仓库WCS系统主流程业务 |
| | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private BasErrLogService basErrLogService; |
| | | @Autowired |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); |
| | | staProtocol.setStaNo(wrkMast.getStaNoSou$().shortValue()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,238); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | |
| | | */ |
| | | public synchronized void storeEmptyPlt() { |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | if (devp.getId()==1) continue; |
| | | // if (devp.getId()==1) continue; |
| | | // 遍历空板入库口 |
| | | for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) { |
| | | // 获取空板入库站信息 |
| | |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol.setStaNo(dto.getStaNo().shortValue()); |
| | | staProtocol.setStaNo(dto.getStaNoSou$(dto.getStaNo(),staProtocol.getSiteId()).shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,4087); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | try { |
| | | for (RgvSlave.RgvStn inSta : rgvSlave.getRgvInSta()) { |
| | | boolean create = deviceDetectionCreate(inSta); |
| | | if (create) { |
| | | continue; |
| | | WrkMast wrkMast = deviceDetectionCreate(inSta); |
| | | if (!Cools.isEmpty(wrkMast)) { |
| | | TaskWrk taskWrk = new TaskWrk(wrkMast); |
| | | taskWrkService.insert(taskWrk); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public synchronized void taskCancel() { |
| | | try { |
| | | List<String> taskList = new ArrayList<>(); |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | TaskProtocolCache taskProtocolCache = rgvThread.getTaskProtocolCache(); |
| | | ConcurrentHashMap<String, TaskProtocol> allTaskProtocol = taskProtocolCache.getAllTaskProtocol(); |
| | | for (TaskProtocol taskProtocol : allTaskProtocol.values()){ |
| | | taskList.add(taskProtocol.getTaskNo().toString()); |
| | | } |
| | | } |
| | | Wrapper<TaskWrk> wrkWrapper = new EntityWrapper<TaskWrk>().eq("status", 5); |
| | | for (String taskNo : taskList){ |
| | | wrkWrapper.ne("task_no", taskNo); |
| | | } |
| | | int count = taskWrkService.selectCount(wrkWrapper); |
| | | if (count>0){ |
| | | taskWrkService.delete(wrkWrapper); |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | public synchronized void taskStart() { |
| | |
| | | return true; |
| | | } |
| | | |
| | | public boolean deviceDetectionCreate(RgvSlave.RgvStn inSta) { |
| | | public WrkMast deviceDetectionCreate(RgvSlave.RgvStn inSta) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, inSta.getDevpPlcId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | return false; |
| | | return null; |
| | | } |
| | | |
| | | // 判断是否满足取货条件 |
| | | if (staProtocol.isAutoing() |
| | | // && staProtocol.isLoading() |
| | | // && staProtocol.isStaOk() |
| | | && staProtocol.getWorkNo() != 0) { |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(staProtocol.getWorkNo()); |
| | | if (Cools.isEmpty(taskWrk)){ |
| | | WrkMast wrkMast = wrkMastService.selectByWrkNo(staProtocol.getWorkNo()); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | if (inSta.getStaNo()==117 || inSta.getStaNo()==120 || inSta.getStaNo()==123 |
| | | || inSta.getStaNo()==217 || inSta.getStaNo()==220 || inSta.getStaNo()==223){ |
| | | WrkMast wrkMast = wrkMastService.selectByWrkNo(staProtocol.getWorkNo()); |
| | | if (!Cools.isEmpty(wrkMast) && wrkMast.getIoType()<100){ |
| | | return true; |
| | | if (wrkMast.getIoType()>100){ |
| | | return null; |
| | | } |
| | | } else { |
| | | return true; |
| | | } |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(staProtocol.getWorkNo()); |
| | | if (Cools.isEmpty(taskWrk)){ |
| | | return wrkMast; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | return null; |
| | | } |
| | | public TaskWrk deviceDetection(RgvSlave.RgvStn inSta) { |
| | | |
| | |
| | | issuedTake.setTaskNo(Long.valueOf(taskWrk.getWrkNo())); |
| | | issuedTake.setTaskStatus(2); |
| | | issuedTake.setTargetPositionStaNo(basDevpPositionSou.getDevNo()); |
| | | issuedTake.setTargetPositionStaNoEnd(basDevpPositionSou.getDevNo$()); |
| | | issuedTake.setTargetPositionStaNoPlcId(basDevpPositionSou.getPlcId()); |
| | | issuedTake.setTaskNoDirection(issuedTake.gettaskNoDirection$(issuedTake.getTaskNo(), issuedTake.getTaskStatus())); |
| | | issuedTake.setTargetPosition(basDevpPositionSou.getPlcPosition()); |
| | |
| | | issuedPut.setTaskNo(Long.valueOf(taskWrk.getWrkNo())); |
| | | issuedPut.setTaskStatus(3); |
| | | issuedPut.setTargetPositionStaNo(basDevpPositionEnd.getDevNo()); |
| | | issuedPut.setTargetPositionStaNoEnd(basDevpPositionEnd.getDevNo$()); |
| | | issuedPut.setTargetPositionStaNoPlcId(basDevpPositionEnd.getPlcId()); |
| | | issuedPut.setTaskNoDirection(issuedPut.gettaskNoDirection$(issuedPut.getTaskNo(), issuedPut.getTaskStatus())); |
| | | issuedPut.setTargetPosition(basDevpPositionEnd.getPlcPosition()); |
| | |
| | | issuedPut.setDirection(basDevpPositionEnd.getRgvSign()==1); |
| | | |
| | | try{ |
| | | if (taskWrk.getIoType()==2 && basDevpPositionEnd.getRgvSign()==1){ |
| | | Date now = new Date(); |
| | | taskWrk.setStatus(TaskStatusType.OVER.id); |
| | | taskWrk.setModiTime(now);//更新时间 |
| | | taskWrk.setCompleteTime(now);//完结时间 |
| | | taskWrkService.updateById(taskWrk); |
| | | } |
| | | Date now = new Date(); |
| | | taskWrk.setStatus(TaskStatusType.OVER.id); |
| | | taskWrk.setModiTime(now);//更新时间 |
| | | taskWrk.setCompleteTime(now);//完结时间 |
| | | taskWrkService.updateById(taskWrk); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | |
| | | @Service("taskWrkService") |
| | | public class TaskWrkServiceImpl extends ServiceImpl<TaskWrkMapper, TaskWrk> implements TaskWrkService { |
| | | |
| | | // @Override |
| | | // public TaskWrk selectByWrkNo(Integer wrkNo) { |
| | | // return this.baseMapper.selectByWrkNo(wrkNo); |
| | | // } |
| | | @Override |
| | | public TaskWrk selectByWrkNo(Integer wrkNo) { |
| | | return this.baseMapper.selectByWrkNo(wrkNo); |
| | | } |
| | | |
| | | @Override |
| | | public TaskWrk selectByTaskNo(Integer taskNo) { |
| | | return this.baseMapper.selectByTaskNo(taskNo); |
| | | } |
| | | |
| | | @Override |
| | | public int saveToHistory() { |
| | | return this.baseMapper.saveToHistory(); |
| | | } |
| | | } |
| | |
| | | |
| | | public class BarcodeUtils { |
| | | |
| | | public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{ |
| | | add(1001);add(1002);add(1003);add(1004);add(1005);add(1006);add(1007); |
| | | add(1008);add(1009);add(1010);add(1011);add(1012);add(1013);add(1014);add(1015); |
| | | add(1016);add(1017);add(1018);add(1019);add(1020);add(1021);add(1022);add(1023); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | | add(1001);add(1002);add(1003);add(1004);add(1005);add(1006);add(1007); |
| | | add(1008);add(1009);add(1010);add(1011);add(1012);add(1013);add(1014);add(1015); |
| | | add(1016);add(1017);add(1018);add(1019);add(1020);add(1021);add(1022);add(1023); |
| | | }}; |
| | | |
| | | public static Integer getStaNo(Integer staNo) { |
| | | switch (staNo){ |
| | | case 1021: |
| | | return 1020; |
| | | case 1012: |
| | | return 1014; |
| | | case 1005: |
| | | return 1004; |
| | | default: |
| | | return staNo; |
| | | } |
| | | } |
| | | public static Integer getStartStaNo(String staNo) { |
| | | switch (staNo){ |
| | | case "1021": |
| | | return 1020; |
| | | case "1012": |
| | | return 1014; |
| | | case "1005": |
| | | return 1004; |
| | | default: |
| | | return Integer.getInteger(staNo); |
| | | } |
| | | } |
| | | // public static Integer getStaNo(Integer staNo) { |
| | | // switch (staNo) { |
| | | // case 1021: |
| | | // return 1020; |
| | | // case 1012: |
| | | // return 1014; |
| | | // case 1005: |
| | | // return 1004; |
| | | // default: |
| | | // return staNo; |
| | | // } |
| | | // } |
| | | public static Integer getOutStaNo(String staNo) { |
| | | switch (staNo){ |
| | | case "1021": |
| | | return 1020; |
| | | case "1012": |
| | | return 1009; |
| | | case "1005": |
| | | return 1004; |
| | | case "101": |
| | | case "105": |
| | | case "109": |
| | | case "115": |
| | | case "201": |
| | | case "205": |
| | | case "209": |
| | | case "215": |
| | | return Integer.parseInt(staNo)+1; |
| | | case "119": |
| | | case "122": |
| | | case "125": |
| | | case "219": |
| | | case "222": |
| | | case "225": |
| | | return Integer.parseInt(staNo)-2; |
| | | default: |
| | | return Integer.parseInt(staNo); |
| | | } |
| | |
| | | } |
| | | |
| | | public static Short CrnStaEnd(Integer endSta,Integer souSta) { |
| | | switch (endSta) { |
| | | switch (souSta) { |
| | | case 103: |
| | | case 107: |
| | | case 111: |
| | |
| | | case 207: |
| | | case 211: |
| | | case 213: |
| | | return (short)(endSta+1); |
| | | return (short)(souSta+1); |
| | | default: |
| | | return endSta.shortValue(); |
| | | } |
| | |
| | | // if (staProtocol.isHigh() == staProtocol.isLow()) { |
| | | // throw new CoolException("plc高低检测异常"); |
| | | // } |
| | | if (staProtocol.getSiteId() == 106 || staProtocol.getSiteId() == 159){ |
| | | this.locType1 = 2; // 高库位 |
| | | }else { |
| | | this.locType1 = 1; // 低库位 |
| | | } |
| | | this.locType1 = 2; // 高库位 |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Integer rgvSstaNo; |
| | | |
| | | public Integer getStaNoSou$(Integer staNoE,Integer sourceStaNo) { |
| | | switch (sourceStaNo){ |
| | | case 118: |
| | | case 121: |
| | | case 122: |
| | | case 218: |
| | | case 221: |
| | | case 222: |
| | | return sourceStaNo+1; |
| | | } |
| | | return staNoE; |
| | | } |
| | | |
| | | } |
| | |
| | | mainService.taskCreate(); |
| | | // 任务下发 |
| | | mainService.taskStart(); |
| | | // 任务删除 |
| | | mainService.taskCancel(); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | add(211);add(212);add(213);add(214);add(215);add(216);add(217);add(218);add(219);add(220); |
| | | add(221);add(222);add(224);add(225); |
| | | }}; |
| | | public static final ArrayList<Integer> staNos1W = new ArrayList<Integer>() {{ |
| | | add(118);add(121);add(124); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> staNos2W = new ArrayList<Integer>() {{ |
| | | add(218);add(221);add(224); |
| | | }}; |
| | | private boolean connectDev = false; |
| | | public Long currentTimeMilliConnectDev= 0L; |
| | | |
| | |
| | | return staNos1; |
| | | case 2: |
| | | return staNos2; |
| | | default: |
| | | throw new CoolException("服务器异常"); |
| | | } |
| | | } |
| | | private ArrayList<Integer> getStaNoW() { |
| | | switch (slave.getId()) { |
| | | case 1: |
| | | return staNos1W; |
| | | case 2: |
| | | return staNos2W; |
| | | default: |
| | | throw new CoolException("服务器异常"); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | int[] staW = new int[]{1004,1014,1020}; |
| | | ArrayList<Integer> staW = getStaNoW(); |
| | | |
| | | //条码 |
| | | // Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB400.100.0",(short) (barcodeSize*8)); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.212",(short) (barcodeSize*8)); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeSize; i++) { |
| | | Integer siteId = staW[i]; // 站点编号 |
| | | Integer siteId = staW.get(i); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | | staProtocol = new StaProtocol(); |
| | | station.put(siteId, staProtocol); |
| | | } |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,6, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1+3*slave.getId()); |
| | | if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { |
| | | barcodeThread.setBarcode(barcode); |
| | | if (!Cools.isEmpty(barcode) && !barcode.equals("000000")){ |
| | | if (!Cools.isEmpty(barcode) && !barcode.equals("00000000")){ |
| | | staProtocol.setBarcodeNow(barcode); |
| | | } else if (Cools.isEmpty(barcode)){ |
| | | staProtocol.setBarcodeNow("-"); |
| | |
| | | //条码 |
| | | // Thread.sleep(50); |
| | | |
| | | OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB400.148.0",(short) (staW.length*4)); |
| | | OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB101.200",(short) (staW.size()*4)); |
| | | if (result3.IsSuccess) { |
| | | for (int i = 0; i < staW.length; i++) { |
| | | Integer siteId = staW[i]; // 站点编号 |
| | | for (int i = 0; i < staW.size(); i++) { |
| | | Integer siteId = staW.get(i); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | | staProtocol = new StaProtocol(); |
| | |
| | | # 入库口1 |
| | | inSta[0]: |
| | | staNo: 118 |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | backSta: 119 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[0].id} |
| | | inSta[1]: |
| | | staNo: 121 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | backSta: 122 |
| | | led: ${wcs-slave.led[1].id} |
| | | inSta[2]: |
| | | staNo: 124 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | backSta: 125 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[2].id} |
| | | # 空板入库口1 |
| | | emptyInSta[0]: |
| | | staNo: 118 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | backSta: 119 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[0].id} |
| | | # 空板入库口1 |
| | | emptyInSta[1]: |
| | | staNo: 121 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | backSta: 122 |
| | | led: ${wcs-slave.led[1].id} |
| | | # 空板入库口1 |
| | | emptyInSta[2]: |
| | | staNo: 124 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | backSta: 125 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[2].id} |
| | | # 拣料入库口1 |
| | | pickSta[0]: |
| | | staNo: 118 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | led: ${wcs-slave.led[0].id} |
| | | backSta: 119 |
| | | # 拣料入库口1 |
| | | pickSta[1]: |
| | | staNo: 121 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | led: ${wcs-slave.led[1].id} |
| | | backSta: 122 |
| | | # 拣料入库口1 |
| | | pickSta[2]: |
| | | staNo: 124 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | led: ${wcs-slave.led[2].id} |
| | | backSta: 125 |
| | | # 出库口1 |
| | | outSta[0]: |
| | |
| | | led: ${wcs-slave.led[0].id} |
| | | outSta[1]: |
| | | staNo: 122 |
| | | led: ${wcs-slave.led[0].id} |
| | | led: ${wcs-slave.led[1].id} |
| | | outSta[2]: |
| | | staNo: 125 |
| | | led: ${wcs-slave.led[0].id} |
| | | led: ${wcs-slave.led[2].id} |
| | | # 输送线1 |
| | | devp[1]: |
| | | id: 2 |
| | |
| | | # 入库口1 |
| | | inSta[0]: |
| | | staNo: 218 |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | barcode: ${wcs-slave.barcode[3].id} |
| | | backSta: 219 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[3].id} |
| | | inSta[1]: |
| | | staNo: 221 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[4].id} |
| | | backSta: 222 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[4].id} |
| | | inSta[2]: |
| | | staNo: 224 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[5].id} |
| | | backSta: 225 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | # 空板入库口1 |
| | | emptyInSta[0]: |
| | | staNo: 218 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[3].id} |
| | | backSta: 219 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[3].id} |
| | | # 空板入库口1 |
| | | emptyInSta[1]: |
| | | staNo: 221 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[4].id} |
| | | backSta: 222 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[4].id} |
| | | # 空板入库口1 |
| | | emptyInSta[2]: |
| | | staNo: 224 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | barcode: ${wcs-slave.barcode[5].id} |
| | | backSta: 225 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | # 拣料入库口1 |
| | | pickSta[0]: |
| | | staNo: 218 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | barcode: ${wcs-slave.barcode[3].id} |
| | | led: ${wcs-slave.led[3].id} |
| | | backSta: 219 |
| | | # 拣料入库口1 |
| | | pickSta[1]: |
| | | staNo: 221 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | barcode: ${wcs-slave.barcode[4].id} |
| | | led: ${wcs-slave.led[4].id} |
| | | backSta: 222 |
| | | # 拣料入库口1 |
| | | pickSta[2]: |
| | | staNo: 224 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | barcode: ${wcs-slave.barcode[5].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | backSta: 225 |
| | | # 出库口1 |
| | | outSta[0]: |
| | | staNo: 219 |
| | | led: ${wcs-slave.led[0].id} |
| | | led: ${wcs-slave.led[3].id} |
| | | outSta[1]: |
| | | staNo: 222 |
| | | led: ${wcs-slave.led[0].id} |
| | | led: ${wcs-slave.led[4].id} |
| | | outSta[2]: |
| | | staNo: 225 |
| | | led: ${wcs-slave.led[0].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | |
| | | |
| | | # 条码扫描仪1 |
| | | barcode[0]: |
| | | id: 1 |
| | | ip: 10.10.10.121 |
| | | ip: 10.10.10.221 |
| | | port: 51236 |
| | | # 条码扫描仪2 |
| | | barcode[1]: |
| | | id: 2 |
| | | ip: 10.10.10.122 |
| | | ip: 10.10.10.222 |
| | | port: 51236 |
| | | # 条码扫描仪3 |
| | | barcode[2]: |
| | | id: 3 |
| | | ip: 10.10.10.123 |
| | | ip: 10.10.10.223 |
| | | port: 51236 |
| | | # 条码扫描仪1mat |
| | | barcode[3]: |
| | | id: 4 |
| | | ip: 10.10.10.124 |
| | | ip: 10.10.10.224 |
| | | port: 51236 |
| | | # 条码扫描仪2mat |
| | | barcode[4]: |
| | | id: 5 |
| | | ip: 10.10.10.125 |
| | | ip: 10.10.10.225 |
| | | port: 51236 |
| | | # 条码扫描仪3mat |
| | | barcode[5]: |
| | | id: 6 |
| | | ip: 10.10.10.126 |
| | | ip: 10.10.10.226 |
| | | port: 51236 |
| | | # LED1 |
| | | led[0]: |
| | | id: 1 |
| | | ip: 10.10.10.212 |
| | | ip: 10.10.10.209 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1036 |
| | | # LED2 |
| | | led[1]: |
| | | id: 2 |
| | | ip: 10.10.10.213 |
| | | ip: 10.10.10.210 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1041 |
| | | # LED3 |
| | | led[2]: |
| | | id: 3 |
| | | ip: 10.10.10.214 |
| | | ip: 10.10.10.211 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1103 |
| | | # LED4 |
| | | led[3]: |
| | | id: 4 |
| | | ip: 10.10.10.216 |
| | | ip: 10.10.10.212 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1047 |
| | | # LED4 |
| | | led[4]: |
| | | id: 5 |
| | | ip: 10.10.10.215 |
| | | ip: 10.10.10.213 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 2037 |
| | | # LED5 |
| | | led[5]: |
| | | id: 6 |
| | | ip: 10.10.10.217 |
| | | ip: 10.10.10.214 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 4001 |
| | | # LED6 |
| | | led[6]: |
| | | id: 7 |
| | | ip: 10.10.10.218 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 4006 |
| | | staArr: 4001 |
| | |
| | | and "task_no" = #{taskNo} |
| | | </select> |
| | | |
| | | <insert id="saveToHistory"> |
| | | insert into "SOURCE"."wcs_task_wrk_log" |
| | | select * from "SOURCE"."wcs_task_wrk" |
| | | where "STATUS"=5 |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | "width": 2900, |
| | | "height": 600, |
| | | "stns": [ |
| | | { "type": "stn", "id": "site-125", "text": "125", "top": 416, "left": 1162, "width": 54, "height": 20 }, |
| | | {"type": "track", "id": "lb_trCart21", "text": "", "top": 65, "left": 1000, "width": 6, "height": 560}, |
| | | {"type": "track", "id": "lb_trCart22", "text": "", "top": 65, "left": 1020, "width": 6, "height": 560}, |
| | | { "type": "stn", "id": "site-3", "text": "2", "top": 384, "left": 984, "width": 62, "height": 20 }, |
| | | { "type": "stn", "id": "site-4", "text": "1", "top": 84, "left": 984, "width": 62, "height": 20 }, |
| | | |
| | | { "type": "stn", "id": "site-201", "text": "201", "top": 84, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-202", "text": "202", "top": 84, "left": 926, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-203", "text": "203", "top": 128, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-204", "text": "204", "top": 128, "left": 926, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-205", "text": "205", "top": 190, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-206", "text": "206", "top": 190, "left": 926, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-207", "text": "207", "top": 238, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-208", "text": "208", "top": 238, "left": 926, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-209", "text": "209", "top": 304, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-210", "text": "210", "top": 304, "left": 926, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-211", "text": "211", "top": 352, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-212", "text": "212", "top": 352, "left": 926, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-213", "text": "213", "top": 416, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-214", "text": "214", "top": 416, "left": 926, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-215", "text": "215", "top": 465, "left": 870, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-216", "text": "216", "top": 465, "left": 926, "width": 54, "height": 20 }, |
| | | |
| | | { "type": "stn", "id": "site-217", "text": "217", "top": 238, "left": 1050, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-218", "text": "218", "top": 238, "left": 1106, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-219", "text": "219", "top": 238, "left": 1162, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-220", "text": "220", "top": 304, "left": 1050, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-221", "text": "221", "top": 304, "left": 1106, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-222", "text": "222", "top": 304, "left": 1162, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-223", "text": "223", "top": 416, "left": 1050, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-224", "text": "224", "top": 416, "left": 1106, "width": 54, "height": 20 }, |
| | | { "type": "stn", "id": "site-225", "text": "225", "top": 416, "left": 1162, "width": 54, "height": 20 }, |
| | | ], |
| | | "barcode": [] |
| | | }, |