| | |
| | | @Resource |
| | | private StaDescService staDescService; |
| | | |
| | | @RequestMapping("/comb/auth") |
| | | @ManagerAuth(memo = "组托") |
| | | public R comb(@RequestBody CombParam combParam){ |
| | | mobileService.comb(combParam, getUserId()); |
| | | return R.ok("组托成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/pda/WarehouseOut/v1") |
| | |
| | | if (wrkMast == null) { |
| | | return R.error("任务不存在"); |
| | | } |
| | | |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(Integer.valueOf(param.getTaskNo())); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | public interface MobileService { |
| | | |
| | | /** |
| | | * 组托 |
| | | */ |
| | | void comb(CombParam param, Long userId); |
| | | |
| | | /** |
| | | * 并板途中拣料 |
| | | */ |
| | | R WarehouseOutV1(CombParam combParam, Long hostId, Long userId); |
| | |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 移动端服务核心类 |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void comb(CombParam param, Long userId) { |
| | | if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | if (param.getCombMats().size() < 1) { |
| | | throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | } |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N")) > 0) { |
| | | throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | } |
| | | |
| | | if (param.getBarcode().length() != 8) { |
| | | throw new CoolException("条码长度不是8位===>>" + param.getBarcode()); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0 || countwait > 0) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | // 无单组托 |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | assert one != null; |
| | | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | } else { |
| | | detlDtos.add(detlDto); |
| | | } |
| | | }); |
| | | |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | // if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) { |
| | | // throw new CoolException("物料:" + detlDto.getMatnr() + "单次最大组托上限为:" + mat.getUpQty()); |
| | | // } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | BeanUtils.copyProperties(mat, waitPakin); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | | waitPakin.setZpallet(param.getBarcode()); |
| | | waitPakin.setIoStatus("N"); |
| | | waitPakin.setAnfme(detlDto.getAnfme()); |
| | | waitPakin.setStatus("Y"); |
| | | waitPakin.setAppeUser(userId); |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | } |
| | | // 关联组托 |
| | | } else { |
| | | // Order order = orderService.selectByNo(param.getOrderNo()); |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, elem.getOrderNo()); |
| | | if (Cools.isEmpty(order) || order.getSettle() > 2) { |
| | | throw new CoolException("订单号不存在或者已执行完成"); |
| | | } |
| | | // 订单明细数量校验 |
| | | // OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | // elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3()); |
| | | OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() |
| | | .eq("order_id", order.getId()) |
| | | .eq("matnr", elem.getMatnr())); |
| | | |
| | | if (Objects.isNull(detls)) { |
| | | throw new CoolException("数据错误:单据明细不存在!!"); |
| | | } |
| | | |
| | | if (elem.getAnfme() > detls.getEnableQty()) { |
| | | throw new CoolException(detls.getMatnr() + "入库数量不合法"); |
| | | } |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | detlDto.setOrderId(order.getId()); |
| | | detlDto.setOrderNo(order.getOrderNo()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.findDto(detlDtos, detlDto); |
| | | assert one != null; |
| | | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); |
| | | } else { |
| | | detlDtos.add(detlDto); |
| | | } |
| | | }); |
| | | |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() |
| | | .eq("order_no", param.getOrderNo()) |
| | | .eq("matnr", detlDto.getMatnr())); |
| | | |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | BeanUtils.copyProperties(mat, waitPakin); |
| | | waitPakin.setOrderNo(detlDto.getOrderNo()); // 单据编号 |
| | | waitPakin.setOrderId(detlDto.getOrderId()); |
| | | waitPakin.setBatch(detlDto.getBatch()); // 序列码 |
| | | waitPakin.setZpallet(param.getBarcode()); // 托盘码 |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | | waitPakin.setAnfme(detlDto.getAnfme()); // 数量 |
| | | waitPakin.setStatus("Y"); // 状态 |
| | | waitPakin.setAppeUser(userId); |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | } |
| | | |
| | | Set<String> stringSet = param.getCombMats().stream().map(CombParam.CombMat::getOrderNo).collect(Collectors.toSet()); |
| | | stringSet.forEach(orderNo -> { |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, orderNo); |
| | | OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R WarehouseOutV1(CombParam combParam, Long hostId, Long userId) { |
| | | // 判断库位状态 |
| | |
| | | * @date 2026/1/9 20:16 |
| | | */ |
| | | private void generateOutStock(TaskDto taskDto, Long userId, int workNo, String wrkCode, Date now, int ioType, LocMast locMast, StaDesc staDesc, String deviceNo) { |
| | | if (Objects.isNull(deviceNo)) { |
| | | throw new CoolException("机台号不能为空!!"); |
| | | } |
| | | BasDevice basDevice = basDeviceService.selectOne(new EntityWrapper<BasDevice>() |
| | | .eq("status", 1) |
| | | .eq("dev_no", deviceNo)); |
| | | if (Objects.isNull(basDevice)) { |
| | | throw new CoolException("机台信息不存在或已禁用!!"); |
| | | } |
| | | |
| | | LocAroundBind binds = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>() |
| | | .eq("loc_type", LocStsType.LOC_STS_TYPE_O.type) |
| | | .eq("dev_no", basDevice.getType()).orderBy("order_no")); |
| | | |
| | | if (Objects.isNull(binds)) { |
| | | throw new CoolException("机台未设置默认工作位!!"); |
| | | } |
| | | // |
| | | // Set<String> locs = binds.stream().map(LocAroundBind::getBlocNo).collect(Collectors.toSet()); |
| | | |
| | | // LocMast locMasts = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | // .in("loc_no", locs) |
| | | // .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | // .orderAsc(Arrays.asList("loc_no"))); |
| | | |
| | | // if (Objects.isNull(locMasts)) { |
| | | // binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>() |
| | | // .eq("dev_no", basDevice.getDevNo())); |
| | | // |
| | | // Set<String> nlocs = binds.stream().map(LocAroundBind::getBlocNo).collect(Collectors.toSet()); |
| | | // |
| | | // locMasts = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | // .in("loc_no", nlocs) |
| | | // .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | // .orderAsc(Arrays.asList("loc_no"))); |
| | | // if (Objects.isNull(locMasts)) { |
| | | // throw new CoolException("暂无可用工作位!!"); |
| | | // } |
| | | // } |
| | | |
| | | LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", binds.getBlocNo())); |
| | | bLocNo.setLocType(LocStsType.LOC_STS_TYPE_S.type); |
| | | |
| | | if (!locAroundBindService.updateById(bLocNo)) { |
| | | throw new CoolException("工位预约失败!!"); |
| | | } |
| | | |
| | | LocMast locMasts = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", bLocNo.getBlocNo())); |
| | | |
| | | locMasts.setLocSts(LocStsType.LOC_STS_TYPE_S.type); |
| | | locMasts.setModiUser(userId); |
| | | locMasts.setModiTime(now); |
| | | if (!locMastService.updateById(locMasts)) { |
| | | throw new CoolException("预约库位状态失败,库位号:" + locMasts.getLocNo()); |
| | | } |
| | | |
| | | |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locMasts.getLocNo(), 1); |
| | | //TODO 1. 获取入库站点, 目标库位 3. 将出库明细添加至入库明细 |
| | | Integer staNo = staNos.stream().findFirst().get(); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | |
| | | wrkMast.setIoType(ioType); // 入出库状态 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | // wrkMast.setStaNo(staDesc.getStnNo() + ""); // 目标站 |
| | | if(!Objects.equals(locMasts.getCrnNo(), locMast.getCrnNo())){ |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 源站 |
| | | wrkMast.setStaNo(staNo + ""); // 目标站 |
| | | } |
| | | wrkMast.setLocNo(locMasts.getLocNo()); |
| | | wrkMast.setStaNo(staDesc.getStnNo() + ""); // 目标站 |
| | | wrkMast.setSourceLocNo(taskDto.getLocNo()); // 源库位 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 自动生成跨区入任务 |
| | | * |
| | | * @author Ryan |
| | | * @date 2026/1/10 14:42 |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void autoInStack() { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 15).eq("online_yn","N")); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo())); |
| | | // 构造跨区入库任务 |
| | | WrkMast inMast = new WrkMast(); |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(1)); |
| | | inMast.setWrkNo(workNo); // 生成新任务号 |
| | | inMast.setBarcode(wrkMast.getBarcode()); // 托盘码保持一致 |
| | | inMast.setIoType(2); // 跨区入库类型 |
| | | inMast.setWrkSts(1L); // 待下发 |
| | | inMast.setLocNo(wrkMast.getLocNo()); // 原目标库位 |
| | | inMast.setIoPri(13.0); |
| | | inMast.setSourceStaNo(wrkMast.getStaNo()); |
| | | inMast.setWrkCode(wrkMast.getWrkNo()+""); // 关联原出库任务 |
| | | inMast.setAppeUser(wrkMast.getAppeUser()); // 申请人 |
| | | inMast.setAppeTime(new Date()); |
| | | inMast.setIoTime(new Date()); |
| | | inMast.setCrnNo(locMast.getCrnNo()); |
| | | if(!wrkMastService.insert(inMast)){ |
| | | throw new CoolException("跨区入库任务生成失败!"); |
| | | }else { |
| | | wrkMast.setOnlineYn("Y"); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | case 101: |
| | | //如果wrkCode不为空,表示是工作台叫货,如果不为空走移库逻辑 |
| | | //todo 判断如果库位所属不是同一个堆垛机号,需再生成一个新的入库任务 |
| | | if (!Objects.isNull(wrkMast.getWrkCode())) { |
| | | //TODO 移库 |
| | | // workService.locMove(wrkMast.getSourceLocNo(), wrkMast.getLocNo(), wrkMast.getAppeUser()); |
| | | |
| | | movLoc(wrkMast); |
| | | |
| | | //修改工位库态 |
| | | LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", wrkMast.getLocNo())); |
| | | if (Objects.isNull(bLocNo)) { |
| | | throw new CoolException("数据错误, 目标工位不存在!!"); |
| | | } |
| | | bLocNo.setLocType(LocStsType.LOC_STS_TYPE_F.type); |
| | | if (!locAroundBindService.updateById(bLocNo)) { |
| | | throw new CoolException("工位状态修改失败!!"); |
| | | } |
| | | } else { |
| | | // if (!Objects.isNull(wrkMast.getWrkCode())) { |
| | | // //TODO 移库 |
| | | //// workService.locMove(wrkMast.getSourceLocNo(), wrkMast.getLocNo(), wrkMast.getAppeUser()); |
| | | // |
| | | //// movLoc(wrkMast); |
| | | // |
| | | // //修改工位库态 |
| | | // LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", wrkMast.getLocNo())); |
| | | // if (Objects.isNull(bLocNo)) { |
| | | // throw new CoolException("数据错误, 目标工位不存在!!"); |
| | | // } |
| | | // bLocNo.setLocType(LocStsType.LOC_STS_TYPE_F.type); |
| | | // if (!locAroundBindService.updateById(bLocNo)) { |
| | | // throw new CoolException("工位状态修改失败!!"); |
| | | // } |
| | | // } else { |
| | | // // 出库确认信号位 |
| | | // if (Cools.isEmpty(wrkMast.getInvWh()) || wrkMast.getInvWh().equals("N")) { |
| | | // return SUCCESS; |
| | |
| | | return FAIL.setMsg("全板出库 ===>> 修改源库位状态失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | break; |
| | | // 并板途中捡料 |
| | | case 108: |
| | |
| | | if (basDevp.getLocType1() == null) { |
| | | throw new CoolException("plc高低检测异常"); |
| | | } |
| | | if (basDevp.getLocType1() == 0) { |
| | | if (basDevp.getLocType1() == 1) { |
| | | this.locType1 = 1; // 低库位 |
| | | } else { |
| | | this.locType1 = 2; // 高库位 |
| | |
| | | .eq("loc_sts", "O") |
| | | .eq("frozen", 0) |
| | | .eq("deleted", 0) |
| | | .eq("whs_type", rowLastnoType.getType().longValue())); |
| | | .eq("loc_type1",locTypeDto.getLocType1())); |
| | | int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100)); |
| | | if (locMasts.size() - crnCountO <= 2) { |
| | | log.error(crnNo + "号堆垛机没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | |
| | | .eq("row1", nearRow) |
| | | .eq("frozen", 0).eq("deleted", 0) |
| | | .eq("loc_sts", "O") |
| | | .eq("whs_type", rowLastnoType.getType().longValue())); |
| | | .eq("loc_type1", locTypeDto.getLocType1())); |
| | | for (LocMast locMast1 : locMasts) { |
| | | //获取巷道 |
| | | // List<String> groupOutsideLocCrn = Utils.getGroupOutLocCrn(curRow,nearRow,locMast1.getLocNo(), curRow>nearRow); |
| | |
| | | if (staDescId == 10 && Utils.BooleanWhsTypeStaIoType(rowLastno)) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").eq("frozen", 0).eq("deleted", 0) |
| | | .ge("row1", sRow).le("row1", eRow).eq("whs_type", rowLastnoType.getType().longValue())); |
| | | .ge("row1", sRow).le("row1", eRow).eq("loc_type1", locTypeDto.getLocType1())); |
| | | if (!locMasts.isEmpty()) { |
| | | for (LocMast loc : locMasts) { |
| | | if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) { |
| | |
| | | .eq("crn_no", crnNo); |
| | | staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | log.error("type_no={},stn_no={},crn_no={}", staDescId, sourceStaNo, crnNo); |
| | | log.error("入库入径不存在,type_no={},stn_no={},crn_no={}", staDescId, sourceStaNo, crnNo); |
| | | // throw new CoolException("入库路径不存在"); |
| | | crnNo = 0; |
| | | } else { |
| | |
| | | if (!locMasts.isEmpty()) { |
| | | for (LocMast locMast1 : locMasts) { |
| | | if (basCrnpService.checkSiteError(crnNo, true)) { |
| | | locMast = locMast1; |
| | | break; |
| | | //判断是否为浅库位,浅库位判断深库位是否有货,无货的优先放到深库位中 |
| | | Integer row1 = locMast1.getRow1(); |
| | | Boolean boo=false; |
| | | if(locMast1.getRow1()==2){ |
| | | row1 = 1; |
| | | boo=true; |
| | | }else if(locMast1.getRow1()==3){ |
| | | row1 = 4; |
| | | boo=true; |
| | | } |
| | | if(boo){ |
| | | LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1", row1) |
| | | .eq("bay1", locMast1.getBay1()) |
| | | .eq("lev1", locMast1.getLev1()) |
| | | .eq("loc_sts", "O")); |
| | | if(!Cools.isEmpty(locMast2)) { |
| | | locMast = locMast2; |
| | | break; |
| | | }else { |
| | | LocMast locMast3 = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1", row1) |
| | | .eq("bay1", locMast1.getBay1()) |
| | | .eq("lev1", locMast1.getLev1()) |
| | | .eq("loc_sts", "F")); |
| | | if(!Cools.isEmpty(locMast3)) { |
| | | locMast = locMast1; |
| | | break; |
| | | } |
| | | } |
| | | }else { |
| | | locMast = locMast1; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | List<WaitPakin> waitPakins = null; |
| | | if (param.getIoType() == 1) { |
| | | //处理托盘码 |
| | | //3S19000677895,M22003772,3 ,KP, 0A2030 ,0A2030202306050023 |
| | | //3S箱码号 ,端子物料号 ,数量,单位,供应商编号,供应商批次号 |
| | | //数量和重量转换出来的是否差不多 |
| | | //weight 为 43.39 去皮2.35 = 41.05 |
| | | //托盘码例子 845000820308,M11000787,1000,MT,0A1263,0A126320260120 |
| | | //换算需要41.05*24.36约等于1000 |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码不能为空"); |
| | | } |
| | | String[] split = param.getBarcode().split(","); |
| | | String barcode = split[0]; |
| | | String matnr = split[1]; |
| | | Double weight = Double.valueOf(split[2]); |
| | | String unit = split[3]; |
| | | String manu = split[4]; |
| | | String batch = split[5]; |
| | | String threeCode = param.getBarcode(); |
| | | param.setBarcode(barcode); |
| | | //实际称重数量 |
| | | Double m = param.getWeight() -2.35; |
| | | |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if(mat==null){ |
| | | log.info("没有找到该物料档案--"+matnr+"组托时自动新增物料,默认24.36KG/M"); |
| | | mat = new Mat(); |
| | | mat.setTagId(1L); |
| | | mat.setLocType(1L); |
| | | mat.setMatnr(matnr); |
| | | mat.setUnit(unit); |
| | | mat.setManu(manu); |
| | | mat.setMaktx(matnr); |
| | | mat.setVolume(24.36); |
| | | matService.insert(mat); |
| | | }else { |
| | | //暂定 |
| | | |
| | | } |
| | | m=m*mat.getVolume(); |
| | | //Double val = Math.round((m - matnr.getSafeQty()) * 10000) / 10000.0; |
| | | Config config = configService.selectConfigByCode("SimulationInbound"); |
| | | if (config != null && config.getValue().equals("Y")) { |
| | | WaitPakin waitPakin1 = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (Cools.isEmpty(waitPakin1)) { |
| | | WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("io_status", "N")); |
| | | if (waitPakin != null) { |
| | | waitPakinService.updateForSet("zpallet = '" + param.getBarcode() + "'", new EntityWrapper<WaitPakin>().eq("zpallet", waitPakin.getZpallet())); |
| | | } |
| | | } |
| | | } |
| | | waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (Cools.isEmpty(waitPakins)) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (wrkMast != null && wrkMast.getIoType() == 103) { |
| | | return R.parse(CodeRes.PICK_600); |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | | waitPakin.setZpallet(param.getBarcode()); |
| | | waitPakin.setAnfme(m); |
| | | waitPakin.setThreeCode(threeCode); |
| | | waitPakinService.insert(waitPakin); |
| | | }else { |
| | | for(WaitPakin waitPakin : waitPakins){ |
| | | waitPakin.setAnfme(m); |
| | | waitPakinService.update(waitPakin,new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | } |
| | | } |
| | | //实际长度 |
| | | WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (Cools.isEmpty(waitPakin)) { |
| | | return R.error(CodeRes.NO_COMB_700); |
| | | } |
| | | boolean flag = false; |
| | | if(Cools.isEmpty(waitPakin.getBeBatch())||waitPakin.getBeBatch()!=1){ |
| | | flag = true; |
| | | } |
| | | if (flag && (weight - m < -2.0 || weight - m > 2.0)) { |
| | | return R.error("二维码="+threeCode+"的物料实际称重转换成的米数和物料标签提供的米数相差较大需要退回或者标记后才能入库!"); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0) { |
| | | return R.error(CodeRes.EXIST_500); |
| | | } |
| | | if (Cools.isEmpty(waitPakins)) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (wrkMast != null && wrkMast.getIoType() == 103) { |
| | | return R.parse(CodeRes.PICK_600); |
| | | } |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "SimulationWarehousing").eq("value", "Y")); |
| | | if (!Cools.isEmpty(config)) { |
| | | waitPakins = waitPakinService.selectList( |
| | | new EntityWrapper<WaitPakin>() |
| | | .eq("io_status", "N")); |
| | | if (Cools.isEmpty(waitPakins)) { |
| | | return R.parse(CodeRes.NO_COMB_700); |
| | | } |
| | | String barcode = ""; |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | barcode = waitPakin.getZpallet(); |
| | | break; |
| | | } |
| | | if (!Cools.isEmpty(barcode)){ |
| | | waitPakinService.updateForSet("zpallet='"+param.getBarcode()+"'",new EntityWrapper<WaitPakin>().eq("zpallet",barcode)); |
| | | } |
| | | }else{ |
| | | return R.parse(CodeRes.NO_COMB_700); |
| | | } |
| | | } |
| | | } |
| | | if (Cools.isEmpty(param.getLocType1())){ |
| | | return R.error("高低检测信号不能为空"); |
| | | } |
| | | |
| | | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), true); |
| | | sourceStaNo.setLocType1(param.getLocType1()); |
| | |
| | | username: sa |
| | | password: sa@123 |
| | | # url: jdbc:sqlserver://192.168.4.15:1433;databasename=jxhcwms |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=jxhcwms |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=nbtlasrs-ddj |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| | |
| | | |
| | | #License相关配置 |
| | | license: |
| | | subject: integrationasrs |
| | | subject: nbtlasrs |
| | | publicAlias: publicCert |
| | | storePass: public_zhongyang_123456789 |
| | | licensePath: license.lic |
| | |
| | | # 双深 |
| | | doubleDeep: true |
| | | # 双深库位排号 |
| | | doubleLocs: 1,4,5,8,9,12,13,16 |
| | | doubleLocs: 1,4 |
| | | # 一个堆垛机负责的货架排数 |
| | | groupCount: 4 |
| | | # 左深库位排号 |
| | | doubleLocsLeft: 1,5,9,13 |
| | | doubleLocsLeft: 1 |
| | | # 右深库位排号 |
| | | doubleLocsRight: 4,8,12,16 |
| | | doubleLocsRight: 4 |
| | | # wms参数配置 |
| | | wms-parameter: |
| | | # 自动补空板功能开关 |
| | |
| | | SELECT top 1 * |
| | | FROM [dbo].[asr_loc_mast] |
| | | WHERE 1=1 |
| | | and whs_type=#{whsType} |
| | | and loc_type1=#{whsType} |
| | | and crn_no=#{crnNo} |
| | | and bay1 = #{bay} |
| | | and lev1 = #{lev} |
| | |
| | | SELECT top 1 * |
| | | FROM [dbo].[asr_loc_mast] |
| | | WHERE 1=1 |
| | | and whs_type=#{whsType} |
| | | and loc_type1=#{whsType} |
| | | and crn_no=#{crnNo} |
| | | and bay1 = #{bay} |
| | | and lev1 = #{lev} |
| | |
| | | ,{field: 'staNo$', align: 'center',title: '目标站', width: 95} |
| | | ,{field: 'sourceLocNo', align: 'center',title: '源库位', width: 120} |
| | | ,{field: 'locNo', align: 'center',title: '目标库位', width: 120} |
| | | ,{field: 'oveMk', align: 'center',title: '是否称重', width: 120} |
| | | // ,{field: 'oveMk', align: 'center',title: '是否称重', width: 120} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone', align: 'center',title: '空操作', hide: true} |
| | | ,{field: 'isSuplus$', align: 'center', title: '回库类型', hide: false, width: 120} |
| | | // ,{field: 'isSuplus$', align: 'center', title: '回库类型', hide: false, width: 120} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true, width: 160} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:350} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |