OrderPicking.Class.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Gss
  5. * Date: 2021/5/19 0019
  6. * Time: 10:53
  7. */
  8. namespace JinDouYun\Controller\Order;
  9. use Mall\Framework\Core\ErrorCode;
  10. use Mall\Framework\Core\StatusCode;
  11. use JinDouYun\Controller\BaseController;
  12. use JinDouYun\Model\Order\MOrderPicking;
  13. class OrderPicking extends BaseController
  14. {
  15. private $objMOrderPincking;
  16. public function __construct($isCheckAcl = true, $isMustLogin = true)
  17. {
  18. parent::__construct($isCheckAcl, $isMustLogin);
  19. $this->objMOrderPincking = new MOrderPicking($this->onlineUserId, $this->onlineEnterpriseId);
  20. }
  21. //重写订单列表
  22. public function getAllOrderPicking()
  23. {
  24. $params = $this->request->getRawJson();
  25. if (empty($params)) {
  26. $this->sendOutput('参数为空', ErrorCode::$paramError);
  27. }
  28. $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10);
  29. $selectParams['limit'] = $pageParams['limit'];
  30. $selectParams['offset'] = $pageParams['offset'];
  31. //根据订单编号查找商品
  32. $selectParams['no'] = getArrayItem($params, 'no','');
  33. if( isset($selectParams['no']) || !empty($selectParams['no']) ){
  34. $tmpSelectParams['no'] = explode('-',$selectParams['no']);
  35. if(count($tmpSelectParams['no'])==3){
  36. $selectParams['no'] = $tmpSelectParams['no'][1].'-'.$tmpSelectParams['no'][2];
  37. }
  38. }
  39. $selectParams['timeName'] = getArrayItem($params,'timeName',''); //时间判断
  40. $selectParams['startTime'] = getArrayItem($params, 'startTime','');
  41. $selectParams['endTime'] = getArrayItem($params, 'endTime','');
  42. $result = $this->objMOrderPincking->getAllOrderPicking($selectParams);
  43. if ($result->isSuccess()) {
  44. $returnData = $result->getData();
  45. $pageData = [
  46. 'pageIndex' => $params['page'],
  47. 'pageSize' => $params['pageSize'],
  48. 'pageTotal' => $returnData['total'],
  49. ];
  50. parent::sendOutput($returnData['data'], 0, $pageData);
  51. } else {
  52. parent::sendOutput($result->getData(), $result->getErrorCode());
  53. }
  54. }
  55. //订单拣货详情
  56. public function getOrderPickingInfo()
  57. {
  58. $pickingId = $this->request->param('request_id');
  59. if(empty($pickingId)){
  60. $this->sendOutput('参数错误', ErrorCode::$paramError);
  61. }
  62. $result = $this->objMOrderPincking->getOrderPickingInfo($pickingId);
  63. if ($result->isSuccess()) {
  64. $this->sendOutput($result->getData());
  65. } else {
  66. $this->sendOutput($result->getData(), $result->getErrorCode());
  67. }
  68. }
  69. /**
  70. * 待拣货明细
  71. */
  72. public function getAllPickingGoodsDetail()
  73. {
  74. $params = $this->request->getRawJson();
  75. if (empty($params)) {
  76. $this->sendOutput('参数为空', ErrorCode::$paramError);
  77. }
  78. $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10);
  79. $selectParams['limit'] = $pageParams['limit'];
  80. $selectParams['offset'] = $pageParams['offset'];
  81. //根据订单编号查找商品
  82. $selectParams['no'] = getArrayItem($params, 'no','');
  83. $selectParams['goodsName'] = getArrayItem($params, 'goodsName','');
  84. $selectParams['operatorId'] = getArrayItem($params, 'operatorId','');
  85. $selectParams['start'] = getArrayItem($params, 'start','');
  86. $selectParams['end'] = getArrayItem($params, 'end','');
  87. $result = $this->objMOrderPincking->getAllPickingGoodsDetail($selectParams);
  88. if ($result->isSuccess()) {
  89. $returnData = $result->getData();
  90. $pageData = [
  91. 'pageIndex' => $params['page'],
  92. 'pageSize' => $params['pageSize'],
  93. 'pageTotal' => $returnData['total'],
  94. ];
  95. parent::sendOutput($returnData['data'], 0, $pageData);
  96. } else {
  97. parent::sendOutput($result->getData(), $result->getErrorCode());
  98. }
  99. }
  100. }