|
|
|
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.dromara.mes.domain.BaseShiftInfo;
|
|
|
|
|
import org.dromara.mes.domain.vo.MesProductPlanEditVo;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.dromara.mes.domain.bo.ProdPlanInfoBo;
|
|
|
|
@ -281,4 +282,63 @@ public class ProdPlanInfoServiceImpl implements IProdPlanInfoService {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询生产计划监控列表
|
|
|
|
|
*
|
|
|
|
|
* @param bo 查询条件
|
|
|
|
|
* @param pageQuery 分页参数
|
|
|
|
|
* @return 生产计划监控分页列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<ProdPlanInfoVo> queryMoritorPageList(ProdPlanInfoBo bo, PageQuery pageQuery) {
|
|
|
|
|
MPJLambdaWrapper<ProdPlanInfo> lqw = buildQW(bo);
|
|
|
|
|
String tableName = getPlanInfoTableName(bo.getWorkshopId());
|
|
|
|
|
Page<ProdPlanInfoVo> result = baseMapper.queryMoritorPageList(pageQuery.build(), tableName, lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MPJLambdaWrapper<ProdPlanInfo> buildQW(ProdPlanInfoBo bo) {
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
|
MPJLambdaWrapper<ProdPlanInfo> lqw = JoinWrappers.lambda(ProdPlanInfo.class)
|
|
|
|
|
.selectAll(ProdPlanInfo.class)
|
|
|
|
|
|
|
|
|
|
//生产计划监控页面传参查询时间区间
|
|
|
|
|
.between( !ObjectUtils.isEmpty(params.get("monitorBeginTime")) && !ObjectUtils.isEmpty(params.get("monitorBeginTime")),
|
|
|
|
|
ProdPlanInfo::getPlanBeginTime, params.get("monitorBeginTime"), params.get("monitorEndTime"))
|
|
|
|
|
|
|
|
|
|
.eq(bo.getPlanId() != null, ProdPlanInfo::getPlanId, bo.getPlanId())
|
|
|
|
|
.eq(bo.getProductOrderId() != null, ProdPlanInfo::getProductOrderId, bo.getProductOrderId())
|
|
|
|
|
.eq(bo.getSaleOrderId() != null, ProdPlanInfo::getSaleOrderId, bo.getSaleOrderId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getSaleorderCode()), ProdPlanInfo::getSaleorderCode, bo.getSaleorderCode())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getPlanCode()), ProdPlanInfo::getPlanCode, bo.getPlanCode())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getDispatchCode()), ProdPlanInfo::getDispatchCode, bo.getDispatchCode())
|
|
|
|
|
.eq(bo.getMaterialId() != null, ProdPlanInfo::getMaterialId, bo.getMaterialId())
|
|
|
|
|
.eq(bo.getMaterialBomId() != null, ProdPlanInfo::getMaterialBomId, bo.getMaterialBomId())
|
|
|
|
|
.eq(bo.getProcessId() != null, ProdPlanInfo::getProcessId, bo.getProcessId())
|
|
|
|
|
.eq(bo.getProcessOrder() != null, ProdPlanInfo::getProcessOrder, bo.getProcessOrder())
|
|
|
|
|
.eq(bo.getLastProcessId() != null, ProdPlanInfo::getLastProcessId, bo.getLastProcessId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getFinalProcessFlag()), ProdPlanInfo::getFinalProcessFlag, bo.getFinalProcessFlag())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getReleaseType()), ProdPlanInfo::getReleaseType, bo.getReleaseType())
|
|
|
|
|
.eq(bo.getReleaseId() != null, ProdPlanInfo::getReleaseId, bo.getReleaseId())
|
|
|
|
|
.eq(bo.getProductionTime() != null, ProdPlanInfo::getProductionTime, bo.getProductionTime())
|
|
|
|
|
.eq(bo.getPlanAmount() != null, ProdPlanInfo::getPlanAmount, bo.getPlanAmount())
|
|
|
|
|
.eq(bo.getDispatchAmount() != null, ProdPlanInfo::getDispatchAmount, bo.getDispatchAmount())
|
|
|
|
|
.eq(bo.getCompleteAmount() != null, ProdPlanInfo::getCompleteAmount, bo.getCompleteAmount())
|
|
|
|
|
.eq(bo.getPlanBeginTime() != null, ProdPlanInfo::getPlanBeginTime, bo.getPlanBeginTime())
|
|
|
|
|
.eq(bo.getPlanEndTime() != null, ProdPlanInfo::getPlanEndTime, bo.getPlanEndTime())
|
|
|
|
|
.eq(bo.getRealBeginTime() != null, ProdPlanInfo::getRealBeginTime, bo.getRealBeginTime())
|
|
|
|
|
.eq(bo.getRealEndTime() != null, ProdPlanInfo::getRealEndTime, bo.getRealEndTime())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAttachId()), ProdPlanInfo::getAttachId, bo.getAttachId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getPlanStatus()), ProdPlanInfo::getPlanStatus, bo.getPlanStatus())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getImportFlag()), ProdPlanInfo::getImportFlag, bo.getImportFlag())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getFinishFlag()), ProdPlanInfo::getFinishFlag, bo.getFinishFlag())
|
|
|
|
|
.eq(bo.getPriority() != null, ProdPlanInfo::getPriority, bo.getPriority())
|
|
|
|
|
.eq(bo.getShiftId() != null, ProdPlanInfo::getShiftId, bo.getShiftId())
|
|
|
|
|
.eq(bo.getClassTeamId() != null, ProdPlanInfo::getClassTeamId, bo.getClassTeamId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getModelCode()), ProdPlanInfo::getModelCode, bo.getModelCode())
|
|
|
|
|
.in(StringUtils.isNotNull(bo.getPlanIds()), ProdPlanInfo::getPlanId, bo.getPlanIds())
|
|
|
|
|
.orderByDesc(ProdPlanInfo::getCreateTime);
|
|
|
|
|
return lqw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|