Commit 18a4d8f3 by 翁国栋

Merge remote-tracking branch 'origin/develop' into develop

parents 966afa02 470d48d7
package cn.timer.api.bean.yggl;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* 人事表格表
* @TableName yggl_personnel_form
*/
@TableName(value ="yggl_personnel_form")
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("人事表格表")
public class YgglPersonnelForm extends Model<YgglPersonnelForm> {
/**
*
*/
@Id
@TableId
private Long id;
/**
* 文件名称
*/
@ApiModelProperty(value = "文件名称")
private String fileName;
/**
* 文件地址
*/
@ApiModelProperty(value = "文件地址")
private String fileUrl;
/**
* 文件图标
*/
@ApiModelProperty(value = "文件图标")
private String fileIcon;
/**
* 类型 0:通知与证明,1:合同与协议,2:人事文档
*/
@ApiModelProperty(value = "类型 0:通知与证明,1:合同与协议,2:人事文档")
private Integer type;
/**
* 逻辑删除标记0.未删除 1.删除
*/
@ApiModelProperty(value = "逻辑删除标记0.未删除 1.删除")
private Integer deleteFlag;
/**
* 组织机构id
*/
@ApiModelProperty(value = "组织机构id")
private Integer orgCode;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -5,7 +5,6 @@
*/
package cn.timer.api.controller.yggl;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -26,6 +25,7 @@ import cn.timer.api.bean.yggl.*;
import cn.timer.api.bean.zzgl.ZzglLogDgjl;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
import cn.timer.api.dao.yggl.YgglAttaHtxxbMapper;
import cn.timer.api.dao.yggl.YgglPersonnelFormMapper;
import cn.timer.api.dto.yggl.*;
import cn.timer.api.utils.redis.RedisUtil;
import com.google.common.collect.Lists;
......@@ -171,6 +171,9 @@ public class YgglController {
@Autowired
private YgglAttaHtxxbMapper ygglAttaHtxxbMapper;
@Autowired
private YgglPersonnelFormMapper ygglPersonnelFormMapper;
/**
* 获取员工档案
*
......@@ -2102,4 +2105,52 @@ public class YgglController {
return ResultUtil.data(htgkDtos);
}
@GetMapping(value = "/getPersonnelForm")
@ApiOperation(value = "人事--人事表格列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglPersonnelForm>> getPersonnelForm(@CurrentUser UserBean userBean,String query) {
List<YgglPersonnelForm> personnelForms = ygglPersonnelFormMapper.selectList(new QueryWrapper<YgglPersonnelForm>().lambda()
.eq(YgglPersonnelForm::getDeleteFlag, 0)
.like(!StrUtil.isEmpty(query),YgglPersonnelForm::getFileName, query)
.and(QueryWrapper -> QueryWrapper.eq(YgglPersonnelForm::getOrgCode, userBean.getOrgCode())
.or().isNull(YgglPersonnelForm::getOrgCode)));
return ResultUtil.data(personnelForms);
}
@GetMapping(value = "/updateFormFileName")
@ApiOperation(value = "人事--修改人事表格文件名", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> updateFormFileName(@CurrentUser UserBean userBean,@RequestParam("fileName") String fileName,@RequestParam("id") Long id) {
try {
YgglPersonnelForm.builder().id(id).fileName(fileName).build().updateById();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
return ResultUtil.success();
}
@GetMapping(value = "/removePersonnelForm")
@ApiOperation(value = "人事--删除人事表格文件", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> removeFormFileName(@CurrentUser UserBean userBean,@RequestParam("id") Long id) {
try {
YgglPersonnelForm.builder().id(id).deleteFlag(1).build().updateById();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
return ResultUtil.success();
}
@PostMapping(value = "/addPersonnelForm")
@ApiOperation(value = "人事--新增人事表格文件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> addPersonnelForm(@CurrentUser UserBean userBean,@RequestBody PersonnelFormDto personnelFormDto) {
try {
YgglPersonnelForm.builder().fileName(personnelFormDto.getFileName()).fileUrl(personnelFormDto.getFileUrl()).type(personnelFormDto.getType()).build().insert();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
return ResultUtil.success();
}
}
package cn.timer.api.dao.yggl;
import cn.timer.api.bean.yggl.YgglPersonnelForm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author admin
* @description 针对表【yggl_personnel_form(人事表格表)】的数据库操作Mapper
* @createDate 2022-05-06 18:16:06
* @Entity generator.domain.YgglPersonnelForm
*/
public interface YgglPersonnelFormMapper extends BaseMapper<YgglPersonnelForm> {
}
package cn.timer.api.dto.yggl;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PersonnelFormDto {
/**
*
*/
@Id
@TableId
private Long id;
/**
* 文件名称
*/
@ApiModelProperty(value = "文件名称")
private String fileName;
/**
* 文件地址
*/
@ApiModelProperty(value = "文件地址")
private String fileUrl;
/**
* 文件图标
*/
@ApiModelProperty(value = "文件图标")
private String fileIcon;
/**
* 类型 0:通知与证明,1:合同与协议,2:人事文档
*/
@ApiModelProperty(value = "类型 0:通知与证明,1:合同与协议,2:人事文档")
private Integer type;
/**
* 逻辑删除标记0.未删除 1.删除
*/
@ApiModelProperty(value = "逻辑删除标记0.未删除 1.删除")
private Integer deleteFlag;
/**
* 组织机构id
*/
@ApiModelProperty(value = "组织机构id")
private Integer orgCode;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
<?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="cn.timer.api.dao.yggl.YgglPersonnelFormMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.yggl.YgglPersonnelForm">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="fileName" column="file_name" jdbcType="VARCHAR"/>
<result property="fileUrl" column="file_url" jdbcType="VARCHAR"/>
<result property="fileIcon" column="file_icon" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id,file_name,file_url,
file_icon,type
</sql>
</mapper>
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