| | |
| | | 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.common.utils.RedisUtil; |
| | | import com.zy.common.utils.*; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | @Autowired |
| | | private HikUtils hikUtils; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | |
| | | if (crnProtocol.modeType == CrnModeType.AUTO && crnProtocol.getTaskNo().equals(wrkMast.getWrkNo().shortValue()) |
| | | && (crnProtocol.statusType == CrnStatusType.PUTTING || crnProtocol.statusType == CrnStatusType.WAITING)) { |
| | | && crnProtocol.statusType == CrnStatusType.WAITING) { |
| | | //放货中 或 等待确认 |
| | | News.warnNoLog("" + mark + " - 0" + " - 开始执行"); |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | String ip = ""; |
| | | if (wrkMast.getStaNo()==401){ |
| | | ip = "172.26.4.231"; |
| | | }else if (wrkMast.getStaNo()==402){ |
| | | ip = "172.26.4.232"; |
| | | }else if (wrkMast.getStaNo()==307){ |
| | | ip = "172.26.1.231"; |
| | | }else if (wrkMast.getStaNo()==303){ |
| | | ip = "172.26.1.232"; |
| | | }else if (wrkMast.getStaNo()==304){ |
| | | ip = "172.26.1.233"; |
| | | } |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String newName = sf.format(new Date()) + "_" + locMast.getLocNo(); |
| | | String pic = wrkMast.getPic(); |
| | | List<String> list = null; |
| | | if (Cools.isEmpty(pic)) { |
| | | list = new ArrayList<>(); |
| | | } else { |
| | | list = JSON.parseArray(pic, String.class); |
| | | } |
| | | list.add(newName); |
| | | //入库前抓拍 |
| | | try { |
| | | hikUtils.startPic(ip, newName + ".jpg"); |
| | | } catch (Exception e) { |
| | | log.error("入库前抓拍"); |
| | | } |
| | | |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | |
| | | News.info("787 修改工作档状态2.设备上走 => 3.吊车入库中 " + wrkMast); |
| | | Date now = new Date(); |
| | | wrkMast.setWrkSts(3L); |
| | | wrkMast.setPic(JSON.toJSONString(list)); |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | |
| | | continue; |
| | | } |
| | | //堆垛机接驳站点没有空料架 |
| | | if(!staProtocol.isEmptyOutType()&&(Cools.isEmpty(wrkMast.getCtnType())||wrkMast.getCtnType()==0)){ |
| | | if(staProtocol.getSiteId()==307&&!staProtocol.isEmptyOutType()&&(Cools.isEmpty(wrkMast.getCtnType())||wrkMast.getCtnType()==0)){ |
| | | //请求wms下发agv搬运空料架到堆垛机接驳站点任务 |
| | | try { |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | Boolean config = true; |
| | | |
| | | if (staProtocol.getSiteId()==307 && !staProtocol.isEmptyOutType()){ |
| | | config = false; |
| | | } |
| | | |
| | | // 判断堆垛机出库站状态 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable() && staProtocol.isEmptyOutType()) { |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable() && config) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | | // 堆垛机控制过滤 |
| | |
| | | } |
| | | break; |
| | | } |
| | | }else if ((staProtocol.getSiteId()==304 || staProtocol.getSiteId()==301) && staProtocol.isAutoing() |
| | | && (staProtocol.isLoading() || staProtocol.getWorkNo() != 0)) { |
| | | if (staProtocol.getSiteId() == 304){ |
| | | wrkMast.setSourceStaNo(301); |
| | | |
| | | }else { |
| | | wrkMast.setSourceStaNo(304); |
| | | } |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | |
| | | } |
| | |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() |
| | | && (staProtocol.getWorkNo() > 9990 && staProtocol.getWorkNo() <= 9999) |
| | | && (staProtocol.getWorkNo() ==0) |
| | | && staProtocol.isPakMk() |
| | | // && staProtocol.getEmptyInType() == 1 |
| | | ) { |
| | |
| | | String errorMsg = "扫码失败,请重试"; |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(5, errorMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode)); |
| | | WaitPakin waitPakin = waitPakinMapper.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).getEntity()); |
| | | if (waitPakin != null || wrkMast != null) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(shallowLoc.getLocNo()); // 源库位 |
| | | wrkMast.setLocNo(loc.getLocNo()); // 目标库位 |
| | | wrkMast.setFullPlt(shallowLoc.getFullPlt()); // 满板 |
| | | wrkMast.setFullPlt(shallowLoc.getLocSts().equals("F") ? "Y" : "N"); // 满板 |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(sourceLocNo); // 源库位 |
| | | wrkMast.setLocNo(locNo); // 目标库位 |
| | | wrkMast.setFullPlt("N"); // 满板:Y |
| | | wrkMast.setFullPlt(sourceLoc.getLocSts().equals("F")?"Y":"N"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |