下料报工删除优化

This commit is contained in:
zxy 2026-01-12 14:30:47 +08:00
parent 9dfaa088f0
commit 17b8037ff6
2 changed files with 13 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package com.chanko.yunxi.mes.module.heli.dal.mysql.taskinreport;
import java.time.LocalDateTime;
import java.util.List;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
@ -66,4 +67,10 @@ public interface TaskInReportMapper extends BaseMapperX<TaskInReportDO> {
return selectPage(reqVO, query);
}
}
default List<TaskInReportDO> selectList(Long dispatchDetailId, Long id) {
return selectList(new MPJLambdaWrapper<TaskInReportDO>()
.eq(TaskInReportDO::getDispatchDetailId, dispatchDetailId)
.ne(TaskInReportDO::getId, id)
.disableSubLogicDel());
}
}

View File

@ -81,8 +81,11 @@ public class TaskInReportServiceImpl implements TaskInReportService {
if (taskDispatchDetailDO.getInReportProcess() == 2) {
throw new RuntimeException("该报工已完成,不允许删除,请确认");
} else {
taskDispatchDetailDO.setInReportProcess(0);
taskDispatchDetailMapper.updateById(taskDispatchDetailDO);
List<TaskInReportDO> taskInReportDOS = taskInReportMapper.selectList(taskInReportDO.getDispatchDetailId(), taskInReportDO.getId());
if (taskInReportDOS.isEmpty()) {
taskDispatchDetailDO.setInReportProcess(0);
taskDispatchDetailMapper.updateById(taskDispatchDetailDO);
}
}
}
// 删除