You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.8 KiB
95 lines
2.8 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\controller\service_logs;
|
|
|
|
use app\service\admin\service_logs\ServiceLogsDistributionService;
|
|
use core\base\BaseAdminController;
|
|
|
|
/**
|
|
* 服务记录分发管理控制器
|
|
* Class ServiceLogsDistribution
|
|
* @package app\adminapi\controller\service_logs
|
|
*/
|
|
class ServiceLogsDistribution extends BaseAdminController
|
|
{
|
|
/**
|
|
* 手动执行分发任务
|
|
* @return \think\Response
|
|
*/
|
|
public function executeDistribution()
|
|
{
|
|
$result = (new ServiceLogsDistributionService())->executeDistribution();
|
|
return success($result);
|
|
}
|
|
|
|
/**
|
|
* 获取分发统计信息
|
|
* @return \think\Response
|
|
*/
|
|
public function getDistributionStats()
|
|
{
|
|
$result = (new ServiceLogsDistributionService())->getDistributionStats();
|
|
return success($result);
|
|
}
|
|
|
|
/**
|
|
* 获取待分发的服务记录列表
|
|
* @return \think\Response
|
|
*/
|
|
public function getPendingDistributionList()
|
|
{
|
|
$data = $this->request->params([
|
|
["distribution_status", ""],
|
|
["date_range", ""]
|
|
]);
|
|
|
|
$where = [];
|
|
if (!empty($data['distribution_status'])) {
|
|
$where['distribution_status'] = $data['distribution_status'];
|
|
}
|
|
if (!empty($data['date_range'])) {
|
|
$where['date_range'] = $data['date_range'];
|
|
}
|
|
|
|
$result = (new ServiceLogsDistributionService())->getPendingDistributionList($where);
|
|
return success($result);
|
|
}
|
|
|
|
/**
|
|
* 重置分发状态
|
|
* @return \think\Response
|
|
*/
|
|
public function resetDistributionStatus()
|
|
{
|
|
$data = $this->request->params([
|
|
["ids", []],
|
|
["type", "both"]
|
|
]);
|
|
|
|
if (empty($data['ids'])) {
|
|
return error('请选择要重置的记录');
|
|
}
|
|
|
|
$result = (new ServiceLogsDistributionService())->resetDistributionStatus($data['ids'], $data['type']);
|
|
return success($result);
|
|
}
|
|
|
|
/**
|
|
* 获取教务和教练人员列表
|
|
* @return \think\Response
|
|
*/
|
|
public function getStaffList()
|
|
{
|
|
$result = (new ServiceLogsDistributionService())->getStaffList();
|
|
return success($result);
|
|
}
|
|
}
|