| | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Synchronized; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StopWatch; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | docIds.add(pakin.getDocId()); |
| | | } |
| | | } |
| | | |
| | | wrapper.in("source",docIds); |
| | | Page<OrderDetl> page = orderDetlService.selectPage(new Page<>(curr, limit), wrapper); |
| | | for (OrderDetl record : page.getRecords()) { |
| | | Double sumAnfme = agvLocDetlService.getSumAnfme(record.getMatnr(), record.getThreeCode()); |
| | | record.setStock(sumAnfme == null ? 0 : sumAnfme); |
| | | } |
| | | |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | if (!agvWrkMast.getBarcode().equals(param.getBarcode())) { |
| | | throw new CoolException("当前货架码与任务不匹配"); |
| | | } |
| | | if (!agvWrkMast.getWrkSts().equals(207L)) { |
| | | throw new CoolException("工作状态不符合离场条件"); |
| | | if (!agvWrkMast.getWrkSts().equals(207L) && !agvWrkMast.getWrkSts().equals(205L)) { |
| | | throw new CoolException("当前工作状态:" + agvWrkMast.getWrkSts$() +"不符合离场条件"); |
| | | } |
| | | if (agvWrkMast.getWrkSts().equals(205L)) { |
| | | // 库位 -- 接驳位 / 库位 |
| | | if (agvWrkMast.getLocNo().substring(0,2).equals("DB")) { |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getLocNo(),"F",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); |
| | | // 接驳位 -- 库位 |
| | | } else { |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getLocNo(),"D",agvWrkMast.getBarcode(),agvWrkMast.getWhsType().shortValue()); |
| | | } |
| | | |
| | | // 接驳位 -- 库位 |
| | | if (agvWrkMast.getSourceLocNo().substring(0,2).equals("DB")) { |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getSourceLocNo(),"O","",(short)0); |
| | | // 库位 -- 接驳位 / 库位 |
| | | } else { |
| | | //修改源库位状态为O |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue(),"",(short)0); |
| | | //更新目标库位明细 101.出库 删除源库位库存明细 |
| | | agvLocDetlService.delete(new EntityWrapper<AgvLocDetl>().eq("loc_no",agvWrkMast.getSourceLocNo())); |
| | | } |
| | | |
| | | agvWrkMast.setSourceLocNo(""); |
| | | } |
| | | |
| | | //生成AGV工作历史档 + 生成AGV工作明细历史档 |
| | |
| | | // 更新站点状态 |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",null); |
| | | // 更新源库位状态 |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getLocNo(),"O","",agvWrkMast.getWhsType().shortValue()); |
| | | // agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getLocNo(),"O","",agvWrkMast.getWhsType().shortValue()); |
| | | |
| | | //删除AGV工作明细档 |
| | | agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",oldWrkNo)); |
| | |
| | | } |
| | | if (wrkMast.getIoType() == 108) { |
| | | wrkMast.setIoType(111); |
| | | wrkMast.setModiTime(new Date()); |
| | | agvWrkMastService.update(wrkMast,new EntityWrapper<AgvWrkMast>().eq("wrk_no", workNo)); |
| | | } else if(wrkMast.getIoType() == 111) { |
| | | wrkMast.setIoType(108); |
| | | wrkMast.setModiTime(new Date()); |
| | | agvWrkMastService.update(wrkMast,new EntityWrapper<AgvWrkMast>().eq("wrk_no", workNo)); |
| | | } |
| | | |
| | |
| | | //判断要修改的工作档状态是否合理,如果不合理则抛出异常 |
| | | checkWrkSts(agvWrkMast,wrkSts); |
| | | agvWrkMast.setWrkSts(wrkSts); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | this.updateById(agvWrkMast); |
| | | } |
| | | |
| | |
| | | /* |
| | | 定时处理AGV工作档中工作状态为205.工作完成 且 (1.入库 || 53,拣料入库 || 57.盘点入库 || 10.空板入库 || 11.单层移库 || 12.跨层移库 || 108.自动调拨 || 109.手动调拨)的数据 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void excutePutwayWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 205) |
| | |
| | | /* |
| | | 定时处理AGV工作档中工作状态为206.出库完成 且 (101.出库 || 110.空板出库) |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void excuteCarryWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 206) |
| | |
| | | /* |
| | | 定时处理AGV工作档中工作状态为206.出库完成 且 (101.出库 || 110.空板出库) |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void excuteCarryWrk2(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 208) |
| | |
| | | putaway:上架 |
| | | 定时处理AGV工作档中工作状态为201.生成入库任务ID 且(出库类型为 53.拣料再入库 || 1.入库 || 10.空板入库栽 || 57.盘点再入库)的数据 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void startPutwayWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectPage(new Page<>(1, 50) |
| | | ,new EntityWrapper<AgvWrkMast>() |
| | |
| | | putaway:上架 |
| | | 定时处理AGV工作档中工作状态为201.生成入库任务ID 且(出库类型为 53.拣料再入库 || 1.入库 || 10.空板入库栽 || 57.盘点再入库)的数据 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void startAllcationIn(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectPage(new Page<>(1, 50) |
| | | ,new EntityWrapper<AgvWrkMast>() |
| | |
| | | carry:搬运,统指出库、移库、点到点搬运等 |
| | | 定时处理AGV工作档中工作状态为21.生成出库任务 且(出库类型为 101.出库 || 103.拣料出库 || 11.库格移栽 || 110.空板出库 || 107.盘点出库)的数据 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void startCarryWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectPage(new Page<>(1, 50) |
| | | ,new EntityWrapper<AgvWrkMast>() |
| | |
| | | /* |
| | | 自动生成空板出库任务 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void autoEmptyOut(){ |
| | | boolean packageEmptyAutoOUt = Cools.eq("Y",Parameter.get().getPackageEmptyAutoOUt()); |
| | | boolean mateEmptyAutoOut = Cools.eq("Y",Parameter.get().getMateEmptyAutoOut()); |
| | |
| | | WrkMastExecute wrkMastExecute = wrkMastExecuteService.selectOne(new EntityWrapper<WrkMastExecute>().eq("io_type", 121).eq("wrk_no", agvWrkMast.getWrkNo().longValue())); |
| | | if (!Cools.isEmpty(wrkMastExecute) && wrkMastExecute.getWrkSts()==3L && wrkMastExecute.getNowPosition()==3){ |
| | | agvWrkMast.setWrkSts(205L);//任务完成 |
| | | agvWrkMast.setModiTime(new Date()); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | //生成agv_wrk_mast_execute任务历史档 |
| | | wrkMastExecuteLogService.save(wrkMastExecute); |
| | |
| | | * ioType 108.自动调拨 |
| | | * crnNo :2目标楼层 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | private synchronized void execute2(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 22) |
| | |
| | | @Autowired |
| | | private NotifyLogHandler notifyLogHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | private void execute(){ |
| | | ReturnT<String> returnT = notifyLogHandler.start(); |
| | | if (!returnT.isSuccess()) { |
| | |
| | | @Autowired |
| | | private OverYearLogHandler overYearLogHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | private void execute(){ |
| | | ReturnT<String> returnT = overYearLogHandler.start(); |
| | | if (!returnT.isSuccess()) { |
| | |
| | | @Autowired |
| | | private PlcLogHandler plcLogHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | private void execute(){ |
| | | ReturnT<String> returnT = plcLogHandler.start(); |
| | | if (!returnT.isSuccess()) { |
| | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | private void execute(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectToBeHistoryData(); |
| | | if (wrkMasts.isEmpty()) { |
| | |
| | | agvWrkMastLogService.save(agvWrkMast); |
| | | //生成AGV工作明细历史档 |
| | | agvWrkDetlLogService.save(wrkNo); |
| | | } else { |
| | | if (!agvWrkMast.getSourceLocNo().substring(0,2).equals("DB")) { |
| | | agvWrkMast.setSourceLocNo(""); |
| | | } |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | } |
| | | |
| | | switch (agvWrkMast.getIoType()){ |
| | |
| | | String orderNo = getOrderNoByWrkNo(wrkNo); |
| | | //修改工作档状态为207.库存更新完成 |
| | | agvWrkMast.setWrkSts(207L); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | //修改源库位状态为O |
| | | if (agvWrkMast.getIoType() == 110) { |
| | |
| | | } |
| | | //修改工作档状态为207.库存更新完成 |
| | | agvWrkMast.setWrkSts(207L); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | //修改源库位状态为O |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",null); |
| | |
| | | } |
| | | |
| | | agvWrkMast.setWrkSts(202L); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | if(agvWrkMast.getIoType() == 1){ |
| | | //修改AGV入库通知档状态入出状态为Y |
| | |
| | | Map<String, Object> devNoMap = devNoMaps.get(0); |
| | | if((int)devNoMap.get("num") < maxWrokNum){ |
| | | agvWrkMast.setLocNo(devNoMap.get("dev_no").toString()); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | log.info("after:" + devNoMap.toString() + ", wrkNo:" + agvWrkMast.getWrkNo() + ", locNo: " + agvWrkMast.getLocNo()); |
| | | } |
| | |
| | | } |
| | | agvWrkMast.setWrkSts(201L); |
| | | agvWrkMast.setLocNo(devpNo.getDevNo()); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | agvWrkMast.setLogErrMemo("start3-doHandMove2"); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | agvWrkMast.setModiTime(new Date()); |
| | |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'wrkNo', align: 'center',title: '工作号',sort: true, width: 85} |
| | | ,{field: 'ioTime$', align: 'center',title: '工作时间',sort: true, width: 160} |
| | | ,{field: 'modiTime$', align: 'center',title: '工作时间',sort: true, width: 160} |
| | | ,{field: 'wrkSts$', align: 'center',title: '工作状态'} |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型'} |
| | | ,{field: 'ioPri', align: 'center',title: '优先级',width: 80} |
| | |
| | | // ,{field: 'crnStrTime$', align: 'center',title: '堆垛机启动时间'} |
| | | // ,{field: 'crnEndTime$', align: 'center',title: '堆垛机停止时间'} |
| | | // ,{field: 'refIotime$', align: 'center',title: '拣料时间'} |
| | | ,{field: 'appeTime$', align: 'center',title: '开始时间', hide:false, width: 160} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true, width: 160} |
| | | // ,{field: 'memo', align: 'center',title: '备注'} |
| | |
| | | ,{field: 'sourceLocNo', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo', align: 'center',title: '目标库位'} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true} |
| | | ,{field: 'appeTime$', align: 'center',title: '开始时间', hide:false} |
| | | ,{field: 'barcode', align: 'center',title: '货架码'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80} |
| | | ]], |