/*
|
* Copyright (c) 2018-2025, ztt All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: ztt
|
*/
|
|
package com.chinaztt.mes.production.mapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.chinaztt.mes.basic.entity.Location;
|
import com.chinaztt.mes.production.dto.ApplyReportTypeDetailDTO;
|
import com.chinaztt.mes.production.dto.OperationTaskDTO;
|
import com.chinaztt.mes.production.entity.OperationTask;
|
import com.chinaztt.mes.production.vo.OperationTaskScreenVO;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
|
/**
|
* 工序任务
|
*
|
* @author zhangxy
|
* @date 2020-09-18 09:26:35
|
*/
|
@Mapper
|
public interface OperationTaskMapper extends BaseMapper<OperationTask> {
|
|
/**
|
* 查询机台工序任务,车间执行看板用
|
*
|
* @param workstationId
|
* @return
|
*/
|
List<OperationTaskDTO> getListByWorkstationId(Long workstationId);
|
|
/**
|
* 分页查询
|
*
|
* @param page
|
* @param ew
|
* @return
|
*/
|
IPage<List<OperationTaskDTO>> queryPage(Page page, @Param("ew") QueryWrapper<OperationTaskDTO> ew);
|
|
/**
|
* 查询工单任务
|
*
|
* @param gen
|
* @return
|
*/
|
List<OperationTaskDTO> getOperationTask(@Param("ew") QueryWrapper<OperationTaskDTO> gen,
|
@Param("stateLimit") Boolean stateLimit,
|
@Param("productSn") String productSn,
|
@Param("salesOrder") String salesOrder,
|
@Param("productName") String productName,
|
@Param("outBatchNo") String outBatchNo,
|
@Param("mpsNo") String mpsNo,
|
@Param("operationStockStatus") Boolean operationStockStatus);
|
|
/**
|
* 更新完成数量
|
*
|
* @param id
|
* @param diffQuantity
|
*/
|
void updateCompletedQuantity(@Param("id") Long id, @Param("diffQuantity") BigDecimal diffQuantity);
|
|
/**
|
* 根据id查询
|
*
|
* @param id
|
* @return
|
*/
|
OperationTaskDTO getOperationTaskDTO(Long id);
|
|
/**
|
* 关联删除
|
*
|
* @param id
|
* @return
|
*/
|
void deleteOperationById(Long id);
|
|
/**
|
* PDA查询所有
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<OperationTaskDTO>> pdaPage(Page page, @Param("ew") QueryWrapper<OperationTaskDTO> gen);
|
|
/**
|
* 查询当前工单同一个制造订单下的下一道工序的工单
|
*
|
* @param operationTaskId
|
* @return
|
*/
|
List<OperationTask> getLastOperationTask(Long operationTaskId);
|
|
/**
|
* @param ids
|
* @return
|
*/
|
List<OperationTaskDTO> selectByIds(@Param("ids") List<Long> ids);
|
|
/**
|
* @param id
|
* @return
|
*/
|
List<OperationTaskDTO> getCombinedOperationTaskInfo(Long id);
|
|
/**
|
* 获取检测汇报类型基础数据
|
*
|
* @return
|
*/
|
List<ApplyReportTypeDetailDTO> getApplyReportType();
|
|
/**
|
* 根据车间订单查询临时车间订单
|
*
|
* @param moId
|
* @return
|
*/
|
List<OperationTaskDTO> getFromMoOptionByMoId(Long moId);
|
|
/**
|
* 根据工单ids查询货盘运输任务
|
*
|
* @param ids
|
* @return
|
*/
|
List<String> getPalletOptaskCode(@Param("ids") List<Long> ids);
|
|
/**
|
* 根据工作站编号获取工作站对应的投料库位列表
|
*
|
* @param workstationNo 工作站编号
|
* @return
|
*/
|
List<Location> getFeedLocationListByWorkstationNo(@Param("workstationNo") String workstationNo);
|
|
/**
|
* 根据工作站编号获取工作站对的工单列表
|
*
|
* @param workstationNo
|
* @return
|
*/
|
List<OperationTask> getActiveOperationTaskListByWorkstationNo(@Param("workstationNo") String workstationNo);
|
|
/**
|
* 根据工作站编号获取没有直接指定工作站的工单列表
|
*
|
* @param workstationNo
|
* @return
|
*/
|
List<OperationTask> getActiveOperationTaskListUnPointWorkstationByWorkstationNo(@Param("workstationNo") String workstationNo);
|
|
/**
|
* 根据货盘运输任务id查询工单
|
*
|
* @param palletId
|
* @return
|
*/
|
List<OperationTaskDTO> getByPalletTransId(Long palletId);
|
|
/**
|
* 根据工单id查询信息
|
*
|
* @param id
|
* @return
|
*/
|
OperationTaskDTO getOperationInfoById(Long id);
|
|
/**
|
* @param id
|
*/
|
void updateNextPriority(Long id);
|
|
/**
|
* @param id
|
*/
|
void removeActualFinishDateById(Long id);
|
|
/**
|
* 根据产出批次号获取生产数量(包含交班产出)
|
*
|
* @param batchNo
|
* @return
|
*/
|
BigDecimal getProdOutQtyByBatchNo(@Param("batchNo") String batchNo);
|
|
/**
|
* 根据产出批次号获取工序id
|
*
|
* @param batchNo
|
* @return
|
*/
|
Long getOperationId(@Param("batchNo") String batchNo);
|
|
/**
|
* 根据工单id查找对应车间订单号
|
*
|
* @param operationTaskId
|
* @return
|
*/
|
String getTaskMoNo(@Param("id") Long operationTaskId);
|
|
/**
|
* 根据工单id查找对应车间订单下所有工单状态
|
*
|
* @param operationTaskId
|
* @return
|
*/
|
List<String> getAllTaskStateByTaskId(@Param("id") Long operationTaskId);
|
|
/**
|
* 根据工单id判断当前是否是最后一道工序工单
|
*
|
* @param id
|
* @return
|
*/
|
Boolean validateIsLastOperation(@Param("id") Long id);
|
|
/**
|
* @param operationTaskId
|
* @return
|
*/
|
Long getFirstOperationId(@Param("operationTaskId") Long operationTaskId);
|
|
/**
|
* @param operationTaskId
|
* @return
|
*/
|
Long getOperationIdByTaskId(@Param("operationTaskId") Long operationTaskId);
|
|
/**
|
* 查询根据客户订单id 查询工单
|
*
|
* @param customerOrderId
|
* @return
|
*/
|
List<OperationTaskScreenVO> getByCustomerOrderId(@Param("customerOrderId") Long customerOrderId);
|
}
|