| | |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.mapper.BasDevpMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.*; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Resource |
| | | private BasDevpMapper basDevpMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | List<String> matnrs = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatnr).distinct().collect(Collectors.toList()); |
| | | List<String> batchs = param.getList().stream().map(FullStoreParam.MatCodeStore::getBatch).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), matnrs.get(0), batchs.get(0), null,locTypeDto); |
| | | // StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), matnrs.get(0), batchs.get(0), null,locTypeDto); |
| | | StartupDto dto = commonService.getLocNo(sourceStaNo,locTypeDto, 1); |
| | | // 生成工作号 |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | |
| | | public void startupFullTakeStore(StockOutParam param, Long userId) { |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取所有库位号集合 |
| | | List<String> locNos = param.getLocDetls().stream().map(StockOutParam.LocDetl::getLocNo).distinct().collect(Collectors.toList()); |
| | | // 浅库位标识 |
| | | boolean sign = false; |
| | | // 提示信息 |
| | | String tips = ""; |
| | | |
| | | /* |
| | | 判断如果是深库位,对应的浅库位不为空则不能出 |
| | | */ |
| | | for (String locNo : locNos) { |
| | | if (sign) { |
| | | break; |
| | | } |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLocNo(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | for (String outerLoc : groupOuterLoc) { |
| | | if (locNos.contains(outerLoc)) { |
| | | continue; |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", outerLoc)); |
| | | if (locMast != null) { |
| | | if (!locMast.getLocSts().equals("O") && !locMast.getLocSts().equals("R")) { |
| | | sign = true; |
| | | tips = "库位号:" + locNo + " 浅库位有非空库位!"; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (sign) { |
| | | throw new CoolException("出库失败;" + tips); |
| | | } |
| | | |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | |
| | | Date now = new Date(); |
| | | List<LocDto> locDtos = taskDto.getLocDtos(); |
| | | for (LocDto locDto : locDtos) { |
| | | // 任务的库位号不是这条明细的库位号并且任务的目标站点不是这条明细的目标站点 |
| | | if (!taskDto.getLocNo().equals(locDto.getLocNo()) && !taskDto.getStaNo().equals(locDto.getStaNo())) { |
| | | throw new CoolException("订单出库异常,请联系管理员"); |
| | | } |
| | | } |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(taskDto.getLocNo()); |
| | | // 获取路径 |
| | | // 获取路径,根据该出库任务的物料明细判断该库位是全板出库 还是捡料出库 |
| | | int ioType = taskDto.isAll() ? 101 : 103; |
| | | StaDesc staDesc = staDescService.queryCrnStnAuto(ioType, locMast.getCrnNo(), staNo.getDevNo()); |
| | | // 生成工作号 |
| | |
| | | public String emptyPlateIn(Integer devpNo, Long userId) { |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | // 检索宽窄 |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, null,null,null, locTypeDto); |
| | | // StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, null,null,null, locTypeDto); |
| | | // 搜索库位 |
| | | StartupDto dto = commonService.getLocNo(sourceStaNo,locTypeDto,10); |
| | | int workNo = dto.getWorkNo(); |
| | | Date now = new Date(); |
| | | // 生成工作档 |
| | |
| | | if (Cools.isEmpty(loc)){ |
| | | throw new CoolException("未找到库位"); |
| | | } |
| | | if (loc.getLocNo().equals("N")){ |
| | | throw new CoolException("N.设备占用(禁止更改)"); |
| | | } |
| | | if (!loc.getLocSts().equals("O") || (!sourceLoc.getLocSts().equals("F") && !sourceLoc.getLocSts().equals("D"))){ |
| | | throw new CoolException("库位状态已改变"); |
| | | } |
| | |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("修改工作档失败"); |
| | | } |
| | | // 手动完成后,清空源站点上的工作号 |
| | | basDevpMapper.updateWorkNoById(wrkMast.getSourceStaNo()); |
| | | |
| | | } |
| | | |
| | | @Override |