/*
|
* 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.technology.service;
|
|
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.quality.dto.TestStandardDTO;
|
import com.chinaztt.mes.quality.entity.TestStandard;
|
import com.chinaztt.mes.technology.dto.DocTestStandardDTO;
|
import com.chinaztt.mes.technology.dto.DocumentDTO;
|
import com.chinaztt.mes.technology.dto.DocumentMaterialCostDTO;
|
import com.chinaztt.mes.technology.dto.JoinDocumentTestStandardDTO;
|
import com.chinaztt.mes.technology.entity.Document;
|
import com.chinaztt.mes.technology.entity.DocumentSamplingRule;
|
import com.chinaztt.mes.technology.entity.DocumentStandardParam;
|
import com.chinaztt.mes.technology.entity.JoinDocumentBomRouting;
|
import com.chinaztt.mes.technology.excel.DocumentTestStandardData;
|
import com.chinaztt.mes.technology.state.document.constant.DocumentStates;
|
import com.chinaztt.ztt.common.core.util.R;
|
import com.sun.org.apache.xpath.internal.operations.Bool;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.io.IOException;
|
import java.util.Collection;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* 工艺文件
|
*
|
* @author zhangxy
|
* @date 2021-05-07 09:45:58
|
*/
|
public interface DocumentService extends IService<Document> {
|
|
|
/**
|
* 查询DTO
|
*
|
* @param documentId
|
* @return
|
*/
|
DocumentDTO getDtoById(Long documentId);
|
|
/**
|
* 计算材料用量
|
*
|
* @param documentId
|
* @return
|
*/
|
R<Map<Long, Collection<DocumentMaterialCostDTO>>> calcMaterialCost(Long documentId);
|
|
|
/**
|
* 保存文件与BOM关系
|
*
|
* @param join
|
* @return
|
*/
|
R<Boolean> saveBom(JoinDocumentBomRouting join);
|
|
/**
|
* 保存检测标准
|
*
|
* @param joins
|
* @return
|
*/
|
R<Boolean> saveTestStandard(List<JoinDocumentTestStandardDTO> joins);
|
|
/**
|
* 删除检测标准
|
*
|
* @param join
|
* @return
|
*/
|
R<Boolean> deleteTestStandard(JoinDocumentTestStandardDTO join);
|
|
/**
|
* 删除文件与BOM关系
|
*
|
* @param join
|
* @return
|
*/
|
R deleteBom(JoinDocumentBomRouting join);
|
|
|
/**
|
* 导出
|
*
|
* @param documentId
|
* @param response
|
*/
|
void exportMaterialCost(Long documentId, HttpServletResponse response);
|
|
/**
|
* 工艺路线判断是否有子节点
|
*
|
* @param id
|
* @return
|
*/
|
R<Integer> routingChildCheck(Long id);
|
|
/**
|
* 根据OA流程ID更新工艺文件状态
|
*
|
* @param workflowId
|
* @param state
|
*/
|
void updateStateByOa(String workflowId, DocumentStates state);
|
|
/**
|
* 上传结构图文件
|
*
|
* @param file
|
* @param documentId
|
* @return
|
*/
|
R uploadJgt(List<MultipartFile> file, Long documentId);
|
|
/**
|
* 上传流程图文件
|
*
|
* @param file
|
* @param documentId
|
* @param lctRemark
|
* @return
|
*/
|
R uploadLct(MultipartFile file, Long documentId, String lctRemark);
|
|
|
/**
|
* 删除结构图
|
*
|
* @param jgtId
|
* @return
|
*/
|
R removeJgt(Long jgtId);
|
|
/**
|
* 删除流程图
|
*
|
* @param documentId
|
* @return
|
*/
|
R removeLct(Long documentId);
|
|
|
/**
|
* 获取文件
|
*
|
* @param fileName
|
* @param response
|
*/
|
void getFile(String fileName, HttpServletResponse response);
|
|
/**
|
* 复制工艺文件
|
*
|
* @param documentList
|
* @return
|
*/
|
R copyDocument(List<Document> documentList);
|
|
/**
|
* 新增工艺文件
|
*
|
* @param document
|
* @return
|
*/
|
R fullSave(Document document);
|
|
/**
|
* 修改工艺文件
|
*
|
* @param document
|
* @return
|
*/
|
R fullUpdate(Document document);
|
|
/**
|
* 通过id查询工艺文件(oa页面展示)
|
*
|
* @param id
|
* @return
|
*/
|
DocumentDTO getDocumentById(Long id);
|
|
/**
|
* 根据ID去更改状态
|
*
|
* @param id
|
* @param state
|
* @return
|
*/
|
// R updateStateById(Long id, DocumentStates state);
|
|
/**
|
* 修改工艺文件状态
|
*
|
* @param ids
|
* @param state
|
* @return
|
*/
|
boolean updateStateByIds(List<Long> ids, DocumentStates state);
|
|
/**
|
* 通过id查询工艺文件绑定的检测规则
|
*
|
* @param ew
|
* @param id
|
* @param page
|
* @return
|
*/
|
IPage<List<TestStandard>> getTestStand(Page page, QueryWrapper<TestStandardDTO> ew, Long id);
|
|
/**
|
* 数据同步到ifs
|
*
|
* @param id
|
* @return
|
*/
|
R ifsSync(Long id);
|
|
/**
|
* 工艺文件-工艺路线-工序-检测标准主从表新增
|
*
|
* @param docBomId 工艺文件与BOM关系表id
|
* @param routingOperationId 工艺工序id
|
* @param testStandardId 检测标准id
|
* @return
|
*/
|
boolean addDocTestStandard(Long docBomId, Long routingOperationId, Long testStandardId);
|
|
/**
|
* 工艺文件-工艺路线-工序-检测标准主表删除
|
*
|
* @param id 记录id
|
* @return
|
*/
|
boolean delDocTestStandardById(Long id);
|
|
/**
|
* 根据工艺文件-工艺路线-查询检测标准
|
*
|
* @param docBomId 工艺文件与BOM关系表id
|
* @param routingOperationId 工艺工序id
|
* @return
|
*/
|
R qryDocTestStandard(Long docBomId, Long routingOperationId);
|
|
/**
|
* 根据工艺文件-工艺路线-工序-检测标准-根据检测参数id删除记录
|
*
|
* @param id 检测参数id
|
* @return
|
*/
|
R delDocTestStandardDetailById(Long id);
|
|
/**
|
* 根据工艺文件-工艺路线-工序-检测标准-检测参数明细更新
|
*
|
* @param documentStandardParamList
|
* @return
|
*/
|
R updDocTestStandardDetails(List<DocumentStandardParam> documentStandardParamList);
|
|
/**
|
* 根据工艺文件-工艺路线-工序-检测标准id查询检测参数明细
|
*
|
* @param standardId 检测标准id
|
* @return
|
*/
|
R qryDocTestStandardDetailsByStandardId(Long standardId);
|
|
/**
|
* 根据ids 删除
|
*
|
* @param ids
|
* @return
|
*/
|
boolean batchDel(List<Long> ids);
|
|
/**
|
* 更改检测标准绑定为true
|
*
|
* @param docBomId
|
* @return
|
*/
|
Document changeTestStandard(Long docBomId);
|
|
|
/**
|
* 更新工艺文件更新人和更新时间
|
*
|
* @param document
|
* @return document
|
*/
|
Document doUpdateRealUser(Document document);
|
|
Boolean addDocSamplingRule(Long docBomId, Long routingOperationId, Long samplingRuleId, DocumentSamplingRule documentSamplingRule, String applyType);
|
|
void export(HttpServletResponse response) throws IOException;
|
|
void importExcel(List<DocumentTestStandardData> list);
|
|
List<DocumentSamplingRule> qryDocSamplingRule(Long docBomId, Long routingOperationId);
|
}
|