Examples of ExternalCompany


Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

        Date startDate = predicate.getStartDate();
        Date endDate = predicate.getFinishDate();
        List<org.libreplan.business.labels.entities.Label> labels = new ArrayList<org.libreplan.business.labels.entities.Label>();
        List<Criterion> criteria = new ArrayList<Criterion>();
        ExternalCompany customer = null;
        OrderStatusEnum state = null;

        for (FilterPair filterPair : (List<FilterPair>) predicate.getFilters()) {
            TaskGroupFilterEnum type = (TaskGroupFilterEnum) filterPair
                    .getType();
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

    private void makeSubcontractRequestRequest_UpdateDeliverDate(SubcontractedTaskData subcontractedTaskData)
    throws ConnectionProblemsException, UnrecoverableErrorServiceException {
        UpdateDeliveringDateDTO updateDeliveringDateDTO = SubcontractedTaskDataConverter
                .toUpdateDeliveringDateDTO(getCompanyCode(), subcontractedTaskData);
        ExternalCompany externalCompany = subcontractedTaskData
                .getExternalCompany();

        NaiveTrustProvider.setAlwaysTrust(true);

        try {
            WebClient client = WebClient.create(externalCompany.getAppURI());
            client.path("ws/rest/subcontracting/subcontract/update");

            Util.addAuthorizationHeader(client,
                    externalCompany.getOurCompanyLogin(),
                    externalCompany.getOurCompanyPassword());

            InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = client
                    .post(updateDeliveringDateDTO,
                            InstanceConstraintViolationsListDTO.class);
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

    private void makeSubcontractRequestRequest_InitialSent(
            SubcontractedTaskData subcontractedTaskData)
            throws ConnectionProblemsException, UnrecoverableErrorServiceException {
        SubcontractedTaskDataDTO subcontractedTaskDataDTO = getSubcontractedTaskData(subcontractedTaskData);

        ExternalCompany externalCompany = subcontractedTaskData
                .getExternalCompany();

        NaiveTrustProvider.setAlwaysTrust(true);

        try {
            WebClient client = WebClient.create(externalCompany.getAppURI());

            client.path("ws/rest/subcontracting/subcontract/create");

            Util.addAuthorizationHeader(client, externalCompany
                    .getOurCompanyLogin(), externalCompany
                    .getOurCompanyPassword());

            InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = client
                    .post(subcontractedTaskDataDTO,
                            InstanceConstraintViolationsListDTO.class);
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

        return false;
    }

    private boolean acceptExternalCompany(FilterPair filter, TaskGroup taskGroup) {
        Order order = (Order) taskGroup.getOrderElement();
        ExternalCompany filterCustomer = (ExternalCompany) filter.getValue();
        if ((order.getCustomer() != null)
                && (order.getCustomer().getId().equals(filterCustomer.getId()))) {
            return true;
        }
        return false;
    }
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

    }

    @Transactional(readOnly = true)
    private ExternalCompany getFromDB(Long id) {
        try {
            ExternalCompany result = externalCompanyDAO.find(id);
            forceLoadEntities(result);
            return result;
        } catch (InstanceNotFoundException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

            throws UnrecoverableErrorServiceException,
            ConnectionProblemsException {
        orderDAO.save(order);

        OrderElementWithAdvanceMeasurementsOrEndDateListDTO orderElementWithAdvanceMeasurementsListDTO = getOrderElementWithAdvanceMeasurementsListDTO(order);
        ExternalCompany externalCompany = order.getCustomer();

        NaiveTrustProvider.setAlwaysTrust(true);

        WebClient client = WebClient.create(externalCompany.getAppURI());

        client.path("ws/rest/subcontracting/reportadvances");

        Util.addAuthorizationHeader(client, externalCompany
                .getOurCompanyLogin(), externalCompany.getOurCompanyPassword());

        try {
            InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = client
                    .post(orderElementWithAdvanceMeasurementsListDTO,
                            InstanceConstraintViolationsListDTO.class);
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

        externalCompany.getName();
    }

    @Override
    public boolean entryMatchesText(Object obj, String text) {
        final ExternalCompany externalCompany = (ExternalCompany) obj;
        text = text.toLowerCase();
        return (externalCompany.getNif().toLowerCase().contains(
                text.toLowerCase()) || externalCompany.getName().toLowerCase()
                .contains(text));
    }
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

        return subcontractModel.getSubcontractedTaskData();
    }

    public void setExternalCompany(Comboitem comboitem) {
        if (comboitem != null && comboitem.getValue() != null) {
            ExternalCompany externalCompany = (ExternalCompany) comboitem
                    .getValue();
            subcontractModel.setExternalCompany(externalCompany);
        } else {
            subcontractModel.setExternalCompany(null);
        }
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

        if ((updateDeliveringDateDTO.deliverDate) == null) {
            throw new ViolationError(updateDeliveringDateDTO.deliverDate.toString(),
                    "deliver date not specified");
        }

        final ExternalCompany externalCompany = adHocTransactionService
                .runOnTransaction(new IOnTransaction<ExternalCompany>() {
                    @Override
                    public ExternalCompany execute() {
                        return findExternalCompanyFor(updateDeliveringDateDTO.externalCompanyNif);
                    }
                });
        if (!externalCompany.isClient()) {
            throw new ViolationError(updateDeliveringDateDTO.externalCompanyNif,
                    "external company is not registered as client");
        }
        try {
            adHocTransactionService
View Full Code Here

Examples of org.libreplan.business.externalcompanies.entities.ExternalCompany

        if (StringUtils.isEmpty(subcontractedTask.externalCompanyNif)) {
            throw new ViolationError(subcontractedTask.subcontractedCode,
                    "external company ID not specified");
        }

        final ExternalCompany externalCompany = adHocTransactionService
                .runOnTransaction(new IOnTransaction<ExternalCompany>() {
                    @Override
                    public ExternalCompany execute() {
                        return findExternalCompanyFor(subcontractedTask);
                    }
                });
        if (!externalCompany.isClient()) {
            throw new ViolationError(subcontractedTask.externalCompanyNif,
                    "external company is not registered as client");
        }

        final OrderElementDTO orderElementDTO = subcontractedTask.orderElementDTO;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.