| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.enums.CrnStatusType; |
| | | import com.zy.asrs.domain.enums.SiteStatusType; |
| | | import com.zy.asrs.domain.param.SystemSwitchParam; |
| | | import com.zy.asrs.domain.vo.*; |
| | | import com.zy.asrs.entity.BasCrnError; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.mapper.BasCrnErrorMapper; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.CrnModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.RgvSlave; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.properties.SystemProperties; |
| | |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private LocMastMapper locMastMapper; |
| | | @Autowired |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | |
| | | @PostMapping("/system/running/status") |
| | | @ManagerAuth(memo = "系统运行状态") |
| | |
| | | vo.setSiteStatus(SiteStatusType.process(staProtocol)); // 状态 |
| | | vo.setNearbySta(staProtocol.getNearbySta()); //RGV位置 |
| | | vos.add(vo); |
| | | } |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PostMapping("/latest/data/crn") |
| | | @ManagerAuth(memo = "堆垛机实时数据") |
| | | public R crnLatestData(){ |
| | | List<CrnLatestDataVo> vos = new ArrayList<>(); |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | if (crnThread == null) { |
| | | continue; |
| | | } |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | CrnLatestDataVo vo = new CrnLatestDataVo(); |
| | | vo.setCrnId(crn.getId()); // 堆垛机编号 |
| | | |
| | | // Short totalBay = locMastMapper.selectTotalBay(); |
| | | |
| | | vo.setOffset((double) new Random().nextInt(560)); // 堆垛机偏移量 |
| | | vo.setBay((short) (crnProtocol.getBay() - crn.getOffset())); // 当前列 |
| | | /** |
| | | * 堆垛机状态判断 |
| | | */ |
| | | if (crnProtocol.getAlarm() > 0) { |
| | | vo.setCrnStatus(CrnStatusType.MACHINE_ERROR); |
| | | } else { |
| | | if (crnProtocol.getTaskNo()>0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setCrnStatus(CrnStatusType.process(wrkMast.getIoType())); |
| | | } else { |
| | | vo.setCrnStatus(crnProtocol.modeType.equals(CrnModeType.AUTO)? CrnStatusType.MACHINE_AUTO: CrnStatusType.MACHINE_UN_AUTO); |
| | | } |
| | | } else { |
| | | vo.setCrnStatus(crnProtocol.modeType.equals(CrnModeType.AUTO)? CrnStatusType.MACHINE_AUTO: CrnStatusType.MACHINE_UN_AUTO); |
| | | } |
| | | } |
| | | vos.add(vo); |
| | | |
| | | } |
| | | return R.ok().add(vos); |
| | | } |
| | |
| | | } |
| | | return R.error(); |
| | | |
| | | } |
| | | |
| | | @PostMapping("/crn/detail") |
| | | @ManagerAuth(memo = "堆垛机设备数据详情") |
| | | public R crnDetail(@RequestParam Integer crnNo){ |
| | | if (Cools.isEmpty(crnNo)){ |
| | | return R.parse(CodeRes.EMPTY); |
| | | } |
| | | CrnDetailVo vo = new CrnDetailVo(); |
| | | for (CrnSlave crnSlave : slaveProperties.getCrn()) { |
| | | if (crnSlave.getId().equals(crnNo)) { |
| | | SiemensCrnThread crnThread = (SiemensCrnThread) SlaveConnection.get(SlaveType.Crn, crnSlave.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | vo.setCrnNo(crnNo); |
| | | vo.setWorkNo(crnProtocol.getTaskNo()); |
| | | vo.setCrnStatus(crnProtocol.getStatusType().desc); |
| | | |
| | | if (crnProtocol.getAlarm() > 0) { |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); |
| | | vo.setError(crnError == null ? "未知异常" : crnError.getErrName()); |
| | | } |
| | | |
| | | if (crnProtocol.getTaskNo() > 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setSourceStaNo(wrkMast.getSourceStaNo$()); |
| | | vo.setStaNo(wrkMast.getStaNo$()); |
| | | vo.setWrkSts(wrkMast.getWrkSts$()); // 工作状态 |
| | | vo.setIoType(wrkMast.getIoType$()); // 入出库类型 |
| | | vo.setSourceLocNo(wrkMast.getSourceLocNo$()); |
| | | vo.setLocNo(wrkMast.getLocNo$()); |
| | | vo.setCrnStatus(crnProtocol.getStatusType().desc); |
| | | vo.setError(""); // todo |
| | | } |
| | | } |
| | | return R.ok().add(vo); |
| | | } |
| | | } |
| | | return R.error(); |
| | | } |
| | | |
| | | @Deprecated |
| | |
| | | import com.zy.asrs.domain.dto.WorkChartAxis; |
| | | import com.zy.asrs.domain.vo.LocChartPie; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.common.model.MatDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.LedThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | Double yDistance = 0.0D; |
| | | Double xDuration = 0.0D; |
| | | Double yDuration = 0.0D; |
| | | |
| | | if (null != crnId) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crnId); |
| | | if (crnThread != null) { |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol != null) { |
| | | xSpeed = Double.valueOf(crnProtocol.getXSpeed()); |
| | | ySpeed = Double.valueOf(crnProtocol.getYSpeed()); |
| | | zSpeed = Double.valueOf(crnProtocol.getZSpeed()); |
| | | switch (crnProtocol.getForkPos()) { |
| | | case 0: |
| | | forkPos = 1; |
| | | break; |
| | | case 1: |
| | | forkPos = 2; |
| | | break; |
| | | case 2: |
| | | forkPos = 0; |
| | | break; |
| | | default: |
| | | forkPos = 1; |
| | | break; |
| | | } |
| | | xDistance = Double.valueOf(crnProtocol.getXDistance()); |
| | | yDistance = Double.valueOf(crnProtocol.getYDistance()); |
| | | xDuration = Double.valueOf(crnProtocol.getXDuration()); |
| | | yDuration = Double.valueOf(crnProtocol.getYDuration()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // ledContent = "ask的模块萨满大算了萨满大了\n 是窘境到埃及嗲家嗲\n 萨达姆打开萨满大凯撒麦当劳萨满大老师"; |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.CrnStatusType; |
| | | import com.zy.asrs.domain.param.SteModeParam; |
| | | import com.zy.asrs.domain.param.SteOperatorParam; |
| | | import com.zy.asrs.domain.vo.SteDataVo; |
| | |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasSteService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | |
| | | if (!Cools.isEmpty(steProtocol.getAlarm0())) { |
| | | vo.setAlarm2(String.valueOf(steProtocol.getAlarm0())); |
| | | } |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/table/ste/msg") |
| | | @ManagerAuth(memo = "穿梭车数据表") |
| | | public R steMsgTable(){ |
| | | List<SteMsgTableVo> list = new ArrayList<>(); |
| | | List<BasSte> stes = basSteService.selectList(new EntityWrapper<BasSte>().orderBy("ste_no")); |
| | | for (BasSte basSte : stes) { |
| | | // 表格行 |
| | | SteMsgTableVo vo = new SteMsgTableVo(); |
| | | vo.setSteNo(basSte.getSteNo()); // 穿梭车号 |
| | | list.add(vo); |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, basSte.getSteNo()); |
| | | if (steThread == null) { |
| | | continue; |
| | | } |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | vo.setWorkNo(steProtocol.getTaskNo().intValue()); // 任务号 |
| | | if (steProtocol.getTaskNo() > 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(steProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setStatus(CrnStatusType.process(wrkMast.getIoType()).getDesc()); // 模式状态 |
| | | vo.setSourceStaNo(wrkMast.getSourceStaNo$()); // 源站 |
| | | vo.setStaNo(wrkMast.getStaNo$()); // 目标站 |
| | | vo.setSourceLocNo(wrkMast.getSourceLocNo()); // 源库位 |
| | | vo.setLocNo(wrkMast.getLocNo()); // 目标库位 |
| | | } |
| | | } else { |
| | | vo.setStatus(steProtocol.mode == 1? CrnStatusType.MACHINE_AUTO.getDesc(): CrnStatusType.MACHINE_UN_AUTO.getDesc()); // 模式状态 |
| | | } |
| | | vo.setSpeed(steProtocol.getSpeed()); // 速度 |
| | | vo.setCloser(steProtocol.getCloser()); // 近点距离 |
| | | vo.setPakMk(steProtocol.getPakMk()); // 作业标记 |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasJarMastStatusService; |
| | | import com.zy.asrs.entity.BasJarMastStatus; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | // null, // 创建时间 |
| | | // null // 更新时间 |
| | | // ); |
| | | |
| | | public String getStatus$(){ |
| | | BasJarMastStatusService service = SpringUtils.getBean(BasJarMastStatusService.class); |
| | | BasJarMastStatus basJarMastStatus = service.selectOne(new EntityWrapper<BasJarMastStatus>().eq("box_type",this.status.toString())); |
| | | if (!Cools.isEmpty(basJarMastStatus)){ |
| | | return String.valueOf(basJarMastStatus.getBoxSpecs()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // public String getStatus$(){ |
| | | // BasJarMastStatusService service = SpringUtils.getBean(BasJarMastStatusService.class); |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | |
| | | |
| | | public Integer getCrnNo() { |
| | | return crnNo; |
| | | } |
| | | |
| | | public String getCrnNo$(){ |
| | | BasCrnpService service = SpringUtils.getBean(BasCrnpService.class); |
| | | BasCrnp basCrnp = service.selectById(this.crnNo); |
| | | if (!Cools.isEmpty(basCrnp)){ |
| | | return String.valueOf(basCrnp.getCrnNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setCrnNo(Integer crnNo) { |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ymd); |
| | | } |
| | | |
| | | public String getCrnNo$(){ |
| | | BasCrnpService service = SpringUtils.getBean(BasCrnpService.class); |
| | | BasCrnp basCrnp = service.selectById(this.crnNo); |
| | | if (!Cools.isEmpty(basCrnp)){ |
| | | return String.valueOf(basCrnp.getCrnNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getWrkDate$(){ |
| | | if (Cools.isEmpty(this.wrkDate)){ |
| | | return ""; |
| | |
| | | // null // 源库位2 |
| | | // ); |
| | | |
| | | public String getCrnNo$(){ |
| | | BasCrnpService service = SpringUtils.getBean(BasCrnpService.class); |
| | | BasCrnp basCrnp = service.selectById(this.crnNo); |
| | | if (!Cools.isEmpty(basCrnp)){ |
| | | return String.valueOf(basCrnp.getCrnNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasJarMastStatusService; |
| | | import com.zy.asrs.entity.BasJarMastStatus; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | default: |
| | | return String.valueOf(this.wrkType); |
| | | } |
| | | } |
| | | |
| | | public String getWrkSts$(){ |
| | | BasJarMastStatusService service = SpringUtils.getBean(BasJarMastStatusService.class); |
| | | BasJarMastStatus basJarMastStatus = service.selectById(this.wrkSts); |
| | | if (!Cools.isEmpty(basJarMastStatus)){ |
| | | return String.valueOf(basJarMastStatus.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.*; |
| | | 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.RedisUtil; |
| | | import com.zy.common.utils.RgvUtils; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.*; |
| | | import com.zy.core.model.command.*; |
| | | import com.zy.core.model.cpmmandParam.CrnCommandParam; |
| | | import com.zy.core.model.protocol.*; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import springfox.documentation.spring.web.json.Json; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 立体仓库WCS系统主流程业务 |
| | |
| | | @Service("mainService") |
| | | @Transactional |
| | | public class MainServiceImpl { |
| | | |
| | | public static final long COMMAND_TIMEOUT = 5 * 1000; |
| | | // private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | |
| | | private static final Integer jarMaxLoc = 7; |
| | | private static final Float jarTemperature = 50F; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private WrkMastMapper wrkMastMapper; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WaitPakinMapper waitPakinMapper; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private BasRgvService basRgvService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private BasErrLogService basErrLogService; |
| | | @Autowired |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | @Autowired |
| | | private BasRgvErrMapper basRgvErrMapper; |
| | | @Autowired |
| | | private BasRgvErrLogService basRgvErrLogService; |
| | | @Autowired |
| | | private BasRgvPathService basRgvPathService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private WrkMastStaMapper wrkMastStaMapper; |
| | | @Autowired |
| | | private BasRgvMapMapper basRgvMapMapper; |
| | | @Autowired |
| | | private RgvOneSignMapper rgvOneSignMapper; |
| | | @Autowired |
| | | private WrkMastCrnMapper wrkMastCrnMapper; |
| | | @Autowired |
| | | private WrkMastSplitTwinMapper wrkMastSplitTwinMapper; |
| | | @Autowired |
| | | private WrkMastSplitTwinService wrkMastSplitTwinService; |
| | | @Autowired |
| | | private BasJarMastService basJarMastService; |
| | | @Autowired |
| | | private WrkMastExecuteService wrkMastExecuteService; |
| | | @Autowired |
| | | private BasJarService basJarService; |
| | | @Autowired |
| | | private BasJarMapper basJarMapper; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | */ |
| | | public class SteUtils { |
| | | |
| | | public static final List<Integer> SHUTTLE_GROUP_ROW_LIST = new ArrayList<Integer>() {{ |
| | | add(2);add(3);add(4);add(5);add(6);add(7);add(8);add(9);add(10); |
| | | add(11);add(12); |
| | | }}; |
| | | public static final List<Integer> SECOND_GROUP_ROW_LIST = new ArrayList<Integer>() {{ |
| | | add(2); |
| | | add(3); |
| | | add(4); |
| | | add(5); |
| | | add(6); |
| | | }}; |
| | | public static final List<Integer> THIRD_GROUP_ROW_LIST = new ArrayList<Integer>() {{ |
| | | add(8); |
| | | add(9); |
| | | add(10); |
| | | add(11); |
| | | add(12); |
| | | }}; |
| | | public static final List<Integer> THIRD_GROUP_BAY_LIST = new ArrayList<Integer>() {{ |
| | | add(4); |
| | | add(10); |
| | | add(16); |
| | | add(22); |
| | | }}; |
| | | |
| | | private static final DecimalFormat fmt = new DecimalFormat("##0.00"); |
| | | |
| | | public static float scale(Float f){ |
| | |
| | | } |
| | | } |
| | | |
| | | public static Integer getGroupRow(String locNo, Boolean pakin, Integer crnNo){ |
| | | int row = getRow(locNo); |
| | | return getGroupRow(row, pakin, crnNo); |
| | | } |
| | | |
| | | public static List<String> getGroupLocNo(String locNo){ |
| | | int row = getRow(locNo); |
| | | int bay = getBay(locNo); |
| | | List<String> result = new ArrayList<>(); |
| | | if (bay==4 || bay==10 || bay==16 || bay==22){ |
| | | if(row<7 && row>1) |
| | | { |
| | | if (SECOND_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer groupRow : SECOND_GROUP_ROW_LIST) { |
| | | result.add(zerofill(String.valueOf(groupRow), 2) + locNo.substring(2)); |
| | | } |
| | | } |
| | | } else if(row>7 && row<13){ |
| | | if (THIRD_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer groupRow : THIRD_GROUP_ROW_LIST) { |
| | | result.add(zerofill(String.valueOf(groupRow), 2) + locNo.substring(2)); |
| | | } |
| | | } |
| | | } |
| | | } else{ |
| | | if (SHUTTLE_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer groupRow : SHUTTLE_GROUP_ROW_LIST) { |
| | | result.add(zerofill(String.valueOf(groupRow), 2) + locNo.substring(2)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public static Integer getGroupRow(Integer row, Boolean pakin, Integer crnNo) { |
| | | if (pakin) { |
| | | if (SHUTTLE_GROUP_ROW_LIST.contains(row)) { |
| | | return crnNo == 1 ? 2 : 12; |
| | | } else { |
| | | return row; |
| | | } |
| | | } else { |
| | | if (SHUTTLE_GROUP_ROW_LIST.contains(row)) { |
| | | return crnNo == 1 ? 2 : 12; |
| | | } else { |
| | | return row; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断库位是否为穿梭库位 |
| | | * @param locNo |
| | | * @return |
| | | */ |
| | | public static Boolean isShuttle(String locNo) { |
| | | int row = Utils.getRow(locNo); |
| | | if (row >= 2 && row <= 12) { |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | /** |
| | | * 入库,堆垛机号1:最外层库位是2排; 2:最外层库位是12排 |
| | | * 出库,堆垛机号1:最外层库位是2排; 2:最外层库位是12排 |
| | | * @param locNo 库位号 |
| | | * @param pakin 入库 |
| | | * @param crnNo 堆垛机号 |
| | | * @return |
| | | */ |
| | | public static Boolean isOutMost(String locNo, Boolean pakin, Integer crnNo) { |
| | | switch (crnNo){ |
| | | case 1: |
| | | return Integer.parseInt(locNo.substring(0, 2)) == 2; |
| | | case 2: |
| | | return Integer.parseInt(locNo.substring(0, 2)) == 12; |
| | | } |
| | | return false; |
| | | } |
| | | // ------------------------------------------------------------------------------------------------------------------- |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 判断是否为深库位 |
| | | */ |
| | | public static boolean isDeepLoc(SlaveProperties slaveProperties, String locNo){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | int row = getRow(locNo); |
| | | return slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为深库位 |
| | | */ |
| | | public static boolean isDeepLoc(SlaveProperties slaveProperties, Integer row){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | return slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为浅库位 |
| | | */ |
| | | public static boolean isShallowLoc(SlaveProperties slaveProperties, String locNo){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | int row = getRow(locNo); |
| | | return !slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为浅库位 |
| | | */ |
| | | public static boolean isShallowLoc(SlaveProperties slaveProperties, Integer row){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | return !slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取 深库位对应的浅库位号 |
| | | */ |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | int row = getRow(deepLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int shallowRow = remainder == 1 ? (row + 1) : (row - 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取 深库位排对应的浅库位排 |
| | | */ |
| | | public static Integer getShallowRow(SlaveProperties slaveProperties, Integer deepRow) { |
| | | int remainder = (int) Arith.remainder(deepRow, slaveProperties.getGroupCount()); |
| | | return remainder == 1 ? (deepRow + 1) : (deepRow - 1); |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位对应的深库位号 |
| | | */ |
| | | public static String getDeepLoc(SlaveProperties slaveProperties, String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int targetRow; |
| | | if (remainder == 2) { |
| | | targetRow = row - 1; |
| | | } else if (remainder == 1) { |
| | | targetRow = row + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | } |
| | | return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位排对应的深库位排 |
| | | */ |
| | | public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) { |
| | | int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount()); |
| | | int targetRow; |
| | | if (remainder == 2) { |
| | | targetRow = shallowRow - 1; |
| | | } else if (remainder == 1) { |
| | | targetRow = shallowRow + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowRow + "不是浅库位排,系统繁忙"); |
| | | } |
| | | return targetRow; |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 排 |
| | | */ |
| | | public static int getRow(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(0, 2)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 列 |
| | | */ |
| | | public static int getBay(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(2, 5)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 层 |
| | | */ |
| | | public static int getLev(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(5, 7)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | | * 通过排列层拼接出库位号 |
| | | */ |
| | | public static String append(int row, int bay, int lev) { |
| | | return zerofill(String.valueOf(row), 2) + zerofill(String.valueOf(bay), 3) + zerofill(String.valueOf(lev), 2); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当检索到双深库位的浅库位时,如果深库位无货,则放入对应的深库位 |
| | | */ |
| | | public static void toDeepIfEmptyByShallow(String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | int remainder = (int) Arith.remainder(row, 4); |
| | | int targetRow = 0; |
| | | if (remainder == 2) { |
| | | targetRow = row - 1; |
| | | } else if (remainder == 3) { |
| | | targetRow = row + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | } |
| | | String targetLoc = zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | |
| | | } |
| | | |
| | | public static String getLocNo(Number row, Number bay, Number lev) { |
| | | return zerofill(String.valueOf(row), 2) + zerofill(String.valueOf(bay), 3) + zerofill(String.valueOf(lev), 2); |
| | | } |
| | | |
| | | // 外侧方向的货位 优先入库方向/优先出库方向 ===>> 反之 |
| | | public static List<String> getGroupOutsideLoc(String locNo,Integer crnNo){ |
| | | //此方法取此排外侧库位 |
| | | int row = getRow(locNo); |
| | | int bay = getBay(locNo); |
| | | List<String> result = new ArrayList<>(); |
| | | if (THIRD_GROUP_BAY_LIST.contains(bay)){ |
| | | if (THIRD_GROUP_ROW_LIST.contains(row)) { |
| | | List<Integer> clone = Arrays.asList(new Integer[THIRD_GROUP_ROW_LIST.size()]); |
| | | Collections.copy(clone, THIRD_GROUP_ROW_LIST); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | if (integer > row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | }else if (SECOND_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer integer : SECOND_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | }else { |
| | | if (SHUTTLE_GROUP_ROW_LIST.contains(row)) { |
| | | if (crnNo==1){ |
| | | for (Integer integer : SHUTTLE_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | }else { |
| | | List<Integer> clone = Arrays.asList(new Integer[SHUTTLE_GROUP_ROW_LIST.size()]); |
| | | Collections.copy(clone, SHUTTLE_GROUP_ROW_LIST); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | if (integer > row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | // 外侧方向的货位 优先入库方向/优先出库方向 ===>> 反之 |
| | | public static List<String> getGroupOutsideLocPakin(String locNo,Integer crnNo){ |
| | | // 此方法取此排内侧库位 |
| | | int row = getRow(locNo); |
| | | int bay = getBay(locNo); |
| | | List<String> result = new ArrayList<>(); |
| | | if (THIRD_GROUP_BAY_LIST.contains(bay)){ |
| | | if (THIRD_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer integer : THIRD_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | }else if (SECOND_GROUP_ROW_LIST.contains(row)) { |
| | | List<Integer> clone = Arrays.asList(new Integer[SECOND_GROUP_ROW_LIST.size()]); |
| | | Collections.copy(clone, SECOND_GROUP_ROW_LIST); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | if (integer > row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }else { |
| | | if (SHUTTLE_GROUP_ROW_LIST.contains(row)) { |
| | | if (crnNo==2){ |
| | | for (Integer integer : SHUTTLE_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | }else { |
| | | List<Integer> clone = Arrays.asList(new Integer[SHUTTLE_GROUP_ROW_LIST.size()]); |
| | | Collections.copy(clone, SHUTTLE_GROUP_ROW_LIST); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | if (integer > row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | return (float) Arith.multiplys(2, f, 1); |
| | | } |
| | | |
| | | 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 static boolean isDeepLoc(SlaveProperties slaveProperties, String locNo){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | int row = getRow(locNo); |
| | | return slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为深库位 |
| | | */ |
| | | public static boolean isDeepLoc(SlaveProperties slaveProperties, Integer row){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | return slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为浅库位 并存在深库位 |
| | | */ |
| | | public static boolean isShallowLoc(SlaveProperties slaveProperties, String locNo) { |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | int row = getRow(locNo); |
| | | if (!slaveProperties.getDoubleLocs().contains(row)){ |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row-1);//判断是否为左浅库位 |
| | | if (deepLocLeft){ |
| | | return true; |
| | | } |
| | | return isDeepLocRight(slaveProperties, row+1);//判断是否为右浅库位 |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为浅库位 |
| | | */ |
| | | public static boolean isShallowLoc(SlaveProperties slaveProperties, Integer row) { |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | if (!slaveProperties.getDoubleLocs().contains(row)){ |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row-1);//判断是否为左浅库位 |
| | | if (deepLocLeft){ |
| | | return true; |
| | | } |
| | | return isDeepLocRight(slaveProperties, row+1);//判断是否为右浅库位 |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 获取 深库位对应的浅库位号 |
| | | */ |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | int row = getRow(deepLoc); |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row);//判断是否为左深库位 |
| | | int shallowRow = deepLocLeft? (row + 1) : (row - 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 深库位排对应的浅库位排 |
| | | */ |
| | | public static Integer getShallowRow(SlaveProperties slaveProperties, Integer deepRow) { |
| | | // int remainder = (int) Arith.remainder(deepRow, slaveProperties.getGroupCount()); |
| | | // return remainder == 1 ? (deepRow + 1) : (deepRow - 1); |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, deepRow);//判断是否为左深库位 |
| | | return deepLocLeft ? (deepRow + 1) : (deepRow - 1); |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为左深库位 |
| | | */ |
| | | public static boolean isDeepLocLeft(SlaveProperties slaveProperties, Integer row) { |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | return slaveProperties.getDoubleLocsLeft().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断是否为右深库位 |
| | | */ |
| | | public static boolean isDeepLocRight(SlaveProperties slaveProperties, Integer row) { |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | return slaveProperties.getDoubleLocsRight().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位对应的深库位号 |
| | | */ |
| | | public static String getDeepLoc(SlaveProperties slaveProperties, String shallowLoc) { |
| | | // int row = getRow(shallowLoc); |
| | | // int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | // int targetRow; |
| | | // if (remainder == 2) { |
| | | // targetRow = row - 1; |
| | | // } else if (remainder == 3) { |
| | | // targetRow = row + 1; |
| | | // } else { |
| | | // throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | // } |
| | | // return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | int row = getRow(shallowLoc); |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, row-1);//判断是否为左浅库位 |
| | | int shallowRow = deepLocLeft? (row - 1) : (row + 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + shallowLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位排对应的深库位排 |
| | | */ |
| | | public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) { |
| | | // int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount()); |
| | | // int targetRow; |
| | | // if (remainder == 2) { |
| | | // targetRow = shallowRow - 1; |
| | | // } else if (remainder == 3) { |
| | | // targetRow = shallowRow + 1; |
| | | // } else { |
| | | // throw new RuntimeException(shallowRow + "不是浅库位排,系统繁忙"); |
| | | // } |
| | | // return targetRow; |
| | | boolean deepLocLeft = isDeepLocLeft(slaveProperties, shallowRow-1);//判断是否为左浅库位 |
| | | return deepLocLeft? (shallowRow - 1) : (shallowRow + 1); |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 排 |
| | | */ |
| | |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | | * 当检索到双深库位的浅库位时,如果深库位无货,则放入对应的深库位 |
| | | */ |
| | | public static void toDeepIfEmptyByShallow(String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | int remainder = (int) Arith.remainder(row, 4); |
| | | int targetRow = 0; |
| | | if (remainder == 2) { |
| | | targetRow = row - 1; |
| | | } else if (remainder == 3) { |
| | | targetRow = row + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | } |
| | | String targetLoc = zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SlaveProperties slaveProperties = new SlaveProperties(); |
| | | slaveProperties.setDoubleDeep(true); |
| | | List<Integer> list = new ArrayList<>(); |
| | | list.add(1);list.add(4);list.add(5);list.add(8);list.add(9);list.add(12); |
| | | slaveProperties.setDoubleLocs(list); |
| | | slaveProperties.setGroupCount(4); |
| | | Integer deepRow = getDeepRow(slaveProperties, 6); |
| | | System.out.println(deepRow); |
| | | |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private RowLastnoService rowLastnoService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | |
| | | } |
| | | } |
| | | return workNo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检索库位号 |
| | | * @param whsType 类型 1:双深式货架 |
| | | * @param staDescId 路径工作类型 |
| | | * @param sourceStaNo 源站 |
| | | * @param matNos 物料号集合 |
| | | * @return locNo 检索到的库位号 |
| | | */ |
| | | @Transactional |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, int times) { |
| | | StartupDto startupDto = new StartupDto(); |
| | | // 生成工作号 |
| | | int workNo = getWorkNo(0); |
| | | |
| | | switch (sourceStaNo) { |
| | | case 202: |
| | | whsType = 2; |
| | | break; |
| | | case 205: |
| | | whsType = 1; |
| | | break; |
| | | case 126: |
| | | whsType = 3; |
| | | break; |
| | | case 110: |
| | | whsType = 4; |
| | | break; |
| | | case 301: |
| | | whsType = 5; |
| | | break; |
| | | default: |
| | | throw new CoolException("库位排号分配错误, 源站号:" + sourceStaNo); |
| | | } |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | if (Cools.isEmpty(rowLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | | |
| | | // ===============>>>> 开始执行 |
| | | int curRow = rowLastno.getCurrentRow(); |
| | | int sRow = rowLastno.getsRow(); |
| | | int eRow = rowLastno.geteRow(); |
| | | int crn_qty = rowLastno.getCrnQty(); |
| | | int rowCount = eRow - sRow + 1; |
| | | // 目标堆垛机号 |
| | | int crnNo = 0; |
| | | // 目标库位 |
| | | LocMast locMast = null; |
| | | |
| | | // 靠近摆放规则 --- 同天同规格物料 |
| | | if (!Cools.isEmpty(matNos)) { |
| | | List<String> locNos = locDetlService.getSameDetlToday(matNos.get(0), sRow, eRow); |
| | | for (String locNo : locNos) { |
| | | if (Utils.isShallowLoc(slaveProperties, locNo)) { |
| | | continue; |
| | | } |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, locNo); |
| | | // 检测目标库位是否为空库位 |
| | | LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) { |
| | | if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) { |
| | | if (VersionUtils.locMoveCheckLocType(shallowLoc, locTypeDto)) { |
| | | locMast = shallowLoc; |
| | | crnNo = locMast.getCrnNo(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 靠近摆放规则 --- 空托 |
| | | if (staDescId == 10) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow)); |
| | | if (locMasts.size() > 0) { |
| | | for (LocMast loc : locMasts) { |
| | | if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) { |
| | | continue; |
| | | } |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo()); |
| | | // 检测目标库位是否为空库位 |
| | | LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) { |
| | | if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) { |
| | | locMast = shallowLoc; |
| | | crnNo = locMast.getCrnNo(); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 如果没有相近物料,则按规则轮询货架 |
| | | if (null == locMast) { |
| | | Shelves shelves = new Shelves(rowCount, crn_qty); |
| | | // 1-4排 |
| | | if (whsType == 1) { |
| | | for (int i = 0; i < shelves.group; i ++) { |
| | | curRow = shelves.start(curRow); |
| | | if (curRow < 0) { |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | | } |
| | | Integer crnNo1 = shelves.get(curRow); |
| | | if (basCrnpService.checkSiteError(crnNo1, true)) { |
| | | crnNo = crnNo1; |
| | | break; |
| | | } |
| | | } |
| | | // 5-8排 |
| | | } else if (whsType == 2) { |
| | | curRow = curRow - 4; |
| | | for (int i = 0; i < shelves.group; i ++) { |
| | | curRow = shelves.start(curRow); |
| | | if (curRow < 0) { |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | | } |
| | | Integer crnNo1 = shelves.get(curRow); |
| | | if (basCrnpService.checkSiteError(crnNo1 + 1, true)) { |
| | | // 偏移量补偿 |
| | | curRow = curRow + 4; |
| | | crnNo = crnNo1 + 1; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | // 126空板入 1-8排 |
| | | } else { |
| | | for (int i = 0; i < shelves.group; i ++) { |
| | | curRow = shelves.start(curRow); |
| | | if (curRow < 0) { |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | | } |
| | | Integer crnNo1 = shelves.get(curRow); |
| | | if (basCrnpService.checkSiteError(crnNo1, true)) { |
| | | crnNo = crnNo1; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (crnNo == 0) { |
| | | throw new CoolException("没有可用的堆垛机"); |
| | | } |
| | | // 获取目标站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", crnNo); |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | log.error("type_no={},stn_no={},crn_no={}", staDescId, sourceStaNo, crnNo); |
| | | throw new CoolException("入库路径不存在"); |
| | | } |
| | | BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn()); |
| | | if (!staNo.getAutoing().equals("Y")) { |
| | | throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用"); |
| | | } |
| | | // 更新库位排号 |
| | | rowLastno.setCurrentRow(curRow); |
| | | rowLastnoService.updateById(rowLastno); |
| | | |
| | | // 开始查找库位 ==============================>> |
| | | |
| | | // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排 |
| | | if (locMast == null) { |
| | | if (Utils.isShallowLoc(slaveProperties, curRow)) { |
| | | Integer deepRow = Utils.getDeepRow(slaveProperties, curRow); |
| | | locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1()); |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast)) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locMast)) { |
| | | locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1()); |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast)) { |
| | | locMast = null; |
| | | } |
| | | // 目标库位 ===>> 浅库位, 则校验其深库位是否为 F D X |
| | | if (null != locMast && Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) { |
| | | LocMast deepLoc = locMastService.selectById(Utils.getDeepLoc(slaveProperties, locMast.getLocNo())); |
| | | if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | // 目标库位 ===>> 深库位, 则校验其浅库位是否为 O |
| | | if (null != locMast && Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) { |
| | | LocMast shallowLoc = locMastService.selectById(Utils.getShallowLoc(slaveProperties, locMast.getLocNo())); |
| | | if (!shallowLoc.getLocSts().equals("O")) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | if (Cools.isEmpty(locMast)) { |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount) { |
| | | times = times + 1; |
| | | return getLocNo(1, staDescId, sourceStaNo, matNos, locTypeDto, times); |
| | | } else { |
| | | times = 0; |
| | | } |
| | | |
| | | // 轻货物找轻库位为空时,可以去找重库位仓 |
| | | if (locTypeDto.getLocType1() == 1) { |
| | | locTypeDto.setLocType1((short) 2); |
| | | return getLocNo(null, staDescId, sourceStaNo, matNos, locTypeDto, times); |
| | | } |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | |
| | | // 返回dto |
| | | startupDto.setWorkNo(workNo); |
| | | startupDto.setCrnNo(crnNo); |
| | | startupDto.setSourceStaNo(sourceStaNo); |
| | | startupDto.setStaNo(staNo.getDevNo()); |
| | | startupDto.setLocNo(locNo); |
| | | return startupDto; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(Arith.remainder(1, 4)); |
| | | System.out.println("0200201".substring(0, 2)); |
| | | String locNo = "0800201"; |
| | | int row = Integer.parseInt(locNo.substring(0, 2)); |
| | | double remainder = Arith.remainder(row, 4); |
| | | int targetRow; |
| | | if (remainder == 1) { |
| | | // 得到当前库位的外围库位 |
| | | targetRow = row + 1; |
| | | } else if (remainder == 0) { |
| | | // 得到当前库位的内围库位 |
| | | targetRow = row - 1; |
| | | } else { |
| | | return; |
| | | } |
| | | String zerofill = zerofill(String.valueOf(targetRow), 2)+locNo.substring(2); |
| | | System.out.println(zerofill); |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count) { |
| | |
| | | |
| | | int CRN_COUNT = 0; |
| | | |
| | | public static final Map<CrnThread, Thread> map = new ConcurrentHashMap<>(); |
| | | |
| | | |
| | | /** |
| | | * PostConstruct会在加载servlet的时候运行一次 |
| | |
| | | } |
| | | |
| | | private void initMq(){ |
| | | // // 初始化堆垛机mq |
| | | // for (Slave crn : slaveProperties.getCrn()) { |
| | | // MessageQueue.init(SlaveType.Crn, crn); |
| | | // } |
| | | // // 初始化RGVmq |
| | | // for (Slave rgv : slaveProperties.getRgv()) { |
| | | // MessageQueue.init(SlaveType.Rgv, rgv); |
| | |
| | | // for (Slave scale : slaveProperties.getScale()) { |
| | | // MessageQueue.init(SlaveType.Scale, scale); |
| | | // } |
| | | // // 初始化硫化罐mq |
| | | // for (Slave jar : slaveProperties.getJar()) { |
| | | // MessageQueue.init(SlaveType.Jar, jar); |
| | | // } |
| | | // // 初始化台车mq |
| | | // for (Slave car : slaveProperties.getCar()) { |
| | | // MessageQueue.init(SlaveType.Car, car); |
| | |
| | | } |
| | | |
| | | private void initThread(){ |
| | | // // 初始化堆垛机线程 |
| | | // log.info("初始化堆垛机线程..................................................."); |
| | | // for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | // CrnThread crnThread = new SiemensCrnThread(crn); |
| | | // Thread thread = new Thread((Runnable) crnThread); |
| | | // thread.start(); |
| | | // map.put(crnThread, thread); |
| | | // SlaveConnection.put(SlaveType.Crn, crn.getId(), crnThread); |
| | | // } |
| | | // // 初始化穿梭车线程 |
| | | // log.info("初始化RGV线程..................................................."); |
| | | // for (RgvSlave rgv : slaveProperties.getRgv()) { |
| | |
| | | // new Thread(ledThread).start(); |
| | | // SlaveConnection.put(SlaveType.Led, led.getId(), ledThread); |
| | | // } |
| | | // // 初始化jar线程 |
| | | // log.info("初始化jar线程..................................................."); |
| | | // for (JarSlave jar : slaveProperties.getJar()) { |
| | | // JarThread jarThread = new JarThread(jar); |
| | | // new Thread(jarThread).start(); |
| | | // SlaveConnection.put(SlaveType.Jar, jar.getId(), jarThread); |
| | | // } |
| | | // // 初始化Ste线程 |
| | | // log.info("初始化ste线程..................................................."); |
| | | // for (SteSlave ste : slaveProperties.getSte()) { |
| | |
| | | |
| | | @PreDestroy |
| | | public void destroy() { |
| | | } |
| | | |
| | | @Component |
| | | class killThread { |
| | | |
| | | /* @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void kill() { |
| | | for (Map.Entry<CrnThread, Thread> entry : map.entrySet()) { |
| | | CRN_COUNT++; |
| | | SiemensCrnThread key = (SiemensCrnThread) entry.getKey(); |
| | | // System.out.println("第"+i+"个堆垛机线程重启线程条件:"+(System.currentTimeMillis() - key.getSign())); |
| | | if (CRN_COUNT>10000){ |
| | | continue; |
| | | } |
| | | if (System.currentTimeMillis() - key.getSign() > 120000 && System.currentTimeMillis() - key.getSign()<1200000) { |
| | | System.out.println("第" + CRN_COUNT + "个堆垛机线程被重启"); |
| | | |
| | | // 请求线程安全停止 |
| | | key.requestStop(); |
| | | |
| | | // 等待线程完成停止, 可以这样做也可以选择不这么做,取决于是否需要等待线程结束 |
| | | try { |
| | | entry.getValue().join(20000); // 等待最多20秒 |
| | | } catch (InterruptedException e) { |
| | | // // 可适当处理中断 |
| | | // Thread.currentThread().interrupt(); // 保留中断状态 |
| | | entry.getValue().stop(); |
| | | } |
| | | |
| | | // 重新启动线程 |
| | | Thread thread = new Thread((Runnable) key); // 假设CrnThread实现了Runnable |
| | | thread.start(); |
| | | |
| | | // 替换映射关系中的旧线程 |
| | | map.put(entry.getKey(), thread); |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.core.model.protocol; |
| | | |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.core.enums.*; |
| | | import lombok.Data; |
| | |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "wcs-slave") |
| | | public class SlaveProperties { |
| | | |
| | | private boolean doubleDeep; |
| | | |
| | | private List<Integer> doubleLocs = new ArrayList<>(); |
| | | private List<Integer> doubleLocsLeft = new ArrayList<>(); |
| | | private List<Integer> doubleLocsRight = new ArrayList<>(); |
| | | |
| | | private int groupCount; |
| | | public class SlaveProperties{ |
| | | |
| | | private List<CrnSlave> crn = new ArrayList<>(); |
| | | |
| | |
| | | host: localhost |
| | | port: 6379 |
| | | database: 0 |
| | | # password: xltys1995 |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapper/*.xml |
| | | # global-config: |
| | | # field-strategy: 0 |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | logging: |
| | | path: /stock/out/@pom.build.finalName@/logs |
| | |
| | | swagger: |
| | | enable: false |
| | | |
| | | wms: |
| | | url: localhost:8080/yxwms |
| | | |
| | | # 下位机配置 |
| | | wcs-slave: |
| | | # 双深 |
| | | doubleDeep: true |
| | | # 双深库位排号 |
| | | doubleLocs: 1,4,5,8,21,24,27 |
| | | # 一个堆垛机负责的货架排数 |
| | | groupCount: 4 |
| | | # 左深库位排号 |
| | | doubleLocsLeft: 1,5,21 |
| | | # 右深库位排号 |
| | | doubleLocsRight: 4,8,24,27 |
| | | # 堆垛机1 |
| | | crn[0]: |
| | | id: 1 |
| | | ip: 10.10.10.120 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 153 |
| | | staNoOther: 152 |
| | | row: 4 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 100 |
| | | staNoOther: 101 |
| | | row: 1 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机2 |
| | | crn[1]: |
| | | id: 2 |
| | | ip: 10.10.10.130 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 145 |
| | | staNoOther: 144 |
| | | row: 8 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 148 |
| | | staNoOther: 149 |
| | | row: 5 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机3 |
| | | crn[2]: |
| | | id: 3 |
| | | ip: 10.10.10.140 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 261 |
| | | staNoOther: 257 |
| | | staNoOther1: 256 |
| | | staNoOther2: 255 |
| | | row: 10 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 200 |
| | | staNoOther: 200 |
| | | row: 9 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机4 |
| | | crn[3]: |
| | | id: 4 |
| | | ip: 10.10.10.150 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 260 |
| | | staNoOther: 248 |
| | | staNoOther1: 247 |
| | | staNoOther2: 246 |
| | | row: 12 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 250 |
| | | staNoOther: 250 |
| | | row: 11 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机5 |
| | | crn[4]: |
| | | id: 5 |
| | | ip: 10.10.10.160 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 259 |
| | | staNoOther: 239 |
| | | staNoOther1: 238 |
| | | staNoOther2: 237 |
| | | row: 14 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 241 |
| | | staNoOther: 241 |
| | | row: 13 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机6 |
| | | crn[5]: |
| | | id: 6 |
| | | ip: 10.10.10.10 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 413 |
| | | staNoOther: 413 |
| | | row: 23 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 415 |
| | | staNoOther: 415 |
| | | row: 22 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机7 |
| | | crn[6]: |
| | | id: 7 |
| | | ip: 10.10.10.20 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 405 |
| | | staNoOther: 405 |
| | | row: 26 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 407 |
| | | staNoOther: 407 |
| | | row: 25 |
| | | bay: 1 |
| | | lev: 1 |
| | | |
| | | # 输送线 |
| | | devp[0]: |
| | | id: 1 |
| | |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 小料箱 双工位单伸 入库口1 |
| | | inSingleSta[0]: |
| | | staNo: 173 |
| | | barcode: ${wcs-slave.barcode[2].id} |
| | | # 小料箱 双工位单伸 空板入库口1 |
| | | emptyInSingleSta[0]: |
| | | staNo: 104 |
| | | # 小料箱 双工位单伸 空板入库口1 |
| | | emptyInSingleSta[1]: |
| | | staNo: 126 |
| | | # 小料箱 双工位单伸 空板入库口1 |
| | | emptyInSingleSta[2]: |
| | | staNo: 131 |
| | | # # 小料箱 双工位单伸 空板入库口1 |
| | | # emptyInSingleSta[1]: |
| | | # staNo: 173 |
| | | # 大料箱 双工位单伸 入库口1 |
| | | inLargeSta[0]: |
| | | staNo: 292 |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | # 大料箱 双工位单伸 入库口1 |
| | | inLargeSta[1]: |
| | | staNo: 281 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | # 大料箱 双工位单伸 空板入库口1 |
| | | emptyInLargeSta[0]: |
| | | staNo: 292 |
| | | # 大料箱 双工位单伸 空板入库口2 |
| | | emptyInLargeSta[1]: |
| | | staNo: 281 |
| | | # 大料箱 双工位单伸 空板入库口2 |
| | | emptyInLargeSta[2]: |
| | | staNo: 310 |
| | | # 大料箱 双工位单伸 空板入库口2 |
| | | emptyInLargeSta[3]: |
| | | staNo: 312 |
| | | # 输送线 |
| | | devp[1]: |
| | | id: 2 |
| | |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 空板入库口1(临时) |
| | | emptyInSta[0]: |
| | | staNo: 511 |
| | | led: ${wcs-slave.led[0].id} |
| | | # 空板入库口1(临时) |
| | | emptyInSta[1]: |
| | | staNo: 515 |
| | | # 空板入库口1(临时) |
| | | emptyInSta[2]: |
| | | staNo: 536 |
| | | led: ${wcs-slave.led[0].id} |
| | | # 空板入库口1(临时) |
| | | emptyInSta[3]: |
| | | staNo: 607 |
| | | # 入库口1 |
| | | inSta[0]: |
| | | staNo: 460 |
| | | barcode: ${wcs-slave.barcode[6].id} |
| | | # 入库口2 |
| | | inSta[1]: |
| | | staNo: 453 |
| | | barcode: ${wcs-slave.barcode[5].id} |
| | | # 入库口464 |
| | | inSta464[0]: |
| | | staNo: 464 |
| | | led: ${wcs-slave.led[0].id} |
| | | barcode: ${wcs-slave.barcode[10].id} |
| | | |
| | | # 入硫化罐RGV |
| | | enterRgv[0]: |
| | | rgvNo: 623 |
| | | steNo: 1 |
| | | jarRegin: 1 |
| | | burial: 5 |
| | | staNoEnter[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 612 |
| | | row: 3 |
| | | staNoEnter[1]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 615 |
| | | row: 1 |
| | | # 入硫化罐RGV |
| | | enterRgv[1]: |
| | | rgvNo: 624 |
| | | steNo: 2 |
| | | jarRegin: 1 |
| | | burial: 6 |
| | | staNoEnter[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 619 |
| | | row: 3 |
| | | staNoEnter[1]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 622 |
| | | row: 1 |
| | | # 出硫化罐RGV |
| | | endRgv[0]: |
| | | rgvNo: 625 |
| | | steNo: 1 |
| | | jarNo: 1 |
| | | jarRegin: 1 |
| | | burial: 5 |
| | | staNoEnd[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 627 |
| | | row: 1 |
| | | # 出硫化罐RGV |
| | | endRgv[1]: |
| | | rgvNo: 626 |
| | | steNo: 2 |
| | | jarNo: 3 |
| | | jarRegin: 1 |
| | | burial: 6 |
| | | staNoEnd[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 628 |
| | | row: 1 |
| | | |
| | | # 条码扫描仪 |
| | | barcode[0]: |
| | | id: 1 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[1]: |
| | | id: 2 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[2]: |
| | | id: 3 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[3]: |
| | | id: 4 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[4]: |
| | | id: 5 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[5]: |
| | | id: 6 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[6]: |
| | | id: 7 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[7]: |
| | | id: 8 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[8]: |
| | | id: 9 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[9]: |
| | | id: 10 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # 条码扫描仪 |
| | | barcode[10]: |
| | | id: 11 |
| | | ip: 10.10.10.52 |
| | | port: 51236 |
| | | # LED1 |
| | | # JAR1 |
| | | jar[0]: |
| | | id: 1 |
| | | ip: 10.10.10.190 |
| | | port: 120 |
| | | jarOtherId: 2 |
| | | # 硫化罐入库站点 |
| | | jarInSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 612 |
| | | rgvNo: 623 |
| | | steNo: 1 |
| | | row: 3 |
| | | # 硫化罐出库站点 |
| | | jarOutSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 627 |
| | | rgvNo: 625 |
| | | steNo: 1 |
| | | row: 1 |
| | | # 硫化罐入库RGV |
| | | jarInRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 623 |
| | | row: 1 |
| | | # 硫化罐出库RGV |
| | | jarOutRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 625 |
| | | row: 1 |
| | | # 硫化罐入库穿梭板 |
| | | jarInSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 1 |
| | | row: 1 |
| | | # 硫化罐出库穿梭板 |
| | | jarOutSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 1 |
| | | row: 1 |
| | | # JAR2 |
| | | jar[1]: |
| | | id: 2 |
| | | ip: 10.10.10.191 |
| | | port: 120 |
| | | jarOtherId: 1 |
| | | # 硫化罐入库站点 |
| | | jarInSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 615 |
| | | rgvNo: 623 |
| | | steNo: 1 |
| | | row: 1 |
| | | # 硫化罐出库站点 |
| | | jarOutSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 627 |
| | | rgvNo: 625 |
| | | steNo: 1 |
| | | row: 1 |
| | | # 硫化罐入库RGV |
| | | jarInRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 623 |
| | | row: 1 |
| | | # 硫化罐出库RGV |
| | | jarOutRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 625 |
| | | row: 1 |
| | | # 硫化罐入库穿梭板 |
| | | jarInSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 1 |
| | | row: 1 |
| | | # 硫化罐出库穿梭板 |
| | | jarOutSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 1 |
| | | row: 1 |
| | | # JAR3 |
| | | jar[2]: |
| | | id: 3 |
| | | ip: 10.10.10.192 |
| | | port: 120 |
| | | jarOtherId: 4 |
| | | # 硫化罐入库站点 |
| | | jarInSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 619 |
| | | rgvNo: 624 |
| | | steNo: 2 |
| | | row: 3 |
| | | # 硫化罐出库站点 |
| | | jarOutSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 628 |
| | | rgvNo: 626 |
| | | steNo: 2 |
| | | row: 1 |
| | | # 硫化罐入库RGV |
| | | jarInRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 624 |
| | | row: 1 |
| | | # 硫化罐出库RGV |
| | | jarOutRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 626 |
| | | row: 2 |
| | | # 硫化罐入库穿梭板 |
| | | jarInSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 2 |
| | | row: 2 |
| | | # 硫化罐出库穿梭板 |
| | | jarOutSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 2 |
| | | row: 2 |
| | | # JAR4 |
| | | jar[3]: |
| | | id: 4 |
| | | ip: 10.10.10.193 |
| | | port: 120 |
| | | jarOtherId: 3 |
| | | # 硫化罐入库站点 |
| | | jarInSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 622 |
| | | rgvNo: 624 |
| | | steNo: 2 |
| | | row: 3 |
| | | # 硫化罐出库站点 |
| | | jarOutSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 628 |
| | | rgvNo: 626 |
| | | steNo: 2 |
| | | row: 1 |
| | | # 硫化罐入库RGV |
| | | jarInRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 624 |
| | | row: 1 |
| | | # 硫化罐出库RGV |
| | | jarOutRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 626 |
| | | row: 2 |
| | | # 硫化罐入库穿梭板 |
| | | jarInSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 2 |
| | | row: 2 |
| | | # 硫化罐出库穿梭板 |
| | | jarOutSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 2 |
| | | row: 2 |
| | | # 冷却槽5 |
| | | jar[4]: |
| | | id: 5 |
| | | ip: 10.10.10.190 |
| | | port: 120 |
| | | jarOtherId: 2 |
| | | # 硫化罐入库站点 |
| | | jarInSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 612 |
| | | rgvNo: 623 |
| | | steNo: 1 |
| | | row: 3 |
| | | # 硫化罐出库站点 |
| | | jarOutSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 627 |
| | | rgvNo: 625 |
| | | steNo: 1 |
| | | row: 1 |
| | | # 硫化罐入库RGV |
| | | jarInRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 623 |
| | | row: 1 |
| | | # 硫化罐出库RGV |
| | | jarOutRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 625 |
| | | row: 1 |
| | | # 硫化罐入库穿梭板 |
| | | jarInSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 1 |
| | | row: 1 |
| | | # 硫化罐出库穿梭板 |
| | | jarOutSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 1 |
| | | row: 1 |
| | | # 冷却槽6 |
| | | jar[5]: |
| | | id: 6 |
| | | ip: 10.10.10.193 |
| | | port: 120 |
| | | jarOtherId: 3 |
| | | # 硫化罐入库站点 |
| | | jarInSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 619 |
| | | rgvNo: 624 |
| | | steNo: 2 |
| | | row: 3 |
| | | # 硫化罐出库站点 |
| | | jarOutSta[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 628 |
| | | rgvNo: 626 |
| | | steNo: 2 |
| | | row: 1 |
| | | # 硫化罐入库RGV |
| | | jarInRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 624 |
| | | row: 1 |
| | | # 硫化罐出库RGV |
| | | jarOutRgv[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | rgvNo: 626 |
| | | row: 2 |
| | | # 硫化罐入库穿梭板 |
| | | jarInSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 2 |
| | | row: 2 |
| | | # 硫化罐出库穿梭板 |
| | | jarOutSte[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | steNo: 2 |
| | | row: 2 |
| | | # ste1 |
| | | ste[0]: |
| | | id: 1 |
| | | ip: 10.10.10.170 |
| | | port: 502 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 入库站点 |
| | | steInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 612 |
| | | rgvNo: 623 |
| | | jarNo: 1 |
| | | row: 3 |
| | | # 入库站点 |
| | | steInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 615 |
| | | rgvNo: 623 |
| | | jarNo: 2 |
| | | row: 1 |
| | | # ste2 |
| | | ste[1]: |
| | | id: 2 |
| | | ip: 10.10.10.175 |
| | | port: 502 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 入库站点 |
| | | steInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 619 |
| | | rgvNo: 624 |
| | | jarNo: 3 |
| | | row: 3 |
| | | # 入库站点 |
| | | steInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staNo: 622 |
| | | rgvNo: 624 |
| | | jarNo: 4 |
| | | row: 1 |
| | | # 磅秤 |
| | | scale[0]: |
| | | id: 1 |
| | | ip: 10.10.10.207 |
| | | port: 5005 |
| | | staNo: 281 |
| | | # 磅秤 |
| | | scale[1]: |
| | | id: 2 |
| | | ip: 10.10.10.206 |
| | | port: 5005 |
| | | staNo: 292 |
| | | # 磅秤 |
| | | scale[2]: |
| | | id: 3 |
| | | ip: 10.10.10.209 |
| | | port: 5005 |
| | | staNo: 453 |
| | | # 磅秤 |
| | | scale[3]: |
| | | id: 4 |
| | | ip: 10.10.10.208 |
| | | port: 5005 |
| | | staNo: 460 |
| | | # LED1 半成品库 |
| | | led[0]: |
| | | id: 1 |
| | | ip: 10.10.10.220 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 453 |
| | | # LED2 破碎区 |
| | | led[1]: |
| | | id: 2 |
| | | ip: 10.10.10.221 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 536 |
| | | # LED3 二楼原料区 |
| | | led[2]: |
| | | id: 3 |
| | | ip: 10.10.10.222 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 281,292 |
| | | # LED4 密炼区 |
| | | led[3]: |
| | | id: 1 |
| | | ip: 10.10.10.223 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[1].id} |
| | | staArr: 453 |
| | | wms: |
| | | url: localhost:8080/yxwms |
| | |
| | | }) |
| | | |
| | | }); |
| | | // 堆垛机信息 |
| | | $('.machine').on('click', function () { |
| | | var id = this.id.split("-")[1]; |
| | | $("#crnWindow").attr('style', 'display:block;'); |
| | | $("#siteWindow").attr("style", "display:none;"); |
| | | $('.detailed').empty(); |
| | | $('.detailed').append(id + '号堆垛机'); |
| | | $.ajax({ |
| | | url: baseUrl + "/console/crn/detail", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: { |
| | | crnNo: id |
| | | }, |
| | | method: 'post', |
| | | success: function (res) { |
| | | for (var val in res.data) { |
| | | var find = $("#crnWindow").find(":input[name='" + val + "']"); |
| | | if (find[0].type === 'text') { |
| | | find.val(res.data[val]); |
| | | } else if (find[0].type === 'checkbox') { |
| | | find.attr("checked", res.data[val] === 'Y'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }) |
| | | |
| | | }) |
| | | // 弹窗关闭 |
| | | $('button').on('click', function () { |
| | | $('#siteWindow').attr('style', 'display:none') |
| | |
| | | }); |
| | | } |
| | | |
| | | // 堆垛机实时数据获取 |
| | | function getCrnInfo() { |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/crn", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var crns = res.data; |
| | | for (var i = 0; i < crns.length; i++) { |
| | | var crnEl = $("#crn-" + crns[i].crnId); |
| | | crnEl.attr("class", "machine " + crns[i].crnStatus); |
| | | var unit = ($('.item').eq(0).width() + 13) / 2; |
| | | if (crns[i].bay < 0) { |
| | | crns[i].bay = 0 |
| | | } |
| | | crnEl.animate({left: (crns[i].bay * unit) + 'px'}, 1000); |
| | | } |
| | | } else if (res.code === 403) { |
| | | parent.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 扫码器实时数据获取 |
| | | function getBarcodeInfo() { |
| | | $.ajax({ |
| | |
| | | } |
| | | |
| | | // 页面点击事件监听 --------------------------------------------------------- |
| | | |
| | | // 输送设备点击事件 |
| | | // $('.site').on('click', function () { |
| | | // var id = this.id.split("-")[1]; |
| | | // if (id === undefined) { |
| | | // return; |
| | | // } |
| | | // layer.open({ |
| | | // title: id + " 站点信息详情", |
| | | // closeBtn: 0, |
| | | // skin: 'layui-layer-lan', |
| | | // offset: '180px', |
| | | // type: 1, |
| | | // shadeClose: true, |
| | | // content: $('#siteWindow'), |
| | | // area: ['35rem', '18rem'], |
| | | // btn: ['确定', '关闭'], |
| | | // success: function(layero, index){ |
| | | // http.post(baseUrl+"/console/site/detail", {siteId: id}, function (res) { |
| | | // for (var val in res.data) { |
| | | // var find = $("#siteWindow").find(":input[name='" + val + "']"); |
| | | // if (find[0].type==='text') { |
| | | // find.val(res.data[val]); |
| | | // } else if (find[0].type === 'checkbox') { |
| | | // find.attr("checked", res.data[val] === 'Y'); |
| | | // } |
| | | // } |
| | | // }) |
| | | // }, |
| | | // end: function () { |
| | | // $(':input', $("#siteWindow")).val('').removeAttr('checked').removeAttr('selected'); |
| | | // } |
| | | // }); |
| | | // }); |
| | | |
| | | // 堆垛机点击事件 |
| | | // $('.machine').on('click', function () { |
| | | // var id = this.id.split("-")[1]; |
| | | // layer.open({ |
| | | // title: id+"号堆垛机", |
| | | // skin: 'layui-layer-lan', |
| | | // closeBtn: 0, |
| | | // type: 1, |
| | | // offset: '150px', |
| | | // shadeClose: true, |
| | | // content: $("#crnWindow"), |
| | | // area: ['40rem', '20rem'], |
| | | // btn: ['确定', '关闭'], |
| | | // success: function(layero, index){ |
| | | // http.post(baseUrl+"/console/crn/detail", {crnNo: id}, function (res) { |
| | | // for (var val in res.data) { |
| | | // var find = $("#crnWindow").find(":input[name='" + val + "']"); |
| | | // if (find[0].type==='text') { |
| | | // find.val(res.data[val]); |
| | | // } else if (find[0].type === 'checkbox') { |
| | | // find.attr("checked", res.data[val] === 'Y'); |
| | | // } |
| | | // } |
| | | // }) |
| | | // }, |
| | | // end: function () { |
| | | // $(':input', $("#crnWindow")).val('').removeAttr('checked').removeAttr('selected'); |
| | | // } |
| | | // }); |
| | | // }); |
| | | |
| | | |
| | | // 小车偏移动画 |
| | | function carAnimate(id, target) { |
| | |
| | | }) |
| | | |
| | | }); |
| | | // 堆垛机信息 |
| | | $('.machine').on('click', function () { |
| | | var id = this.id.split("-")[1]; |
| | | $("#crnWindow").attr('style', 'display:block;'); |
| | | $("#siteWindow").attr("style", "display:none;"); |
| | | $('.detailed').empty(); |
| | | $('.detailed').append(id + '号堆垛机'); |
| | | $.ajax({ |
| | | url: baseUrl + "/console/crn/detail", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: { |
| | | crnNo: id |
| | | }, |
| | | method: 'post', |
| | | success: function (res) { |
| | | for (var val in res.data) { |
| | | var find = $("#crnWindow").find(":input[name='" + val + "']"); |
| | | if (find[0].type === 'text') { |
| | | find.val(res.data[val]); |
| | | } else if (find[0].type === 'checkbox') { |
| | | find.attr("checked", res.data[val] === 'Y'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }) |
| | | |
| | | }) |
| | | // 弹窗关闭 |
| | | $('button').on('click', function () { |
| | | $('#siteWindow').attr('style', 'display:none') |
| | |
| | | |
| | | carAnimate(Number(sites[i].siteId), Number(sites[i].nearbySta)); |
| | | } |
| | | } |
| | | } else if (res.code === 403) { |
| | | parent.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 堆垛机实时数据获取 |
| | | function getCrnInfo() { |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/crn", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | // console.log(res) |
| | | if (res.code === 200) { |
| | | var crns = res.data; |
| | | for (var i = 0; i < crns.length; i++) { |
| | | var crnEl = $("#crn-" + crns[i].crnId); |
| | | crnEl.attr("class", "machine " + crns[i].crnStatus); |
| | | var unit = 0;//($('.item').eq(0).width() + 13) / 2; |
| | | |
| | | if (crns[i].bay < 0 || crns[i].bay === -2) { |
| | | crns[i].bay = 1 |
| | | } |
| | | // crnEl.animate({left: (crns[i].bay * unit) + 'px'}, 1000); |
| | | // crns[i].bay = 15; |
| | | |
| | | var offSet = 0; |
| | | unit = 17; |
| | | offSet = 550; |
| | | |
| | | |
| | | if(crns[i].bay === 1){ |
| | | crnEl.animate({left: offSet + 'px'}, 1000); |
| | | } else { |
| | | crnEl.animate({left: (offSet - unit + (crns[i].bay * unit)) + 'px'}, 1000); |
| | | } |
| | | |
| | | } |
| | | } else if (res.code === 403) { |
| | | parent.location.href = baseUrl + "/login"; |
| | |
| | | }); |
| | | } |
| | | |
| | | // 穿梭车数据表获取 ---- 表二 |
| | | function getSteMsgInfo() { |
| | | let tableEl = $('#ste-msg-table'); |
| | | $.ajax({ |
| | | url: baseUrl+ "/ste/table/ste/msg", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var table = res.data; |
| | | if (table.length > steMsgTableBlankRows && table.length !== steMsgTableFullRows) { |
| | | initSteMsgTable(table.length-steMsgTableBlankRows); |
| | | steMsgTableFullRows = table.length; |
| | | } |
| | | for (var i=1;i<=table.length;i++){ |
| | | var tr = tableEl.find("tr").eq(i); |
| | | setVal(tr.children("td").eq(0), table[i-1].steNo); |
| | | setVal(tr.children("td").eq(1), table[i-1].workNo); |
| | | setVal(tr.children("td").eq(2), table[i-1].status); |
| | | setVal(tr.children("td").eq(3), table[i-1].sourceStaNo); |
| | | setVal(tr.children("td").eq(4), table[i-1].staNo); |
| | | setVal(tr.children("td").eq(5), table[i-1].sourceLocNo); |
| | | setVal(tr.children("td").eq(6), table[i-1].locNo); |
| | | setVal(tr.children("td").eq(7), table[i-1].speed); |
| | | setVal(tr.children("td").eq(8), table[i-1].closer); |
| | | setVal(tr.children("td").eq(9), table[i-1].pakMk); |
| | | } |
| | | } else if (res.code === 403){ |
| | | window.location.href = baseUrl+"/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 穿梭车日志输出 ----------------------------------------------------------------------- |
| | | function getSteOutput() { |
| | | $.ajax({ |