order_processing.dart 24 KB

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