Package beans.contract.entity

Examples of beans.contract.entity.Contract


    Field[] f2 = new Field[]{new Field("client.id", dst.getId()), new Field("trash", trash)};
        List<Polis> polisL1 = findEntityList(Polis.class, f2);

        ArrayList<AuditDetails> target = new ArrayList<AuditDetails>();
        for (Polis polis2 : polisL2) {
            Contract contract = polis2.getContract();
            System.out.println("      CONTRACT id=" + contract.getId() + "  №" + contract.getIndex());
            Polis polis1 = null;
            for (int i = 0; i < polisL1.size(); i++) {
                if (polisL1.get(i).getContract().getId() == contract.getId()) {
                    polis1 = polisL1.get(i);
                    break;
                }
            }
            if (polis1 == null) {
View Full Code Here


     * @return список услуг договора
     */
    @Override
    public List<ServicePriceDetails> getServices() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        Contract entity = getExistentEntity();
       
        List list = findEntityList(ServicePrice.class, "contract", entity);
        List<ServicePriceDetails> res = new ArrayList<ServicePriceDetails>();
        Iterator i = list.iterator();
        while (i.hasNext()) {
View Full Code Here

            checkCommandAccessibility(COMMAND_MODIFY_OMI);
        } else {
            checkCommandAccessibility(COMMAND_MODIFY_CLINIC);
        }
        if (getId() != 0 && servicePrice.getId() != 0) {
            Contract entity = getExistentEntity();
            Service service = servicePrice.getService();
            Field[] fields = new FindEntity.Field[]{
                        new Field("polis.contract", entity),
                        new Field("service", service)
                    };
View Full Code Here

     * @throws EJBException в случае если обновление отвергнуто системой
     *          безопастности либо произошла ошибка     *
     */
    @Override
    public ModificationInfo setService(ServicePriceDetails details) throws ClipsServerException {
        Contract entity = getExistentEntity();

        AuditDoc<ServicePrice> auditDoc;
        ServicePrice servicePrice = null;
        if (details.id != 0) {
            servicePrice = findEntity(ServicePrice.class, details.id);
View Full Code Here

     * @throws generic.ClipsServerException
     */
    @Override
    public Set<Integer> getPacketTemplates() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        Contract entity = getExistentEntity();

        Iterator<ContractPacket> list = findEntityList(ContractPacket.class, "key.contract", entity.getId()).iterator();
        Set<Integer> res = new HashSet<Integer>();
        while (list.hasNext()) {
            ContractPacket templates = list.next();
            res.add(templates.getKey().getPacketTemplate());
        }
View Full Code Here

     * @param packets
     * @throws generic.ClipsServerException
     */
    @Override
    public ModificationInfo setPacketTemplates(Set<Integer> packets) throws ClipsServerException {
        Contract entity = getExistentEntity();
        if (entity.getType() == Contract.TYPE_OMI) {
            checkCommandAccessibility(COMMAND_MODIFY_OMI);
        } else {
            checkCommandAccessibility(COMMAND_MODIFY_CLINIC);
        }
        Set<Integer> backup = new HashSet<Integer>(packets);
        Set<Integer> old = getPacketTemplates();

        packets.removeAll(old);
        old.removeAll(backup);

        int eid = entity.getId();
        Iterator<Integer> addNew = packets.iterator();
        ArrayList<AuditDoc> auditDocList = new ArrayList<AuditDoc>();
        while (addNew.hasNext()) {
            //Проверка содержатся ли все услуги добавляемого пакета в договоре
            Integer packetTemplateID = addNew.next();
View Full Code Here

     * @throws ClipsServerException
     */
    @Override
    public ContractPolisChunk getPolisList(ContractPolisFilter filter) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        Contract entity = getExistentEntity();
       
        ArrayList<Field> fields = new ArrayList<Field>();
               
        Field f = new Field("contract", entity);
        fields.add(f);
View Full Code Here

        return chunk;
    }

    @Override
    public boolean isClientNotYetInContract(int clientID) throws ClipsServerException {
        Contract entity = getExistentEntity();
        Field f[] = {
                new Field("contract", entity),
                new Field("client.id", clientID),
                new Field("trash", false)
            };
View Full Code Here

     */
    @Override
    public ModificationInfo setPolis(PolisDetails details) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_WRITE_MEMBER);

        Contract entity = getExistentEntity();

        ArrayList<AuditDoc> auditDocList = new ArrayList<AuditDoc>();
        Polis polis = null;
        AuditDoc<Polis> auditDoc;
        Address a = new Address();
View Full Code Here

        return new ModificationInfo(persistAudit(auditDoc));
    }

    @Override
    public ModificationInfo copy() throws ClipsServerException {
        Contract contract = getExistentEntity();
        if (contract.getType() == Contract.TYPE_OMI) {
            checkCommandAccessibility(COMMAND_MODIFY_OMI);
        } else {
            checkCommandAccessibility(COMMAND_MODIFY_CLINIC);
        }
        try {
            ArrayList<AuditDoc> auditDocList = new ArrayList<AuditDoc>();
            AuditDoc<Contract> auditDoc = new AuditDoc<Contract>(null, getCollaborator());
            auditDocList.add(auditDoc);
            Contract newContract = (Contract) contract.clone();
            newContract.setBegin(null);
            newContract.setIndex(newContract.getIndex() + "(копия)");
            int id = saveEntity(newContract);
            auditDoc.check(newContract);

            copyServices(contract, newContract, auditDocList);
            copyPackets(contract, newContract, auditDocList);
View Full Code Here

TOP

Related Classes of beans.contract.entity.Contract

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.