In electronic product manufacturing, quality control and production cost man-agement pose challenges for enterprises. First, key factors for production deci-sions are identified: component inspection, assembly, inspection of semi-finished and finished products, and handling defective goods at different stages. Next, dynamic programming and genetic algorithms optimise sampling inspection. A production decision model covers multiple processes and compo-nent combinations. The relationship between the inspection and the final product quality is explored, showing that different decision paths affect the total cost and defect rate. Real-time monitoring and a dynamic Bayesian network guide pro-duction strategy adjustments to boost efficiency and reduce defects. This study proposes adaptable inspection and disassembly strategies that reduce costs and optimise resource use across production scenarios.