123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <?php
- namespace JInDouYun\Controller\Cashier;
- use JinDouYun\Controller\BaseController;
- use JinDouYun\Model\Cashier\MCashierPushMoneyDetail;
- use Mall\Framework\Core\ErrorCode;
- /**
- * Description:
- * Class PushMoney
- * @package JInDouYun\Controller\Cashier
- */
- class PushMoney extends BaseController
- {
- /**
- * @var MCashierPushMoneyDetail
- */
- private $objMCashierPushMoneyDetail;
- /**
- * PushMoney constructor.
- * @param bool $isCheckAcl
- * @param bool $isMustLogin
- * @param bool $checkToken
- * @param bool $getAreaCode
- * @throws \Exception
- */
- public function __construct($isCheckAcl = false, $isMustLogin = true, $checkToken = true, $getAreaCode = false)
- {
- parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode);
- $this->objMCashierPushMoneyDetail = new MCashierPushMoneyDetail($this->onlineUserId,$this->onlineEnterpriseId);
- }
- /**
- * Doc: (des="")
- * User: XMing
- * Date: 2020/8/31
- * Time: 5:41 下午
- */
- public function getAll()
- {
- $params = $this->request->getRawJson();
- if (empty($params)) {
- parent::sendOutput('参数为空', ErrorCode::$paramError);
- }
- if (!isset($params['pushType']) || empty($params['pushType'])){
- parent::sendOutput('pushType参数错误',ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCashierPushMoneyDetail->getAll($params);
- if (!$result->isSuccess()) {
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- /**
- * Doc: (des="获取交班记录")
- * User: XMing
- * Date: 2020/9/1
- * Time: 11:12 上午
- */
- public function getRecordList()
- {
- $params = $this->request->getRawJson();
- if (empty($params)) {
- parent::sendOutput('参数为空', ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCashierPushMoneyDetail->getRecordList($params);
- if (!$result->isSuccess()) {
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- /**
- * Doc: (des="收款记录详情")
- * User: XMing
- * Date: 2020/9/1
- * Time: 11:35 上午
- */
- public function getRecordInfo()
- {
- $id = $this->request->param('request_id');
- if (empty($id)){
- parent::sendOutput('id参数错误',ErrorCode::$paramError);
- }
- $result = $this->objMCashierPushMoneyDetail->getRecordInfo($id);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
- /**
- * Doc: (des="1.获取交接详情")
- * User: XMing
- * Date: 2020/9/1
- * Time: 12:01 下午
- */
- public function connectDetails()
- {
- $shopId = $this->request->param('shopId');
- if (empty($shopId)){
- parent::sendOutput('shopId参数错误',ErrorCode::$paramError);
- }
- $result = $this->objMCashierPushMoneyDetail->connectDetails($shopId);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
- /**
- * Doc: (des="2.确定交接")
- * User: XMing
- * Date: 2020/9/1
- * Time: 12:18 下午
- */
- public function confirmConnect()
- {
- $id = $this->request->param('request_id');
- if (empty($id)){
- parent::sendOutput('缺少id参数',ErrorCode::$paramError);
- }
- $offDutyTime = $this->request->param('offDutyTime');
- if (empty($offDutyTime) || !is_numeric($offDutyTime)){
- parent::sendOutput('offDutyTime参数错误',ErrorCode::$paramError);
- }
- $remark = $this->request->param('remark');
- $result = $this->objMCashierPushMoneyDetail->confirmConnect($id,$offDutyTime,$remark);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
- /**
- * Doc: (des="3.收银登陆")
- * User: XMing
- * Date: 2020/9/1
- * Time: 2:35 下午
- */
- public function loggerConnect()
- {
- $params = $this->request->getRawJson();
- /*if (!isset($params['mobile']) || empty($params['mobile'])){
- parent::sendOutput('mobile参数错误',ErrorCode::$paramError);
- }*/
- if (!isset($params['shopId']) || empty($params['shopId'])){
- parent::sendOutput('shopId参数错误',ErrorCode::$paramError);
- }
- $result = $this->objMCashierPushMoneyDetail->loggerConnect($params);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
- }
|