Pārlūkot izejas kodu

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 4 gadi atpakaļ
vecāks
revīzija
9c12e7539e

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/EmployeeInfoDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.EmployeeInfo;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface EmployeeInfoDao extends BaseDAO<Long, EmployeeInfo> {
+
+	
+}

+ 309 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/EmployeeInfo.java

@@ -0,0 +1,309 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
+import com.ym.mec.biz.dal.enums.JobTypeEnum;
+
+/**
+ * 对应数据库表(employee_info):
+ */
+public class EmployeeInfo {
+
+	/**  */
+	private Long id;
+
+	@ApiModelProperty(value = "姓名", required = false)
+	private String realName;
+
+	@ApiModelProperty(value = "手机号码", required = false)
+	private String mobileNo;
+
+	@ApiModelProperty(value = "微信号", required = false)
+	private String wechatNo;
+
+	@ApiModelProperty(value = "身份证号", required = false)
+	private String idCard;
+
+	@ApiModelProperty(value = "年龄", required = false)
+	private Integer age;
+
+	@ApiModelProperty(value = "性别", required = false)
+	private boolean gender;
+
+	@ApiModelProperty(value = "出生年月日", required = false)
+	private java.util.Date birthdate;
+
+	@ApiModelProperty(value = "紧急联系人姓名", required = false)
+	private String emergencyContactName;
+
+	@ApiModelProperty(value = "紧急联系人关系", required = false)
+	private String emergencyContactRelation;
+
+	@ApiModelProperty(value = "紧急联系人电话", required = false)
+	private String emergencyContactPhone;
+
+	@ApiModelProperty(value = "所在城市", required = false)
+	private String liveCity;
+
+	@ApiModelProperty(value = "意向城市", required = false)
+	private String intentionCity;
+
+	@ApiModelProperty(value = "教育背景(时间,学历,毕业院校", required = false)
+	private String educationalBackground;
+
+	@ApiModelProperty(value = "声部", required = false)
+	private Integer subjectId;
+
+	@ApiModelProperty(value = "是否评估", required = false)
+	private boolean isInterviewed;
+
+	@ApiModelProperty(value = "其他综合情况", required = false)
+	private String otherComment;
+
+	@ApiModelProperty(value = "入职日期", required = false)
+	private java.util.Date entryDate;
+	
+	@ApiModelProperty(value = "分部", required = false)
+	private Integer organId;
+
+	@ApiModelProperty(value = "职位", required = false)
+	private JobTypeEnum position;
+
+	@ApiModelProperty(value = "工作性质(全职/兼职)", required = false)
+	private JobNatureEnum jobNature;
+
+	@ApiModelProperty(value = "是否是试用期", required = false)
+	private boolean isProbationPeriod;
+
+	@ApiModelProperty(value = "银行卡号", required = false)
+	private String bankCardNo;
+
+	@ApiModelProperty(value = "开户行", required = false)
+	private String bankAddress;
+
+	@ApiModelProperty(value = "离职日期", required = false)
+	private java.util.Date resignationDate;
+
+	/**  */
+	private java.util.Date createTime;
+
+	/**  */
+	private java.util.Date updateTime;
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getId() {
+		return this.id;
+	}
+
+	public void setRealName(String realName) {
+		this.realName = realName;
+	}
+
+	public String getRealName() {
+		return this.realName;
+	}
+
+	public void setMobileNo(String mobileNo) {
+		this.mobileNo = mobileNo;
+	}
+
+	public String getMobileNo() {
+		return this.mobileNo;
+	}
+
+	public void setWechatNo(String wechatNo) {
+		this.wechatNo = wechatNo;
+	}
+
+	public String getWechatNo() {
+		return this.wechatNo;
+	}
+
+	public void setIdCard(String idCard) {
+		this.idCard = idCard;
+	}
+
+	public String getIdCard() {
+		return this.idCard;
+	}
+
+	public void setAge(Integer age) {
+		this.age = age;
+	}
+
+	public Integer getAge() {
+		return this.age;
+	}
+
+	public void setGender(boolean gender) {
+		this.gender = gender;
+	}
+
+	public boolean isGender() {
+		return this.gender;
+	}
+
+	public void setBirthdate(java.util.Date birthdate) {
+		this.birthdate = birthdate;
+	}
+
+	public java.util.Date getBirthdate() {
+		return this.birthdate;
+	}
+
+	public void setEmergencyContactName(String emergencyContactName) {
+		this.emergencyContactName = emergencyContactName;
+	}
+
+	public String getEmergencyContactName() {
+		return this.emergencyContactName;
+	}
+
+	public void setEmergencyContactRelation(String emergencyContactRelation) {
+		this.emergencyContactRelation = emergencyContactRelation;
+	}
+
+	public String getEmergencyContactRelation() {
+		return this.emergencyContactRelation;
+	}
+
+	public void setEmergencyContactPhone(String emergencyContactPhone) {
+		this.emergencyContactPhone = emergencyContactPhone;
+	}
+
+	public String getEmergencyContactPhone() {
+		return this.emergencyContactPhone;
+	}
+
+	public void setLiveCity(String liveCity) {
+		this.liveCity = liveCity;
+	}
+
+	public String getLiveCity() {
+		return this.liveCity;
+	}
+
+	public void setIntentionCity(String intentionCity) {
+		this.intentionCity = intentionCity;
+	}
+
+	public String getIntentionCity() {
+		return this.intentionCity;
+	}
+
+	public void setEducationalBackground(String educationalBackground) {
+		this.educationalBackground = educationalBackground;
+	}
+
+	public String getEducationalBackground() {
+		return this.educationalBackground;
+	}
+
+	public void setSubjectId(Integer subjectId) {
+		this.subjectId = subjectId;
+	}
+
+	public Integer getSubjectId() {
+		return this.subjectId;
+	}
+
+	public void setIsInterviewed(boolean isInterviewed) {
+		this.isInterviewed = isInterviewed;
+	}
+
+	public boolean isIsInterviewed() {
+		return this.isInterviewed;
+	}
+
+	public void setOtherComment(String otherComment) {
+		this.otherComment = otherComment;
+	}
+
+	public String getOtherComment() {
+		return this.otherComment;
+	}
+
+	public void setEntryDate(java.util.Date entryDate) {
+		this.entryDate = entryDate;
+	}
+
+	public java.util.Date getEntryDate() {
+		return this.entryDate;
+	}
+
+	public void setPosition(JobTypeEnum position) {
+		this.position = position;
+	}
+
+	public JobTypeEnum getPosition() {
+		return this.position;
+	}
+
+	public void setJobNature(JobNatureEnum jobNature) {
+		this.jobNature = jobNature;
+	}
+
+	public JobNatureEnum getJobNature() {
+		return this.jobNature;
+	}
+
+	public void setIsProbationPeriod(boolean isProbationPeriod) {
+		this.isProbationPeriod = isProbationPeriod;
+	}
+
+	public boolean isIsProbationPeriod() {
+		return this.isProbationPeriod;
+	}
+
+	public void setBankCardNo(String bankCardNo) {
+		this.bankCardNo = bankCardNo;
+	}
+
+	public String getBankCardNo() {
+		return this.bankCardNo;
+	}
+
+	public void setBankAddress(String bankAddress) {
+		this.bankAddress = bankAddress;
+	}
+
+	public String getBankAddress() {
+		return this.bankAddress;
+	}
+
+	public void setResignationDate(java.util.Date resignationDate) {
+		this.resignationDate = resignationDate;
+	}
+
+	public java.util.Date getResignationDate() {
+		return this.resignationDate;
+	}
+
+	public void setCreateTime(java.util.Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public java.util.Date getCreateTime() {
+		return this.createTime;
+	}
+
+	public void setUpdateTime(java.util.Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public java.util.Date getUpdateTime() {
+		return this.updateTime;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 7 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java

@@ -1,17 +1,18 @@
 package com.ym.mec.biz.dal.entity;
 
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.enums.JobNatureEnum;
-import com.ym.mec.biz.dal.enums.JobTypeEnum;
-import com.ym.mec.biz.dal.enums.ProbationPeriodEnum;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
+import com.ym.mec.biz.dal.enums.JobTypeEnum;
+import com.ym.mec.biz.dal.enums.ProbationPeriodEnum;
+
 /**
  * 对应数据库表(teacher):
  */

+ 65 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EmployeeInfoQueryInfo.java

@@ -0,0 +1,65 @@
+package com.ym.mec.biz.dal.page;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
+import com.ym.mec.biz.dal.enums.JobTypeEnum;
+import com.ym.mec.common.page.QueryInfo;
+
+public class EmployeeInfoQueryInfo extends QueryInfo {
+
+	@ApiModelProperty(value = "姓名/编号/手机号", required = false)
+	private String userNameOrIdOrMobile;
+
+	@ApiModelProperty(value = "分部", required = false)
+	private Integer organId;
+
+	@ApiModelProperty(value = "声部", required = false)
+	private Integer subjectId;
+
+	@ApiModelProperty(value = "职位", required = false)
+	private JobTypeEnum position;
+
+	@ApiModelProperty(value = "工作性质(全职/兼职)", required = false)
+	private JobNatureEnum jobNature;
+
+	public String getUserNameOrIdOrMobile() {
+		return userNameOrIdOrMobile;
+	}
+
+	public void setUserNameOrIdOrMobile(String userNameOrIdOrMobile) {
+		this.userNameOrIdOrMobile = userNameOrIdOrMobile;
+	}
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
+	public Integer getSubjectId() {
+		return subjectId;
+	}
+
+	public void setSubjectId(Integer subjectId) {
+		this.subjectId = subjectId;
+	}
+
+	public JobTypeEnum getPosition() {
+		return position;
+	}
+
+	public void setPosition(JobTypeEnum position) {
+		this.position = position;
+	}
+
+	public JobNatureEnum getJobNature() {
+		return jobNature;
+	}
+
+	public void setJobNature(JobNatureEnum jobNature) {
+		this.jobNature = jobNature;
+	}
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/EmployeeInfoService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.EmployeeInfo;
+import com.ym.mec.common.service.BaseService;
+
+public interface EmployeeInfoService extends BaseService<Long, EmployeeInfo> {
+
+}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeInfoServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.EmployeeInfoDao;
+import com.ym.mec.biz.dal.entity.EmployeeInfo;
+import com.ym.mec.biz.service.EmployeeInfoService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class EmployeeInfoServiceImpl extends BaseServiceImpl<Long, EmployeeInfo>  implements EmployeeInfoService {
+	
+	@Autowired
+	private EmployeeInfoDao employeeInfoDao;
+
+	@Override
+	public BaseDAO<Long, EmployeeInfo> getDAO() {
+		return employeeInfoDao;
+	}
+	
+}

+ 185 - 0
mec-biz/src/main/resources/config/mybatis/EmployeeInfoMapper.xml

@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.EmployeeInfoDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.EmployeeInfo" id="EmployeeInfo">
+		<result column="id_" property="id" />
+		<result column="real_name_" property="realName" />
+		<result column="mobile_no_" property="mobileNo" />
+		<result column="wechat_no_" property="wechatNo" />
+		<result column="id_card_" property="idCard" />
+		<result column="age_" property="age" />
+		<result column="gender_" property="gender" />
+		<result column="birthdate_" property="birthdate" />
+		<result column="emergency_contact_name_" property="emergencyContactName" />
+		<result column="emergency_contact_relation_" property="emergencyContactRelation" />
+		<result column="emergency_contact_phone_" property="emergencyContactPhone" />
+		<result column="live_city_" property="liveCity" />
+		<result column="intention_city_" property="intentionCity" />
+		<result column="educational_background_" property="educationalBackground" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="is_interviewed_" property="isInterviewed" />
+		<result column="other_comment_" property="otherComment" />
+		<result column="entry_date_" property="entryDate" />
+		<result column="position_" property="position" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
+		<result column="job_nature_" property="jobNature" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
+		<result column="is_probation_period_" property="isProbationPeriod" />
+		<result column="bank_card_no_" property="bankCardNo" />
+		<result column="bank_address_" property="bankAddress" />
+		<result column="resignation_date_" property="resignationDate" />
+		<result column="organ_id_" property="organId" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="EmployeeInfo">
+		SELECT * FROM
+		employee_info WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="EmployeeInfo">
+		SELECT * FROM employee_info ORDER
+		BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.EmployeeInfo"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO employee_info
+		(id_,real_name_,mobile_no_,wechat_no_,id_card_,age_,gender_,birthdate_,emergency_contact_name_,emergency_contact_relation_,emergency_contact_phone_,live_city_,intention_city_,educational_background_,subject_id_,is_interviewed_,other_comment_,entry_date_,organ_id_,position_,job_nature_,is_probation_period_,bank_card_no_,bank_address_,resignation_date_,create_time_,update_time_)
+		VALUES(#{id},#{realName},#{mobileNo},#{wechatNo},#{idCard},#{age},#{gender},#{birthdate},#{emergencyContactName},#{emergencyContactRelation},#{emergencyContactPhone},#{liveCity},#{intentionCity},#{educationalBackground},#{subjectId},#{isInterviewed},#{otherComment},#{entryDate},#{organId},#{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isProbationPeriod},#{bankCardNo},#{bankAddress},#{resignationDate},#{createTime},#{updateTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.EmployeeInfo">
+		UPDATE employee_info
+		<set>
+			<if test="isProbationPeriod != null">
+				is_probation_period_ = #{isProbationPeriod},
+			</if>
+			<if test="subjectId != null">
+				subject_id_ = #{subjectId},
+			</if>
+			<if test="gender != null">
+				gender_ = #{gender},
+			</if>
+			<if test="entryDate != null">
+				entry_date_ = #{entryDate},
+			</if>
+			<if test="otherComment != null">
+				other_comment_ = #{otherComment},
+			</if>
+			<if test="jobNature != null">
+				job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="educationalBackground != null">
+				educational_background_ = #{educationalBackground},
+			</if>
+			<if test="emergencyContactPhone != null">
+				emergency_contact_phone_ = #{emergencyContactPhone},
+			</if>
+			<if test="resignationDate != null">
+				resignation_date_ = #{resignationDate},
+			</if>
+			<if test="position != null">
+				position_ = #{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="emergencyContactRelation != null">
+				emergency_contact_relation_ = #{emergencyContactRelation},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="bankCardNo != null">
+				bank_card_no_ = #{bankCardNo},
+			</if>
+			<if test="realName != null">
+				real_name_ = #{realName},
+			</if>
+			<if test="idCard != null">
+				id_card_ = #{idCard},
+			</if>
+			<if test="age != null">
+				age_ = #{age},
+			</if>
+			<if test="liveCity != null">
+				live_city_ = #{liveCity},
+			</if>
+			<if test="intentionCity != null">
+				intention_city_ = #{intentionCity},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+			<if test="wechatNo != null">
+				wechat_no_ = #{wechatNo},
+			</if>
+			<if test="isInterviewed != null">
+				is_interviewed_ = #{isInterviewed},
+			</if>
+			<if test="mobileNo != null">
+				mobile_no_ = #{mobileNo},
+			</if>
+			<if test="emergencyContactName != null">
+				emergency_contact_name_ = #{emergencyContactName},
+			</if>
+			<if test="birthdate != null">
+				birthdate_ = #{birthdate},
+			</if>
+			<if test="bankAddress != null">
+				bank_address_ = #{bankAddress},
+			</if>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM employee_info WHERE id_ = #{id}
+	</delete>
+	
+	<sql id="queryPageMap">
+		<where>
+			<if test="organId != null">
+            	AND organ_id_ = #{organId}
+	        </if>
+	        <if test="userNameOrIdOrMobile != null">
+	            AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR t.id_ = #{search})
+	        </if>
+	        <if test="subjectId != null">
+	            AND subject_id_ = #{subjectId}
+	        </if>
+	        <if test="position != null">
+	            AND position_ = #{position,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+	        </if>
+	        <if test="jobNature != null">
+	            AND job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+	        </if>
+		</where>
+    </sql>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="EmployeeInfo" parameterType="map">
+		SELECT * FROM employee_info 
+        <include refid="queryPageMap"/>
+		ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM employee_info
+        <include refid="queryPageMap"/>
+	</select>
+</mapper>

+ 57 - 0
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeInfoController.java

@@ -0,0 +1,57 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.entity.EmployeeInfo;
+import com.ym.mec.biz.dal.page.EmployeeInfoQueryInfo;
+import com.ym.mec.biz.service.EmployeeInfoService;
+import com.ym.mec.common.controller.BaseController;
+
+@RequestMapping("employeeInfo")
+@Api(tags = "员工信息服务")
+@RestController
+public class EmployeeInfoController extends BaseController {
+
+    @Autowired
+    private EmployeeInfoService employeeInfoService;
+
+    @ApiOperation(value = "新增员工信息")
+    @PostMapping("/insert")
+    @PreAuthorize("@pcs.hasPermissions('employeeInfo/insert')")
+    public Object insert(@RequestBody EmployeeInfo employeeInfo) {
+    	Date date = new Date();
+    	employeeInfo.setUpdateTime(date);
+    	employeeInfo.setCreateTime(date);
+    	employeeInfoService.insert(employeeInfo);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改员工信息")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('employeeInfo/update')")
+    public Object update(@RequestBody EmployeeInfo employeeInfo) {
+    	Date date = new Date();
+    	employeeInfo.setUpdateTime(date);
+    	employeeInfoService.update(employeeInfo);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询员工列表")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('employeeInfo/queryPage')")
+    public Object queryPage(EmployeeInfoQueryInfo queryInfo) {
+        return succeed(employeeInfoService.queryPage(queryInfo));
+    }
+
+}