/*
|
* 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.service;
|
|
import com.alibaba.fastjson.JSONObject;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.chinaztt.mes.basic.entity.Template;
|
import com.chinaztt.mes.plan.dto.ManufacturingOrderDTO;
|
import com.chinaztt.mes.plan.dto.ManufacturingOrderOperationTemplateDTO;
|
import com.chinaztt.mes.production.dto.*;
|
import com.chinaztt.mes.production.entity.*;
|
import com.chinaztt.mes.production.vo.OperationTaskScreenVO;
|
import com.chinaztt.ztt.common.core.util.R;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
|
/**
|
* 工序任务
|
*
|
* @author zhangxy
|
* @date 2020-09-18 09:26:35
|
*/
|
public interface OperationTaskService extends IService<OperationTask> {
|
|
/**
|
* 分页查询
|
*
|
* @param page
|
* @param ew
|
* @return
|
*/
|
IPage<List<OperationTaskDTO>> getPage(Page page, QueryWrapper<OperationTaskDTO> ew);
|
|
/**
|
* 工作站id
|
*
|
* @param workstationId
|
* @return
|
*/
|
List<OperationTaskDTO> getOperationTask(Long workstationId, String productSn, String salesOrder,
|
String productName, String outBatchNo, String mpsNo);
|
|
/**
|
* 改变工单状态
|
*
|
* @param ids
|
* @param event
|
* @return
|
*/
|
boolean changeState(List<Long> ids, String event);
|
|
/**
|
* 改变后台工单状态
|
*
|
* @param id
|
* @param event
|
* @return
|
*/
|
boolean changeState(Long id, String event);
|
|
/**
|
* 根据id查询
|
*
|
* @param id
|
* @return
|
*/
|
OperationTaskDTO getOperation(Long id);
|
|
/**
|
* 关联保存
|
*
|
* @param operationTaskDTO
|
* @return
|
*/
|
String fullSave(OperationTaskDTO operationTaskDTO);
|
|
/**
|
* 批量保存
|
*
|
* @param operationTaskDTOList
|
* @return
|
*/
|
List<String> batchFullSave(List<OperationTaskDTO> operationTaskDTOList);
|
|
/**
|
* 关联修改
|
*
|
* @param operationTaskDTO
|
* @return
|
*/
|
String fullUpdate(OperationTaskDTO operationTaskDTO);
|
|
/**
|
* 关联删除
|
*
|
* @param id
|
* @return
|
*/
|
boolean fullDelete(Long id);
|
|
/**
|
* 通过id查询工单来源
|
*
|
* @param id
|
* @return
|
*/
|
List<ManufacturingOrderDTO> getOperationSupplyById(Long id);
|
|
/**
|
* 通过id查询工单所需物料
|
*
|
* @param gen
|
* @return
|
*/
|
List<OperationTaskMaterialDTO> getMaterial(QueryWrapper<OperationTaskMaterialDTO> gen);
|
|
/**
|
* PDA查询所有
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<OperationTaskDTO>> pdaPage(Page page, QueryWrapper<OperationTaskDTO> gen);
|
|
/**
|
* PDA查询工单所需物料
|
*
|
* @param gen
|
* @return
|
*/
|
List<JSONObject> pdaMaterial(QueryWrapper<OperationTaskMaterialDTO> gen);
|
|
/**
|
* 通过工序任务ID查询工单所需物料
|
*
|
* @param id
|
* @return
|
*/
|
List<OperationTaskMaterial> getOperationMaterialById(Long id);
|
|
/**
|
* 通过id查询工单所需物料
|
*
|
* @param id
|
* @return
|
*/
|
OperationTaskMaterial getOperationMaterialByMaterialId(Long id);
|
|
/**
|
* 新增工单所需物料
|
*
|
* @param operationTaskMaterial
|
* @return
|
*/
|
R addOperationMaterial(OperationTaskMaterial operationTaskMaterial);
|
|
/**
|
* 更新工单所需物料
|
*
|
* @param operationTaskMaterial
|
* @return
|
*/
|
R updateOperationMaterial(OperationTaskMaterial operationTaskMaterial);
|
|
/**
|
* 删除工单所需物料
|
*
|
* @param id
|
* @return
|
*/
|
R deleteOperationMaterial(Long id);
|
|
|
/**
|
* 通过id查询工单所关联的模板和参数
|
*
|
* @param id
|
* @return
|
*/
|
List<ManufacturingOrderOperationTemplateDTO> getTemplate(Long id);
|
|
/**
|
* 通过工序id、模板类型、所在页面查询工单所关联的模板(类型为生产记录可以修改)
|
*
|
* @param id
|
* @param page
|
* @param template
|
* @return
|
*/
|
IPage<List<Template>> getTemplateUpdate(Page page, Long id, Template template);
|
|
/**
|
* 通过模板类型查询工单所关联的模板
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<Template>> getTemplateByType(Page page, QueryWrapper<Template> gen);
|
|
/**
|
* 根据工单、当班记录、参数集模板,查询点巡检或原始记录的主表
|
*
|
* @param operationTaskRecordDTO
|
* @return
|
*/
|
List<OperationTaskRecordDTO> getTemplateRecord(OperationTaskRecordDTO operationTaskRecordDTO);
|
|
/**
|
* 修改工单模板对应的参数
|
*
|
* @param operationTaskParamList
|
* @return
|
*/
|
boolean updateTemplateParam(List<OperationTaskParam> operationTaskParamList);
|
|
/**
|
* 通过id查询工单是否完成
|
*
|
* @param id
|
* @return
|
*/
|
Object getOperationTaskById(Long id);
|
|
/**
|
* 根据点巡检或原始记录的主表id,查询具体的点巡检或原始记录的从表信息
|
*
|
* @param operationTaskParamDTO
|
* @return
|
*/
|
List<OperationTaskParamDTO> getTemplateParam(OperationTaskParamDTO operationTaskParamDTO);
|
|
/**
|
* 新增原始记录,点巡检的数据
|
*
|
* @param operationTaskRecordDTO
|
* @param file
|
* @return
|
*/
|
OperationTaskRecord addTemplateParam(OperationTaskRecordDTO operationTaskRecordDTO, List<MultipartFile> file);
|
|
/**
|
* @param operationTaskId 工单id
|
* @param dutyRecordId 班次id
|
* @param workstationId 工作台id
|
* @param productOutId 产出id
|
* @param operationTaskParamList 参数
|
* @param operationTemplateId
|
* @param id
|
* @param file
|
* @return
|
*/
|
OperationTaskRecord addTemplateParam(Long operationTaskId, Long dutyRecordId, Long workstationId, Long productOutId, String operationTaskParamList, Long operationTemplateId, Long id, List<MultipartFile> file);
|
|
/**
|
* @param templateRecordInputDTO
|
* @return
|
*/
|
List<OperationTaskRecord> batchAddTemplateRecord(TemplateRecordInputDTO templateRecordInputDTO);
|
|
/**
|
* @param templateRecordInputDTO
|
* @return
|
*/
|
Boolean batchUpdateTemplateRecord(TemplateRecordInputDTO templateRecordInputDTO);
|
|
/**
|
* 通过id删除点巡检或原始记录的主从表
|
*
|
* @param operationTaskRecordDTO
|
* @return
|
*/
|
Boolean deleteTemplateRecord(OperationTaskRecordDTO operationTaskRecordDTO);
|
|
/**
|
* 批量删除点巡检或原始记录的主从表
|
*
|
* @param idList
|
* @return
|
*/
|
Boolean deleteBatchTemplateRecord(List<Long> idList);
|
|
/**
|
* 上传文件
|
*
|
* @param file
|
* @param operationTaskRecordId
|
* @return
|
*/
|
R uploadFile(List<MultipartFile> file, Long operationTaskRecordId);
|
|
/**
|
* 删除文件
|
*
|
* @param operationTaskAttachment
|
* @return
|
*/
|
R<Boolean> deleteFile(OperationTaskAttachment operationTaskAttachment);
|
|
/**
|
* 获取文件
|
*
|
* @param bucket
|
* @param fileName
|
* @param response
|
* @return
|
*/
|
R getFile(String bucket, String fileName, HttpServletResponse response);
|
|
/**
|
* 合并工单
|
*
|
* @param ids 工单id
|
* @return
|
*/
|
R combineOperationTask(List<Long> ids);
|
|
/**
|
* 查询被合并工单信息
|
*
|
* @param id
|
* @return
|
*/
|
List<OperationTaskDTO> getCombinedOperationTaskInfo(Long id);
|
|
|
//*************************************************************************对接数据采集终端
|
|
/**
|
* 根据系统号查询设备所需信息
|
*
|
* @param productOutput 工单
|
* @return
|
*/
|
R getAllMessage(ProductOutputDTO productOutput);
|
|
|
/**
|
* 根据采集的检测信息新增检测汇报
|
*
|
* @param infosOfferDetectionTerminalDTO
|
* @return
|
*/
|
R saveReport(InfosOfferDetectionTerminalDTO infosOfferDetectionTerminalDTO);
|
|
/**
|
* 获取检测汇报类型基础数据
|
*
|
* @return
|
*/
|
R getApplyReportType();
|
|
//*************************************************************************对接数据采集终端
|
|
/**
|
* 根据车间订单id 查询临时工单
|
*
|
* @param moId
|
* @return
|
*/
|
R getFromMoOptionByMoId(Long moId);
|
|
/**
|
* 根据工单id查询工单所需物料
|
*
|
* @param ids
|
*/
|
R addReserve(List<Long> ids);
|
|
/**
|
* 根据工单ids查询货盘运输任务
|
*
|
* @param ids id
|
* @return R
|
*/
|
R getPalletOptaskCode(List<Long> ids);
|
|
/**
|
* 根据工作站编号获取可见范围内的工单(在mes参数集中配置)&&线边仓库位
|
*
|
* @param workstationNo 工作站编号
|
* @return
|
*/
|
R getBasicInfoForPdaFeedByWorkstationNo(String workstationNo);
|
|
/**
|
* 根据货盘运输任务id 查询工单
|
*
|
* @param id 货盘运输任务id
|
* @return
|
*/
|
List<OperationTaskDTO> getByPalletTransId(Long id);
|
|
/**
|
* 批量更新工单优先级
|
*
|
* @param operationTaskList
|
* @return
|
*/
|
Boolean batchUpdatePriority(List<OperationTask> operationTaskList);
|
|
/**
|
* 判断该工单是否可以开始
|
*
|
* @param id
|
* @param workstationId
|
* @return
|
*/
|
Boolean checkIsStart(Long id, Long workstationId);
|
|
/**
|
* 判断该工单完成数量是否大于计划数量
|
*
|
* @param id
|
* @param event
|
* @return
|
*/
|
void checkStatus(Long id, String event);
|
|
|
List<OperationTaskScreenVO> getByCustomerOrderId(Long customerOrderId);
|
}
|