下料报工删除优化
This commit is contained in:
parent
9dfaa088f0
commit
17b8037ff6
@ -1,6 +1,7 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.dal.mysql.taskinreport;
|
package com.chanko.yunxi.mes.module.heli.dal.mysql.taskinreport;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
@ -66,4 +67,10 @@ public interface TaskInReportMapper extends BaseMapperX<TaskInReportDO> {
|
|||||||
return selectPage(reqVO, query);
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -81,8 +81,11 @@ public class TaskInReportServiceImpl implements TaskInReportService {
|
|||||||
if (taskDispatchDetailDO.getInReportProcess() == 2) {
|
if (taskDispatchDetailDO.getInReportProcess() == 2) {
|
||||||
throw new RuntimeException("该报工已完成,不允许删除,请确认");
|
throw new RuntimeException("该报工已完成,不允许删除,请确认");
|
||||||
} else {
|
} else {
|
||||||
taskDispatchDetailDO.setInReportProcess(0);
|
List<TaskInReportDO> taskInReportDOS = taskInReportMapper.selectList(taskInReportDO.getDispatchDetailId(), taskInReportDO.getId());
|
||||||
taskDispatchDetailMapper.updateById(taskDispatchDetailDO);
|
if (taskInReportDOS.isEmpty()) {
|
||||||
|
taskDispatchDetailDO.setInReportProcess(0);
|
||||||
|
taskDispatchDetailMapper.updateById(taskDispatchDetailDO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 删除
|
// 删除
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user