order_processing.dart 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. import 'dart:convert';
  2. import 'package:bbyyy/beans/my_shop_bean_entity.dart';
  3. import 'package:bbyyy/beans/template_bean_entity.dart';
  4. import 'package:bbyyy/https/MyDio.dart';
  5. import 'package:bbyyy/https/url.dart';
  6. import 'package:bbyyy/my_tools/easy_loading/easy_loading.dart';
  7. import 'package:flustars/flustars.dart';
  8. import 'package:flutter/material.dart';
  9. import 'package:flutter/services.dart';
  10. import '../const.dart';
  11. import '../dims.dart';
  12. import '../event_bus.dart';
  13. import '../my_colors.dart';
  14. import '../my_cookie.dart';
  15. import '../my_tools.dart';
  16. import '../my_views.dart';
  17. import '../order.dart';
  18. import '../pop_up_queue.dart';
  19. class OrderProcessing {
  20. OrderProcessing._internal();
  21. static OrderProcessing _singleton = OrderProcessing._internal();
  22. factory OrderProcessing() => _singleton;
  23. List<MyShopBeanDataData> shops = []; //所属货帮
  24. List<MyShopBeanDataData> showShops = []; //展示货帮
  25. List<TemplateBeanData> orderTemplate = []; //订单模板
  26. List<TemplateBeanData> matchTemplates = []; //订单模板
  27. String clipboardData = ''; //剪切板数据
  28. MyShopBeanDataData shop; //选中的店铺
  29. TemplateBeanData template; //匹配的模板
  30. //最大金额赢家数量 0---发送订单的人不是最大赢家 1---发订单的人是最大赢家 2---发订单的人是最大赢家且有两个一样的金额
  31. int commissionPayerNum = -1;
  32. String orderHash = ''; //订单hash值
  33. StateSetter ss;
  34. List<OrderInfo2> order; //订单
  35. BuildContext buildContext;
  36. int amountCompleted = 0;
  37. bool saving = false;
  38. Map idTemplate = Map();
  39. //初始化变量
  40. void initialization() {
  41. amountCompleted = 0;
  42. shops.clear();
  43. orderTemplate.clear();
  44. clipboardData = '';
  45. shop = null;
  46. template = null;
  47. commissionPayerNum = -1;
  48. orderHash = '';
  49. order.clear();
  50. EasyLoading.dismiss();
  51. showToast('发送成功');
  52. saving = false;
  53. EventBus().off('saveOrder');
  54. PopUpQueue().onShow = false;
  55. PopUpQueue().showNext();
  56. }
  57. //查询订单模板
  58. queryOrderTemplate(String clipboardData, BuildContext buildContext) {
  59. this.clipboardData = clipboardData;
  60. this.buildContext = buildContext;
  61. print('=======queryOrderTemplate========');
  62. MyDio().query(
  63. {'key': 'order_template', "dims": orderTemplateDims, "filters": {}},
  64. (response, hasError) {
  65. if (!hasError) {
  66. TemplateBeanEntity entity = TemplateBeanEntity()
  67. .fromJson(json.decode(response.data.toString()));
  68. orderTemplate = entity.data;
  69. // matchAllTemplates();
  70. queryTheStore();
  71. } else {
  72. PopUpQueue().onShow = false;
  73. PopUpQueue().showNext();
  74. }
  75. }, (error) {
  76. PopUpQueue().onShow = false;
  77. PopUpQueue().showNext();
  78. });
  79. }
  80. //查询所属店铺
  81. queryTheStore() {
  82. // print('=======queryTheStore========');
  83. MyDio().query({
  84. "key": "shop_user",
  85. "filters": {
  86. "or": true,
  87. "conditions": [
  88. "role!=0",
  89. "user_uid==${MyCookie().getUID()}",
  90. "review_state==1"
  91. ],
  92. "filters": [
  93. {
  94. "conditions": ["role==0", "user_uid==${MyCookie().getUID()}"]
  95. }
  96. ]
  97. },
  98. "dims": shopUserDims,
  99. "paging": [1, 20000]
  100. }, (response, hasError) {
  101. if (!hasError) {
  102. MyShopBeanEntity entity =
  103. MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
  104. if (entity.data.data == null || entity.data.data.isEmpty) {
  105. PopUpQueue().onShow = false;
  106. PopUpQueue().showNext();
  107. return;
  108. }
  109. shops = entity.data.data;
  110. shops.removeWhere((element) => !element.privateShop);
  111. shops.removeWhere((element) => !element.innerTrade);
  112. bool hasMatch = false;
  113. showShops.clear();
  114. for (int i = 0; i < shops.length; i++) {
  115. if (shop == null) {
  116. shop = shops[i];
  117. }
  118. matchTemplate();
  119. if (orderHash != '') {
  120. hasMatch = true;
  121. showShops.add(shops[i]);
  122. orderHash = '';
  123. } else {
  124. shop = null;
  125. }
  126. }
  127. if (hasMatch) {
  128. showView();
  129. }
  130. if (!hasMatch) {
  131. print('noMatch');
  132. PopUpQueue().onShow = false;
  133. PopUpQueue().showNext();
  134. }
  135. } else {
  136. PopUpQueue().onShow = false;
  137. PopUpQueue().showNext();
  138. }
  139. }, (error) {
  140. PopUpQueue().onShow = false;
  141. PopUpQueue().showNext();
  142. });
  143. }
  144. //优先匹配店铺模板
  145. matchTemplate() {
  146. // print('=======================|matchTemplate|=======================');
  147. w:
  148. for (int i = 0; i < orderTemplate.length; i++) {
  149. // print(
  150. // '=======================|${orderTemplate[i].shopUid}||${shop.shopUid}|=======================');
  151. if (orderTemplate[i].shopUid == shop.shopUid) {
  152. if (parseOrder(orderTemplate[i])) {
  153. break w;
  154. }
  155. }
  156. }
  157. if (orderHash != '') {
  158. } else {
  159. v:
  160. for (int i = 0; i < orderTemplate.length; i++) {
  161. if (orderTemplate[i].shopUid == 0) {
  162. if (parseOrder(orderTemplate[i])) {
  163. break v;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. bool parseOrder(TemplateBeanData element) {
  170. // print('=======parseOrder========');
  171. // print(
  172. // '=========================|${element.template}|=============================');
  173. // print(
  174. // '=========================|$clipboardData|=============================');
  175. var res;
  176. try {
  177. res = parseString2(
  178. element.template.replaceAll('\r', ''), '''$clipboardData''');
  179. } catch (e) {}
  180. print(res.toString());
  181. if (res != null) {
  182. print('-----------data[i].template-----------');
  183. print(element.template);
  184. print('json.encode(res) =============\n${json.encode(res)}');
  185. var order = parse2(res);
  186. print('order.toString()=============\n${order.toString()}');
  187. print('order.length=============\n${order.length}');
  188. var maxAmount = 0.0;
  189. int maxAmountNum = 0;
  190. List<String> maxAmountOwner = [];
  191. res.forEach((key, value) {
  192. if (key.contains('amount')) {
  193. try {
  194. if (double.parse(value) > maxAmount) {
  195. maxAmount = double.parse(value);
  196. maxAmountNum = 1;
  197. maxAmountOwner.clear();
  198. maxAmountOwner.add(res[key.replaceAll('amount', 'person')]);
  199. } else if (double.parse(value) == maxAmount) {
  200. maxAmountNum++;
  201. maxAmountOwner.add(res[key.replaceAll('amount', 'person')]);
  202. }
  203. } catch (e) {}
  204. }
  205. });
  206. if (maxAmountOwner.isNotEmpty) {
  207. maxAmountOwner.forEach((element) {
  208. if (MyCookie().getName().contains(element) ||
  209. element.contains(MyCookie().getName())) {
  210. commissionPayerNum = maxAmountNum;
  211. }
  212. });
  213. }
  214. print('maxAmount============\n$maxAmount\n==============');
  215. print('maxAmountNum==============\n$maxAmountNum\n==============');
  216. print(
  217. 'maxAmountOwner==============\n${maxAmountOwner.toString()}\n==============');
  218. print(
  219. 'commissionPayerNum================ \n$commissionPayerNum\n==============');
  220. order.removeWhere((element) =>
  221. !element.seller.name
  222. .contains(MyCookie().loginInformation.data.extra.name) &&
  223. !MyCookie()
  224. .loginInformation
  225. .data
  226. .extra
  227. .name
  228. .contains(element.seller.name));
  229. if (order.length > 0) {
  230. orderHash = computeOrderHash(res);
  231. this.order = order;
  232. idTemplate[element.shopUid] = order;
  233. return true;
  234. } else {
  235. return false;
  236. }
  237. } else {
  238. return false;
  239. }
  240. }
  241. showView() {
  242. print('=======|showView|========');
  243. Clipboard.setData(ClipboardData(text: ''));
  244. EasyLoading.instance
  245. ..contentPadding = EdgeInsets.symmetric(horizontal: 0, vertical: 12)
  246. ..alignment = Alignment.bottomCenter
  247. ..loadingStyle = EasyLoadingStyle.light
  248. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  249. EasyLoading.show(
  250. indicator: Material(
  251. color: Colors.white,
  252. child: StatefulBuilder(
  253. builder: (c, s) {
  254. ss = s;
  255. return Column(
  256. children: [
  257. Container(
  258. child: Stack(
  259. children: [
  260. Container(
  261. child: MyViews().myText('智能订单', MyColors.c333333, 14),
  262. alignment: Alignment.center,
  263. height: 22,
  264. ),
  265. Positioned(
  266. right: 0,
  267. child: GestureDetector(
  268. onTap: () {
  269. initialization();
  270. PopUpQueue().onShow = false;
  271. PopUpQueue().showNext();
  272. },
  273. behavior: HitTestBehavior.translucent,
  274. child: Container(
  275. child: Icon(
  276. Icons.close,
  277. size: 20,
  278. color: Colors.white,
  279. ),
  280. decoration: BoxDecoration(
  281. color: MyColors.cB6B6B6,
  282. borderRadius: BorderRadius.circular(11)),
  283. height: 22,
  284. width: 22,
  285. ),
  286. ),
  287. )
  288. ],
  289. alignment: Alignment.center,
  290. ),
  291. height: 30,
  292. padding: EdgeInsets.symmetric(horizontal: 12),
  293. ),
  294. Container(
  295. height: 5,
  296. color: MyColors.cF7F7F7,
  297. margin: EdgeInsets.only(top: 10),
  298. ),
  299. Column(
  300. children: items(order),
  301. ),
  302. Container(
  303. height: 5,
  304. color: MyColors.cF7F7F7,
  305. margin: EdgeInsets.only(top: 10),
  306. ),
  307. Visibility(
  308. child: Column(
  309. children: [
  310. Container(
  311. child: MyViews().myText('货帮选择', MyColors.c333333, 13),
  312. margin: EdgeInsets.only(left: 7, top: 11),
  313. ),
  314. Container(
  315. margin:
  316. EdgeInsets.symmetric(horizontal: 7, vertical: 10),
  317. height: (showShops.length * 1.0 / 2).ceil() *
  318. (double.parse(
  319. '${MediaQuery.of(buildContext).size.width - 74}') /
  320. 2 /
  321. 3.8 +
  322. 10) -
  323. 10,
  324. child: GridView(
  325. gridDelegate:
  326. SliverGridDelegateWithFixedCrossAxisCount(
  327. crossAxisCount: 2, //横轴三个子widget
  328. childAspectRatio: 3.8,
  329. crossAxisSpacing: 10,
  330. mainAxisSpacing: 8 //宽高比为1时,子widget
  331. ),
  332. children: shopItem(showShops),
  333. padding: EdgeInsets.all(0),
  334. ),
  335. ),
  336. ],
  337. crossAxisAlignment: CrossAxisAlignment.start,
  338. ),
  339. visible: showShops.length != 1,
  340. ),
  341. Container(
  342. height: 0.5,
  343. color: MyColors.cF7F7F7,
  344. margin: EdgeInsets.only(bottom: 10),
  345. ),
  346. Container(
  347. child: GestureDetector(
  348. onTap: () {
  349. if (saving) {
  350. return;
  351. } else {
  352. saving = true;
  353. EventBus().on('saveOrder', (arg) {
  354. amountCompleted++;
  355. if (amountCompleted == order.length) {
  356. initialization();
  357. }
  358. });
  359. order.forEach((element) {
  360. sendOrder(element);
  361. });
  362. }
  363. },
  364. behavior: HitTestBehavior.translucent,
  365. child: Container(
  366. decoration: BoxDecoration(
  367. color: MyColors.cFF4233,
  368. borderRadius: BorderRadius.circular(20),
  369. ),
  370. height: 40,
  371. width: 150,
  372. child: MyViews().myText('发送订单', Colors.white, 14),
  373. alignment: Alignment.center,
  374. ),
  375. ),
  376. alignment: Alignment.center,
  377. )
  378. ],
  379. mainAxisAlignment: MainAxisAlignment.start,
  380. crossAxisAlignment: CrossAxisAlignment.start,
  381. );
  382. },
  383. ),
  384. ),
  385. );
  386. }
  387. //订单视图
  388. items(List<OrderInfo2> order) {
  389. List<Widget> items = [];
  390. order.forEach((element) {
  391. items.add(Container(
  392. child: Column(
  393. children: [
  394. Row(
  395. children: [
  396. Container(
  397. margin: EdgeInsets.only(left: 8, right: 7),
  398. child: ClipRRect(
  399. child: MyViews().netImg(
  400. imgURL(MyCookie().loginInformation.data.extra.picture),
  401. 35,
  402. 35),
  403. borderRadius: BorderRadius.circular(17.5),
  404. ),
  405. ),
  406. Expanded(
  407. child: Container(
  408. height: 35,
  409. child: Column(
  410. children: [
  411. Text(
  412. '付款人:${element.payer.name}',
  413. style: TextStyle(
  414. color: MyColors.c333333,
  415. fontSize: 13,
  416. decoration: TextDecoration.none,
  417. ),
  418. ),
  419. Text(
  420. '订单时间:${element.time}',
  421. style: TextStyle(
  422. color: MyColors.c666666,
  423. fontSize: 10,
  424. decoration: TextDecoration.none,
  425. ),
  426. ),
  427. ],
  428. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  429. crossAxisAlignment: CrossAxisAlignment.start,
  430. ),
  431. ),
  432. ),
  433. Container(
  434. margin: EdgeInsets.only(right: 10),
  435. child: Text(
  436. '¥${(element.payer.amount * element.factor).toStringAsFixed(2)}',
  437. style: TextStyle(
  438. color: MyColors.cFF4233,
  439. fontSize: 14,
  440. decoration: TextDecoration.none,
  441. ),
  442. ),
  443. ),
  444. ],
  445. crossAxisAlignment: CrossAxisAlignment.center,
  446. ),
  447. Container(
  448. height: 0.5,
  449. margin: EdgeInsets.only(right: 10, left: 50, top: 5),
  450. color: MyColors.cE7E7E7,
  451. )
  452. ],
  453. ),
  454. margin: EdgeInsets.only(top: 5),
  455. ));
  456. });
  457. return items;
  458. }
  459. //店铺视图
  460. shopItem(List<MyShopBeanDataData> shops) {
  461. List<Widget> items = [];
  462. for (int i = 0; i < shops.length; i++) {
  463. items.add(GestureDetector(
  464. onTap: () {
  465. MyShopBeanDataData oldShop = shop;
  466. shop = shops[i];
  467. orderHash = '';
  468. matchTemplate();
  469. if (orderHash == '') {
  470. // showToast('店铺选择错误');
  471. shop = oldShop;
  472. matchTemplate();
  473. } else {
  474. ss(() {});
  475. }
  476. },
  477. behavior: HitTestBehavior.translucent,
  478. child: Container(
  479. child: Row(
  480. children: [
  481. Container(
  482. margin: EdgeInsets.only(right: 5),
  483. child: ClipRRect(
  484. child: MyViews().netImg(imgURL(shops[i].shopPic), 30, 30),
  485. borderRadius: BorderRadius.circular(15),
  486. ),
  487. ),
  488. Expanded(
  489. child: Column(
  490. children: [
  491. Text(
  492. shops[i].shopName,
  493. style: TextStyle(
  494. color: shop.shopUid == shops[i].shopUid
  495. ? MyColors.cFF4233
  496. : MyColors.c666666,
  497. fontSize: 12,
  498. ),
  499. maxLines: 1,
  500. overflow: TextOverflow.ellipsis,
  501. softWrap: true,
  502. ),
  503. Text(
  504. 'ID:${shops[i].shopUid}',
  505. style: TextStyle(
  506. color: shop.shopUid == shops[i].shopUid
  507. ? MyColors.cFF4233
  508. : MyColors.c666666,
  509. fontSize: 10,
  510. ),
  511. maxLines: 1,
  512. overflow: TextOverflow.ellipsis,
  513. softWrap: true,
  514. ),
  515. ],
  516. crossAxisAlignment: CrossAxisAlignment.start,
  517. ),
  518. ),
  519. ],
  520. ),
  521. decoration: BoxDecoration(
  522. color: shop.shopUid == shops[i].shopUid
  523. ? MyColors.cFFECEB
  524. : MyColors.cEDEDED,
  525. borderRadius: BorderRadius.circular(4),
  526. ),
  527. constraints: BoxConstraints(maxWidth: 150),
  528. padding: EdgeInsets.symmetric(horizontal: 6, vertical: 6),
  529. ),
  530. ));
  531. }
  532. return items;
  533. }
  534. //发送订单
  535. void sendOrder(OrderInfo2 element) {
  536. MyDio().save({
  537. 'key': 'order',
  538. 'object': {
  539. 'uuid': orderHash,
  540. 'shop_uid': shop.shopUid,
  541. 'shop_pic': shop.shopPic,
  542. 'shop_name': shop.shopName,
  543. 'seller_pic': MyCookie().loginInformation.data.extra.picture,
  544. 'seller_uid': MyCookie().getUID(),
  545. 'seller_name': MyCookie().loginInformation.data.extra.name,
  546. 'buyer_name': element.payer.name,
  547. 'type': orderTypeThirdPlatform,
  548. 'amount': NumUtil.multiply(element.payer.amount, element.factor),
  549. 'commission_payer_num': commissionPayerNum
  550. }
  551. }, (response, hasError) {
  552. if (!hasError) {
  553. EventBus().emit('saveOrder');
  554. }
  555. }, (error) {});
  556. }
  557. //匹配所有模板
  558. void matchAllTemplates() {
  559. orderTemplate.forEach((element) {
  560. if (parseOrder2(element)) {
  561. print(
  562. '==============parseOrder(element)\n${element.template}\n===================');
  563. matchTemplates.add(element);
  564. }
  565. });
  566. checkMyStore();
  567. }
  568. void checkMyStore() {
  569. MyDio().query({
  570. "key": "shop_user",
  571. "filters": {
  572. "or": true,
  573. "conditions": [
  574. "role!=0",
  575. "user_uid==${MyCookie().getUID()}",
  576. "review_state==1"
  577. ],
  578. "filters": [
  579. {
  580. "conditions": ["role==0", "user_uid==${MyCookie().getUID()}"]
  581. }
  582. ]
  583. },
  584. "dims": shopUserDims,
  585. "paging": [1, 20000]
  586. }, (response, hasError) {
  587. if (!hasError) {
  588. MyShopBeanEntity entity =
  589. MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
  590. if (entity.data.data == null || entity.data.data.isEmpty) {
  591. PopUpQueue().onShow = false;
  592. PopUpQueue().showNext();
  593. return;
  594. }
  595. shops = entity.data.data;
  596. shops.removeWhere((element) => !element.privateShop);
  597. shops.removeWhere((element) => !element.innerTrade);
  598. List<MyShopBeanDataData> showShows = [];
  599. if (idTemplate.length == 0) {
  600. PopUpQueue().onShow = false;
  601. PopUpQueue().showNext();
  602. return;
  603. }
  604. if (idTemplate[0] == null) {
  605. shops.forEach((shop) {
  606. idTemplate.keys.forEach((element) {
  607. print('idTemplate.keys$element-------${shop.shopUid}');
  608. if (shop.shopUid == element) {
  609. showShows.add(shop);
  610. }
  611. });
  612. });
  613. shops = showShows;
  614. print('shops.length${shops.length}');
  615. }
  616. shop = shops[0];
  617. matchTemplate();
  618. showView();
  619. // bool hasMatch = false;
  620. // x:
  621. // for (int i = 0; i < shops.length; i++) {
  622. // shop = shops[i];
  623. // matchTemplate();
  624. // if (orderHash != '') {
  625. // hasMatch = true;
  626. // showView();
  627. // break x;
  628. // }
  629. // }
  630. // if (!hasMatch) {
  631. // print('noMatch');
  632. // PopUpQueue().onShow = false;
  633. // PopUpQueue().showNext();
  634. // }
  635. } else {
  636. PopUpQueue().onShow = false;
  637. PopUpQueue().showNext();
  638. }
  639. }, (error) {
  640. PopUpQueue().onShow = false;
  641. PopUpQueue().showNext();
  642. });
  643. }
  644. bool parseOrder2(TemplateBeanData element) {
  645. var res;
  646. try {
  647. res = parseString2(
  648. element.template.replaceAll('\r', ''), '''$clipboardData''');
  649. } catch (e) {}
  650. print(res.toString());
  651. if (res != null) {
  652. print('-----------data[i].template-----------');
  653. print(element.template);
  654. print('json.encode(res) =============\n${json.encode(res)}');
  655. var order = parse2(res);
  656. print('order.toString()=============\n${order.toString()}');
  657. print('order.length=============\n${order.length}');
  658. var maxAmount = 0.0;
  659. int maxAmountNum = 0;
  660. List<String> maxAmountOwner = [];
  661. res.forEach((key, value) {
  662. if (key.contains('amount')) {
  663. try {
  664. if (double.parse(value) > maxAmount) {
  665. maxAmount = double.parse(value);
  666. maxAmountNum = 1;
  667. maxAmountOwner.clear();
  668. maxAmountOwner.add(res[key.replaceAll('amount', 'person')]);
  669. } else if (double.parse(value) == maxAmount) {
  670. maxAmountNum++;
  671. maxAmountOwner.add(res[key.replaceAll('amount', 'person')]);
  672. }
  673. } catch (e) {}
  674. }
  675. });
  676. if (maxAmountOwner.isNotEmpty) {
  677. maxAmountOwner.forEach((element) {
  678. if (MyCookie().getName().contains(element) ||
  679. element.contains(MyCookie().getName())) {
  680. commissionPayerNum = maxAmountNum;
  681. }
  682. });
  683. }
  684. print('maxAmount============\n$maxAmount\n==============');
  685. print('maxAmountNum==============\n$maxAmountNum\n==============');
  686. print(
  687. 'maxAmountOwner==============\n${maxAmountOwner.toString()}\n==============');
  688. print(
  689. 'commissionPayerNum================ \n$commissionPayerNum\n==============');
  690. order.removeWhere((element) =>
  691. !element.seller.name
  692. .contains(MyCookie().loginInformation.data.extra.name) &&
  693. !MyCookie()
  694. .loginInformation
  695. .data
  696. .extra
  697. .name
  698. .contains(element.seller.name));
  699. if (order.length > 0) {
  700. orderHash = computeOrderHash(res);
  701. this.order = order;
  702. idTemplate[element.shopUid] = order;
  703. return true;
  704. } else {
  705. return false;
  706. }
  707. } else {
  708. return false;
  709. }
  710. }
  711. }