| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.controller.CrnController; |
| | | import com.zy.asrs.controller.TaskWrkController; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.domain.param.CrnOperatorParam; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CarryParam; |
| | | import com.zy.asrs.entity.param.TaskCreateParam; |
| | | import com.zy.asrs.mapper.*; |
| | | import com.zy.asrs.service.*; |
| | |
| | | private TaskWrkMapper taskWrkMapper; |
| | | @Autowired |
| | | private TaskWrkService taskWrkService; |
| | | @Autowired |
| | | private TaskWrkController taskWrkController; |
| | | @Autowired |
| | | private StaDescMapper staDescMapper; |
| | | @Autowired |
| | |
| | | if (Cools.isEmpty(taskWrk1)){ |
| | | continue; |
| | | } |
| | | if (taskWrk1.getWrkSts() == 2){ |
| | | if (taskWrk1.getIoType() == 3 && taskWrk1.getWrkSts()<3){ |
| | | taskWrk = taskWrk1; |
| | | break; |
| | | } |
| | |
| | | if (offer) { |
| | | log.info("下发输送线任务成功:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | | Date now = new Date(); |
| | | taskWrk.setStatus(TaskStatusType.OVER3.id); |
| | | // taskWrk.setStatus(TaskStatusType.OVER3.id); |
| | | taskWrk.setStatus(TaskStatusType.OVER.id);//手动完成任务 |
| | | taskWrk.setWrkSts(14); |
| | | taskWrk.setModiTime(now); |
| | | taskWrk.setCompleteTime(now); |
| | | |
| | | LocMast locMast=locMastService.selectByLocNo(taskWrk.getStartPoint()); |
| | | if(Cools.isEmpty(locMast)){ |
| | | R.error("没有找到该库位") ; |
| | | } |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiTime(now); |
| | | |
| | | |
| | | |
| | | locMastService.updateById(locMast); |
| | | taskWrkService.updateById(taskWrk); |
| | | } else { |
| | | log.error("下发输送线任务失败:taskWrk:" + JSON.toJSONString(taskWrk)); |
| | |
| | | } |
| | | } |
| | | } |
| | | public void locMastTaskDemo(){ |
| | | try{ |
| | | for (CrnSlave crnSlave : slaveProperties.getCrn()) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crnSlave.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | for (String locNo : crnProtocol.getLocMastDemoList()){ |
| | | LocMast locMast = locMastService.selectByLocNo(locNo); |
| | | if (locMast.getLocSts().equals("F")){ |
| | | CarryParam carryParam = new CarryParam(); |
| | | carryParam.setTaskNo(locNo); |
| | | carryParam.setBarcode(locNo); |
| | | carryParam.setIoType(1);//任务类型=》1:出库、2:移库、3:入库 ====转换为====> 1:入库,2:出库,3:移库 |
| | | carryParam.setTaskPriority(1); |
| | | carryParam.setTargetPoint("1012"); |
| | | carryParam.setStartPoint(BarcodeUtils.formatCode(locNo)); |
| | | carryParam.setMeno("Demo"); |
| | | taskWrkController.addTaskPoint(carryParam); |
| | | Thread.sleep(50); |
| | | } else if (locMast.getLocSts().equals("O")){ |
| | | CarryParam carryParam = new CarryParam(); |
| | | carryParam.setTaskNo(locNo); |
| | | carryParam.setBarcode(locNo); |
| | | carryParam.setIoType(3);//任务类型=》1:出库、2:移库、3:入库 ====转换为====> 1:入库,2:出库,3:移库 |
| | | carryParam.setTaskPriority(1); |
| | | carryParam.setStartPoint("1012"); |
| | | carryParam.setTargetPoint(BarcodeUtils.formatCode(locNo)); |
| | | carryParam.setMeno("Demo"); |
| | | taskWrkController.addTaskPoint(carryParam); |
| | | Thread.sleep(50); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |