紧急任务修改

This commit is contained in:
秦鸿展
2026-07-17 15:32:11 +08:00
parent 2373be59e6
commit 9ed1797b59
@@ -496,25 +496,20 @@ public class ShiftManageDomainService {
@Transactional(rollbackFor = Exception.class)
public Boolean revokeAudit(ShiftManageDO shiftManageDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
List<Long> shiftManageIds = shiftManageDO.getShiftManageIds();
if (CollectionUtils.isEmpty(shiftManageIds)) {
Long shiftManageId = shiftManageDO.getShiftManageId();
if (shiftManageId == null) {
throw new ServiceException("移位单id不能为空");
}
List<ShiftManage> shiftManageList = shiftManageService.listByIds(shiftManageIds);
if (CollectionUtils.isEmpty(shiftManageList)) {
ShiftManage shiftManage = shiftManageService.getById(shiftManageId);
if (shiftManage == null) {
throw new ServiceException("移位单不存在");
}
for (ShiftManage shiftManage : shiftManageList) {
if (!Integer.valueOf(2).equals(shiftManage.getShiftStatus())) {
throw new ServiceException("移位单【" + shiftManage.getShiftNumber() + "】状态不为待移位,不可撤回");
}
if (!Integer.valueOf(2).equals(shiftManage.getShiftStatus())) {
throw new ServiceException("移位单【" + shiftManage.getShiftNumber() + "】状态不为待移位,不可撤回");
}
// 删除生成的配送任务(taskType=5trackingNumber=shiftNumber
List<String> shiftNumbers = shiftManageList.stream()
.map(ShiftManage::getShiftNumber)
.collect(Collectors.toList());
deliveTaskService.remove(new QueryWrapper<DeliveTask>().lambda()
.in(DeliveTask::getTrackingNumber, shiftNumbers)
.eq(DeliveTask::getTrackingNumber, shiftManage.getShiftNumber())
.eq(DeliveTask::getTaskType, 5));
// 回退:shiftStatus=1(已创建),taskDistribution=2(未下发),auditStatus=1(未审核)
shiftManageService.update(null, new UpdateWrapper<ShiftManage>().lambda()
@@ -524,7 +519,7 @@ public class ShiftManageDomainService {
.set(ShiftManage::getUpdateBy, loginUser.getUserid())
.set(ShiftManage::getUpdateByName, loginUser.getUsername())
.set(ShiftManage::getUpdateTime, new Date())
.in(ShiftManage::getShiftManageId, shiftManageIds));
.eq(ShiftManage::getShiftManageId, shiftManageId));
return true;
}