This article develops an integrated model in considering the situations of an imperfect process with imperfect maintenance and inspection time for the joint determination of both economic production quantity (EPQ) and preventive maintenance (PM). This imperfect process has a general deterioration distribution with increasing hazard rate. Even with periodic PM, such a production system cannot be recovered as good as new. This means that the system condition depends on how long it runs. Also, the PM level can be distinct due to the maintenance cost. For convenience, it is assumed the age of system is reduced in proportional to the PM level. Further, during a production cycle, we need an inspection to see if the process is in control. This inspection might demand a considerable amount of time. In this article, we take PM level and inspection time into consideration to optimise EPQ with two types of out-of-control states. To see how the method works, we use a Weibull shock model to show the optimal solutions for the least costs.