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 { /** * 根据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 productMainDTOList); /** * 批量更新报工 * * @param productMainDTOList * @return */ Boolean batchUpdateProductMain(List productMainDTOList); /** * 更新产出 * * @param productMainDTO * @return */ boolean updateProductOutput(ProductMainDTO productMainDTO); /** * 删除产出 * * @param id * @return */ boolean deleteProductOutputById(Long id); /** * 删除产出 * * @param * @return */ boolean deleteProductOutputByIds(List 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 gen); /** * 更改状态 * * @param id * @param event * @return */ R changeState(Long id, String event); /** * 根据产出id获取产出明细 * * @param id * @return */ List getProductOutPutById(Long id); /** * 分页查询汇报产出 * * @param page * @param gen * @return */ IPage getOutputList(Page page, QueryWrapper gen, ProductOutputDTO productOutputDTO); /** * 扫码查询汇报产出 * * @param productOutputDTO * @return */ List getOutputListByScan(ProductOutputDTO productOutputDTO); /** * 根据工单id获取绑定的工序的工步 * * @param id * @return */ List getStep(Long id); /** * 根据工单id获取已经绑定的工步 * * @param id * @return */ List getProductStep(Long id); /** * 根据工单id和sn号获取已经绑定的工步 * * @param id * @param sn * @return */ List getProductStepBySn(Long id,String sn); /** * 根据工步记录id,查询出工步记录的所有信息 * * @param id * @return */ ProductStepDTO getAllProductStep(Long id); /** * 新增或修改工步信息 * * @param productStepDTO * @return */ List addOrUpdateStep(ProductStepDTO productStepDTO); /** * 根据工步记录id,查询出工步记录的所有信息 * * @param id * @return */ boolean deleteProductStep(Long id); /** * 工作站id获取报工产出 * * @param page * @param gen * @param id * @return */ IPage> getProductOut(Page page, QueryWrapper gen, Long id); /** * 更改状态 * * @param ids * @param event * @return */ R changeProductOutPutState(List ids, String event); /** * @param workstationId * @param opeartionTaskId * @return */ ProductOutput getShiftedProductByWidAndOpId(Long workstationId, Long opeartionTaskId); /** * 获取报工单列表 * * @param page * @param gen * @return */ IPage> getList(Page page,QueryWrapper gen); /** * 根据报工单id交班或取消 * * @param id * @param event * @return */ R changeProductOutPutStateByMainId(Long id, String event); /** * 批量删除报工单 * * @param ids * @return */ Boolean batchCancelProductMain(List ids); /** * 批量修改报工单状态 * * @param ids * @param event * @return */ Boolean batchChange(List ids, String event); /** * 获取报工页签装备或射频打印url * * @param id * @param type 1 装备 2射频 3装备射频sn打印 4射频小页签打印 * @return */ String getPrintUrl(Integer type, Long id, String sn); Map> getComponentList(Long operationTaskId); /** * 根据工单id获取已经绑定的工步 * * @param gen * @return */ IPage> getProductStep(Page page, QueryWrapper gen); /** * 判断投料是否足够 * * @param productStepDTO * @return */ Boolean judgeAddInput(ProductStepDTO productStepDTO); /** * 查询批量段长 * * @param operationTaskId * @return */ List getGenerateSN(Long operationTaskId); /** * 报工产出的导出 * * @param operationTaskId * @return */ List exportList(Long operationTaskId, Long workstationId); /** * 根据客户订单号查询productSn号码 * * @param customerOrderNo * @return */ List getGenerateSnByCustomerOrderNo(String customerOrderNo); /** * 根据工单查找sn * @param taskId * @return */ String getSNByTaskId(Long taskId); /** * 获取当前产出批次号的产出记录条数 * @param outBatchNo * @return */ long getOutputByBatchNo(String outBatchNo); /** * 多次批量标签打印 * @param ids * @return */ Boolean batchLabelPrintTimes(List ids); /** * check批量标签打印 * @param ids * @return */ Boolean checkBatchLabelPrint(List ids,Boolean isSubmit); /** * 批量标签打印 * @param ids * @return */ List batchLabelPrint(List ids); /** * 批量标签打印密码校验 * @param password * @param ids * @return */ R checkLabelPrintPassword(String password,List ids,Boolean isSubmit); /** * 批量更新打印次数 * @param ids * @return */ R updatePrintNum(List ids); List getPartNamesByOrderNo(String customerOrderNo); List getProductSnByCustomerNoAndPartName(String customerOrderNo, String partName); /** * 校验当前报工后是否会超出工单计划产量 * @param productMainDTOList */ R validateOverProduction(List productMainDTOList); /** * 校验零件是否为原材料 * @param partNoList */ R checkRawPart(List partNoList); /** * 校验当前报工投料是否充足 * * @param productMainDTOList * @return */ R validateOverFeed(List productMainDTOList); /** * 将报工单状态更新为处理中 * @param ids * @return */ R process(List ids); /** * 校验当前工单是否是最后一道工序工单 * @param id * @return */ Boolean validateIsLastOperation(Long id); /** * 校验是否是交班后产出 * @param snList * @return */ List validateChangeProductOut(List list); /** * 报工单状态重置为草稿 * @param ids * @return */ Boolean resetState(List ids); /** * 获取工单下草稿状态报工产出 * @param id 工单id * @return */ List getDraftProductOut(Long id); /** * 根据SN号校验工步流程是否走完 * @param outBatchNo * @return */ Boolean validateStepFinish(String outBatchNo); /** * 新增库存新增SN号校重 * @param stockDTO * @return */ Boolean checkSn(StockDTO stockDTO); }