Package com.mossle.party.domain

Examples of com.mossle.party.domain.PartyStruct


        for (Long userId : userIds) {
            PartyEntity user = partyEntityManager.findUnique(
                    "from PartyEntity where partyType.id=1 and reference=?",
                    Long.toString(userId));

            PartyStruct partyStruct = partyStructManager
                    .findUnique(
                            "from PartyStruct where partyStructType.id=2 and parentEntity=? and childEntity=?",
                            group, user);

            if (partyStruct == null) {
                partyStruct = new PartyStruct();
                partyStruct.setPartyStructType(partyStructTypeManager.get(2L));
                partyStruct.setChildEntity(group);
                partyStruct.setParentEntity(user);
                partyStructManager.save(partyStruct);
            }
        }

        messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
View Full Code Here


        for (Long userId : selectedItem) {
            PartyEntity user = partyEntityManager.findUnique(
                    "from PartyEntity where partyType.id=1 and reference=?",
                    Long.toString(userId));

            PartyStruct partyStruct = partyStructManager
                    .findUnique(
                            "from PartyStruct where partyStructType.id=2 and parentEntity=? and childEntity=?",
                            group, user);

            if (partyStruct != null) {
View Full Code Here

        List<PartyEntity> partyEntities = partyEntityManager.getAll();
        model.addAttribute("partyStructTypes", partyStructTypes);
        model.addAttribute("partyEntities", partyEntities);

        if (id != null) {
            PartyStruct partyStruct = partyStructManager.get(id);
            model.addAttribute("model", partyStruct);
        }

        return "party/party-struct-input";
    }
View Full Code Here

    public String save(@ModelAttribute PartyStruct partyStruct,
            @RequestParam("partyStructTypeId") Long partyStructTypeId,
            @RequestParam("parentEntityId") Long parentEntityId,
            @RequestParam("childEntityId") Long childEntityId,
            RedirectAttributes redirectAttributes) {
        PartyStruct dest = null;
        Long id = partyStruct.getId();

        if (id != null) {
            dest = partyStructManager.get(id);
            beanMapper.copy(partyStruct, dest);
        } else {
            dest = partyStruct;
        }

        dest.setPartyStructType(partyStructTypeManager.get(partyStructTypeId));
        dest.setParentEntity(partyEntityManager.get(parentEntityId));
        dest.setChildEntity(partyEntityManager.get(childEntityId));
        partyStructManager.save(dest);
        messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
                "保存成功");

        return "redirect:/party/party-struct-list.do";
View Full Code Here

                    childEntityRef);
            logger.debug("child : {}", child);

            PartyEntity parent = partyEntityManager.get(partyEntityId);

            PartyStruct dest = new PartyStruct();
            beanMapper.copy(partyStruct, dest);
            dest.setPartyStructType(partyStructTypeManager
                    .get(partyStructTypeId));
            dest.setParentEntity(parent);
            dest.setChildEntity(child);
            partyStructManager.save(dest);
        } else {
            // 组织
            PartyEntity child = null;

            if (childEntityId == null) {
                child = new PartyEntity();
                child.setName(childEntityName);
                child.setPartyType(partyType);
                partyEntityManager.save(child);
            } else {
                child = partyEntityManager.get(childEntityId);
            }

            logger.debug("child : {}", child);

            PartyEntity parent = partyEntityManager.get(partyEntityId);

            PartyStruct dest = new PartyStruct();
            beanMapper.copy(partyStruct, dest);
            dest.setPartyStructType(partyStructTypeManager
                    .get(partyStructTypeId));
            dest.setParentEntity(parent);
            dest.setChildEntity(child);
            partyStructManager.save(dest);
        }

        return "redirect:/party/org-list.do?partyStructTypeId="
                + partyStructTypeId + "&partyEntityId=" + partyEntityId;
View Full Code Here

    public String removeUser(
            @RequestParam("selectedItem") List<Long> selectedItem,
            @RequestParam("partyEntityId") Long partyEntityId,
            @RequestParam("partyStructTypeId") Long partyStructTypeId) {
        for (Long childId : selectedItem) {
            PartyStruct partyStruct = partyStructManager.get(childId);
            partyStructManager.remove(partyStruct);
        }

        // addActionMessage(messages.getMessage("core.success.delete", "删除成功"));
        return "redirect:/party/org-list.do?partyStructTypeId="
View Full Code Here

TOP

Related Classes of com.mossle.party.domain.PartyStruct

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.