Commit 0a7b0c46 authored by jiangkebao's avatar jiangkebao
Browse files

Merge branch 'master' into jkb

# Conflicts:
#	src/Service/Interfaces/SocketIoServiceInterface.php
parents 7e64c1b6 c7842f12
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
<?php
/**
 * Created by PhpStorm.
 * User: Zero
 * Date: 2020/7/3
 * Time: 14:27
 */

namespace Meibuyu\Micro\Handler;

use Hyperf\Contract\ConfigInterface;
use Hyperf\Di\Annotation\Inject;
use Meibuyu\Micro\Exceptions\HttpResponseException;
use Meibuyu\Micro\Model\Auth;
use Meibuyu\Micro\Service\Interfaces\MessageServiceInterface;

class MessageHandler
{

    /**
     * @Inject()
     * @var MessageServiceInterface
     */
    private $messageService;

    /**
     * @Inject
     * @var ConfigInterface
     */
    protected $config;

    /**
     * 发送模板消息
     * @param $receiverIds
     * @param $templateId
     * @param array $replace
     * @throws HttpResponseException
     */
    public function sendTemp($receiverIds, $templateId, $replace = [])
    {
        $application = $this->config->get('app_name');
        if (!$application) {
            throw new HttpResponseException("请设置应用名app_name");
        }
        $receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds];
        $sendUserId = Auth::id();
        $this->messageService->send($receiverIds, $application, $templateId, $sendUserId, $replace);
    }

}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ abstract class BaseRepository implements RepositoryInterface
    /**
     * @var ContainerInterface
     */
    private $container;
    protected $container;

    /**
     * @var RequestInterface
+22 −0
Original line number Diff line number Diff line
@@ -53,6 +53,13 @@ interface BaseInfoServiceInterface
     */
    public function getCurrencyListByIdList(array $idList, array $columns = ['id', 'name']): array;

    /**
     * 通过Keyword获取货币id数组
     * @param $keyword
     * @return array
     */
    public function getCurrencyIdsByKeyword($keyword);

    /**
     * 通过单个id获取岗位信息
     * @param int $id 职位id
@@ -140,4 +147,19 @@ interface BaseInfoServiceInterface
     */
    public function sites(array $relations = [], array $columns = ['id', "name"]): array;

    /**
     * 获取部门领导id数据
     * @param array $ids 部门id数组
     * @return array
     */
    public function getDepartmentLeaderIdsByIds($ids);

    /**
     * 获取审阅人员
     * @param $teamId
     * @param $authId
     * @return array|bool
     */
    public function getReviewUsers($teamId, $authId);

}
+0 −40
Original line number Diff line number Diff line
@@ -11,44 +11,4 @@ namespace Meibuyu\Micro\Service\Interfaces;

interface DispatchPlanServiceInterface
{

    /**
     * description:获取退税任务列表
     * author: fuyunnan
     * @param array $conditions 筛选条件
	 * @param int $pageSize 默认10
     * Date: 2020/6/13
     * @return array
     */
    public function listRefundTasks(array $conditions, int $pageSize = DEFAULT_PAGE_SIZE) : array;

    /**
     * description:新建退税单 获取底部产品列表
     * author: fuyunnan
     * @param array $conditions 请求参数
     * @param int $pageSize 请求参数
     * Date: 2020/6/13
     * @return array
     */
    public function listRefundProducts(array $conditions = [], int $pageSize = DEFAULT_PAGE_SIZE ) :array;


     /**
      * description:删除退税任务
      * author: fuyunnan
      * @param int $id 计划任务id
      * Date: 2020/6/13
      * @return bool
      */
    public function delete($id) :bool;

	/**
	 * description:获取发货计划详情
	 * author: fuyunnan
	 * @param array $idList
	 * @param array $conditions 将参数条件写成二维数组形式 $conditions = [ ['id','=',1],['name','=',''jack] ]
	 * Date: 2020/6/13
	 * @return array
	 */
	public function getDispatchPlan(array $idList, array $conditions = []):array;
}
+23 −0
Original line number Diff line number Diff line
<?php
/**
 * Created by PhpStorm.
 * User: 姜克保
 * Date: 2020/5/20
 * Time: 15:48
 */

namespace Meibuyu\Micro\Service\Interfaces;

use phpDocumentor\Reflection\Types\Integer;

interface MessageServiceInterface
{
    /**
     * @param array $receiveUserId 接收人id
     * @param string $application 应用名称
     * @param int $sendUserId 发送人id(发送人id等于0时是系统消息)
     * @param int $templateId 模板id
     * @param array $replace 替换模板内容
     */
    public function send(array $receiveUserId, $application, $templateId, $sendUserId = 0, $replace = []): bool;
}
Loading