commit
eff3d94cc3
@ -381,10 +381,10 @@ class CompanyController extends BaseAdminController
|
|||||||
// $master_email=substr(md5(uniqid()),rand(0, 22),10)."@lihai.com";
|
// $master_email=substr(md5(uniqid()),rand(0, 22),10)."@lihai.com";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 根据street码查询所属镇管理公司
|
// 根据street码查询所属镇农科公司
|
||||||
$company = Company::where(['street' => $params['street'], 'company_type' => 41])->find();
|
$company = Company::where(['street' => $params['street'], 'company_type' => 41])->find();
|
||||||
if(empty($company)) {
|
if(empty($company)) {
|
||||||
throw new Exception('当前区域无镇管理公司');
|
throw new Exception('当前区域无镇农科公司');
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'mer_intention_id' => $params['mer_intention_id']??'', // 商城商户入驻申请id,签约完成后回调使用
|
'mer_intention_id' => $params['mer_intention_id']??'', // 商城商户入驻申请id,签约完成后回调使用
|
||||||
@ -410,7 +410,7 @@ class CompanyController extends BaseAdminController
|
|||||||
$approveModel->name = $shopApproveType == 1? '商户入驻审批': '开通交易审批';
|
$approveModel->name = $shopApproveType == 1? '商户入驻审批': '开通交易审批';
|
||||||
$approveModel->admin_id = 0; // 后台发起人id 暂时为0
|
$approveModel->admin_id = 0; // 后台发起人id 暂时为0
|
||||||
$approveModel->department_id = '0';
|
$approveModel->department_id = '0';
|
||||||
$approveModel->check_admin_ids = $company['admin_id']; // 当前审批人ID 镇管理公司负责人
|
$approveModel->check_admin_ids = $company['admin_id']; // 当前审批人ID 镇农科公司负责人
|
||||||
$approveModel->check_status = 1; // 状态 0待审核,1审核中,2审核通过,3审核不通过,4撤销审核
|
$approveModel->check_status = 1; // 状态 0待审核,1审核中,2审核通过,3审核不通过,4撤销审核
|
||||||
$approveModel->other_type = 6;
|
$approveModel->other_type = 6;
|
||||||
$approveModel->extend = json_encode(array_merge($params, $data));
|
$approveModel->extend = json_encode(array_merge($params, $data));
|
||||||
|
@ -56,7 +56,7 @@ class TaskTemplateController extends BaseAdminController
|
|||||||
$params['admin_id'] = $this->adminId;
|
$params['admin_id'] = $this->adminId;
|
||||||
$company = Company::find($params['company_id']);
|
$company = Company::find($params['company_id']);
|
||||||
if ($company->company_type == 41) {
|
if ($company->company_type == 41) {
|
||||||
// 创建 镇管理公司 任务模板
|
// 创建 镇农科公司 任务模板
|
||||||
$result = TaskTemplateLogic::addTownTaskTemplate($params);
|
$result = TaskTemplateLogic::addTownTaskTemplate($params);
|
||||||
} else {
|
} else {
|
||||||
$result = TaskTemplateLogic::add($params);
|
$result = TaskTemplateLogic::add($params);
|
||||||
|
@ -348,15 +348,15 @@ class CompanyController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询镇管理公司
|
* 查询镇农科公司
|
||||||
*/
|
*/
|
||||||
public function street_company(){
|
public function street_company(){
|
||||||
$street=$this->request->param('street_code');
|
$street=$this->request->param('street_code');
|
||||||
$company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 16,'street'=>$street], true);
|
$company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$street], true);
|
||||||
if($company){
|
if($company){
|
||||||
return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]);
|
return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]);
|
||||||
}else{
|
}else{
|
||||||
return $this->fail('没有镇管理公司');
|
return $this->fail('当前区域无镇农科公司');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -76,11 +76,11 @@ class CronController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务结算
|
* 镇农科公司任务结算
|
||||||
*/
|
*/
|
||||||
public function town_task_settlement()
|
public function town_task_settlement()
|
||||||
{
|
{
|
||||||
Log::info('镇管理公司定时任务结算执行-开始'.date('Y-m-d H:i:s'));
|
Log::info('镇农科公司定时任务结算执行-开始'.date('Y-m-d H:i:s'));
|
||||||
//yesterday 昨日未结算的任务计划
|
//yesterday 昨日未结算的任务计划
|
||||||
$taskSchedulingPlanList = TaskSchedulingPlan::whereDay('end_time','yesterday')
|
$taskSchedulingPlanList = TaskSchedulingPlan::whereDay('end_time','yesterday')
|
||||||
->withJoin(['scheduling'], 'left')
|
->withJoin(['scheduling'], 'left')
|
||||||
@ -92,18 +92,18 @@ class CronController extends BaseApiController
|
|||||||
foreach($taskSchedulingPlanList as $taskSchedulingPlan){
|
foreach($taskSchedulingPlanList as $taskSchedulingPlan){
|
||||||
queue(TownTaskSettlementJob::class, $taskSchedulingPlan);
|
queue(TownTaskSettlementJob::class, $taskSchedulingPlan);
|
||||||
}
|
}
|
||||||
Log::info('镇管理公司定时任务结算执行-结束'.date('Y-m-d H:i:s'));
|
Log::info('镇农科公司定时任务结算执行-结束'.date('Y-m-d H:i:s'));
|
||||||
return $this->success('镇管理公司定时任务结算执行成功');
|
return $this->success('镇农科公司定时任务结算执行成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务下发
|
* 镇农科公司任务下发
|
||||||
*/
|
*/
|
||||||
public function town_task_add()
|
public function town_task_add()
|
||||||
{
|
{
|
||||||
//任务下发
|
//任务下发
|
||||||
$time = strtotime(date('Y-m-d'));
|
$time = strtotime(date('Y-m-d'));
|
||||||
// 查询系统 所有镇管理公司 未下发 的 任务安排
|
// 查询系统 所有镇农科公司 未下发 的 任务安排
|
||||||
$taskSchedulingList = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->where('company_type', 41)->with('company_info')->select()->toArray();
|
$taskSchedulingList = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->where('company_type', 41)->with('company_info')->select()->toArray();
|
||||||
|
|
||||||
$taskSchedulingIds = [];
|
$taskSchedulingIds = [];
|
||||||
@ -123,7 +123,7 @@ class CronController extends BaseApiController
|
|||||||
}
|
}
|
||||||
Company::where('id', 'in', $companyIds)->inc('day_count')->update();
|
Company::where('id', 'in', $companyIds)->inc('day_count')->update();
|
||||||
TaskScheduling::where('id', 'in', $taskSchedulingIds)->update(['cron_time' => time()]);
|
TaskScheduling::where('id', 'in', $taskSchedulingIds)->update(['cron_time' => time()]);
|
||||||
Log::info('镇管理公司定时任务下发执行成功' . date('Y-m-d H:i:s'));
|
Log::info('镇农科公司定时任务下发执行成功' . date('Y-m-d H:i:s'));
|
||||||
return $this->success('镇管理公司定时任务下发执行成功');
|
return $this->success('镇农科公司定时任务下发执行成功');
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -346,7 +346,7 @@ class TaskController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务详情
|
* 镇农科公司任务详情
|
||||||
*/
|
*/
|
||||||
public function service_task_detail()
|
public function service_task_detail()
|
||||||
{
|
{
|
||||||
@ -356,7 +356,7 @@ class TaskController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务-督促小组服务团队学习任务 -提交
|
* 镇农科公司任务-督促小组服务团队学习任务 -提交
|
||||||
*/
|
*/
|
||||||
public function commit_town_task_type4()
|
public function commit_town_task_type4()
|
||||||
{
|
{
|
||||||
|
@ -70,7 +70,7 @@ class LoginLogic extends BaseLogic
|
|||||||
if ($params['is_captain']) {
|
if ($params['is_captain']) {
|
||||||
$group_id=2;
|
$group_id=2;
|
||||||
}
|
}
|
||||||
// 镇管理公司服务部长
|
// 镇农科公司服务部长
|
||||||
if ($params['is_service_manager'] == 1) {
|
if ($params['is_service_manager'] == 1) {
|
||||||
$user = User::where(['company_id' => $params['company_id'], 'group_id' => 14])->find();
|
$user = User::where(['company_id' => $params['company_id'], 'group_id' => 14])->find();
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
|
@ -116,7 +116,7 @@ class CompanyLogic extends BaseLogic
|
|||||||
AdminLogic::insertRole($admin_id, [6]);
|
AdminLogic::insertRole($admin_id, [6]);
|
||||||
$admin['group_id']=5;
|
$admin['group_id']=5;
|
||||||
} elseif ($params['company_type']==41) {
|
} elseif ($params['company_type']==41) {
|
||||||
//镇管理公司 总负责人
|
//镇农科公司 总负责人
|
||||||
AdminLogic::insertRole($admin_id, [7]); //后台角色
|
AdminLogic::insertRole($admin_id, [7]); //后台角色
|
||||||
$admin['group_id']=15; // 前台角色
|
$admin['group_id']=15; // 前台角色
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ use think\facade\Db;
|
|||||||
use app\api\logic\SmsLogic;
|
use app\api\logic\SmsLogic;
|
||||||
use app\common\logic\CompanyLogic;
|
use app\common\logic\CompanyLogic;
|
||||||
use app\common\logic\UserLogic;
|
use app\common\logic\UserLogic;
|
||||||
|
use think\facade\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contract逻辑
|
* Contract逻辑
|
||||||
@ -297,6 +298,7 @@ class ContractLogic extends BaseLogic
|
|||||||
public static function postsms($params)
|
public static function postsms($params)
|
||||||
{
|
{
|
||||||
$result = self::detail($params);
|
$result = self::detail($params);
|
||||||
|
Log::info(['发送合同短信', $result]);
|
||||||
if ($result && $result['file'] != '') {
|
if ($result && $result['file'] != '') {
|
||||||
//发送短信
|
//发送短信
|
||||||
$data = [
|
$data = [
|
||||||
@ -352,6 +354,7 @@ class ContractLogic extends BaseLogic
|
|||||||
'code' => 'api/Hetong/url?id=' . $find['id'].'&type='.$v['type'],
|
'code' => 'api/Hetong/url?id=' . $find['id'].'&type='.$v['type'],
|
||||||
'scene' => 'WQ'
|
'scene' => 'WQ'
|
||||||
];
|
];
|
||||||
|
Log::info(['发送合同短信-消息体', $sms]);
|
||||||
$result = SmsLogic::contractUrl($sms);
|
$result = SmsLogic::contractUrl($sms);
|
||||||
if ($result != true) {
|
if ($result != true) {
|
||||||
return self::setError(SmsLogic::getError());
|
return self::setError(SmsLogic::getError());
|
||||||
|
@ -300,7 +300,7 @@ class TaskLogic extends BaseLogic
|
|||||||
public static function TownCronAdd(array $taskTemplate)
|
public static function TownCronAdd(array $taskTemplate)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Log::info(['镇管理公司定时任务下发-任务模板', $taskTemplate]);
|
Log::info(['镇农科公司定时任务下发-任务模板', $taskTemplate]);
|
||||||
// 单次任务不重复下发,在结算时刷新任务时间
|
// 单次任务不重复下发,在结算时刷新任务时间
|
||||||
if ($taskTemplate['types'] == 3) {
|
if ($taskTemplate['types'] == 3) {
|
||||||
$task = Task::where('template_id', $taskTemplate['id'])->find();
|
$task = Task::where('template_id', $taskTemplate['id'])->find();
|
||||||
@ -325,10 +325,10 @@ class TaskLogic extends BaseLogic
|
|||||||
'status' => 1
|
'status' => 1
|
||||||
];
|
];
|
||||||
$TaskSchedulingPlan = TaskSchedulingPlan::create($TaskSchedulingPlan_data);
|
$TaskSchedulingPlan = TaskSchedulingPlan::create($TaskSchedulingPlan_data);
|
||||||
Log::info(['镇管理公司定时任务下发-添加plan结果', $TaskSchedulingPlan]);
|
Log::info(['镇农科公司定时任务下发-添加plan结果', $TaskSchedulingPlan]);
|
||||||
|
|
||||||
$serviceManagerUser = User::where(['company_id'=>$taskTemplate['company_id'], 'group_id'=> 14])->find();
|
$serviceManagerUser = User::where(['company_id'=>$taskTemplate['company_id'], 'group_id'=> 14])->find();
|
||||||
Log::info(['镇管理公司定时任务下发-服务部长user信息', $serviceManagerUser]);
|
Log::info(['镇农科公司定时任务下发-服务部长user信息', $serviceManagerUser]);
|
||||||
$arr = [
|
$arr = [
|
||||||
'template_id' => $taskTemplate['id'],
|
'template_id' => $taskTemplate['id'],
|
||||||
'scheduling_plan_id' => $TaskSchedulingPlan['id'],
|
'scheduling_plan_id' => $TaskSchedulingPlan['id'],
|
||||||
@ -352,7 +352,7 @@ class TaskLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
$data['extend'] = json_encode($extend);
|
$data['extend'] = json_encode($extend);
|
||||||
$task_id = (new Task())->insertGetId($data);
|
$task_id = (new Task())->insertGetId($data);
|
||||||
Log::info(['镇管理公司定时任务下发-添加task结果', $task_id]);
|
Log::info(['镇农科公司定时任务下发-添加task结果', $task_id]);
|
||||||
TaskSchedulingPlan::where('id', $TaskSchedulingPlan['id'])->update(['task_id' => $task_id, 'is_execute' => 1]);
|
TaskSchedulingPlan::where('id', $TaskSchedulingPlan['id'])->update(['task_id' => $task_id, 'is_execute' => 1]);
|
||||||
// 任务累计进行天数 +1
|
// 任务累计进行天数 +1
|
||||||
TaskTemplate::where('id', $taskTemplate['id'])->inc('day_count')->update();
|
TaskTemplate::where('id', $taskTemplate['id'])->inc('day_count')->update();
|
||||||
@ -407,7 +407,7 @@ class TaskLogic extends BaseLogic
|
|||||||
public static function townTaskSettlement($taskSchedulePlan)
|
public static function townTaskSettlement($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Log::info(['镇管理公司定时任务结算执行-任务计划', $taskSchedulePlan]);
|
Log::info(['镇农科公司定时任务结算执行-任务计划', $taskSchedulePlan]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
// 任务类型用的数据字典主键id,将id和value作映射,避免测试和正式环境数据字典数据不一致时出问题
|
// 任务类型用的数据字典主键id,将id和value作映射,避免测试和正式环境数据字典数据不一致时出问题
|
||||||
$townTaskTypeList = DictData::where(['type_value' => 'town_task_type', 'status' => 1])->column('value', 'id');
|
$townTaskTypeList = DictData::where(['type_value' => 'town_task_type', 'status' => 1])->column('value', 'id');
|
||||||
@ -445,17 +445,17 @@ class TaskLogic extends BaseLogic
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error(['镇管理任务结算失败',$e]);
|
Log::error(['镇农科任务结算失败',$e]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统自动判定镇管理公司下属小组服务公司 是否100%完成每日任务:三轮车任务,档案更新任务,平台交易任务
|
* 系统自动判定镇农科公司下属小组服务公司 是否100%完成每日任务:三轮车任务,档案更新任务,平台交易任务
|
||||||
*/
|
*/
|
||||||
private static function dealTownTask1($taskSchedulePlan)
|
private static function dealTownTask1($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
|
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
|
||||||
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
||||||
@ -501,7 +501,7 @@ class TaskLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
private static function dealTownTask2($taskSchedulePlan)
|
private static function dealTownTask2($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
||||||
$day = $taskTemplateInfo['stage_day_one'] + $taskTemplateInfo['stage_day_two'];
|
$day = $taskTemplateInfo['stage_day_one'] + $taskTemplateInfo['stage_day_two'];
|
||||||
@ -602,7 +602,7 @@ class TaskLogic extends BaseLogic
|
|||||||
|
|
||||||
private static function dealTownTask3($taskSchedulePlan)
|
private static function dealTownTask3($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
||||||
$groupServiceCompanyList = Company::where(['street' => $townCompany['street'], 'company_type' => 18])->select()->toArray();
|
$groupServiceCompanyList = Company::where(['street' => $townCompany['street'], 'company_type' => 18])->select()->toArray();
|
||||||
@ -651,7 +651,7 @@ class TaskLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
private static function dealTownTask4($taskSchedulePlan)
|
private static function dealTownTask4($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
||||||
$taskDayCount = $taskTemplateInfo['day_count']; // 任务累计进行天数
|
$taskDayCount = $taskTemplateInfo['day_count']; // 任务累计进行天数
|
||||||
@ -743,12 +743,12 @@ class TaskLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查镇所属小组服务公司当日实际完成金额总和+镇管理公司的资金池
|
* 查镇所属小组服务公司当日实际完成金额总和+镇农科公司的资金池
|
||||||
* 查镇所属小组服务公司当日任务目标金额总和
|
* 查镇所属小组服务公司当日任务目标金额总和
|
||||||
*/
|
*/
|
||||||
private static function dealTownTask5($taskSchedulePlan)
|
private static function dealTownTask5($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
||||||
$townTask = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
$townTask = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
||||||
@ -770,7 +770,7 @@ class TaskLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 完成条件: 查镇所属小组服务公司当日实际完成金额总和+镇管理公司的资金池 > 查镇所属小组服务公司当日任务目标金额总和
|
// 完成条件: 查镇所属小组服务公司当日实际完成金额总和+镇农科公司的资金池 > 查镇所属小组服务公司当日任务目标金额总和
|
||||||
if($targetAmount != 0 && bcadd($townTransactionPool, $townTotalTradeAmount, 2) >= $targetAmount) {
|
if($targetAmount != 0 && bcadd($townTransactionPool, $townTotalTradeAmount, 2) >= $targetAmount) {
|
||||||
// 将余下金额放入镇交易池
|
// 将余下金额放入镇交易池
|
||||||
$leftTransactionPool = bcsub(bcadd($townTransactionPool, $townTotalTradeAmount, 2), $targetAmount, 2);
|
$leftTransactionPool = bcsub(bcadd($townTransactionPool, $townTotalTradeAmount, 2), $targetAmount, 2);
|
||||||
@ -788,13 +788,13 @@ class TaskLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
private static function dealTownTask6($taskSchedulePlan)
|
private static function dealTownTask6($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
$taskDayCount = $taskTemplateInfo['day_count']; // 任务累计进行天数
|
$taskDayCount = $taskTemplateInfo['day_count']; // 任务累计进行天数
|
||||||
$task = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
$task = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
||||||
$stageDayOneAccumulative = $taskTemplateInfo['stage_day_one']; // 第一阶段累计天数
|
$stageDayOneAccumulative = $taskTemplateInfo['stage_day_one']; // 第一阶段累计天数
|
||||||
$stageDayTwoAccumulative = intval(bcadd($taskTemplateInfo['stage_day_one'], $taskTemplateInfo['stage_day_two'])); // 第二阶段累计天数 第一+第二
|
$stageDayTwoAccumulative = intval(bcadd($taskTemplateInfo['stage_day_one'], $taskTemplateInfo['stage_day_two'])); // 第二阶段累计天数 第一+第二
|
||||||
$townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇管理公司
|
$townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇农科公司
|
||||||
$villageCompanyList = Company::where(['street' => $townCompany['street'], 'company_type'=> 17])->select()->toArray(); // 村管理公司
|
$villageCompanyList = Company::where(['street' => $townCompany['street'], 'company_type'=> 17])->select()->toArray(); // 村管理公司
|
||||||
|
|
||||||
// 当前任务进行天数 < 第一+第二阶段天数 只刷新任务时间
|
// 当前任务进行天数 < 第一+第二阶段天数 只刷新任务时间
|
||||||
@ -850,10 +850,10 @@ class TaskLogic extends BaseLogic
|
|||||||
// 安全任务结算
|
// 安全任务结算
|
||||||
private static function dealTownTask7($taskSchedulePlan)
|
private static function dealTownTask7($taskSchedulePlan)
|
||||||
{
|
{
|
||||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||||
|
|
||||||
$townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇管理公司
|
$townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇农科公司
|
||||||
$task = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
$task = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
||||||
|
|
||||||
// 片区下公司有任一投诉都判定为未完成
|
// 片区下公司有任一投诉都判定为未完成
|
||||||
|
@ -44,7 +44,7 @@ class DictData extends BaseModel
|
|||||||
return $data['status'] ? '正常' : '停用';
|
return $data['status'] ? '正常' : '停用';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据镇管理公司任务类型,获取code
|
// 根据镇农科公司任务类型,获取code
|
||||||
public function getTownTaskType($typeId){
|
public function getTownTaskType($typeId){
|
||||||
$townTaskTypeList = DictData::where(['type_value' => 'town_task_type', 'status' => 1])->column('value', 'id');
|
$townTaskTypeList = DictData::where(['type_value' => 'town_task_type', 'status' => 1])->column('value', 'id');
|
||||||
if(isset($townTaskTypeList[$typeId])) {
|
if(isset($townTaskTypeList[$typeId])) {
|
||||||
|
@ -6,7 +6,7 @@ use app\common\logic\task\TaskLogic;
|
|||||||
use think\queue\Job;
|
use think\queue\Job;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务下发执行的具体逻辑
|
* 镇农科公司任务下发执行的具体逻辑
|
||||||
*/
|
*/
|
||||||
class TownTaskAdd
|
class TownTaskAdd
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@ use think\queue\Job;
|
|||||||
class TownTaskSettlementJob
|
class TownTaskSettlementJob
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务结算
|
* 镇农科公司任务结算
|
||||||
*/
|
*/
|
||||||
public function fire(Job $job, $taskSchedulingPlan)
|
public function fire(Job $job, $taskSchedulingPlan)
|
||||||
{
|
{
|
||||||
|
@ -19,13 +19,13 @@ class TownTaskCron extends Task {
|
|||||||
// $this->everyMinute();//每分钟
|
// $this->everyMinute();//每分钟
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务下发
|
* 镇农科公司任务下发
|
||||||
*/
|
*/
|
||||||
protected function execute()
|
protected function execute()
|
||||||
{
|
{
|
||||||
//任务下发
|
//任务下发
|
||||||
$time = strtotime(date('Y-m-d'));
|
$time = strtotime(date('Y-m-d'));
|
||||||
// 查询系统 所有镇管理公司 未下发 的 任务安排
|
// 查询系统 所有镇农科公司 未下发 的 任务安排
|
||||||
$taskSchedulingList = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->where('company_type', 41)->with('company_info')->select()->toArray();
|
$taskSchedulingList = TaskScheduling::where('cron_time', '<', $time)->where('status', 1)->where('company_type', 41)->with('company_info')->select()->toArray();
|
||||||
|
|
||||||
$taskSchedulingIds = [];
|
$taskSchedulingIds = [];
|
||||||
|
@ -15,7 +15,7 @@ class TownTaskSettlementCron extends Task
|
|||||||
// $this->everyMinute();//每分钟
|
// $this->everyMinute();//每分钟
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 镇管理公司任务结算
|
* 镇农科公司任务结算
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected function execute()
|
protected function execute()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user