| src/main/java/com/zy/asrs/controller/MobileController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/entity/param/AgvCallParams.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/service/MobileService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/webapp/static/js/task/task.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -200,6 +200,42 @@ return mobileService.OutCallAgv(params, getUserId()); } /** * 缓存区出库组托上架 * @author Ryan * @date 2025/12/8 13:45 * @param params * @return com.core.common.R */ @ManagerAuth @ApiOperation("缓存出库上架") @PostMapping("/commb/task/pub") public R combPub(@RequestBody AgvCallParams params) { if (Objects.isNull(params)) { return R.error("参数不能为空!!"); } return mobileService.combOutPub(params); } /** * 缓存区出库组托上架 * @author Ryan * @date 2025/12/8 13:45 * @param params * @return com.core.common.R */ @ManagerAuth @ApiOperation("缓存出库列表") @PostMapping("/cache/task/list") public R combCacehList(@RequestBody AgvCallParams params) { if (Objects.isNull(params)) { return R.error("参数不能为空!!"); } return mobileService.combCacehList(params); } // 组托 ---------------------------------------------------------------------------------------------------- src/main/java/com/zy/asrs/entity/param/AgvCallParams.java
@@ -23,6 +23,9 @@ @ApiModelProperty("托盘码") private String barcode; @ApiModelProperty("BS编码") private String bsCode; @ApiModelProperty("操作类型") private String type; src/main/java/com/zy/asrs/service/MobileService.java
@@ -109,4 +109,23 @@ R callEmptyCar(AgvCallParams params, Long userId); R collectionInCall(AgvCallParams params, Long userId); /** * 缓存出库组托上架 * @author Ryan * @date 2025/12/8 13:46 * @param params * @return com.core.common.R */ R combOutPub(AgvCallParams params); /** * 缓存出库组托列表 * @author Ryan * @date 2025/12/8 15:36 * @param params * @return com.core.common.R */ R combCacehList(AgvCallParams params); } src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1287,7 +1287,7 @@ /**生成缓存区出库任务*/ generateCacheOutTask(station, locCaches, userId); // /**生成立库出库任务*/ /**生成立库出库任务*/ generateCRNOutTask(station, locCaches, userId); return R.ok(); @@ -1303,7 +1303,7 @@ .eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type) .eq("area_id", basAreas.getId()) ); if (locCaches.isEmpty()){ if (locCaches.isEmpty()) { throw new CoolException("暂无空板库位"); } @@ -1341,7 +1341,7 @@ } List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", params.getBarcode())); if (!tasks.isEmpty()){ if (!tasks.isEmpty()) { throw new CoolException("托盘码已生成任务"); } @@ -1349,8 +1349,7 @@ List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>() .in("loc_sts", LocStsType.LOC_STS_TYPE_O.type, LocStsType.LOC_STS_TYPE_D.type) .eq("area_id", basAreas.getId()) ); .eq("area_id", basAreas.getId())); if (locCaches.isEmpty()) { throw new CoolException("当前暂无空库位!!"); } @@ -1361,10 +1360,58 @@ } /** * 缓存出库组托上架 * @author Ryan * @date 2025/12/8 13:47 * @param params * @return com.core.common.R */ @Override public R combOutPub(AgvCallParams params) { return R.ok(); } /** * 缓存组托数据 * @author Ryan * @date 2025/12/8 15:37 * @param params * @return com.core.common.R */ @Override public R combCacehList(AgvCallParams params) { if (Objects.isNull(params.getBarcode())) { throw new CoolException("托盘码不能为空!!"); } if (Objects.isNull(params.getBsCode())) { throw new CoolException("BS码不能为空!!"); } Task task = taskService.selectOne(new EntityWrapper<Task>() .eq("io_type", TaskIOType.PICK_OUT.type) .eq("wrk_sts", 14) .eq("barcode", params.getBarcode())); if (Objects.isNull(task)) { throw new CoolException("数据错误:任务信息存在!!"); } List<TaskDetl> taskDetl = taskDetlService.selectList(new EntityWrapper<TaskDetl>() .eq("three_code", params.getBsCode()) .eq("zpallet", params.getBarcode())); if (Objects.isNull(taskDetl) || taskDetl.isEmpty()) { throw new CoolException("当前BS编码不存在!!"); } return R.ok().add(taskDetl); } /** * 生成立库出库任务 * * @param locCaches * @author Ryan * @date 2025/12/3 8:06 * @param locCaches */ @Override @Transactional(rollbackFor = Exception.class) @@ -1456,9 +1503,10 @@ /** * 生成堆垛机出库任务 * * @param locMasts * @author Ryan * @date 2025/12/6 14:44 * @param locMasts */ @Transactional(rollbackFor = Exception.class) public void generateOutTask(List<LocMast> locMasts, Integer ioType, BasDevp devp, Long userId) { @@ -1544,7 +1592,7 @@ task.setWrkNo(workNo) .setIoTime(new Date()) .setWrkSts(11L) // 工作状态:11.生成出库ID .setIoType(loc.getLocSts().equals("D") ? 110 : 101) // 入出库状态: 11.库格移载 .setIoType(loc.getLocSts().equals("D") ? 110 : 103) // 入出库状态: 11.库格移载 .setTaskType("agv") .setIoPri(10D) .setFullPlt(loc.getLocSts().equals("D") ? "N" : "Y") // 满板:Y @@ -1562,7 +1610,9 @@ if (!taskService.insert(task)) { throw new CoolException("保存工作档失败"); } List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_id", loc.getId())); List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>() .eq("loc_no", loc.getLocNo())); if (!detls.isEmpty()) { List<TaskDetl> taskDetls = new ArrayList<>(); detls.forEach(pakin -> { @@ -1598,8 +1648,8 @@ } // 修改目标站点信息 if (station.getLocSts().equals("O")) { station.setLocSts("S"); // S.入库预约 if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { station.setLocSts(LocStsType.LOC_STS_TYPE_S.type); // S.入库预约 station.setModiTime(new Date()); station.setModiUser(userId); if (!basStationService.updateById(station)) { @@ -1673,7 +1723,9 @@ throw new CoolException("保存工作档明细失败"); } pakins.forEach(pakin -> {pakin.setIoStatus("Y");}); pakins.forEach(pakin -> { pakin.setIoStatus("Y"); }); if (!waitPakinService.updateBatchById(pakins)) { throw new CoolException("更新组托信息失败"); @@ -1707,7 +1759,7 @@ } public HIKResultDTO sendAgvTask(HIKApiDTO haiKangApiDTO,String path){ public HIKResultDTO sendAgvTask(HIKApiDTO haiKangApiDTO, String path) { HIKResultDTO result = new HIKResultDTO(); ForwardAGVTaskDTO forwardAGVTaskParam = new ForwardAGVTaskDTO(); src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -11,6 +11,7 @@ import com.zy.asrs.entity.result.OpenOrderCompeteResult; import com.zy.asrs.entity.result.StockVo; import com.zy.asrs.enums.CheckStatusEnum; import com.zy.asrs.enums.OrderTypeEnum; import com.zy.asrs.mapper.TagMapper; import com.zy.asrs.service.*; import com.zy.asrs.utils.MatUtils; @@ -618,7 +619,7 @@ checkOrder.setOrderNo(param.getOrderNo()); checkOrder.setUuid(String.valueOf(snowflakeIdWorker.nextId())); checkOrder.setOrderTime( DateUtils.convert(now)); checkOrder.setDocType(param.getOrderType()); checkOrder.setDocType(Long.valueOf(OrderTypeEnum.ADJUSTMENT.type)); checkOrder.setSettle(1L); checkOrder.setCreateBy(9527L); checkOrder.setCreateTime(now); src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -17,6 +17,7 @@ import java.util.Collections; import java.util.Date; import java.util.List; import java.util.Objects; import java.util.concurrent.TimeUnit; @Service("taskService") @@ -36,6 +37,10 @@ private TaskDetlLogService taskDetlLogService; @Autowired private BasStationService basStationService; @Autowired private OrderDetlPakinService orderDetlService; @Autowired private OrderPakinService orderService; @Override @Transactional(rollbackFor = Exception.class) @@ -69,7 +74,7 @@ @Override @Transactional public void pickWrkMast(String workNo, Long userId) { Task wrkMast = this.selectById(workNo); Task wrkMast = this.selectOne(new EntityWrapper<Task>().eq("wrk_no", workNo) ); if (Cools.isEmpty(wrkMast)) { throw new CoolException(workNo + "工作档不存在"); } @@ -227,34 +232,30 @@ List<TaskDetl> wrkDetls = taskDetlService.selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", wrkMast.getWrkNo())); for (TaskDetl wrkDetl : wrkDetls) { if (!Cools.isEmpty(wrkDetl.getOrderNo())) { // if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { // throw new CoolException("订单数据回滚失败"); // } OrderInAndOutUtil.decrease(Boolean.FALSE, wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme()); //修改订单主表状态,没有作业数量时才可以修改 boolean flag = true; // List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no",wrkDetl.getOrderNo())); Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, wrkDetl.getOrderNo()); List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); for (OrderDetl orderDetl : orderDetls) { OrderPakin order = orderService.selectByNo(wrkDetl.getOrderNo()); //OrderInAndOutUtil.selectByNo(Boolean.FALSE, wrkDetl.getOrderNo()); if (Objects.isNull(order)) { throw new CoolException("单据信息不存在!!"); } List<OrderDetlPakin> orderDetls = orderDetlService.selectByOrderId(order.getId()); //OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); for (OrderDetlPakin orderDetl : orderDetls) { if (orderDetl.getWorkQty() > 0) { flag = false; } } if (flag) { // Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo())); if (!Cools.isEmpty(order) && order.getSettle() == 2) { order.setSettle(1L); order.setUpdateBy(userId); order.setUpdateTime(now); } // if(!orderService.update(order,new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo()))){ // throw new CoolException("修改订单状态失败"); // } OrderInAndOutUtil.updateOrder(Boolean.FALSE, order.getId(), order.getSettle(), userId); orderService.updateById(order); } } } src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -59,6 +59,8 @@ private BasStationServiceImpl basStationService; @Autowired private CheckOrderDetlService checkOrderDetlService; @Autowired private WaitPakinLogService waitPakinLogService; public ReturnT<String> start(WrkMast wrkMast) { // 4.入库完成 @@ -831,59 +833,153 @@ @Transactional(rollbackFor = Exception.class) public ReturnT<String> agvDoIn(Task wrkMast) { LocCache locCache = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getLocNo())); if (Objects.isNull(locCache)) { throw new CoolException("数据错误,库位不存在!!"); } if (!locCache.getLocSts().equals(LocStsType.LOC_STS_TYPE_S.type)) { throw new CoolException( "当前库位状态为:" + LocStsType.LOC_STS_TYPE_S.type + "." + LocStsType.LOC_STS_TYPE_S.desc + ",不是出库预约状态"); } List<WaitPakin> apallet = waitPakinService .selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); if (Objects.isNull(apallet)) { throw new CoolException("数据错误:组托数据不存在!!"); } apallet.forEach(pakin -> { LocDetl detl = new LocDetl(); BeanUtils.copyProperties(pakin, detl); detl.setBarcode(pakin.getBarcode()); detl.setAnfme(pakin.getAnfme()); detl.setBrand(pakin.getBrand()); detl.setAppeTime(new Date()); detl.setSpecs(pakin.getSpecs()); detl.setColor(pakin.getColor()); detl.setLocId(locCache.getId()); detl.setLocNo(locCache.getLocNo()); detl.setAreaId(locCache.getAreaId()); detl.setAreaName(locCache.getAreaName()); detl.setUnit(pakin.getUnit()); detl.setBatch(pakin.getBatch()); if (!locDetlService.insert(detl)) { throw new CoolException("库位明细保存失败!!"); if(wrkMast.getIoType().equals(1)){ if (Objects.isNull(locCache)) { throw new CoolException("数据错误,库位不存在!!"); } }); if (!locCache.getLocSts().equals(LocStsType.LOC_STS_TYPE_S.type)) { throw new CoolException( "当前库位状态为:" + LocStsType.LOC_STS_TYPE_S.type + "." + LocStsType.LOC_STS_TYPE_S.desc + ",不是出库预约状态"); } List<WaitPakin> apallet = waitPakinService .selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); if (Objects.isNull(apallet)) { throw new CoolException("数据错误:组托数据不存在!!"); } apallet.forEach(pakin -> { LocDetl detl = new LocDetl(); BeanUtils.copyProperties(pakin, detl); locCache.setLocSts(LocStsType.LOC_STS_TYPE_F.type); locCache.setModiTime(new Date()); locCache.setBarcode(wrkMast.getBarcode()); locCache.setModiTime(new Date()); locCache.setIoTime(new Date()); if (!locCacheService.updateById(locCache)) { throw new CoolException("库位状态修改失败!"); } wrkMast.setWrkSts(5L); wrkMast.setModiTime(new Date()); if (!taskService.updateById(wrkMast)) { throw new CoolException("任务状态修改失败!!"); } detl.setBarcode(pakin.getBarcode()); detl.setAnfme(pakin.getAnfme()); detl.setBrand(pakin.getBrand()); detl.setAppeTime(new Date()); detl.setSpecs(pakin.getSpecs()); detl.setColor(pakin.getColor()); detl.setLocId(locCache.getId()); detl.setLocNo(locCache.getLocNo()); detl.setAreaId(locCache.getAreaId()); detl.setAreaName(locCache.getAreaName()); detl.setUnit(pakin.getUnit()); detl.setBatch(pakin.getBatch()); if (!locDetlService.insert(detl)) { throw new CoolException("库位明细保存失败!!"); } }); Set<Long> list = apallet.stream().map(WaitPakin::getOrderId).collect(Collectors.toSet()); List<OrderPakin> pakins = orderPakinService.selectList(new EntityWrapper<OrderPakin>().in("id", list)); if (Objects.isNull(pakins) || pakins.isEmpty()) { locCache.setLocSts(LocStsType.LOC_STS_TYPE_F.type); locCache.setModiTime(new Date()); locCache.setBarcode(wrkMast.getBarcode()); locCache.setModiTime(new Date()); locCache.setIoTime(new Date()); if (!locCacheService.updateById(locCache)) { throw new CoolException("库位状态修改失败!"); } wrkMast.setWrkSts(5L); wrkMast.setModiTime(new Date()); if (!taskService.updateById(wrkMast)) { throw new CoolException("任务状态修改失败!!"); } for (WaitPakin pakin : apallet){ WaitPakinLog waitPakinLog = new WaitPakinLog(); BeanUtils.copyProperties(pakin, waitPakinLog); waitPakinLogService.insert(waitPakinLog); waitPakinService.deleteById(pakin.getId()); } Set<Long> list = apallet.stream().map(WaitPakin::getOrderId).collect(Collectors.toSet()); List<OrderPakin> pakins = orderPakinService.selectList(new EntityWrapper<OrderPakin>().in("id", list)); if (Objects.isNull(pakins) || pakins.isEmpty()) { // throw new CoolException("单据不存在!!"); } }else if(wrkMast.getIoType().equals(53)){ // 根据工作号,查询工作明细档 List<TaskDetl> wrkDetls53 = taskDetlService .selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", wrkMast.getWrkNo())); if (wrkDetls53.isEmpty()) { // exceptionHandle("拣料入库 ===>> 工作明细档为空;[workNo={0}]", wrkMast.getWrkNo()); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg("拣料入库 ===>> 工作明细档为空; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); } for (TaskDetl wrkDetl : wrkDetls53) { LocDetl locDetl = locDetlService.selectItem(locCache.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); if (null != locDetl) { if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locCache.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3())) { // exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", // wrkMast.getWrkNo(), wrkMast.getLocNo()); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg("拣料入库 ===>> 修改库存明细数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); } } // 更新订单完成数量 OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); if (orderDetlPakout == null) { orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); } try { if (!Cools.isEmpty(orderDetlPakout)) { if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { // exceptionHandle("拣料入库 ===>> 更新订单完成数量失败;[workNo={0}],[locNo={1}]", // wrkMast.getWrkNo(), wrkMast.getLocNo()); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg("拣料入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); } } } catch (Exception ignore) { } } Date now = new Date(); // 修改库位状态 Q ====>> F if (locCache.getLocSts().equals("Q")) { locCache.setLocSts("F"); locCache.setBarcode(wrkMast.getBarcode()); locCache.setIoTime(now); locCache.setModiTime(now); if (!locCacheService.updateById(locCache)) { // exceptionHandle("拣料入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", // wrkMast.getWrkNo(), wrkMast.getLocNo()); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg("拣料入库 ===>> 修改库位状态失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); } } // 修改工作主档状态 wrkMast.setWrkSts(5L); wrkMast.setModiTime(now); if (!taskService.updateById(wrkMast)) { // exceptionHandle("更新入库完成状态失败;[workNo={0}]", wrkMast.getWrkNo()); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL .setMsg("更新入库完成状态失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); } } return SUCCESS; } } src/main/webapp/static/js/task/task.js
@@ -27,11 +27,11 @@ , {field: 'wrkSts$', align: 'center', title: '工作状态', width: 150} , {field: 'ioType$', align: 'center', title: '入出库类型', width: 150} , {field: 'ioPri', align: 'center', title: '优先级', width: 80} , {field: 'taskType$', align: 'center', title: '任务类型'} , {field: 'taskType$', align: 'center', title: '任务类型', width: 120} , {field: 'crnNo$', align: 'center', title: '堆垛机', hide: true} , {field: 'sourceStaNo$', align: 'center', title: '源站'} , {field: 'staNo$', align: 'center', title: '目标站', width: 120} , {field: 'sourceStaNo$', align: 'center', title: '源站', width: 120} , {field: 'sourceLocNo', align: 'center', title: '源库位', width: 120} , {field: 'staNo$', align: 'center', title: '目标站', width: 120} , {field: 'locNo', align: 'center', title: '目标库位', width: 120} , {field: 'barcode', align: 'center', title: '条码', width: 110} , {field: 'preHave', align: 'center', title: '先入品', hide: true}