作者 张关杰

hr dev

@@ -17,6 +17,7 @@ class AsideGlobalException extends Exception @@ -17,6 +17,7 @@ class AsideGlobalException extends Exception
17 { 17 {
18 $this->code = $code; 18 $this->code = $code;
19 $this->message = $message; 19 $this->message = $message;
  20 +
20 if (empty($this->message)) { 21 if (empty($this->message)) {
21 $this->message = Code::fromValue($code)->description; 22 $this->message = Code::fromValue($code)->description;
22 } 23 }
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers\Aside\Manage;
  4 +use App\Enums\Common\Code;
  5 +use App\Http\Controllers\Aside\BaseController;
  6 +use Illuminate\Http\Request;
  7 +use App\Http\Logic\Aside\Manage\HrLogic;
  8 +
  9 +class HrController extends BaseController
  10 +{
  11 + public function list(Request $request, HrLogic $logic)
  12 + {
  13 + $list = $logic->getList($this->param);
  14 + return $this->response('success', Code::SUCCESS, $list);
  15 + }
  16 +
  17 + public function info(Request $request, HrLogic $logic){
  18 + $request->validate([
  19 + 'id'=>'required'
  20 + ],[
  21 + 'id.required' => 'ID不能为空'
  22 + ]);
  23 + $data = $logic->getInfo($this->param['id']);
  24 + return $this->success($data);
  25 + }
  26 +
  27 + public function save(Request $request, HrLogic $logic){
  28 + //print_r($this->param);exit;
  29 + $data = $logic->save($this->param);
  30 + return $this->success($data);
  31 + }
  32 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Logic\Aside\Manage;
  4 +
  5 +
  6 +use App\Http\Logic\Aside\BaseLogic;
  7 +use App\Models\Aside\ManageHrModel;
  8 +use App\Models\Aside\ManageHrLogModel;
  9 +use Illuminate\Support\Facades\DB;
  10 +use Illuminate\Support\Facades\Hash;
  11 +
  12 +
  13 +/**
  14 + * Class ManageHrLogic
  15 + * @package App\Http\Logic\Aside\Manage
  16 + * @author zgj
  17 + * @date 2023/5/30
  18 + */
  19 +class HrLogic extends BaseLogic
  20 +{
  21 + public function __construct()
  22 + {
  23 + parent::__construct();
  24 + $this->model = new ManageHrModel();
  25 + }
  26 +
  27 +
  28 + public function save($param){
  29 + if(isset($param['id'])){
  30 + $id = $param['id'];
  31 + $data = $this->model->read($id);
  32 + if(empty($data)){
  33 + $this->fail('没有该数据');
  34 + }
  35 + $param['update_at'] = date("Y-m-d H:i:s");
  36 + return parent::save($param);
  37 + }else{
  38 +
  39 + }
  40 + }
  41 +}
  1 +<?php
  2 +
  3 +namespace App\Models\Aside;
  4 +
  5 +use Illuminate\Database\Eloquent\Factories\HasFactory;
  6 +use Illuminate\Database\Eloquent\Model;
  7 +
  8 +class ManageHrLogModel extends Model
  9 +{
  10 + protected $table = 'gl_manage_hr_log';
  11 + use HasFactory;
  12 +}
  1 +<?php
  2 +
  3 +namespace App\Models\Aside;
  4 +
  5 +use Illuminate\Database\Eloquent\Factories\HasFactory;
  6 +use Illuminate\Database\Eloquent\Model;
  7 +
  8 +class ManageHrModel extends Model
  9 +{
  10 + protected $table = 'gl_manage_hr';
  11 + //use HasFactory;
  12 +
  13 + /**
  14 + * 归属小组
  15 + * @return string[]
  16 + * @author zgj
  17 + * @date 2023/5/31
  18 + */
  19 + public static function belongGroup()
  20 + {
  21 + return [
  22 + 1 => 'KA组',
  23 + 2 => 'A组',
  24 + 3 => 'B组',
  25 + 4 => 'C组',
  26 + 5 => 'D组',
  27 + 6 => 'E组',
  28 + 7 => 'F组',
  29 + 8 => 'G组',
  30 + 9 => 'H组',
  31 + 10 => 'GA组',
  32 + 11=> 'GB组',
  33 + 12 => 'GC组',
  34 + 13 => '前端组',
  35 + 14 => '后端组',
  36 + 15 => '黑格组',
  37 + 16 => '售后组',
  38 + 0 => '其他',
  39 + ];
  40 + }
  41 +
  42 + /**
  43 + * 学历
  44 + * @return string[]
  45 + * @author zgj
  46 + * @date 2023/5/31
  47 + */
  48 + public static function education()
  49 + {
  50 + return [
  51 + 1 => '专科',
  52 + 2 => '本科',
  53 + 3 => '研究生及以上',
  54 + 0 => '其他',
  55 + ];
  56 + }
  57 + /**
  58 + * 入职岗位
  59 + * @return string[]
  60 + * @author zgj
  61 + * @date 2023/5/31
  62 + */
  63 + public static function entryPosition()
  64 + {
  65 + return [
  66 + 1 => '优化师',
  67 + 2 => '优化师助理',
  68 + 3 => '优化顾问',
  69 + 4 => '项目经理',
  70 + 5 => '平面设计',
  71 + 6 => '技术经理',
  72 + 7 => '技术主管',
  73 + 8 => '技术总监',
  74 + 9 => '渠道经理',
  75 + 10 => '前端研发',
  76 + 11=> '后端研发',
  77 + 12 => '行政财务',
  78 + 13 => '品牌营销',
  79 + 14 => '销售经理',
  80 + 15 => '销售主管',
  81 + 16 => '售后技术',
  82 + 17 => '售后服务',
  83 + 18 => '外贸销售',
  84 + 19 => '渠道助理',
  85 + 20 => '黑格运营',
  86 + 21 => '运营',
  87 + 22 => '短视频剪辑师',
  88 + 23 => '人事',
  89 + 24 => '采购',
  90 + 0 => '其他',
  91 + ];
  92 + }
  93 +
  94 + /**
  95 + * 级别序列
  96 + * @return string[]
  97 + * @author zgj
  98 + * @date 2023/5/31
  99 + */
  100 + public static function pLevel()
  101 + {
  102 + return [
  103 + 0 => '实习期/试用期(P0)',
  104 + 1 => '初级(P1)',
  105 + 2 => '初级(P2)',
  106 + 3 => '初级(P3)',
  107 + 4 => '中级(P4)',
  108 + 5 => '中级(P5)',
  109 + 6 => '中级(P6)',
  110 + 7 => '高级(P7)',
  111 + 8 => '高级(P8)',
  112 + 9 => '高级(P9)',
  113 + 10 => '高级(P10)',
  114 + 11=> '职务初级(M1)',
  115 + 12 => '职务初级(M2)',
  116 + 13 => '职务初级(M3)',
  117 + 14 => '职务中级(M4)',
  118 + 15 => '职务中级(M5)',
  119 + 16 => '职务中级(M6)',
  120 + 17 => '职务高级(M7)',
  121 + 18 => '职务高级(M8)',
  122 + 19 => '职务高级(M9)',
  123 + 20 => '职务高级(M10)',
  124 + ];
  125 + }
  126 + /**
  127 + * 是否党员
  128 + * @return string[]
  129 + * @author zgj
  130 + * @date 2023/5/31
  131 + */
  132 + public static function dangyuan()
  133 + {
  134 + return [
  135 + 0 => '群众',
  136 + 1 => '预备党员',
  137 + 2 => '正式党员',
  138 + ];
  139 + }
  140 +
  141 + /**
  142 + * 是否有党支部
  143 + * @return string[]
  144 + * @author zgj
  145 + * @date 2023/5/31
  146 + */
  147 + public static function dangzhibu()
  148 + {
  149 + return [
  150 + 0 => '无',
  151 + 1 => '是',
  152 + 2 => '否',
  153 + ];
  154 + }
  155 +}
@@ -98,6 +98,13 @@ Route::middleware(['web'])->group(function (){ //admin用渲染默认要加上w @@ -98,6 +98,13 @@ Route::middleware(['web'])->group(function (){ //admin用渲染默认要加上w
98 Route::post('/save', [Aside\Manage\DeptController::class, 'save'])->name('admin.dept_save'); 98 Route::post('/save', [Aside\Manage\DeptController::class, 'save'])->name('admin.dept_save');
99 Route::any('/delete', [Aside\Manage\DeptController::class, 'delete'])->name('admin.dept_delete'); 99 Route::any('/delete', [Aside\Manage\DeptController::class, 'delete'])->name('admin.dept_delete');
100 }); 100 });
  101 +
  102 + //人事管理
  103 + Route::prefix('hr')->group(function () {
  104 + Route::get('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr');
  105 + Route::get('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info');
  106 + Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save');
  107 + });
101 }); 108 });
102 109
103 //项目管理 110 //项目管理