不查不要求报工的

This commit is contained in:
Ledo 2025-03-04 21:36:55 +08:00
parent 15d7c63608
commit 7e7b2e633b
2 changed files with 29 additions and 9 deletions

View File

@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch;
import cn.hutool.core.collection.CollUtil;
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.query.LambdaQueryWrapperX;
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailPageReqVO;
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailTotalVO;
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskPlanJDBaoBiaoPageReqVO;
@ -73,7 +74,14 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
System.out.println("开始时间: " + sTime);
System.out.println("结束时间: " + eTime);
}*/
default TaskDispatchDetailDO selectBeforeDo(TaskDispatchDetailDO taskDispatchDetailDO){
MPJLambdaWrapper<TaskDispatchDetailDO> query = new MPJLambdaWrapper<>();
query.leftJoin(ProcedureDO.class,"a",ProcedureDO::getId,TaskDispatchDetailDO::getProcedureId)
.eq(TaskDispatchDetailDO::getSort, taskDispatchDetailDO.getSort() - 1)
.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId())
.eq(TaskDispatchDetailDO::getProcedureStatus, 2);
return selectOne(query);
}
default PageResult<TaskDispatchDetailDO> selectPageGroup(YgjxPageReqVO pageReqVO) {
MPJLambdaWrapper<TaskDispatchDetailDO> query = new MPJLambdaWrapper<>();
query.select( "DATE_FORMAT(t.create_time, '%Y-%m') as yearMonth,\n" +
@ -274,7 +282,19 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
.eq(TaskDispatchDetailDO::getDispatchId, dispatchId);
return selectList(query);
}
default List<TaskDispatchDetailDO> selectListByDispatchIdNew(Long dispatchId) {
MPJLambdaWrapper<TaskDispatchDetailDO> query = new MPJLambdaWrapper<>();
query.selectAll(TaskDispatchDetailDO.class)
.select("a.is_report as is_report,a.code as procedure_code")
.select("count(b.amount) as numAmount")
.leftJoin(ProcedureDO.class,"a",ProcedureDO::getId,TaskDispatchDetailDO::getProcedureId)
.leftJoin(TaskReportDO.class,"b",TaskReportDO::getDispatchDetailId,TaskDispatchDetailDO::getId)
.eq(ProcedureDO::getIsReport,1)
.disableSubLogicDel()
.groupBy(TaskDispatchDetailDO::getId)
.eq(TaskDispatchDetailDO::getDispatchId, dispatchId);
return selectList(query);
}
default int deleteByDispatchId(Long dispatchId) {
return deleteById(dispatchId);
}

View File

@ -364,12 +364,12 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
public TaskDispatchDetailDO getTaskDispatchDetail(TaskDispatchDetailPageReqVO pageReqVO){
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectGet(pageReqVO);
if (taskDispatchDetailDO.getSort()!=null&&taskDispatchDetailDO.getSort() != 1){
TaskDispatchDetailDO taskDispatchDetailDO1 = taskDispatchDetailMapper.selectOne(new LambdaQueryWrapperX<TaskDispatchDetailDO>()
.eq(TaskDispatchDetailDO::getSort, taskDispatchDetailDO.getSort() - 1)
.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId())
.eq(TaskDispatchDetailDO::getProcedureStatus, 2)
);
// TaskDispatchDetailDO taskDispatchDetailDO1 = taskDispatchDetailMapper.selectOne(new LambdaQueryWrapperX<TaskDispatchDetailDO>()
// .eq(TaskDispatchDetailDO::getSort, taskDispatchDetailDO.getSort() - 1)
// .eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId())
// .eq(TaskDispatchDetailDO::getProcedureStatus, 2)
// );
TaskDispatchDetailDO taskDispatchDetailDO1 = taskDispatchDetailMapper.selectBeforeDo(taskDispatchDetailDO);
if (taskDispatchDetailDO1 == null){
//查不出来上一道工序已完工就代表它没完成
taskDispatchDetailDO.setBeforeProcedureStatus(0);
@ -495,7 +495,7 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
.eq(TaskDispatchDO::getProjectSubId, taskDispatchDO.getProjectSubId())
.eq(TaskDispatchDO::getDispatchType,"ASSEMBLE"));
//零件是否生产完成
List<TaskDispatchDetailDO> taskDispatchDetailDOS = taskDispatchDetailMapper.selectListByDispatchId(taskDispatchDO.getId());
List<TaskDispatchDetailDO> taskDispatchDetailDOS = taskDispatchDetailMapper.selectListByDispatchIdNew(taskDispatchDO.getId());
List<TaskDispatchDetailDO> productionList = taskDispatchDetailDOS.stream().filter(e -> !e.getId().equals(taskDispatchDetailDO.getId())).collect(Collectors.toList());
//过程检 零件所有生产派工完成生成
boolean isBomDetailProductionOver = true;