From 1e01cb4da6055dd19c720a7012301ec34bee982a Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 30 六月 2025 16:41:04 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveController.java | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 48 insertions(+), 5 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveController.java index a14c907..88ebbe5 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveController.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveController.java @@ -1,6 +1,7 @@ package com.vincent.rsf.server.manager.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.vincent.rsf.framework.common.Cools; @@ -12,8 +13,12 @@ import com.vincent.rsf.server.common.domain.BaseParam; import com.vincent.rsf.server.common.domain.KeyValVo; import com.vincent.rsf.server.common.domain.PageParam; +import com.vincent.rsf.server.manager.entity.TaskItem; import com.vincent.rsf.server.manager.entity.Wave; import com.vincent.rsf.server.manager.entity.WaveItem; +import com.vincent.rsf.server.manager.enums.WaveExceStatus; +import com.vincent.rsf.server.manager.enums.WaveItemExceStatus; +import com.vincent.rsf.server.manager.service.TaskItemService; import com.vincent.rsf.server.manager.service.WaveService; import com.vincent.rsf.server.system.controller.BaseController; import io.swagger.annotations.ApiOperation; @@ -30,6 +35,8 @@ @Autowired private WaveService waveService; + @Autowired + private TaskItemService taskItemService; @PreAuthorize("hasAuthority('manager:wave:list')") @PostMapping("/wave/page") @@ -85,10 +92,15 @@ @OperationLog("Delete 娉㈡鍗曟嵁") @PostMapping("/wave/remove/{ids}") public R remove(@PathVariable Long[] ids) { - if (!waveService.removeByIds(Arrays.asList(ids))) { - return R.error("Delete Fail"); + if (Objects.isNull(ids)) { + throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒"); } - return R.ok("Delete Success").add(ids); + List<Long> list = Arrays.asList(ids); + List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getSourceId, list)); + if (!taskItems.isEmpty()) { + throw new CoolException("鏈夋湭瀹屾垚浠诲姟锛屼笉鍙墽琛屽垹闄ゆ搷浣滐紒锛�"); + } + return waveService.cancelWave(list); } @PreAuthorize("hasAuthority('manager:wave:list')") @@ -118,14 +130,24 @@ if (Cools.isEmpty(map) || Cools.isEmpty(map.get("wave"))) { throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒"); } - return waveService.publicTask(map); + return waveService.publicTask(map, getLoginUserId()); + } + + @PreAuthorize("hasAuthority('manager:wave:update')") + @ApiOperation("閫夋嫨鏄庣粏涓嬪彂浠诲姟") + @PostMapping("/wave/selects/task") + public R waveToTask(@RequestBody Map<String, Object> map) { + if (Cools.isEmpty(map) || Cools.isEmpty(map.get("ids"))) { + throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒"); + } + return waveService.waveToTask(map, getLoginUserId()); } @PreAuthorize("hasAuthority('manager:wave:list')") @ApiOperation("娉㈡鍑哄簱浠诲姟棰勮") @PostMapping("/wave/locs/preview/page") public R mergeWavePreview(@RequestBody Map<String, Object> map) { - if (Cools.isEmpty(map.get("wave")) || StringUtils.isBlank(map.get("wave").toString())) { + if (Cools.isEmpty(map.get("waveId")) || StringUtils.isBlank(map.get("waveId").toString())) { throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒"); } Long waveId = Long.parseLong(map.get("waveId").toString()); @@ -135,4 +157,25 @@ return R.ok().add(pageResult); } + @PreAuthorize("hasAuthority('manager:waveItem:update')") + @ApiOperation("鏆傚仠涓嬪彂浠诲姟") + @PostMapping("/wave/pause/pub/{id}") + public R pausePublicTask(@PathVariable Long id) { + waveService.update(new LambdaUpdateWrapper<Wave>() + .eq(Wave::getId, id) + .set(Wave::getExceStatus, WaveExceStatus.WAVE_EXCE_STATUS_PAUSE.val)); + return R.ok(); + } + + @PreAuthorize("hasAuthority('manager:waveItem:update')") + @ApiOperation("缁х画涓嬪彂浠诲姟") + @PostMapping("/wave/continue/pub/{id}") + public R continuePublicTask(@PathVariable Long id) { + waveService.update(new LambdaUpdateWrapper<Wave>() + .eq(Wave::getId, id) + .set(Wave::getExceStatus, WaveExceStatus.WAVE_EXCE_STATUS_EXCING.val)); + return R.ok(); + } + + } -- Gitblit v1.9.1