Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.SubcontractState


    public void sendToSubcontractor(SubcontractedTaskData subcontractedTaskData)
            throws ValidationException, ConnectionProblemsException,
            UnrecoverableErrorServiceException {
        subcontractedTaskDataDAO.save(subcontractedTaskData);

        SubcontractState currentState = subcontractedTaskData.getState();

        if (currentState.equals(SubcontractState.PENDING_INITIAL_SEND)) {
            subcontractedTaskData.setState(SubcontractState.FAILED_SENT);
        } else if (currentState
                .equals(SubcontractState.PENDING_UPDATE_DELIVERING_DATE)) {
            subcontractedTaskData.setState(SubcontractState.FAILED_UPDATE);
        }

        if (!subcontractedTaskData.isSendable()) {
            throw new RuntimeException("Subcontracted task already sent");
        }

        if (!subcontractedTaskData.getExternalCompany()
                .getInteractsWithApplications()) {
            throw new RuntimeException(
                    "External company has not interaction fields filled");
        }

        makeSubcontractRequestRequest(subcontractedTaskData,currentState);

        Date today = new Date();
        if ((currentState.equals(SubcontractState.PENDING_INITIAL_SEND))
                || (currentState.equals(SubcontractState.FAILED_SENT))) {
            subcontractedTaskData.setSubcontractCommunicationDate(today);
        }

        //update the first required deliver date
        subcontractedTaskData.updateFirstRequiredDeliverDate(today);
View Full Code Here


    }

    @Override
    @Transactional(readOnly = true)
    public String exportXML(SubcontractedTaskData subcontractedTaskData) {
        SubcontractState currentState = subcontractedTaskData.getState();
        if ((currentState.equals(SubcontractState.PENDING_INITIAL_SEND) || (currentState
                .equals(SubcontractState.FAILED_SENT)))) {
            return exportXML_CreateSubcontractor(subcontractedTaskData);
        } else {
            return exportXML_UpdateSubcontractor(subcontractedTaskData);
        }
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.SubcontractState

Copyright © 2018 www.massapicom. 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.