Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
254ab45896
@ -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,22 @@ 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.selectAll(TaskDispatchDetailDO.class).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 TaskDispatchDetailDO selectNoReportBeforeDo(TaskDispatchDetailDO taskDispatchDetailDO){
|
||||
MPJLambdaWrapper<TaskDispatchDetailDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(TaskDispatchDetailDO.class).leftJoin(ProcedureDO.class,"a",ProcedureDO::getId,TaskDispatchDetailDO::getProcedureId)
|
||||
.eq(TaskDispatchDetailDO::getSort, taskDispatchDetailDO.getSort() - 1)
|
||||
.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId())
|
||||
.eq(ProcedureDO::getIsReport,0);
|
||||
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 +290,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);
|
||||
}
|
||||
|
@ -364,17 +364,22 @@ 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)
|
||||
);
|
||||
|
||||
if (taskDispatchDetailDO1 == null){
|
||||
//查不出来上一道工序已完工就代表它没完成
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(0);
|
||||
}else{
|
||||
// TaskDispatchDetailDO taskDispatchDetailDO1 = taskDispatchDetailMapper.selectOne(new LambdaQueryWrapperX<TaskDispatchDetailDO>()
|
||||
// .eq(TaskDispatchDetailDO::getSort, taskDispatchDetailDO.getSort() - 1)
|
||||
// .eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId())
|
||||
// .eq(TaskDispatchDetailDO::getProcedureStatus, 2)
|
||||
// );
|
||||
TaskDispatchDetailDO taskDispatchDetailDO2 = taskDispatchDetailMapper.selectNoReportBeforeDo(taskDispatchDetailDO);
|
||||
if (taskDispatchDetailDO2 != null){
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(1);
|
||||
}else{
|
||||
TaskDispatchDetailDO taskDispatchDetailDO1 = taskDispatchDetailMapper.selectBeforeDo(taskDispatchDetailDO);
|
||||
if (taskDispatchDetailDO1 == null){
|
||||
//查不出来上一道工序已完工就代表它没完成
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(0);
|
||||
}else{
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(1);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
taskDispatchDetailDO.setBeforeProcedureStatus(1);
|
||||
@ -495,7 +500,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;
|
||||
|
Loading…
Reference in New Issue
Block a user