package com.chinaztt.mes.production.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.plan.dto.ManufacturingOrderSnGenerateDTO;
|
import com.chinaztt.mes.plan.entity.MoStructureComponent;
|
import com.chinaztt.mes.production.dto.*;
|
import com.chinaztt.mes.production.entity.ProductInput;
|
import com.chinaztt.mes.production.entity.ProductMain;
|
import com.chinaztt.mes.production.entity.ProductOutput;
|
import com.chinaztt.mes.production.excel.ProductOutPutData;
|
import com.chinaztt.mes.technology.dto.StepDTO;
|
import com.chinaztt.mes.technology.entity.Step;
|
import com.chinaztt.mes.warehouse.dto.StockDTO;
|
import com.chinaztt.ztt.common.core.util.R;
|
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* 报工主表
|
*
|
* @author cxf
|
* @date 2020-11-17 10:12:27
|
*/
|
public interface ProductMainService extends IService<ProductMain> {
|
|
/**
|
* 根据id取消报工
|
*
|
* @param id
|
* @return
|
*/
|
boolean cancelProductMainById(Long id);
|
|
/**
|
* 新增产出
|
*
|
* @param productMainDTO
|
* @return
|
*/
|
Long saveProductOutput(ProductMainDTO productMainDTO);
|
|
/**
|
* 新增产出
|
*
|
* @param productMainDTO
|
* @return
|
*/
|
Long batchSaveProductOutput(ProductMainDTO productMainDTO);
|
|
/**
|
* 批量新增报工
|
*
|
* @param productMainDTO
|
* @return
|
*/
|
Boolean batchSaveProductMain(List<ProductMainDTO> productMainDTOList);
|
|
/**
|
* 批量更新报工
|
*
|
* @param productMainDTOList
|
* @return
|
*/
|
Boolean batchUpdateProductMain(List<ProductMainDTO> productMainDTOList);
|
|
/**
|
* 更新产出
|
*
|
* @param productMainDTO
|
* @return
|
*/
|
boolean updateProductOutput(ProductMainDTO productMainDTO);
|
|
/**
|
* 删除产出
|
*
|
* @param id
|
* @return
|
*/
|
boolean deleteProductOutputById(Long id);
|
|
/**
|
* 删除产出
|
*
|
* @param
|
* @return
|
*/
|
boolean deleteProductOutputByIds(List<Long> ids);
|
|
/**
|
* 新增投入
|
*
|
* @param productInputDTO
|
* @return
|
*/
|
Boolean saveProductInput(ProductInputDTO productInputDTO);
|
|
/**
|
* 更新投入
|
*
|
* @param productInput
|
* @return
|
*/
|
boolean updateProductInput(ProductInput productInput);
|
|
/**
|
* 删除投入
|
*
|
* @param id
|
* @return
|
*/
|
boolean deleteProductInputById(Long id);
|
|
/**
|
* 根据报工主表id获取投入产出明细
|
*
|
* @param id
|
* @return
|
*/
|
ProductMainDTO getProductMainById(Long id);
|
|
/**
|
* 分页查询生产进度
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage getProductionProgress(Page page, QueryWrapper<ProductOutputDTO> gen);
|
|
/**
|
* 更改状态
|
*
|
* @param id
|
* @param event
|
* @return
|
*/
|
R<Boolean> changeState(Long id, String event);
|
|
/**
|
* 根据产出id获取产出明细
|
*
|
* @param id
|
* @return
|
*/
|
List<ProductOutputDTO> getProductOutPutById(Long id);
|
|
/**
|
* 分页查询汇报产出
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage getOutputList(Page page, QueryWrapper<ProductOutputDTO> gen, ProductOutputDTO productOutputDTO);
|
|
/**
|
* 扫码查询汇报产出
|
*
|
* @param productOutputDTO
|
* @return
|
*/
|
List<ProductOutputDTO> getOutputListByScan(ProductOutputDTO productOutputDTO);
|
|
/**
|
* 根据工单id获取绑定的工序的工步
|
*
|
* @param id
|
* @return
|
*/
|
List<Step> getStep(Long id);
|
|
/**
|
* 根据工单id获取已经绑定的工步
|
*
|
* @param id
|
* @return
|
*/
|
List<StepDTO> getProductStep(Long id);
|
|
/**
|
* 根据工单id和sn号获取已经绑定的工步
|
*
|
* @param id
|
* @param sn
|
* @return
|
*/
|
List<StepDTO> getProductStepBySn(Long id,String sn);
|
|
/**
|
* 根据工步记录id,查询出工步记录的所有信息
|
*
|
* @param id
|
* @return
|
*/
|
ProductStepDTO getAllProductStep(Long id);
|
|
/**
|
* 新增或修改工步信息
|
*
|
* @param productStepDTO
|
* @return
|
*/
|
List<StepDTO> addOrUpdateStep(ProductStepDTO productStepDTO);
|
|
/**
|
* 根据工步记录id,查询出工步记录的所有信息
|
*
|
* @param id
|
* @return
|
*/
|
boolean deleteProductStep(Long id);
|
|
/**
|
* 工作站id获取报工产出
|
*
|
* @param page
|
* @param gen
|
* @param id
|
* @return
|
*/
|
IPage<List<ProductOutputDTO>> getProductOut(Page page, QueryWrapper<ProductOutputDTO> gen, Long id);
|
|
/**
|
* 更改状态
|
*
|
* @param ids
|
* @param event
|
* @return
|
*/
|
R<Boolean> changeProductOutPutState(List<Long> ids, String event);
|
|
/**
|
* @param workstationId
|
* @param opeartionTaskId
|
* @return
|
*/
|
ProductOutput getShiftedProductByWidAndOpId(Long workstationId, Long opeartionTaskId);
|
|
/**
|
* 获取报工单列表
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<ProductMainListDTO>> getList(Page page,QueryWrapper<ProductMainListDTO> gen);
|
|
/**
|
* 根据报工单id交班或取消
|
*
|
* @param id
|
* @param event
|
* @return
|
*/
|
R<Boolean> changeProductOutPutStateByMainId(Long id, String event);
|
|
/**
|
* 批量删除报工单
|
*
|
* @param ids
|
* @return
|
*/
|
Boolean batchCancelProductMain(List<Long> ids);
|
|
/**
|
* 批量修改报工单状态
|
*
|
* @param ids
|
* @param event
|
* @return
|
*/
|
Boolean batchChange(List<Long> ids, String event);
|
|
/**
|
* 获取报工页签装备或射频打印url
|
*
|
* @param id
|
* @param type 1 装备 2射频 3装备射频sn打印 4射频小页签打印
|
* @return
|
*/
|
String getPrintUrl(Integer type, Long id, String sn);
|
|
Map<Long, List<MoStructureComponent>> getComponentList(Long operationTaskId);
|
|
/**
|
* 根据工单id获取已经绑定的工步
|
*
|
* @param gen
|
* @return
|
*/
|
IPage<List<StepDTO>> getProductStep(Page page, QueryWrapper<ProductStepDTO> gen);
|
|
/**
|
* 判断投料是否足够
|
*
|
* @param productStepDTO
|
* @return
|
*/
|
Boolean judgeAddInput(ProductStepDTO productStepDTO);
|
|
/**
|
* 查询批量段长
|
*
|
* @param operationTaskId
|
* @return
|
*/
|
List<ManufacturingOrderSnGenerateDTO> getGenerateSN(Long operationTaskId);
|
|
/**
|
* 报工产出的导出
|
*
|
* @param operationTaskId
|
* @return
|
*/
|
List<ProductOutPutData> exportList(Long operationTaskId, Long workstationId);
|
|
/**
|
* 根据客户订单号查询productSn号码
|
*
|
* @param customerOrderNo
|
* @return
|
*/
|
List<String> getGenerateSnByCustomerOrderNo(String customerOrderNo);
|
|
/**
|
* 根据工单查找sn
|
* @param taskId
|
* @return
|
*/
|
String getSNByTaskId(Long taskId);
|
|
/**
|
* 获取当前产出批次号的产出记录条数
|
* @param outBatchNo
|
* @return
|
*/
|
long getOutputByBatchNo(String outBatchNo);
|
|
/**
|
* 多次批量标签打印
|
* @param ids
|
* @return
|
*/
|
Boolean batchLabelPrintTimes(List<Long> ids);
|
|
/**
|
* check批量标签打印
|
* @param ids
|
* @return
|
*/
|
Boolean checkBatchLabelPrint(List<Long> ids,Boolean isSubmit);
|
|
/**
|
* 批量标签打印
|
* @param ids
|
* @return
|
*/
|
List<ProductOutputLabelDTO> batchLabelPrint(List<Long> ids);
|
|
/**
|
* 批量标签打印密码校验
|
* @param password
|
* @param ids
|
* @return
|
*/
|
R checkLabelPrintPassword(String password,List<Long> ids,Boolean isSubmit);
|
|
/**
|
* 批量更新打印次数
|
* @param ids
|
* @return
|
*/
|
R updatePrintNum(List<Long> ids);
|
|
List<String> getPartNamesByOrderNo(String customerOrderNo);
|
|
List<String> getProductSnByCustomerNoAndPartName(String customerOrderNo, String partName);
|
|
/**
|
* 校验当前报工后是否会超出工单计划产量
|
* @param productMainDTOList
|
*/
|
R validateOverProduction(List<ProductMainDTO> productMainDTOList);
|
|
/**
|
* 校验零件是否为原材料
|
* @param partNoList
|
*/
|
R checkRawPart(List<String> partNoList);
|
|
/**
|
* 校验当前报工投料是否充足
|
*
|
* @param productMainDTOList
|
* @return
|
*/
|
R validateOverFeed(List<ProductMainDTO> productMainDTOList);
|
|
/**
|
* 将报工单状态更新为处理中
|
* @param ids
|
* @return
|
*/
|
R process(List<Long> ids);
|
|
/**
|
* 校验当前工单是否是最后一道工序工单
|
* @param id
|
* @return
|
*/
|
Boolean validateIsLastOperation(Long id);
|
|
/**
|
* 校验是否是交班后产出
|
* @param snList
|
* @return
|
*/
|
List<ProductOutput> validateChangeProductOut(List<ProductOutput> list);
|
|
|
/**
|
* 报工单状态重置为草稿
|
* @param ids
|
* @return
|
*/
|
Boolean resetState(List<Long> ids);
|
/**
|
* 获取工单下草稿状态报工产出
|
* @param id 工单id
|
* @return
|
*/
|
List<ProductOutputDTO> getDraftProductOut(Long id);
|
|
/**
|
* 根据SN号校验工步流程是否走完
|
* @param outBatchNo
|
* @return
|
*/
|
Boolean validateStepFinish(String outBatchNo);
|
|
/**
|
* 新增库存新增SN号校重
|
* @param stockDTO
|
* @return
|
*/
|
Boolean checkSn(StockDTO stockDTO);
|
|
}
|