Recruitment application for thinkp5 to develop OA office system

Development and operation environment:

Shenzhou notebook K650D-G6D1 i5-6400 GTX950M

Windows 10 professional

Nginx or Apache Web server software

MySQL 5.7. X database

PHP7.1.0

PHPStrom 2017

PowerDesigner 16.5

Axure RP8

Prototype design drawing (recruitment application)

Database table (recruitment application): recruitment application ID, application date, position, number of positions prepared, time of arrival, subordinate department, number of on-the-job employees, number of employees, recruitment reason, recruitment reason others, responsibility description, job qualification description, education background, discipline knowledge, functional level, comprehensive ability, language ability, computer level, work experience, gender, age, Other, add time, edit time, add person, edit person, delete or not.

SQL code of recruitment application form:

create table zy_recruit_apply
(
 apply_id int not null auto_increment comment 'Application for recruitment ID',
 apply_date int not null default 0 comment 'Date of application',
 post char(50) not null default '' comment 'post',
 post_count smallint not null default 0 comment 'Number of employees',
 arrival_time int not null default 0 comment 'Arrival time',
 org_dpm_id int not null default 0 comment 'Subordinate departments',
 on_post_count smallint not null default 0 comment 'Number of persons on duty',
 recruit_count smallint not null default 0 comment 'Number of recruits',
 recruit_reason char(100) not null default '' comment 'Recruitment reason: 0-Other 1-Reserve talents 2-Part time job 3-Termination supplement 4-Expand preparation (multiple selection) "," Separation)',
 recruit_reason_other char(100) not null default '' comment 'Recruitment reasons other: record recruitment reasons-Description of other options',
 duty_explain text comment 'Job description',
 post_explain varchar(500) not null default '' comment 'Qualification description',
 education char(50) not null default '' comment 'Education',
 subject_knowledge char(200) not null default '' comment 'Subject knowledge',
 function_level char(255) not null default '' comment 'Functional grade',
 composite_ability char(255) not null default '' comment 'Comprehensive ability',
 language_ability char(255) not null default '' comment 'Language ability',
 computer_level char(255) not null default '' comment 'Computer level',
 work_experience char(255) not null default '' comment 'Hands-on background',
 sex tinyint not null default 0 comment 'Gender: 0, not limited to 1 male and 2 female',
 age char(50) not null default '' comment 'Age',
 other char(255) not null default '' comment 'Other',
 add_time int not null default 0 comment 'Adding time',
 edit_time int not null default 0 comment 'Editing time',
 add_uid int not null default 0 comment 'Add people',
 edit_uid int not null default 0 comment 'Editor',
 is_del tinyint not null default 0 comment 'Delete: 0 No 1 yes',
 primary key (apply_id)
);
alter table zy_recruit_apply comment 'Application for recruitment';

Recruitment application form interface:

PHP implementation code:

public function add(){
 $orgDpmLogic = new OrgDepartmentLogic();
 $listTree = $orgDpmLogic->listOrderTree(0);
 $this->assign('listTree',$listTree);
 $recruitReason = config('recruit_reason');
 $this->assign('recruitReason',$recruitReason);
 $this->assign('sex',[0=>'Unlimited',1=>'male',2=>'female']);
 //Approval template type - 1 recruitment application
 $templateType = 1;
 $approvalTypeLogic = new ApprovalTypeLogic();
 $approvalType = $approvalTypeLogic->getRecordByTemplateType($templateType);
 if(!$approvalType){
 $this->error('Approval template does not exist!');
 exit;
 }
 //Obtain recruitment application process
 $approvalFlowLogic = new ApprovalFlowLogic();
 $approvalFlowList = $approvalFlowLogic->getRecordList($approvalType['type_id']);
 $this->assign('approvalType',$approvalType);
 $this->assign('approvalFlowList',$approvalFlowList);
 return $this->fetch();
}
public function add_save(){
 $result = new Result();
 if($this->request->isPost() == false){
 $result->msg = 'Failed to add: illegal operation!';
 $result->success = false;
 return $result;
 }
 $postData = $this->request->post();
 $result = $this->addEditEmptyCheck($postData);
 if(!$result->success) return $result;
 $postData['apply_date'] = strtotime($postData['apply_date']);
 $postData['arrival_time'] = strtotime($postData['arrival_time']);
 if(isset($postData['recruit_reason']) && count($postData['recruit_reason'])){
 $postData['recruit_reason'] = implode(',',$postData['recruit_reason']);
 }else{
 $postData['recruit_reason'] = '';
 }
 $uid = $this->userId;
 $time = time();
 $postData['add_time'] = $time;
 $postData['add_uid'] = $uid;
 $postData['edit_time'] = $time;
 $postData['edit_uid'] = $uid;
 $detail = $postData['detail'];
 unset($postData['detail']);
 $typeId = $postData['type_id'];
 unset($postData['type_id']);
 $result = $this->logic->addRecruitApply($postData);
 //Initiate approval
 if($result->success){
 $approval = array();
 $approval['type_id'] = $typeId;
 $approval['title'] = 'Application for recruitment-'.date('YmdHis',time());
 $approval['approval_status'] = 0;
 $approval['initiate_uid'] = $this->userId;
 $approval['source_id'] = $result->data;
 $detailList = array();
 foreach($detail['approval_uid'] as $k=>$v){
 $data = array();
 $data['approval_id'] = 0;
 $data['approval_uid'] = $v;
 $data['flow_id'] = $detail['flow_id'][$k];
 $data['approval_weight'] = $detail['approval_weight'][$k];
 array_push($detailList,$data);
 }
 $approvalLogic = new ApprovalLogic();
 $approvalLogic->startApproval($approval,$detailList);
 }
 return $result;
}

This is the code of the Controller layer. The business implementation Logic is implemented in the Logic business Logic layer.

Author: ACRM underwriter, kjuQ-kjuQ:282130106.

If reprinted, please indicate the original author and source, thank you.

Keywords: Programming Database Windows Nginx Apache

Added by marukochan on Sat, 07 Dec 2019 04:11:50 +0200