| | |
| | | import com.zy.asrs.entity.BasDevice; |
| | | import com.zy.asrs.entity.LocAroundBind; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasDeviceService; |
| | | import com.zy.asrs.service.LocAroundBindService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | /** |
| | | * 通知WCS锁定库位,及禁止当前库位的一切操作 |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R backLocs(WorkTaskParams params) { |
| | | if (Objects.isNull(params.getTaskNo())) { |
| | | if (Objects.isNull(params.getWrkNo())) { |
| | | throw new CoolException("工作号不能为空!!"); |
| | | } |
| | | String wrkCode = params.getTaskNo(); |
| | | if (wrkCode.contains("-1")) { |
| | | throw new CoolException("配对任务编码错误,请检查后重新上传!!"); |
| | | } |
| | | |
| | | WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_code", params.getTaskNo())); |
| | | |
| | | // String wrkCode = params.getTaskNo(); |
| | | // if (wrkCode.contains("-1")) { |
| | | // throw new CoolException("配对任务编码错误,请检查后重新上传!!"); |
| | | // } |
| | | WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getWrkNo())); |
| | | if (Objects.isNull(mast)) { |
| | | throw new CoolException("任务不存在!!"); |
| | | } |
| | | if (!mast.getWrkSts().equals(103L)) { |
| | | throw new CoolException("当前任务并非余料出库任务!!"); |
| | | } |
| | | mast.setWrkSts(53L); |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("任务状态更新失败!!"); |
| | | } |
| | | // if (!mast.getWrkSts().equals(103L)) { |
| | | // throw new CoolException("当前任务并非余料出库任务!!"); |
| | | // } |
| | | // if (params.getIsSuplus() == 1) { |
| | | // mast.setIsSuplus(1); |
| | | // } |
| | | // |
| | | // if (!wrkMastService.updateById(mast)) { |
| | | // throw new CoolException("任务状态更新失败!!"); |
| | | // } |
| | | workService.backLocOperation(mast.getWrkNo() + "", mast.getAppeUser()); |
| | | |
| | | return R.ok("接收成功,执行回库中..."); |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 堆垛机执行状态上报 |
| | | * @author Ryan |
| | | * @date 2026/1/10 16:30 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R receviceTaskFromWcs(ReceviceTaskParams params) { |
| | | if (Objects.isNull(params.getDevice())) { |
| | | throw new CoolException("设备号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getSuperTaskNo())) { |
| | | throw new CoolException("WMS任务号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getMsgType())) { |
| | | throw new CoolException("动作类型不能为空!!"); |
| | | } |
| | | WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_code", params.getSuperTaskNo())); |
| | | if (Objects.isNull(mast)) { |
| | | throw new CoolException("任务档不存在!!"); |
| | | } |
| | | if (!Objects.isNull(params.getMsgType()) && params.getMsgType().equals("task")) { |
| | | throw new CoolException("消息不能为空!!"); |
| | | } |
| | | |
| | | if (params.getMsgType().equals("task_complete")) { |
| | | mast.setWrkSts(4L); |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else if (params.getMsgType().equals("task_cancel")){ |
| | | |
| | | } |
| | | |
| | | // if (!wrkMastService.updateById(mast)) { |
| | | // throw new CoolException("任务状态修改失败!!"); |
| | | // } |
| | | |
| | | return R.ok(); |
| | | } |
| | | } |