factory-mgt
Rushdi Mohamed 1 year ago
parent d97b0e3f9f
commit 3b59638415

@ -24,7 +24,7 @@ import io.entgra.device.mgt.core.factory.mgt.common.dto.ProductionPlan;
public interface FactoryMgtDAO extends BaseRequestDAO<ProductionPlan> { public interface FactoryMgtDAO extends BaseRequestDAO<ProductionPlan> {
boolean addProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException, FactoryMgtDAOException; void addProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException, FactoryMgtDAOException;
boolean updateProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException, FactoryMgtDAOException; boolean updateProductionPlan(ProductionPlan productionPlan) throws FactoryMgtPluginException, FactoryMgtDAOException;

@ -38,7 +38,7 @@ public class FactoryMgtDAOImpl implements FactoryMgtDAO {
private static final Log log = LogFactory.getLog(FactoryMgtDAOImpl.class); private static final Log log = LogFactory.getLog(FactoryMgtDAOImpl.class);
@Override @Override
public boolean addProductionPlan(ProductionPlan productionPlan) throws FactoryMgtDAOException { public void addProductionPlan(ProductionPlan productionPlan) throws FactoryMgtDAOException {
String sql = "INSERT INTO PRODUCTION_PLAN (DATE, TIME, MACHINE_ID, PRODUCT_ID, TARGET) VALUES (?, ?, ?, ?, ?)"; String sql = "INSERT INTO PRODUCTION_PLAN (DATE, TIME, MACHINE_ID, PRODUCT_ID, TARGET) VALUES (?, ?, ?, ?, ?)";
try { try {
int paramIndex = 1; int paramIndex = 1;
@ -49,7 +49,7 @@ public class FactoryMgtDAOImpl implements FactoryMgtDAO {
stmt.setString(paramIndex++, productionPlan.getMachineId()); stmt.setString(paramIndex++, productionPlan.getMachineId());
stmt.setString(paramIndex++, productionPlan.getProductId()); stmt.setString(paramIndex++, productionPlan.getProductId());
stmt.setInt(paramIndex, productionPlan.getTarget()); stmt.setInt(paramIndex, productionPlan.getTarget());
return stmt.executeUpdate() > 0; stmt.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {

@ -108,4 +108,5 @@ public class FactoryMgtDAOUtil {
} }
return productionPlans; return productionPlans;
} }
} }

@ -15,6 +15,7 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package io.entgra.device.mgt.core.factory.mgt.core.util; package io.entgra.device.mgt.core.factory.mgt.core.util;
import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException; import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException;

@ -18,7 +18,6 @@
package io.entgra.device.mgt.core.factory.mgt.core; package io.entgra.device.mgt.core.factory.mgt.core;
import com.google.gson.Gson;
import io.entgra.device.mgt.core.factory.mgt.common.bean.PaginatedMeterRequestQuery; import io.entgra.device.mgt.core.factory.mgt.common.bean.PaginatedMeterRequestQuery;
import io.entgra.device.mgt.core.factory.mgt.common.dto.ProductionPlan; import io.entgra.device.mgt.core.factory.mgt.common.dto.ProductionPlan;
import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException; import io.entgra.device.mgt.core.factory.mgt.common.exception.FactoryMgtException;
@ -27,8 +26,8 @@ import io.entgra.device.mgt.core.factory.mgt.common.responses.BulkStatusResponse
import io.entgra.device.mgt.core.factory.mgt.common.spi.ProductionPlanService; import io.entgra.device.mgt.core.factory.mgt.common.spi.ProductionPlanService;
import io.entgra.device.mgt.core.factory.mgt.common.wrapper.ProductionPlanWrapper; import io.entgra.device.mgt.core.factory.mgt.common.wrapper.ProductionPlanWrapper;
import io.entgra.device.mgt.core.factory.mgt.core.mock.BaseFactoryMgtPluginTest; import io.entgra.device.mgt.core.factory.mgt.core.mock.BaseFactoryMgtPluginTest;
import io.entgra.device.mgt.core.factory.mgt.core.service.impl.ProductionPlanServiceImpl; import io.entgra.device.mgt.core.factory.mgt.core.service.impl.ProductionPlanServiceImpl;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.testng.Assert; import org.testng.Assert;

Loading…
Cancel
Save