| | |
| | | @TableField("fire_status") |
| | | private Integer fireStatus; |
| | | |
| | | // 产品状态{0:无,1:待测,2:测试中;3.测试完成;4.测试失败;5.静置中;6:静置完成;7:暂停测试;8:紧急出库;} |
| | | // 产品状态{0:空闲,1:待测,2:测试中;3.测试完成;4.测试失败;} |
| | | @ApiModelProperty(value= "") |
| | | @TableField("pack_status") |
| | | private Integer packStatus; |
| | |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 0: |
| | | return "暂停"; |
| | | return "空闲"; |
| | | case 1: |
| | | return "待测"; |
| | | case 2: |
| | | return "复核中"; |
| | | case 3: |
| | | return "测试中"; |
| | | case 4: |
| | | case 3: |
| | | return "完成"; |
| | | case 4: |
| | | return "失败"; |
| | | case 5: |
| | | return "已移库"; |
| | | default: |
| | |
| | | if(station.getAutoing()==null || !station.getAutoing().equals("Y")) { |
| | | throw new CoolException(devpNo+"站点不是自动状态"); |
| | | } |
| | | if(station.getLoading()==null || !station.getLoading().equals("Y")) { |
| | | throw new CoolException(devpNo+"站点无物"); |
| | | } |
| | | // if(station.getLoading()==null || !station.getLoading().equals("Y")) { |
| | | // throw new CoolException(devpNo+"站点无物"); |
| | | // } |
| | | if(station.getWrkNo()!=null && station.getWrkNo()>0 && station.getWrkNo() < 9990) { |
| | | throw new CoolException(devpNo+"站点已有工作号"); |
| | | } |
| | |
| | | combParam.setLocNo(locMast.getLocNo()); |
| | | combParam.setPackSts(7); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | // new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+locMast.getLocNo()); |
| | |
| | | throw new CoolException("产品在测试中,禁止库位移栽"); |
| | | // }else if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) { |
| | | // throw new CoolException("移转库位属于不同堆垛机"); |
| | | }else if(sourceLoc.getPackStatus()!=3){ |
| | | }else if(sourceLoc.getPackStatus()==3||sourceLoc.getPackStatus()==4){ |
| | | if(sourceLoc.getLocType1()==loc.getLocType1()){ |
| | | throw new CoolException("源库为与目标库位的库位类型相同"); |
| | | } |
| | | }else if (sourceLoc.getPackStatus()==5){ |
| | | if(sourceLoc.getLocType1()!=loc.getLocType1()){ |
| | | throw new CoolException("源库为静置货物与目标库位的库位类型不相同"); |
| | | } |
| | | } |
| | | Date now = new Date(); |
| | | // 获取工作号 |
| | |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute() { |
| | | if (confirmDeep) return; |
| | | // if (confirmDeep) return; |
| | | ReturnT<String> result = moveLocHandler.start(); |
| | | if (!result.isSuccess()) { |
| | | log.error("测试完成移库失败"); |
| | |
| | | .eq("row1", equipmentRow) |
| | | .eq("loc_type1", (short) 1) |
| | | .eq("fire_status", 0) |
| | | .eq("ctn_kind",1) |
| | | ); |
| | | if (!Cools.isEmpty(locMasts2)) { |
| | | for (LocMast locMast : locMasts2) { |
| | |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("loc_no", locMast.getLocNo()) |
| | | .eq("barcode", locDetl.getMatnr()) |
| | | .eq("status", 4) |
| | | .eq("status", 3) |
| | | ); |
| | | boolean sign = false; |
| | | if (!Cools.isEmpty(testMast)) { |
| | | if (testMast.getStatus() == 4) { |
| | | if (testMast.getStatus() == 3) { |
| | | //移库开始,查询目标库位 |
| | | LocMast targetLocNo = locMastService.queryFreeLocMast(3, (short) 2); |
| | | if (Cools.isEmpty(targetLocNo)) { |
| | |
| | | } else { |
| | | log.error("测试库位:" + locMast.getLocNo() + "所属测试档为空或者不状态为4"); |
| | | } |
| | | if (sign) { |
| | | if (false) { |
| | | //4.测试完成上报 |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(locDetl.getMatnr()); |
| | |
| | | combParam.setPackSts(1); |
| | | combParam.setStepSts(4); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | new PostMesDataUtils().postMesData("MES系统", mesUrl, inpath, combParam); |
| | | // new PostMesDataUtils().postMesData("MES系统", mesUrl, inpath, combParam); |
| | | return SUCCESS; |
| | | } |
| | | } |
| | |
| | | } catch (Exception e) { |
| | | log.error("" + e); |
| | | } |
| | | |
| | | //测试失败,移库 |
| | | try { |
| | | List<LocMast> locMasts2 = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "F") |
| | | .eq("pack_status", 4)//测试失败 |
| | | .eq("row1", equipmentRow) |
| | | .eq("loc_type1", (short) 1) |
| | | .eq("fire_status", 0) |
| | | .eq("ctn_kind",1) |
| | | ); |
| | | if (!Cools.isEmpty(locMasts2)) { |
| | | for (LocMast locMast : locMasts2) { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | if (Cools.isEmpty(locDetl)) { |
| | | log.error("测试失败 出库、移库==>库存明细查询失败!库位号:" + locMast.getLocNo()); |
| | | continue; |
| | | } |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("loc_no", locMast.getLocNo()) |
| | | .eq("barcode", locDetl.getMatnr()) |
| | | .eq("status", 4) |
| | | ); |
| | | boolean sign = false; |
| | | if (!Cools.isEmpty(testMast)) { |
| | | if (testMast.getStatus() == 4) { |
| | | //移库开始,查询目标库位 |
| | | LocMast targetLocNo = locMastService.queryFreeLocMast(3, (short) 4); |
| | | if (Cools.isEmpty(targetLocNo)) { |
| | | targetLocNo = locMastService.queryFreeLocMast(2, (short) 4); |
| | | if (Cools.isEmpty(targetLocNo)) { |
| | | targetLocNo = locMastService.queryFreeLocMast(1, (short) 4); |
| | | if (Cools.isEmpty(targetLocNo)) { |
| | | return FAIL.setMsg("没有中转库位"); |
| | | } |
| | | } |
| | | } |
| | | if (targetLocNo != null) { |
| | | workService.locMove(locMast.getLocNo(), targetLocNo.getLocNo(), (long) 9935); |
| | | sign = true; |
| | | } else { |
| | | log.error("测试失败自动移库--->没有空库位!"); |
| | | } |
| | | |
| | | } else if (testMast.getStatus() != 4) { |
| | | log.error("测试状态异常,库位号为:" + testMast.getLocNo()); |
| | | } |
| | | |
| | | } else { |
| | | log.error("测试库位:" + locMast.getLocNo() + "所属测试档为空或者不状态为4"); |
| | | } |
| | | if (false) { |
| | | //4.测试完成上报 |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(locDetl.getMatnr()); |
| | | combParam.setLocNo(locMast.getLocNo()); |
| | | combParam.setPackSts(1); |
| | | combParam.setStepSts(4); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | // new PostMesDataUtils().postMesData("MES系统", mesUrl, inpath, combParam); |
| | | return SUCCESS; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("" + e); |
| | | } |
| | | |
| | | //测试有空库位 移库 |
| | | try { |
| | | List<LocMast> locMasts3 = locMastService.selectList(new EntityWrapper<LocMast>() |
| | |
| | | combParam.setPackSts(1); |
| | | combParam.setStepSts(6); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | // new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+locMast.getLocNo()); |
| | |
| | | } |
| | | |
| | | combParam.setRequestTime(DateUtils.convert(now)); |
| | | new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | // new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("全板入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | locMast.setModiTime(now); |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | |
| | | |
| | | boolean sign =false; |
| | | if (locMast.getLocType1().equals(sourceLoc.getLocType1())){ |
| | | locMast.setPackStatus(packStatus); |
| | | |
| | |
| | | //测试库位转静置库位和NG库位 |
| | | if (locMast.getLocType1().equals((short)4)){ |
| | | locMast.setPackStatus(4); //4:NG |
| | | //入库标记 |
| | | packQualifiedService.insertPackQualified(true,new Date(),locDetl.getMatnr()); |
| | | //出库标记 |
| | | packQualifiedService.insertPackQualified(false,new Date(),locDetl.getMatnr()); |
| | | // //入库标记 |
| | | // packQualifiedService.insertPackQualified(true,new Date(),locDetl.getMatnr()); |
| | | // //出库标记 |
| | | // packQualifiedService.insertPackQualified(false,new Date(),locDetl.getMatnr()); |
| | | }else { |
| | | locMast.setPackStatus(5); //5:静置中 |
| | | //入库标记 |
| | | packQualifiedService.insertPackQualified(true,new Date(),locDetl.getMatnr()); |
| | | //出库标记 |
| | | packQualifiedService.insertPackQualified(false,new Date(),locDetl.getMatnr()); |
| | | // //入库标记 |
| | | // packQualifiedService.insertPackQualified(true,new Date(),locDetl.getMatnr()); |
| | | // //出库标记 |
| | | // packQualifiedService.insertPackQualified(false,new Date(),locDetl.getMatnr()); |
| | | } |
| | | sign=true; |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("loc_no",sourceLoc.getLocNo()) |
| | | .eq("barcode",locDetl.getMatnr()) |
| | | .eq("status",4) |
| | | .in("status",3,4) |
| | | ); |
| | | testMast.setStatus(5); |
| | | testMast.setLocNo(locMast.getLocNo()); |
| | | testMast.setModiTime(new Date()); |
| | | if (!testMastService.update(testMast,new EntityWrapper<TestMast>() |
| | | .eq("loc_no",sourceLoc.getLocNo()) |
| | | .eq("barcode",locDetl.getMatnr()) |
| | | .eq("status",4))){ |
| | | if (!testMastService.updateById(testMast)){ |
| | | throw new CoolException("更改测试状态失败"); |
| | | } |
| | | |
| | | } |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("库位移转 ===>> 修改目标库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("库位移转 ===>> 修改目标库位状态失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | |
| | | if (locMast.getCrnNo()==1 && sign){ |
| | | //7.测试库位转静置库位出库完成上报 |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(locDetl.getMatnr()); |
| | | combParam.setLocNo(wrkMast.getSourceLocNo()); |
| | | combParam.setStepSts(7); |
| | | if (locMast.getPackStatus()==4){ |
| | | combParam.setPackSts(2); |
| | | }else if (locMast.getPackStatus()==5){ |
| | | combParam.setPackSts(1); |
| | | } |
| | | combParam.setRequestTime(DateUtils.convert(now)); |
| | | new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | //5.测试库位转静置库位入库完成上报 |
| | | combParam.setPackNo(locDetl.getMatnr()); |
| | | combParam.setLocNo(wrkMast.getLocNo()); |
| | | if (locMast.getPackStatus()==4){ |
| | | combParam.setPackSts(2); |
| | | combParam.setStepSts(5); |
| | | }else if (locMast.getPackStatus()==5){ |
| | | combParam.setPackSts(1); |
| | | combParam.setStepSts(8); |
| | | }else { |
| | | combParam.setPackSts(0); |
| | | } |
| | | combParam.setRequestTime(DateUtils.convert(now)); |
| | | new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | } |
| | | break; |
| | | default: |
| | |
| | | combParam.setStepSts(6);//静置库出库完成 |
| | | } |
| | | combParam.setRequestTime(DateUtils.convert(now)); |
| | | new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | // new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | } |
| | | } |
| | | break; |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | |
| | | } |
| | | } |
| | | } |
| | | // 靠近摆放规则 --- 空托 |
| | | 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 (shallowLoc.getLocType1()<locTypeDto.getLocType1()){ |
| | | continue; |
| | | } |
| | | if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) { |
| | | locMast = shallowLoc; |
| | | crnNo = locMast.getCrnNo(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locMast)) { |
| | | List<LocMast> locMastList3 = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "O") |
| | | .eq("row1",3) |
| | | .notIn("loc_type1",1)); |
| | | if (!Cools.isEmpty(locMastList3)) { |
| | | locMast = locMastList3.get(0); |
| | | }else { |
| | | List<LocMast> locMastList1 = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "O") |
| | | .eq("row1",1) |
| | | .notIn("loc_type1",1)); |
| | | if (!Cools.isEmpty(locMastList1)) { |
| | | locMast = locMastList1.get(0); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (Cools.isEmpty(locMast)){ |
| | | locMast = locMastService.queryFreeLocMast(1, locTypeDto.getLocType1()); |
| | |
| | | if (Cools.isEmpty(param.getSourceStaNo())) { |
| | | return R.error("源站编号不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("托盘码不能为空"); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | List<WaitPakin> waitPakins = null; |
| | | if (param.getIoType() == 1) { |
| | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), false); |
| | | sourceStaNo.setLocType1(param.getLocType1()); |
| | | // sourceStaNo.setLocType1((short)1); |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | |
| | | StartupDto dto = null; |
| | |
| | | } |
| | | |
| | | TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() |
| | | .eq("barcode", wrkDetl.getMatnr()));//pack码 |
| | | .eq("barcode", wrkDetl.getMatnr()) |
| | | .eq("user_id",wrkDetl.getZpallet()));//pack码 |
| | | if (Cools.isEmpty(testMast)){ |
| | | //生成测试档 |
| | | testMast=new TestMast(); |
| | |
| | | combParam.setPackSts(0); |
| | | combParam.setStepSts(1); |
| | | combParam.setRequestTime(DateUtils.convert(now)); |
| | | new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | // new PostMesDataUtils().postMesData("MES系统",mesUrl,inpath,combParam); |
| | | } |
| | | } |
| | | } else { |
| | |
| | | wcs-slave: |
| | | # 双深 |
| | | doubleDeep: true |
| | | # 双深库位排号 3,1,4 |
| | | doubleLocs: |
| | | # 双深库位排号 |
| | | doubleLocs: 3 |
| | | # 一个堆垛机负责的货架排数 |
| | | groupCount: 2 |
| | | groupCount: 3 |
| | | |
| | | # MES系统 |
| | | mes: |
| | |
| | | <label class="layui-form-label">状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="status"> |
| | | <option value="0">待申请</option> |
| | | <option value="1">申请中</option> |
| | | <option value="2">已复核</option> |
| | | <option value="3">测试中</option> |
| | | <option value="4">完成</option> |
| | | <option value="0">空库位</option> |
| | | <option value="1">待测</option> |
| | | <option value="2">测试中</option> |
| | | <option value="3">完成</option> |
| | | <option value="4">失败</option> |
| | | <option value="5">已移库</option> |
| | | <option value="6">火警</option> |
| | | </select> |