package com.chinaztt.mes.service.impl; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.chinaztt.mes.basic.entity.*; import com.chinaztt.mes.basic.mapper.*; import com.chinaztt.mes.common.numgen.NumberGenerator; import com.chinaztt.mes.dto.ParamReveiveDTO; import com.chinaztt.mes.dto.ProductTreeDTO; import com.chinaztt.mes.dto.StructureDTO; import com.chinaztt.mes.mapper.PocMapper; import com.chinaztt.mes.plan.dto.CustomerOrderDTO; import com.chinaztt.mes.plan.dto.ManufacturingOrderDTO; import com.chinaztt.mes.plan.dto.MasterProductionScheduleTheoryQuantityDTO; import com.chinaztt.mes.plan.entity.Customer; import com.chinaztt.mes.plan.entity.CustomerOrder; import com.chinaztt.mes.plan.entity.JoinModelCustomer; import com.chinaztt.mes.plan.entity.MasterProductionSchedule; import com.chinaztt.mes.plan.mapper.*; import com.chinaztt.mes.plan.service.CustomerOrderService; import com.chinaztt.mes.plan.service.CustomerService; import com.chinaztt.mes.plan.service.ManufacturingOrderService; import com.chinaztt.mes.plan.state.orderstate.constant.CustomerOrderStateStringValues; import com.chinaztt.mes.production.dto.OperationTaskDTO; import com.chinaztt.mes.production.mapper.OperationTaskMapper; import com.chinaztt.mes.production.service.OperationTaskService; import com.chinaztt.mes.service.PocService; import com.chinaztt.mes.technology.dto.BomDTO; import com.chinaztt.mes.technology.dto.RoutingDTO; import com.chinaztt.mes.technology.dto.StructureTree; import com.chinaztt.mes.technology.entity.*; import com.chinaztt.mes.technology.mapper.*; import com.chinaztt.mes.technology.service.BomService; import com.chinaztt.mes.technology.service.DocumentService; import com.chinaztt.mes.technology.service.RoutingService; import com.chinaztt.mes.technology.state.bom.constant.BomStates; import com.chinaztt.mes.technology.state.document.constant.DocumentStateStringValues; import com.chinaztt.mes.technology.state.routing.constant.RoutingStates; import lombok.AllArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; /** * @author xucg * @date 2023-08-17 * @apiNote */ @Service @AllArgsConstructor @Transactional public class PocServiceImpl implements PocService { private BomMapper bomMapper; private BomService bomService; private BasicParamTemplateMapper basicParamTemplateMapper; private CustomerMapper customerMapper; private CustomerOrderMapper customerOrderMapper; private CustomerOrderService customerOrderService; private CustomerService customerService; private DocumentService documentService; private MasterProductionScheduleTheoryQuantityMapper masterProductionScheduleTheoryQuantityMapper; private MasterProductionScheduleMapper masterProductionScheduleMapper; private ManufacturingOrderService manufacturingOrderService; private OperationMapper operationMapper; private OperationTaskMapper operationTaskMapper; private OperationJoinTemplateMapper operationJoinTemplateMapper; private OperationTaskService operationTaskService; private PartMapper partMapper; private ParamMapper paramMapper; private PocMapper pocMapper; private ParamJoinTemplateMapper paramJoinTemplateMapper; private RoutingMapper routingMapper; private RoutingService routingService; private RoutingOperationMapper routingOperationMapper; private StructureMapper structureMapper; private StructureComponentMapper structureComponentMapper; private LocationMapper locationMapper; private NumberGenerator bomNumberGenerator; private NumberGenerator documentNumberGenerator; private NumberGenerator masterProductionScheduleNumberGenerator; private NumberGenerator routingNumberGenerator; private NumberGenerator