InventoryViewController.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. //
  2. // InventoryViewController.m
  3. // IBOSS
  4. //
  5. // Created by apple on 2017/5/15.
  6. // Copyright © 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:库存明细表控制器
  9. //
  10. #import "InventoryViewController.h"
  11. #import "InventoryDetailViewController.h"
  12. #import "InventoryCell.h"
  13. #import "InventorySearchModel.h"
  14. @interface InventoryViewController ()<UITableViewDataSource, UITableViewDelegate,RefreshTableViewDelegate>{
  15. NSMutableDictionary *_cellHeight;
  16. // 页码
  17. int _pageNumber;
  18. }
  19. @end
  20. @implementation InventoryViewController
  21. @synthesize customTableView;
  22. #pragma mark - 公共函数
  23. /**
  24. viewDidLoad函数
  25. */
  26. - (void)viewDidLoad {
  27. [super viewDidLoad];
  28. [self initUI];
  29. _ceaseFlag=@"";
  30. _settingValues=@"0";
  31. [self loadNavStyle];
  32. [self getSystemSettingsValue];
  33. [self initSlideSlip];
  34. UIView *noDataView = [self noDataViewByFrame:customTableView.mTableView.bounds];
  35. customTableView.mTableView.backgroundView =noDataView;
  36. //[self startLoading];
  37. //[self reloadData];
  38. }
  39. /**
  40. 安全区视图发生变化
  41. */
  42. -(void)viewSafeAreaInsetsDidChange{
  43. [self.view setBackgroundColor:[UIColor whiteColor]];
  44. customTableView.frame = self.view.safeAreaLayoutGuide.layoutFrame;
  45. [super viewSafeAreaInsetsDidChange];
  46. }
  47. /**
  48. didReceiveMemoryWarning函数
  49. */
  50. - (void)didReceiveMemoryWarning {
  51. [super didReceiveMemoryWarning];
  52. }
  53. #pragma mark - 委托回调函数
  54. /**
  55. 单元格cell个数
  56. @param tableView <#tableView description#>
  57. @param section <#section description#>
  58. @return <#return value description#>
  59. */
  60. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  61. {
  62. return [self.arrNewdataList count];
  63. }
  64. /**
  65. <#Description#>
  66. @param tableView <#tableView description#>
  67. @return <#return value description#>
  68. */
  69. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  70. return 1;
  71. }
  72. /**
  73. 高度
  74. @param tableView <#tableView description#>
  75. @param indexPath <#indexPath description#>
  76. @return <#return value description#>
  77. */
  78. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  79. return [_cellHeight[@(indexPath.row)] floatValue];
  80. }
  81. /**
  82. 预防高度
  83. @param tableView <#tableView description#>
  84. @param indexPath <#indexPath description#>
  85. @return <#return value description#>
  86. */
  87. -(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
  88. return 250;
  89. }
  90. /**
  91. 每个单元格cell
  92. @param tableView <#tableView description#>
  93. @param indexPath <#indexPath description#>
  94. @return <#return value description#>
  95. */
  96. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  97. {
  98. static NSString *cellIdentifier = @"InventoryCell";
  99. InventoryCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
  100. if (!cell) {
  101. cell = [[InventoryCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
  102. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  103. }
  104. else
  105. //当页面拉动的时候 当cell存在并且最后一个存在 把它进行删除就出来一个独特的cell我们在进行数据配置即可避免
  106. {
  107. while ([cell.contentView.subviews lastObject] != nil) {
  108. [(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
  109. }
  110. }
  111. _infoModel = [_arrNewdataList objectAtIndex:indexPath.row];
  112. cell.model = _infoModel;
  113. _cellHeight[@(indexPath.row)] = @(cell.cellHeight);
  114. // 强制布局 xib时调用
  115. //[cell layoutIfNeeded];
  116. return cell;
  117. }
  118. /**
  119. 点击单元格事件
  120. @param tableView <#tableView description#>
  121. @param indexPath <#indexPath description#>
  122. */
  123. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  124. {
  125. self.hidesBottomBarWhenPushed=YES;
  126. InventoryDetailViewController *detailVc = [[InventoryDetailViewController alloc] init];
  127. _infoModel= [_arrNewdataList objectAtIndex:indexPath.row];
  128. detailVc.inventoryId=_infoModel.inventoryId;
  129. detailVc.code = _infoModel.code;
  130. detailVc.onlyCode = _infoModel.onlyCode;
  131. detailVc.settingValues=_settingValues;
  132. detailVc.wareHouseName = _infoModel.wareHouseName;
  133. detailVc.specification = _infoModel.specification;
  134. detailVc.brandName = _infoModel.brandName;
  135. detailVc.goodName = _infoModel.goodName;
  136. detailVc.gradeName = _infoModel.gradeName;
  137. detailVc.colorNumber = _infoModel.colorNumber;
  138. detailVc.inventoryQuantity = _infoModel.inventoryQuantity;
  139. detailVc.canSaleQuantity = _infoModel.canSaleQuantity;
  140. detailVc.positionNumber = _infoModel.positionNumber;
  141. detailVc.occupyQuantity=_infoModel.occupyQuantity;
  142. detailVc.displayStandardPrice=_infoModel.displayStandardPrice;
  143. detailVc.displayInventoryQuantity=_infoModel.displayInventoryQuantityFlag;
  144. detailVc.displayCanSalesQuantity=_infoModel.displayCanSalesQuantityFlag;
  145. detailVc.price = _infoModel.price;
  146. detailVc.boxPieceFlag = _infoModel.boxPieceFlag;
  147. detailVc.box = _infoModel.box;
  148. detailVc.piece = _infoModel.piece;
  149. [self.navigationController pushViewController:detailVc animated:YES];
  150. }
  151. #pragma mark - scrollView回调
  152. /**
  153. 显示下拉更新
  154. @param scrollView <#scrollView description#>
  155. */
  156. - (void)scrollViewDidScroll:(UIScrollView *)scrollView{
  157. if (scrollView.isDragging) {//显示下拉更新
  158. if (customTableView.mRefreshHeader.state == PullRefreshPulling && scrollView.contentOffset.y > -65.0f && scrollView.contentOffset.y < 0.0f && [customTableView CanRefresh]) {
  159. [customTableView.mRefreshHeader setState:PullRefreshNormal];
  160. }
  161. else if (customTableView.mRefreshHeader.state == PullRefreshNormal && scrollView.contentOffset.y < -65.0f && [customTableView CanRefresh]) {//显示松开更新
  162. [customTableView.mRefreshHeader setState:PullRefreshPulling];
  163. }
  164. }
  165. }
  166. /**
  167. 刷新数据源
  168. */
  169. - (void)refreshTableView
  170. {
  171. [self.customTableView reloadData];
  172. }
  173. /**
  174. 加载列表数据失败回调
  175. @param sender <#sender description#>
  176. */
  177. - (void)onLoadFail:(ASIDownManager *)sender {
  178. [self cancel];
  179. [self showAlertViewText:@"网络异常"];
  180. }
  181. - (void)onSystemSettingLoadFinish:(ASIDownManager *)sender {
  182. [self cancel];
  183. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  184. // 服务器返回数据状态值
  185. int iStatus = resultModel.status;
  186. // 服务器返回数据状态值正确
  187. if (iStatus == 0) {
  188. NSArray * infoArr = (NSArray *)resultModel.result;
  189. if(infoArr != nil && infoArr.count>0)
  190. {
  191. NSDictionary *infoDic= infoArr[0];
  192. _settingValues = [infoDic objectForKey:@"SettingValues"];
  193. }
  194. }
  195. else
  196. {
  197. _settingValues=@"0";
  198. }
  199. }
  200. /**
  201. 加载列表数据失败回调
  202. @param sender <#sender description#>
  203. */
  204. - (void)onSystemSettingLoadFail:(ASIDownManager *)sender {
  205. _settingValues=@"0";
  206. [self cancel];
  207. [self showAlertViewText:@"网络异常"];
  208. }
  209. /**
  210. 加载列表数据成功回调
  211. @param sender <#sender description#>
  212. */
  213. - (void)onLoadFinish:(ASIDownManager *)sender {
  214. int iNewCount = 0;
  215. customTableView.mTableView.backgroundView = nil;
  216. // 取消进度条
  217. [self cancel];
  218. // 服务器返回数据
  219. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  220. // 服务器返回数据状态值
  221. int iStatus = resultModel.status;
  222. // 服务器返回数据消息
  223. NSString *message = resultModel.message;
  224. // 服务器返回数据状态值正确
  225. if (iStatus == 0) {
  226. NSArray * infoArr = (NSArray *)resultModel.result;
  227. if(infoArr != nil && infoArr.count>0)
  228. {
  229. if (_pageNumber == 1)
  230. {
  231. [self.arrDataList removeAllObjects];
  232. [self.arrNewdataList removeAllObjects];
  233. }
  234. [self.arrDataList addObjectsFromArray:infoArr];
  235. // 转换model对象
  236. if(infoArr.count > 0 ){
  237. for (int i = 0; i < infoArr.count; i++) {
  238. NSDictionary *str = infoArr[i];
  239. InventoryModel *model = [InventoryModel dk_modelWithDictionary:str];
  240. model.settingValues=_settingValues;
  241. if(model.price==nil||[model.price isEqualToString:@""])
  242. {
  243. model.displayStandardPrice=NO;
  244. }
  245. else
  246. {
  247. model.displayStandardPrice=YES;
  248. }
  249. if(model.inventoryQuantity==nil||[model.inventoryQuantity isEqualToString:@""])
  250. {
  251. model.displayInventoryQuantityFlag=NO;
  252. }
  253. else
  254. {
  255. model.displayInventoryQuantityFlag=YES;
  256. }
  257. model.costPrice=[NSString stringWithFormat:@"%.2f",[model.costPrice doubleValue]];
  258. if(model.canSaleQuantity != nil && ![model.canSaleQuantity isEqualToString:@""]){
  259. model.displayCanSalesQuantityFlag=YES;
  260. if(model.circulateType != nil && ![model.circulateType isEqualToString:@""]){
  261. model.boxPieceFlag = YES;
  262. if(model.package != nil && ![model.package isEqualToString:@""]){
  263. int circulateType= [model.circulateType intValue];
  264. float acreage=[model.acreage floatValue];
  265. if(circulateType==1)
  266. {
  267. if([model.canSaleQuantity doubleValue]>=0)
  268. {
  269. model.box = [NSString stringWithFormat:@"%ld",(long)floor([model.canSaleQuantity doubleValue]/[model.package doubleValue])];
  270. }
  271. else
  272. {
  273. model.box = [NSString stringWithFormat:@"%ld",(long)ceil([model.canSaleQuantity doubleValue]/[model.package doubleValue])];
  274. }
  275. model.piece = [NSString stringWithFormat:@"%ld",(long)[model.canSaleQuantity intValue]%[model.package intValue]];
  276. }
  277. else
  278. {
  279. if([model.package intValue]>0&&acreage>0)
  280. {
  281. long canSalesPieces=0;
  282. int canSalesBox=0;
  283. if([model.canSaleQuantity doubleValue]>=0)
  284. {
  285. canSalesPieces=(long)ceil([model.canSaleQuantity doubleValue]/acreage);
  286. canSalesBox=(int)floor(canSalesPieces/[model.package intValue]);
  287. }
  288. else
  289. {
  290. canSalesPieces=(long)floor([model.canSaleQuantity doubleValue]/acreage);
  291. canSalesBox=(int)ceil(canSalesPieces/[model.package intValue]);
  292. }
  293. int canSalesPiece=canSalesPieces%[model.package intValue];
  294. model.box = [NSString stringWithFormat:@"%d",canSalesBox];
  295. model.piece=[NSString stringWithFormat:@"%d",canSalesPiece];
  296. }
  297. }
  298. }else{
  299. model.box = @"0";
  300. model.piece = @"0";
  301. }
  302. }else{
  303. model.boxPieceFlag = NO;
  304. }
  305. }
  306. else{
  307. model.displayCanSalesQuantityFlag=NO;
  308. model.boxPieceFlag = NO;
  309. }
  310. [_arrNewdataList addObject:model];
  311. }
  312. }
  313. iNewCount =(int)infoArr.count;
  314. customTableView.mbMoreHidden = (iNewCount == 0);
  315. [customTableView FinishLoading];
  316. [customTableView reloadData];
  317. }
  318. else{
  319. [customTableView FinishLoading];
  320. customTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  321. // 无数据
  322. if(self.arrDataList.count == 0){
  323. // 无数据的view
  324. UIView *noDataView = [self noDataViewByFrame:customTableView.mTableView.bounds];
  325. customTableView.mTableView.backgroundView =noDataView;
  326. }
  327. if(self.arrDataList== nil || self.arrDataList.count == 0){
  328. [self showAlertViewBackText:@"未找到匹配结果"];
  329. }
  330. }
  331. }
  332. // 服务器返回数据状态值异常
  333. else if(iStatus == ActionResultStatusAuthError
  334. ||iStatus == ActionResultStatusNoLogin
  335. ||iStatus == ActionResultStatusLogined||iStatus==ActionResultSessionOverdue){
  336. [self showReLoginDialog:message];
  337. }
  338. else{
  339. [customTableView FinishLoading];
  340. [self showAlertViewText:message];
  341. }
  342. }
  343. #pragma mark - 刷新回调
  344. /**
  345. 取消刷新
  346. @param sender sender description
  347. @return return value description
  348. */
  349. - (BOOL)CanRefreshTableView:(RefreshTableView *)sender {
  350. return YES;
  351. }
  352. /**
  353. 加载更多
  354. @param sender <#sender description#>
  355. */
  356. - (void)LoadMoreList:(RefreshTableView *)sender {
  357. _pageNumber++;
  358. [self startLoading];
  359. [self reloadData];
  360. }
  361. /**
  362. 下拉刷新
  363. @param sender <#sender description#>
  364. */
  365. - (void)ReloadList:(RefreshTableView *)sender{
  366. _pageNumber = 1;
  367. [self.arrDataList removeAllObjects];
  368. [self.arrNewdataList removeAllObjects];
  369. [customTableView reloadData];
  370. customTableView.mbMoreHidden=YES;
  371. [self startLoading];
  372. [self reloadData];
  373. }
  374. /**
  375. 隐藏进度条
  376. */
  377. - (void)cancel {
  378. [self stopLoading];
  379. }
  380. /**
  381. 隐藏键盘
  382. @param scrollView scrollView description
  383. */
  384. - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
  385. {
  386. [self.view endEditing:YES];
  387. }
  388. #pragma mark - 私有函数
  389. /**
  390. 初始化ui
  391. */
  392. - (void)initUI{
  393. self.navigationItem.title = @"库存明细表";
  394. _arrDataList = [[NSMutableArray alloc]init];
  395. _arrNewdataList = [[NSMutableArray alloc]init];
  396. _infoModel = [[InventoryModel alloc]init];
  397. customTableView = [[RefreshTableView alloc]
  398. initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,
  399. self.view.frame.size.height)];
  400. customTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  401. customTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
  402. customTableView.backgroundColor = [UIColor whiteColor];
  403. customTableView.delegate = self;
  404. [self.view addSubview:customTableView];
  405. _pageNumber = 1;
  406. _cellHeight = [[NSMutableDictionary alloc] init];
  407. _isFilterQuantityEqZero = YES;
  408. }
  409. /**
  410. 导航按钮样式
  411. */
  412. - (void)loadNavStyle
  413. {
  414. //右边
  415. UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 40, 16)];
  416. UIButton *btnfilter = [UIButton buttonWithType:UIButtonTypeCustom];
  417. [btnfilter addTarget:self action:@selector(search)
  418. forControlEvents:UIControlEventTouchUpInside];
  419. btnfilter.frame = CGRectMake(0, 0, 16, 16);
  420. [btnfilter setTitleColor:NavBarItemColor forState:UIControlStateNormal];
  421. [btnfilter setBackgroundImage:[UIImage imageNamed:@"icon_filter_white"]
  422. forState:UIControlStateNormal];
  423. [v addSubview:btnfilter];
  424. UIButton *filterLbl = [[UIButton alloc]init];
  425. filterLbl.frame=CGRectMake(CGRectGetMaxX(btnfilter.frame)+3,0,28, 16);
  426. [filterLbl setTitle:@"筛选" forState:UIControlStateNormal];
  427. [filterLbl setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  428. filterLbl.titleLabel.font = [UIFont systemFontOfSize:ButtonFontOfSize];
  429. [filterLbl addTarget:self action:@selector(search)
  430. forControlEvents:UIControlEventTouchUpInside];
  431. [v addSubview:filterLbl];
  432. UIBarButtonItem *menubtnAdd = [[UIBarButtonItem alloc] initWithCustomView:v];
  433. self.navigationItem.rightBarButtonItem = menubtnAdd;
  434. //返回
  435. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  436. [button setImage:[UIImage imageNamed:@"icon_back"] forState:UIControlStateNormal];
  437. [button addTarget:self action:@selector(goBack)
  438. forControlEvents:UIControlEventTouchUpInside];
  439. button.frame = CGRectMake(0, 0,45,22);
  440. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  441. self.navigationItem.leftBarButtonItem = menuButton;
  442. }
  443. /**
  444. 抽屉弹出
  445. */
  446. - (void)search{
  447. [_filterController show];
  448. }
  449. /**
  450. 抽屉初始化
  451. */
  452. - (void)initSlideSlip{
  453. // 抽屉对象
  454. __weak typeof(self) weakself=self;
  455. SideSlipFilterController *extractedExpr = [[SideSlipFilterController alloc] initWithSponsor:self resetBlock:^(NSArray *dataList) {
  456. for (SideSlipModel *model in dataList) {
  457. //selectedItem
  458. model.selectedItemList = nil;
  459. model.customDict = nil;
  460. }
  461. } commitBlock:^(NSArray *dataList) {
  462. // 查询条件
  463. SideSlipModel *serviceRegionModel = dataList[0];
  464. InventorySearchModel *m = [serviceRegionModel.customDict objectForKey:INVENTORY_SEARCH_RANGE_MODEL];
  465. //NSLog(@"%@--%@--%@--%@--%d",m.brandID,m.goodsCode,m.onlyCode,m.warehouseID,m.isfilterQuantityEqZero);
  466. self.brandIdStr = m.brandId;
  467. self.goodsCodeStr = m.goodsCode;
  468. self.goodsNameStr = m.goodsName;
  469. self.onlyCodeStr = m.onlyCode;
  470. self.goodsSpecification=m.goodsSpecification;
  471. self.minimumCanSalesQuantity=m.minimumCanSalesQuantity;
  472. self.maximumCanSalesQuantity=m.maximumCanSalesQuantity;
  473. self.ceaseFlag=m.ceaseFlag;
  474. self.warehouseIdStr = m.warehouseId;
  475. self.isFilterQuantityEqZero = m.isfilterQuantityEqZero;
  476. self.positionNumberValue=m.positionNumberName;
  477. [weakself.filterController dismiss];
  478. [self ReloadList:self.customTableView];
  479. }];
  480. self.filterController = extractedExpr;
  481. _filterController.animationDuration = AnimationDuration;
  482. _filterController.hasHeadView = YES;
  483. _filterController.sideSlipLeading = UIScreenSideSlipLeading*[UIScreen mainScreen].bounds.size.width;
  484. _filterController.dataList = [self packageDataList];
  485. }
  486. /**
  487. 数据源
  488. @return <#return value description#>
  489. */
  490. - (NSArray *)packageDataList {
  491. NSMutableArray *dataArray = [NSMutableArray array];
  492. SideSlipModel *model = [[SideSlipModel alloc] init];
  493. model.containerCellClass = @"InventorySearchCell";
  494. model.regionTitle = @"查询条件";
  495. [dataArray addObject:model];
  496. return [dataArray mutableCopy];
  497. }
  498. /**
  499. 系统参数是,客户报备地址允许修改,为否则为客户报备地址不许修改
  500. */
  501. - (void)getSystemSettingsValue{
  502. [self startLoading];
  503. NSString *urlStr = ServerURL;
  504. NSMutableDictionary *dict= [NSMutableDictionary new];
  505. [dict setObject:@"GetSystemSettingValues" forKey:@"Action"];
  506. [dict setObject:kkAccountCode forKey:@"AccountCode"];
  507. [dict setObject:kkUserCode forKey:@"UserCode"];
  508. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  509. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  510. [dict setObject:@"SS_IVT_08" forKey:@"SettingType"];
  511. self.downManager= [[ASIDownManager alloc] init];;
  512. self.downManager.delegate = self;
  513. self.downManager.onRequestSuccess = @selector(onSystemSettingLoadFinish:);
  514. self.downManager.onRequestFail = @selector(onSystemSettingLoadFail:);
  515. [self.downManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  516. }
  517. /**
  518. 加载数据
  519. */
  520. - (void)reloadData
  521. {
  522. //NSString *urlStr = ServerURL;
  523. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  524. [dict setObject:@"GetNewInventoryListIphone" forKey:@"Action"];
  525. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  526. [dict setObject:kkUserCode forKey:@"UserCode"];
  527. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  528. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  529. [dict setObject:[NSString stringWithFormat:@"%d",_pageNumber] forKey:@"PageNum"];
  530. [dict setObject:[NSString stringWithFormat:@"%d",pageSize] forKey:@"PageSize"];
  531. [dict setObject:_goodsNameStr==nil? @"":_goodsNameStr forKeyedSubscript:@"GoodsName"];
  532. [dict setObject:_goodsCodeStr==nil?@"":_goodsCodeStr forKeyedSubscript:@"GoodsCode"];
  533. [dict setObject:_onlyCodeStr==nil?@"":_onlyCodeStr forKeyedSubscript:@"OnlyCode"];
  534. [dict setObject:_warehouseIdStr==nil?@"":_warehouseIdStr forKeyedSubscript:@"WarehouseCode"];
  535. [dict setObject:_brandIdStr==nil?@"":_brandIdStr forKeyedSubscript:@"BrandID"];
  536. [dict setObject:self.ceaseFlag==nil||[self.ceaseFlag isEqualToString:@""]?@"2":self.ceaseFlag forKeyedSubscript:@"CeaseFlag"];
  537. [dict setObject:_goodsSpecification forKeyedSubscript:@"Specification"];
  538. [dict setObject:_minimumCanSalesQuantity forKeyedSubscript:@"CanSaleQuantityBegin"];
  539. [dict setObject:_maximumCanSalesQuantity forKeyedSubscript:@"CanSaleQuantityEnd"];
  540. [dict setObject:self.positionNumberValue==nil?@"":self.positionNumberValue forKey:@"PositionNumber"];
  541. if(_isFilterQuantityEqZero){
  542. [dict setObject:@"true" forKey:@"isfilterQuantityEqZero"];
  543. }else{
  544. [dict setObject:@"false" forKey:@"isfilterQuantityEqZero"];
  545. }
  546. _downManager = [[ASIDownManager alloc] init];
  547. _downManager.delegate = self;
  548. _downManager.onRequestSuccess = @selector(onLoadFinish:);
  549. _downManager.onRequestFail = @selector(onLoadFail:);
  550. [_downManager postHttpRequest:ServerURL dic:dict path:nil fileName:nil];
  551. }
  552. @end