Commit ce3912b9 authored by yinxiaoling's avatar yinxiaoling

char 改 varchar

parent def712dc
...@@ -95,6 +95,7 @@ class StrategySetController extends Controller ...@@ -95,6 +95,7 @@ class StrategySetController extends Controller
$params['strategy_sn'] = $strategySn; $params['strategy_sn'] = $strategySn;
$params['user_name'] = $allowLoginUser['user_name']; $params['user_name'] = $allowLoginUser['user_name'];
$params['parent_sn'] = $allowLoginUser['parent_sn']; $params['parent_sn'] = $allowLoginUser['parent_sn'];
//Log::channel('api')->info(var_export($params,true));
$StrategySet = new StrategySet($params); $StrategySet = new StrategySet($params);
$setReturn = $StrategySet->save(); $setReturn = $StrategySet->save();
if ($setReturn){ //策略保存成功,处理excel数据 if ($setReturn){ //策略保存成功,处理excel数据
......
...@@ -31,6 +31,7 @@ class StrategyTaskJob implements ShouldQueue ...@@ -31,6 +31,7 @@ class StrategyTaskJob implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
$StrategyService = new StrategyService(); $StrategyService = new StrategyService();
$StrategyService->createTaskDataJob($this->paramsArr['strategySn']); $StrategyService->createTaskDataJob($this->paramsArr['strategySn']);
} }
......
...@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; ...@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class StrategySet extends Model class StrategySet extends Model
{ {
protected $fillable = ['call_number','strategy_sn','strategy_name','user_sn','user_name','parent_sn','project_sn','day_type','frequency_type','call_time_set','disabled']; protected $fillable = ['latest_total','total','call_number','strategy_sn','strategy_name','user_sn','user_name','parent_sn','project_sn','day_type','frequency_type','call_time_set','disabled'];
protected $table = 'strategy_set'; protected $table = 'strategy_set';
......
...@@ -136,7 +136,7 @@ class StrategyService ...@@ -136,7 +136,7 @@ class StrategyService
foreach($arr as $v){ foreach($arr as $v){
$col[$v]=12; $col[$v]=12;
} }
$sheet->setWidth($col); //$sheet->setWidth($col);
foreach ($arr as $k=> $v){ foreach ($arr as $k=> $v){
$objRichText = new \PHPExcel_RichText(); $objRichText = new \PHPExcel_RichText();
if(!empty($datas[0][$k])){ if(!empty($datas[0][$k])){
...@@ -196,8 +196,9 @@ class StrategyService ...@@ -196,8 +196,9 @@ class StrategyService
$insertTemp['updated_at'] = $now; $insertTemp['updated_at'] = $now;
$insertData[] = $insertTemp; $insertData[] = $insertTemp;
} }
//dd($insertData); //Log::channel('api')->info(var_export($insertData,true));
$insertExcelReturn = StrategyExcel::insert($insertData); $insertExcelReturn = StrategyExcel::insert($insertData);
//Log::channel('api')->info($insertExcelReturn);
if ($insertExcelReturn){//创建任务数据,这一步剥离出来,不然接口返回太慢,方案==,使用队列处理 if ($insertExcelReturn){//创建任务数据,这一步剥离出来,不然接口返回太慢,方案==,使用队列处理
$jobParams = ['strategySn'=>$strategySn]; $jobParams = ['strategySn'=>$strategySn];
// /opt/lampp/bin/php /opt/lampp/xiaoa/xiaoa-aic/artisan queue:work --queue=StrategyTask --sleep=3 --tries=0 --daemon --timeout=90 // /opt/lampp/bin/php /opt/lampp/xiaoa/xiaoa-aic/artisan queue:work --queue=StrategyTask --sleep=3 --tries=0 --daemon --timeout=90
......
...@@ -19,16 +19,16 @@ class DatabaseSeeder extends Seeder ...@@ -19,16 +19,16 @@ class DatabaseSeeder extends Seeder
Schema::create($tableName, function (Blueprint $table){ Schema::create($tableName, function (Blueprint $table){
$table->increments('id'); $table->increments('id');
$table->uuid('strategy_sn')->comment('sn编号'); //sn编号 $table->uuid('strategy_sn')->comment('sn编号'); //sn编号
$table->char('strategy_name',50)->comment('策略名称'); $table->string('strategy_name',50)->comment('策略名称');
$table->char('user_sn',100)->comment('用户sn'); $table->string('user_sn',100)->comment('用户sn');
$table->char('user_name',50)->comment('用户名'); $table->string('user_name',50)->comment('用户名');
$table->char('call_number',50)->comment('主叫号码'); $table->string('call_number',50)->comment('主叫号码');
$table->char('parent_sn',50)->comment('主账号名'); $table->string('parent_sn',50)->comment('主账号名');
$table->char('project_sn',100)->comment('项目sn'); $table->string('project_sn',100)->comment('项目sn');
$table->unsignedSmallInteger('day_type')->default(0)->comment('外呼日期类型 0每天 1日期前一天和当天'); $table->unsignedSmallInteger('day_type')->default(0)->comment('外呼日期类型 0每天 1日期前一天和当天');
$table->unsignedSmallInteger('frequency_type')->default(1)->comment('外呼频率类型 (1 一天一次 2 一天两次)'); $table->unsignedSmallInteger('frequency_type')->default(1)->comment('外呼频率类型 (1 一天一次 2 一天两次)');
$table->char('call_time_set',50)->comment('呼叫设置时间点,两个用#号分割'); $table->string('call_time_set',50)->comment('呼叫设置时间点,两个用#号分割');
$table->unsignedSmallInteger('disabled')->default(0)->comment('是否不可用 0启用 1停用'); $table->unsignedSmallInteger('disabled')->default(0)->comment('是否不可用 0启用 1停用');
$table->integer('total')->default(0)->comment('excel导入号码总数量'); $table->integer('total')->default(0)->comment('excel导入号码总数量');
$table->integer('latest_total')->default(0)->comment('最新一次导入excel号码数量'); $table->integer('latest_total')->default(0)->comment('最新一次导入excel号码数量');
...@@ -47,8 +47,8 @@ class DatabaseSeeder extends Seeder ...@@ -47,8 +47,8 @@ class DatabaseSeeder extends Seeder
if(!Schema::hasTable($tableName)){ if(!Schema::hasTable($tableName)){
Schema::create($tableName, function (Blueprint $table){ Schema::create($tableName, function (Blueprint $table){
$table->increments('id'); $table->increments('id');
$table->char('strategy_sn',100)->comment('sn编号'); $table->string('strategy_sn',100)->comment('sn编号');
$table->char('name',50)->nullable()->comment('姓名'); $table->string('name',50)->nullable()->comment('姓名');
$table->date('duty_date')->nullable()->comment('值班日期'); $table->date('duty_date')->nullable()->comment('值班日期');
$table->unsignedBigInteger('phone')->comment('手机号'); $table->unsignedBigInteger('phone')->comment('手机号');
$table->unsignedSmallInteger('last_handle_month')->default(0)->comment('最后处理月份,当月处理后不再处理'); $table->unsignedSmallInteger('last_handle_month')->default(0)->comment('最后处理月份,当月处理后不再处理');
...@@ -66,16 +66,16 @@ class DatabaseSeeder extends Seeder ...@@ -66,16 +66,16 @@ class DatabaseSeeder extends Seeder
Schema::create($tableName, function (Blueprint $table){ Schema::create($tableName, function (Blueprint $table){
$table->increments('id'); $table->increments('id');
$table->uuid('strategy_sn')->comment('策略sn编号'); //sn编号 $table->uuid('strategy_sn')->comment('策略sn编号'); //sn编号
$table->char('name',50)->nullable()->comment('姓名'); $table->string('name',50)->nullable()->comment('姓名');
$table->date('duty_date')->nullable()->comment('值班日期(年月日)'); $table->date('duty_date')->nullable()->comment('值班日期(年月日)');
$table->timestamp('import_date')->nullable()->comment('导入日期(年-月-日 时:分:秒)'); $table->timestamp('import_date')->nullable()->comment('导入日期(年-月-日 时:分:秒)');
$table->unsignedBigInteger('phone')->comment('手机号'); $table->unsignedBigInteger('phone')->comment('手机号');
$table->char('call_number',50)->comment('主叫号码'); $table->string('call_number',50)->comment('主叫号码');
$table->date('call_date')->comment('外呼时间(年月日)'); $table->date('call_date')->comment('外呼时间(年月日)');
$table->time('call_time')->comment('外呼时间(时分秒)'); $table->time('call_time')->comment('外呼时间(时分秒)');
$table->char('parent_sn',50)->comment('主账号名'); $table->string('parent_sn',50)->comment('主账号名');
$table->char('user_sn',50)->comment('账号sn'); $table->string('user_sn',50)->comment('账号sn');
$table->char('project_sn',100)->comment('项目sn'); $table->string('project_sn',100)->comment('项目sn');
$table->unsignedSmallInteger('is_created')->default(0)->comment('是否新建任务(0未建 1已建)'); $table->unsignedSmallInteger('is_created')->default(0)->comment('是否新建任务(0未建 1已建)');
$table->unsignedSmallInteger('created_fail_number')->default(0)->comment('任务创建失败尝试次数'); $table->unsignedSmallInteger('created_fail_number')->default(0)->comment('任务创建失败尝试次数');
......
...@@ -30,4 +30,6 @@ REDIS_HOST=120.77.61.117 ...@@ -30,4 +30,6 @@ REDIS_HOST=120.77.61.117
8、添加小a这边接口支持值班策略项目访问路由及中间件 8、添加小a这边接口支持值班策略项目访问路由及中间件
9、添加crontab定时任务
* * * * * /opt/lampp/bin/php /opt/lampp/xiaoa/xiaoa-aic/artisan schedule:run >> /dev/null 2>&1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment