List装form

List<MemberPrivilegeForm> formlist = new ArrayList<MemberPrivilegeForm>();
        int status = 0;//状态 0:正常 1:锁定
        List<MemberPrivilege> mplist = this.memberPrivilegeService.listObjectTwo(status, shop_id, startPage, endPageSize, orderby);

        for(MemberPrivilege mp:mplist){
            String name = "";
            String levelLimit = mp.getLevel_limit();// 适用会员等级   id1,id2…
            int id = Integer.parseInt(levelLimit);
            if(id==0){
                name="全部会员";
            }else{
                MemberLevel level = this.memberLevelService.getObject(id);
                if(level!=null){
                    name = level.getLevel_name();
                }
            }
            int memberPrivilegeId= mp.getMember_privilege_id();// 特权设置ID
            int shopId = mp.getShop_id();// 店铺ID
            String privilegeName = mp.getPrivilege_name();// 特权名称
            String startTime = mp.getStart_time();// 有效開始时间
            String endTime = mp.getEnd_time();// 有效结束时间
            int privilegeType = mp.getPrivilege_type();// 特权类型
            String privilegeValue = mp.getPrivilege_value();// 特权值
            String privilegeInfo = mp.getPrivilege_info();// 特权说明
            int statuss = mp.getStatus();// 状态

            MemberPrivilegeForm form = new MemberPrivilegeForm();

            form.setMemberPrivilegeId(memberPrivilegeId);
            form.setShopId(shopId);
            form.setPrivilegeName(privilegeName);
            form.setStartTime(startTime);
            form.setEndTime(endTime);
            form.setPrivilegeType(privilegeType);
            form.setPrivilegeValue(privilegeValue);
            form.setPrivilegeInfo(privilegeInfo);
            form.setStatuss(statuss);
            form.setName(name);
            formlist.add(form);
        }
posted @ 2017-07-30 12:09  yfceshi  阅读(123)  评论(0编辑  收藏  举报