Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
万
万科
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
万科
Commits
6e929801
Commit
6e929801
authored
Nov 29, 2015
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交公告。
parent
2d300a22
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
126 additions
and
136 deletions
+126
-136
VankeBaseAPI.h
vanke/controller/VankeBaseAPI.h
+11
-0
VankeBaseAPI.m
vanke/controller/VankeBaseAPI.m
+11
-0
VankeNoticeListAPI.h
vanke/controller/VankeNoticeListAPI.h
+33
-14
VankeNoticeListAPI.m
vanke/controller/VankeNoticeListAPI.m
+42
-41
VankeSettlementListAPI.h
vanke/controller/VankeSettlementListAPI.h
+0
-10
VankeSettlementListAPI.m
vanke/controller/VankeSettlementListAPI.m
+0
-12
VankeUserLoginAPI.m
vanke/controller/VankeUserLoginAPI.m
+1
-1
VankeNoticeListModel.h
vanke/model/VankeNoticeListModel.h
+2
-5
VankeNoticeListModel.m
vanke/model/VankeNoticeListModel.m
+10
-38
VankeNoticeListBoardCell_iPhone.m
...iPhone/templates/notice/VankeNoticeListBoardCell_iPhone.m
+9
-6
VankeNoticeListBoard_iPhone.m
...iew_iPhone/templates/notice/VankeNoticeListBoard_iPhone.m
+6
-8
VankeNoticeListBoard_iPhone.xml
...w_iPhone/templates/notice/VankeNoticeListBoard_iPhone.xml
+1
-1
No files found.
vanke/controller/VankeBaseAPI.h
View file @
6e929801
...
...
@@ -24,3 +24,14 @@
-
(
void
)
setClientError
:
(
NSString
*
)
error
;
@end
// 分页信息
@interface
Paging
:
BeeActiveObject
@property
(
nonatomic
,
strong
)
NSNumber
*
page
;
@property
(
nonatomic
,
strong
)
NSNumber
*
pageSize
;
@property
(
nonatomic
,
strong
)
NSNumber
*
pageCount
;
@property
(
nonatomic
,
strong
)
NSNumber
*
recordCount
;
@end
vanke/controller/VankeBaseAPI.m
View file @
6e929801
...
...
@@ -64,3 +64,14 @@
}
@end
#pragma Paging
@implementation
Paging
@synthesize
page
=
_page
;
@synthesize
pageSize
=
_pageSize
;
@synthesize
pageCount
=
_pageCount
;
@synthesize
recordCount
=
_recordCount
;
@end
vanke/controller/VankeNoticeListAPI.h
View file @
6e929801
...
...
@@ -15,12 +15,14 @@
/*
* 查询项目列表
*
http://.../wanke-server/rest/project/queryprojectsby?classificationEquals={classificationEquals}&nameLike={nameLike}&salesDateEquals={salesDateEquals}& passengerDateEquals={passengerDateEquals}&trafficDateEquals={trafficDateEquals
}
*
http://.../wanke-server/rest/affiche/download/{user_uuid}?read={read}&page_number={pageNumber}&page_size={pageSize
}
*/
@interface
VankeNoticeListAPI
:
VankeBaseAPI
// 发布日期大于等于
@property
(
nonatomic
,
strong
)
NSString
*
publishTimeBegin
;
// 是否已读
@property
(
nonatomic
,
assign
)
BOOL
read
;
@property
(
nonatomic
,
assign
)
NSUInteger
pageNumber
;
@property
(
nonatomic
,
assign
)
NSUInteger
pageSize
;
@end
...
...
@@ -28,30 +30,47 @@
@interface
Notice
:
BeeActiveObject
// 标识
@property
(
nonatomic
,
strong
)
NSString
*
noticeId
;
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
// 版本
@property
(
nonatomic
,
strong
)
NSNumber
*
version
;
// 发布时间
@property
(
nonatomic
,
strong
)
NSString
*
create_time
;
// 发布人
@property
(
nonatomic
,
strong
)
NSString
*
create_id
;
// 发布人
@property
(
nonatomic
,
strong
)
NSString
*
create_operName
;
@property
(
nonatomic
,
strong
)
NSString
*
lastModify_time
;
@property
(
nonatomic
,
strong
)
NSString
*
lastModify_id
;
@property
(
nonatomic
,
strong
)
NSString
*
lastModify_operName
;
@property
(
nonatomic
,
strong
)
NSString
*
enterprise
;
// 标题
@property
(
nonatomic
,
strong
)
NSString
*
title
;
// 发布人
@property
(
nonatomic
,
strong
)
NSString
*
publisher
;
// 发布时间
@property
(
nonatomic
,
strong
)
NSString
*
publishTime
;
// 优先级
@property
(
nonatomic
,
strong
)
NSString
*
priority
;
// 内容
@property
(
nonatomic
,
strong
)
NSString
*
content
;
// 优先级
@property
(
nonatomic
,
strong
)
NSNumber
*
priority
;
// 状态
@property
(
nonatomic
,
strong
)
NSNumber
*
state
;
// 附件
@property
(
nonatomic
,
strong
)
NSString
*
attachment
;
// 是否已读
@property
(
nonatomic
,
assign
)
BOOL
readed
;
-
(
NSString
*
)
getAttachmentUrl
;
@end
// 返回数据
@interface
NoticeListResponseData
:
BeeActiveObject
@property
(
nonatomic
,
strong
)
Paging
*
paging
;
@property
(
nonatomic
,
strong
)
NSArray
*
records
;
//Notice
@end
// 请求响应
@interface
NoticeListResponse
:
VankeResponse
@property
(
nonatomic
,
strong
)
N
SArray
*
data
;
@property
(
nonatomic
,
strong
)
N
oticeListResponseData
*
data
;
-
(
int
)
total
;
-
(
NSInteger
)
total
;
@end
\ No newline at end of file
vanke/controller/VankeNoticeListAPI.m
View file @
6e929801
...
...
@@ -9,10 +9,13 @@
#import "VankeNoticeListAPI.h"
#import "VankeConfig.h"
#import "VankeUtil.h"
#import "VankeCommonModel.h"
@implementation
VankeNoticeListAPI
@synthesize
publishTimeBegin
;
@synthesize
read
;
@synthesize
pageNumber
;
@synthesize
pageSize
;
-
(
void
)
route
:(
BeeMessage
*
)
msg
{
if
(
self
.
sending
)
...
...
@@ -21,39 +24,20 @@
return
;
}
[
self
http_get
:
@"/project/queryprojectsby"
].
PARAM
(
@"publishTimeBegin"
,
self
.
publishTimeBegin
).
TIMEOUT
(
10
);
User
*
curUser
=
[[
VankeCommonModel
sharedInstance
]
currentUser
];
NSDictionary
*
dict
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:
self
.
read
?
@"true"
:
@"false"
,
@"read"
,
[
NSString
stringWithFormat
:
@"%lu"
,
self
.
pageNumber
],
@"page_number"
,
[
NSString
stringWithFormat
:
@"%lu"
,
self
.
pageSize
],
@"page_size"
,
nil
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"/affiche/download/%@"
,
curUser
.
code
];
[
self
http_post
:
url
].
BODY
(
dict
).
TIMEOUT
(
10
);
}
else
if
(
self
.
succeed
)
{
NSLog
(
@"response: %@"
,
self
.
responseString
);
// self.serverResp = [NoticeListResponse objectFromDictionary: self.responseJSONDictionary];
NoticeListResponse
*
resp
=
[[
NoticeListResponse
alloc
]
init
];
NSMutableArray
*
ary
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
10
];
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
Notice
*
obj
=
[[
Notice
alloc
]
init
];
obj
.
noticeId
=
[
NSString
stringWithFormat
:
@"%d"
,
i
];
obj
.
title
=
[
NSString
stringWithFormat
:
@"重要通知%d"
,
i
];
obj
.
publishTime
=
@"2015-11-15"
;
obj
.
publisher
=
@"张三"
;
if
(
i
%
3
==
0
)
{
obj
.
priority
=
@"低"
;
}
else
if
(
i
%
3
==
1
)
{
obj
.
priority
=
@"中"
;
}
else
if
(
i
%
3
==
2
)
{
obj
.
priority
=
@"高"
;
}
obj
.
content
=
@"销售录入对账单..."
;
obj
.
attachment
=
@"a.png"
;
[
ary
addObject
:
obj
];
}
resp
.
data
=
ary
;
self
.
serverResp
=
resp
;
self
.
serverResp
=
[
NoticeListResponse
objectFromDictionary
:
self
.
responseJSONDictionary
];
if
(
nil
==
self
.
serverResp
)
{
self
.
failed
=
YES
;
...
...
@@ -66,10 +50,11 @@
}
-
(
BOOL
)
checkToQuery
{
// if ([VankeUtil isBlankString:self.publishTimeBegin]) {
// [self setClientError: @"发布日期不能为空"];
// return NO;
// }
User
*
curUser
=
[[
VankeCommonModel
sharedInstance
]
currentUser
];
if
(
nil
==
curUser
)
{
[
self
setClientError
:
@"尚未登录"
];
return
NO
;
}
return
YES
;
}
...
...
@@ -80,12 +65,19 @@
@implementation
Notice
@synthesize
noticeId
;
@synthesize
uuid
;
@synthesize
version
;
@synthesize
create_time
;
@synthesize
create_id
;
@synthesize
create_operName
;
@synthesize
lastModify_id
;
@synthesize
lastModify_time
;
@synthesize
lastModify_operName
;
@synthesize
enterprise
;
@synthesize
title
;
@synthesize
publisher
;
@synthesize
publishTime
;
@synthesize
priority
;
@synthesize
content
;
@synthesize
priority
;
@synthesize
state
;
@synthesize
attachment
;
-
(
NSString
*
)
getAttachmentUrl
{
...
...
@@ -98,16 +90,25 @@
@end
#pragma NoticeListResponseData
@implementation
NoticeListResponseData
@synthesize
paging
;
@synthesize
records
;
CONVERT_PROPERTY_CLASS
(
records
,
Notice
)
@end
#pragma NoticeListResponse
@implementation
NoticeListResponse
@synthesize
data
;
CONVERT_PROPERTY_CLASS
(
data
,
Notice
)
-
(
int
)
total
{
return
nil
==
data
?
0
:[
data
count
];
-
(
NSInteger
)
total
{
return
nil
==
data
?
0
:
data
.
records
.
count
;
}
@end
vanke/controller/VankeSettlementListAPI.h
View file @
6e929801
...
...
@@ -39,16 +39,6 @@
@end
// 分页信息
@interface
Paging
:
BeeActiveObject
@property
(
nonatomic
,
strong
)
NSNumber
*
page
;
@property
(
nonatomic
,
strong
)
NSNumber
*
pageSize
;
@property
(
nonatomic
,
strong
)
NSNumber
*
pageCount
;
@property
(
nonatomic
,
strong
)
NSNumber
*
recordCount
;
@end
// 对账单科目
@interface
SubjectItem
:
BeeActiveObject
...
...
vanke/controller/VankeSettlementListAPI.m
View file @
6e929801
...
...
@@ -81,18 +81,6 @@
@end
#pragma Paging
@implementation
Paging
@synthesize
page
=
_page
;
@synthesize
pageSize
=
_pageSize
;
@synthesize
pageCount
=
_pageCount
;
@synthesize
recordCount
=
_recordCount
;
@end
#pragma SubjectItem
@implementation
SubjectItem
...
...
vanke/controller/VankeUserLoginAPI.m
View file @
6e929801
...
...
@@ -24,7 +24,7 @@
return
;
}
NSString
*
url
=
[
NSString
stringWithFormat
:
@"/user/login/%@"
,
self
.
userName
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"/
wanke/
user/login/%@"
,
self
.
userName
];
NSString
*
encryptPwd
=
[
VankeUtil
md5
:
self
.
password
];
NSDictionary
*
dict
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:
self
.
authenticode
,
@"authenticode"
,
...
...
vanke/model/VankeNoticeListModel.h
View file @
6e929801
...
...
@@ -10,13 +10,10 @@
@interface
VankeNoticeListModel
:
BeeStreamViewModel
// 发布时间大于
@property
(
nonatomic
,
strong
)
NSString
*
publishTimeBegin
;
// 是否已读
@property
(
nonatomic
,
assign
)
BOOL
read
ed
;
@property
(
nonatomic
,
assign
)
BOOL
read
;
// 公告列表
@property
(
nonatomic
,
strong
)
NS
Mutable
Array
*
notices
;
@property
(
nonatomic
,
strong
)
NSArray
*
notices
;
@end
vanke/model/VankeNoticeListModel.m
View file @
6e929801
...
...
@@ -14,9 +14,8 @@
@implementation
VankeNoticeListModel
@synthesize
publishTimeBegin
=
_publishTimeBegin
;
@synthesize
notices
=
_notices
;
@synthesize
read
ed
=
_reade
d
;
@synthesize
read
=
_rea
d
;
-
(
void
)
load
{
...
...
@@ -27,32 +26,9 @@
-
(
void
)
unload
{
self
.
publishTimeBegin
=
nil
;
self
.
notices
=
nil
;
}
#pragma mark - cache
-
(
void
)
loadCache
{
[
self
.
notices
removeAllObjects
];
[
self
.
notices
addUniqueObjectsFromArray
:[
Notice
readObjectForKey
:
self
.
publishTimeBegin
]
compare
:
^
NSComparisonResult
(
id
left
,
id
right
)
{
return
[((
Notice
*
)
left
).
noticeId
compare
:((
Notice
*
)
right
).
noticeId
];
}];
}
-
(
void
)
saveCache
{
[
Notice
saveObject
:
self
.
notices
forKey
:
self
.
publishTimeBegin
];
}
-
(
void
)
clearCache
{
[
self
.
notices
removeAllObjects
];
[
Notice
removeObjectForKey
:
self
.
publishTimeBegin
];
}
#pragma mark - paging query
-
(
void
)
firstPage
...
...
@@ -68,10 +44,6 @@
}
}
-
(
void
)
loadFromServer
{
}
-
(
void
)
gotoPage
:
(
NSUInteger
)
page
{
[
VankeNoticeListAPI
cancel
];
...
...
@@ -80,7 +52,9 @@
@weakify
(
api
);
@weakify
(
self
);
api
.
publishTimeBegin
=
self
.
publishTimeBegin
;
api
.
read
=
self
.
read
;
api
.
pageNumber
=
page
-
1
;
api
.
pageSize
=
PER_PAGE
;
api
.
whenUpdate
=
^
{
...
...
@@ -96,30 +70,28 @@
if
(
api
.
succeed
)
{
NoticeListResponse
*
resp
=
(
NoticeListResponse
*
)
api
.
serverResp
;
if
(
nil
==
resp
||
nil
==
resp
.
data
)
{
api
.
failed
=
YES
;
}
else
{
NSMutableArray
*
notices
=
(
NSMutableArray
*
)
self
.
notices
;
if
(
page
<=
1
)
{
[
self
.
notices
removeAllObjects
];
[
self
.
notices
addObjectsFromArray
:
resp
.
data
];
[
notices
removeAllObjects
];
[
notices
addObjectsFromArray
:
resp
.
data
.
records
];
}
else
{
[
self
.
notices
addObjectsFromArray
:
resp
.
data
];
[
self
.
notices
unique
:
^
NSComparisonResult
(
id
left
,
id
right
)
{
return
[((
Notice
*
)
left
).
noticeId
compare
:((
Notice
*
)
right
).
noticeI
d
];
[
notices
addObjectsFromArray
:
resp
.
data
.
records
];
[
notices
unique
:
^
NSComparisonResult
(
id
left
,
id
right
)
{
return
[((
Notice
*
)
left
).
uuid
compare
:((
Notice
*
)
right
).
uui
d
];
}];
}
self
.
more
=
(
self
.
notices
.
count
>=
[
resp
total
])
?
NO
:
YES
;
self
.
loaded
=
YES
;
[
self
saveCache
];
}
}
...
...
vanke/view_iPhone/templates/notice/VankeNoticeListBoardCell_iPhone.m
View file @
6e929801
...
...
@@ -30,19 +30,22 @@ DEF_OUTLET( BeeUILabel, lblPublishTime )
$
(
self
.
lblTitle
).
DATA
(
obj
.
title
);
[
self
setPriority
:
obj
.
priority
];
$
(
self
.
lblPublisher
).
DATA
([
NSString
stringWithFormat
:
@"发布人: %@"
,
obj
.
publisher
]);
$
(
self
.
lblPublishTime
).
DATA
([
NSString
stringWithFormat
:
@"发布时间: %@"
,
obj
.
publishTime
]);
$
(
self
.
lblPublisher
).
DATA
([
NSString
stringWithFormat
:
@"发布人: %@"
,
obj
.
create_operName
]);
$
(
self
.
lblPublishTime
).
DATA
([
NSString
stringWithFormat
:
@"发布时间: %@"
,
obj
.
create_time
]);
}
-
(
void
)
setPriority
:
(
NS
String
*
)
priority
{
-
(
void
)
setPriority
:
(
NS
Number
*
)
priority
{
$
(
self
.
imgPriority
).
REMOVE_CLASS
(
@"low"
);
$
(
self
.
imgPriority
).
REMOVE_CLASS
(
@"medium"
);
$
(
self
.
imgPriority
).
REMOVE_CLASS
(
@"high"
);
if
([
priority
eq
:
@"低"
])
{
int
v
=
[
priority
intValue
];
if
(
v
==
0
)
{
$
(
self
.
imgPriority
).
ADD_CLASS
(
@"low"
);
}
else
if
(
[
priority
eq
:
@"中"
]
)
{
}
else
if
(
v
==
1
)
{
$
(
self
.
imgPriority
).
ADD_CLASS
(
@"medium"
);
}
else
if
(
[
priority
eq
:
@"高"
]
)
{
}
else
if
(
v
==
2
)
{
$
(
self
.
imgPriority
).
ADD_CLASS
(
@"high"
);
}
$
(
self
.
lblPriority
).
DATA
(
priority
);
...
...
vanke/view_iPhone/templates/notice/VankeNoticeListBoard_iPhone.m
View file @
6e929801
...
...
@@ -66,11 +66,11 @@ ON_CREATE_VIEWS( signal )
[
self
.
segment
addTitle
:
@"未读"
tag
:
SEGMENT_UNREAD
];
[
self
.
segment
addTitle
:
@"已读"
tag
:
SEGMENT_READED
];
self
.
segment
.
tintColor
=
[
UIColor
whiteColor
];
NSDictionary
*
dic
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:[
UIColor
blackColor
],
NSForegroundColorAttributeName
,
nil
];
[
self
.
segment
setTitleTextAttributes
:
dic
forState
:
UIControlStateSelected
];
NSDictionary
*
dic2
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:[
UIColor
blackColor
],
NSForegroundColorAttributeName
,
nil
];
[
self
.
segment
setTitleTextAttributes
:
dic2
forState
:
UIControlStateNormal
];
//
self.segment.tintColor = [UIColor whiteColor];
//
NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor],NSForegroundColorAttributeName, nil];
//
[self.segment setTitleTextAttributes:dic forState:UIControlStateSelected];
//
NSDictionary *dic2 = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor],NSForegroundColorAttributeName, nil];
//
[self.segment setTitleTextAttributes:dic2 forState:UIControlStateNormal];
self
.
segment
.
selectedTag
=
SEGMENT_UNREAD
;
self
.
list
.
headerClass
=
[
PullLoader
class
];
...
...
@@ -127,8 +127,6 @@ ON_CREATE_VIEWS( signal )
{
[
self
.
model
nextPage
];
};
self
.
model
.
publishTimeBegin
=
@""
;
}
ON_DELETE_VIEWS
(
signal
)
...
...
@@ -184,7 +182,7 @@ ON_SIGNAL3( BeeUINavigationBar, RIGHT_TOUCHED, signal )
ON_SIGNAL3
(
VankeNoticeListBoard_iPhone
,
segment
,
signal
)
{
NSLog
(
@"Seg.selectedSegmentTag:%d"
,
self
.
segment
.
selectedTag
);
_model
.
read
ed
=
(
_segment
.
selectedTag
==
1
);
_model
.
read
=
(
_segment
.
selectedTag
==
1
);
[
_model
firstPage
];
}
...
...
vanke/view_iPhone/templates/notice/VankeNoticeListBoard_iPhone.xml
View file @
6e929801
...
...
@@ -8,7 +8,7 @@
<linear
orientation=
"v"
class=
"segment-wrapper"
>
<image
class=
"bg"
/>
<segment
id=
"segment"
/>
<
/linear
/
>
</linear>
</linear>
<style
type=
"text/css"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment