| | |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.rcs.*; |
| | | import com.zy.asrs.mapper.AgvInfoMapper; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | | import com.zy.common.service.CommonService; |
| | | 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; |
| | |
| | | private CommonService commonService; |
| | | @Resource |
| | | private AgvInfoMapper agvInfoMapper; |
| | | @Autowired |
| | | private LocDetlMapper locDetlMapper; |
| | | |
| | | |
| | | // region MES接口 |
| | |
| | | public int synMatInfo(MesMatInfo mesMatInfo) { |
| | | |
| | | try { |
| | | List<LocDetl> locDetls = locDetlMapper.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("matnr", mesMatInfo.getItem_no())); |
| | | if (locDetls.size() > 0) { |
| | | return -2; |
| | | } |
| | | // 规则定义:默认第3层为同步的物料类型 |
| | | long secondPath = 2; |
| | | String secondParentName = WMS_CURRENT_NAME; |
| | |
| | | // 终点为空,计算接驳位 |
| | | BasStation basStation = null; |
| | | if (Cools.isEmpty(mesOutApply.getNextStationId())) { |
| | | List<BasStation> basStations = basStationService.selectList(new EntityWrapper<BasStation>().eq("loc_sts", "O")); |
| | | // 1.连杆线,2.螺杆线 |
| | | int productionLine = mesOutApply.getStationId().startsWith("LL") ? 1 : 2; |
| | | List<BasStation> basStations = basStationService.selectList(new EntityWrapper<BasStation>().eq("loc_sts", "O").eq("area_id",productionLine)); |
| | | if (basStations.isEmpty()) { |
| | | mesReturn.setSuccess("2"); |
| | | mesReturn.setMessage("无空接驳位,请稍后再试!"); |
| | |
| | | // 下发给RCS |
| | | RcsTaskSubmit rcsTaskSubmit = new RcsTaskSubmit(); |
| | | // 模板名 |
| | | if(transTask.getCurStationId().startsWith("LL") || transTask.getCurStationId().startsWith("LG")) { // 起点产线 |
| | | if(transTask.getCurStationId().startsWith("LL") || transTask.getCurStationId().startsWith("LJ")|| transTask.getCurStationId().startsWith("LG") || transTask.getCurStationId().startsWith("LT")) { // 起点产线 |
| | | rcsTaskSubmit.setTaskType("DJ1"); |
| | | } else if(transTask.getNextStationId().startsWith("LL") || transTask.getNextStationId().startsWith("LG")) { // 终点产线 |
| | | } else if(transTask.getNextStationId().startsWith("LL") || transTask.getNextStationId().startsWith("LJ")|| transTask.getNextStationId().startsWith("LG") || transTask.getNextStationId().startsWith("LT")) { // 终点产线 |
| | | rcsTaskSubmit.setTaskType("DJ2"); |
| | | } |
| | | rcsTaskSubmit.setRobotTaskCode(transTask.getTaskno()); |
| | |
| | | */ |
| | | public int applyInStation(TransParent apply) { |
| | | |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") ? "AGVTransportPalletNotice" : "Aprs/AGVTransportPalletNotice"); |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") || apply.getProductLineId().equals("LJ") ? "AGVTransportPalletNotice" : "Aprs/AGVTransportPalletNotice"); |
| | | String response = RcsServiceImpl.sendPost(url, JSONObject.toJSONString(apply)); |
| | | if (!StringUtils.isEmpty(response) && response.contains("Success")){ |
| | | MesReturn mesReturn = JSONObject.parseObject(response, MesReturn.class); |
| | |
| | | */ |
| | | public int outStation(TransParent apply) { |
| | | |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") ? "AGVDepartureCompleted" : "Aprs/AGVDepartureCompleted"); |
| | | String url = MES_URL + (apply.getProductLineId().equals("LL") || apply.getProductLineId().equals("LJ") ? "AGVDepartureCompleted" : "Aprs/AGVDepartureCompleted"); |
| | | String response = RcsServiceImpl.sendPost(url, JSONObject.toJSONString(apply)); |
| | | if (!StringUtils.isEmpty(response) && response.contains("Success")){ |
| | | MesReturn mesReturn = JSONObject.parseObject(response, MesReturn.class); |
| | |
| | | stockDetl.setAnfme(locDetl.getAnfme()); |
| | | stockDetls.add(stockDetl); |
| | | } |
| | | dtLocDetailVo.setLocDetl(stockDetls); |
| | | dtLocDetailVo.setLocDetls(stockDetls); |
| | | dtLocDetailVoList.add(dtLocDetailVo); |
| | | } |
| | | |