|  |  |  | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | import com.zy.asrs.domain.enums.TaskStatusType; | 
|---|
|  |  |  | import com.zy.asrs.domain.enums.WorkNoType; | 
|---|
|  |  |  | import com.zy.asrs.entity.StaDesc; | 
|---|
|  |  |  | import com.zy.asrs.mapper.TaskWrkMapper; | 
|---|
|  |  |  | import com.zy.asrs.entity.TaskWrk; | 
|---|
|  |  |  | import com.zy.asrs.service.StaDescService; | 
|---|
|  |  |  | import com.zy.asrs.service.TaskWrkService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.zy.common.service.CommonService; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private CommonService commonService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private StaDescService staDescService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public TaskWrk selectByTaskNo(String taskNo) { | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void startup(TaskWrk taskWrk, Long userId) { | 
|---|
|  |  |  | //入库任务派发 | 
|---|
|  |  |  | StaDesc staDesc = staDescService.queryCrn(taskWrk.getIoType(), Integer.parseInt(taskWrk.getStartPoint())); | 
|---|
|  |  |  | if (staDesc == null) { | 
|---|
|  |  |  | return;//不存在路径 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int workNo = commonService.getWorkNo(WorkNoType.PAKIN.type);//获取入库工作号 | 
|---|
|  |  |  | taskWrk.setWrkNo(workNo);//工作号 | 
|---|
|  |  |  | taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//派发状态 | 
|---|
|  |  |  | taskWrk.setAssignTime(new Date());//派发时间 | 
|---|
|  |  |  | taskWrk.setWrkSts(2);//工作状态 2.设备上走 | 
|---|
|  |  |  | taskWrk.setCrnNo(staDesc.getCrnNo());//堆垛机号 | 
|---|
|  |  |  | taskWrk.setModiTime(new Date()); | 
|---|
|  |  |  | taskWrk.setModiUser(userId); | 
|---|
|  |  |  | updateById(taskWrk); | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void stockOut(TaskWrk taskWrk, Long userId) { | 
|---|
|  |  |  | //出库任务派发 | 
|---|
|  |  |  | StaDesc staDesc = staDescService.queryCrn(taskWrk.getIoType(), Integer.parseInt(taskWrk.getTargetPoint())); | 
|---|
|  |  |  | if (staDesc == null) { | 
|---|
|  |  |  | return;//不存在路径 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int workNo = commonService.getWorkNo(WorkNoType.PAKOUT.type);//获取出库工作号 | 
|---|
|  |  |  | taskWrk.setWrkNo(workNo);//工作号 | 
|---|
|  |  |  | taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//派发状态 | 
|---|
|  |  |  | taskWrk.setAssignTime(new Date());//派发时间 | 
|---|
|  |  |  | taskWrk.setWrkSts(11);//工作状态 11.生成出库ID | 
|---|
|  |  |  | taskWrk.setCrnNo(staDesc.getCrnNo());//堆垛机号 | 
|---|
|  |  |  | taskWrk.setModiTime(new Date()); | 
|---|
|  |  |  | taskWrk.setModiUser(userId); | 
|---|
|  |  |  | updateById(taskWrk); | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void locMove(TaskWrk taskWrk, Long userId) { | 
|---|
|  |  |  | //库格移载任务派发 | 
|---|
|  |  |  | StaDesc staDesc = staDescService.queryCrn(taskWrk.getIoType(), Integer.parseInt(taskWrk.getTargetPoint())); | 
|---|
|  |  |  | if (staDesc == null) { | 
|---|
|  |  |  | return;//不存在路径 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int workNo = commonService.getWorkNo(WorkNoType.OTHER.type);//获取工作号 | 
|---|
|  |  |  | taskWrk.setWrkNo(workNo);//工作号 | 
|---|
|  |  |  | taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//派发状态 | 
|---|
|  |  |  | taskWrk.setAssignTime(new Date());//派发时间 | 
|---|
|  |  |  | taskWrk.setWrkSts(11);//工作状态 11.生成出库ID | 
|---|
|  |  |  | taskWrk.setCrnNo(staDesc.getCrnNo());//堆垛机号 | 
|---|
|  |  |  | taskWrk.setModiTime(new Date()); | 
|---|
|  |  |  | taskWrk.setModiUser(userId); | 
|---|
|  |  |  | updateById(taskWrk); | 
|---|