Commit 2191704e authored by fangxinjiang's avatar fangxinjiang

代码优化

parent 55132bbf
......@@ -117,41 +117,6 @@ public class TCertRecord extends BaseEntity {
@Schema(description ="印章名称")
private String seal;
/**
* 创建者
*/
@ExcelAttribute(name = "创建者" )
@Schema(description ="创建者")
private String createBy;
/**
* 更新人
*/
@ExcelAttribute(name = "更新人" )
@Schema(description ="更新人")
private String updateBy;
/**
* 创建人姓名
*/
@ExcelAttribute(name = "创建人姓名" )
@Schema(description ="创建人姓名")
private String createName;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间" )
@Schema(description ="创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@ExcelAttribute(name = "更新时间" )
@Schema(description ="更新时间")
private LocalDateTime updateTime;
/**
* 证明类型:0 在职 1 离职2劳动合同解除 3调档函4.代缴证明
*/
......@@ -174,10 +139,10 @@ public class TCertRecord extends BaseEntity {
private String leaveReason;
/**
* 性别:0男 1
* 性别:1男 2
*/
@ExcelAttribute(name = "性别:0男 1女" )
@Schema(description ="性别:0男 1女")
@ExcelAttribute(name = "性别" )
@Schema(description ="性别:1男 2女,和档案一致")
private String sex;
/**
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 员工不良记录
*
* @author fxj
* @date 2022-06-29 15:50:45
*/
@Data
@TableName("t_emp_bad_record")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "员工不良记录")
public class TEmpBadRecord extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelAttribute(name = "主键" )
@Schema(description ="主键")
@ExcelIgnore
private String id;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" ,maxLength = 20)
@Schema(description ="员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 员工ID
*/
@ExcelAttribute(name = "员工ID")
@Schema(description ="员工ID")
@ExcelIgnore
private String empId;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" ,maxLength = 20)
@Schema(description ="身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 产生项目
*/
@ExcelAttribute(name = "产生项目" ,maxLength = 50)
@Schema(description ="产生项目")
@ExcelProperty("产生项目")
private String project;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码" ,maxLength = 50)
@Schema(description ="项目编码")
@ExcelProperty("项目编码")
private String projectCode;
/**
* 发生时间
*/
@ExcelAttribute(name = "发生时间" )
@Schema(description ="发生时间")
@ExcelProperty("发生时间")
private Date happenTime;
/**
* 备注
*/
@ExcelAttribute(name = "备注", maxLength = 200)
@Schema(description ="备注")
@ExcelProperty("备注")
private String remark;
/**
* 费用损失 (费用损失与其他费用损失其一必填)
*/
@ExcelAttribute(name = "费用损失 " )
@Schema(description ="费用损失 (费用损失与其他费用损失其一必填)")
@ExcelProperty("费用损失")
private BigDecimal loseFee;
/**
* 其他损失 (费用损失与其他费用损失其一必填)
*/
@ExcelAttribute(name = "其他损失" )
@Schema(description ="其他损失 (费用损失与其他费用损失其一必填)")
@ExcelProperty("其他损失")
private BigDecimal loseFeeOther;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Date 2022/6/29
* @Description
* @Version 1.0
*/
@Data
public class EmpBadRecordSearchVo extends TEmpBadRecord {
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author fxj
* @Date 2022/6/29
* @Description
* @Version 1.0
*/
@Data
public class EmpBadRecordVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" ,maxLength = 20, isNotEmpty = true)
@Schema(description ="员工姓名")
private String empName;
/**
* 员工ID
*/
@ExcelAttribute(name = "员工ID")
@Schema(description ="员工ID")
private String empId;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号" ,maxLength = 20, isNotEmpty = true)
@Schema(description ="身份证号")
private String empIdcard;
/**
* 产生项目
*/
@ExcelAttribute(name = "产生项目" ,maxLength = 50, isNotEmpty = true)
@Schema(description ="产生项目")
private String project;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码" ,maxLength = 50, isNotEmpty = true)
@Schema(description ="项目编码")
private String projectCode;
/**
* 发生时间
*/
@ExcelAttribute(name = "发生时间" , isNotEmpty = true)
@Schema(description ="发生时间")
private Date happenTime;
/**
* 备注
*/
@ExcelAttribute(name = "备注", maxLength = 200, isNotEmpty = true)
@Schema(description ="备注")
private String remark;
/**
* 费用损失 (费用损失与其他费用损失其一必填)
*/
@ExcelAttribute(name = "费用损失 " )
@Schema(description ="费用损失 (费用损失与其他费用损失其一必填)")
private BigDecimal loseFee;
/**
* 其他损失 (费用损失与其他费用损失其一必填)
*/
@ExcelAttribute(name = "其他损失" )
@Schema(description ="其他损失 (费用损失与其他费用损失其一必填)")
private BigDecimal loseFeeOther;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpBadRecordService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpBadRecordSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 员工不良记录
*
* @author fxj
* @date 2022-06-29 15:50:45
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tempbadrecord" )
@Tag(name = "员工不良记录管理")
public class TEmpBadRecordController {
private final TEmpBadRecordService tEmpBadRecordService;
/**
* 分页查询
* @param page 分页对象
* @param tEmpBadRecord 员工不良记录
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
//@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_get')" )
public R<IPage<TEmpBadRecord>> getTEmpBadRecordPage(Page page, EmpBadRecordSearchVo tEmpBadRecord) {
return R.ok(tEmpBadRecordService.pageDiy(page, tEmpBadRecord));
}
/**
* 不分页查询
* @param tEmpBadRecord 员工不良记录
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage" )
//@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_get')" )
public R<List<TEmpBadRecord>> getTEmpBadRecordNoPage(@RequestBody EmpBadRecordSearchVo tEmpBadRecord) {
return R.ok(tEmpBadRecordService.noPageDiy(tEmpBadRecord));
}
/**
* 通过id查询员工不良记录
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_tempbadrecord_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_get')" )
public R<TEmpBadRecord> getById(@PathVariable("id" ) String id) {
return R.ok(tEmpBadRecordService.getById(id));
}
/**
* 新增员工不良记录
* @param tEmpBadRecord 员工不良记录
* @return R
*/
@Operation(summary = "新增员工不良记录", description = "新增员工不良记录:hasPermission('demo_tempbadrecord_add')")
@SysLog("新增员工不良记录" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_add')" )
public R<Boolean> save(@RequestBody TEmpBadRecord tEmpBadRecord) {
return tEmpBadRecordService.saveDiy(tEmpBadRecord);
}
/**
* 修改员工不良记录
* @param tEmpBadRecord 员工不良记录
* @return R
*/
@Operation(summary = "修改员工不良记录", description = "修改员工不良记录:hasPermission('demo_tempbadrecord_edit')")
@SysLog("修改员工不良记录" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_edit')" )
public R<Boolean> updateById(@RequestBody TEmpBadRecord tEmpBadRecord) {
return R.ok(tEmpBadRecordService.updateById(tEmpBadRecord));
}
/**
* 通过id删除员工不良记录
* @param id id
* @return R
*/
@Operation(summary = "通过id删除员工不良记录", description = "通过id删除员工不良记录:hasPermission('demo_tempbadrecord_del')")
@SysLog("通过id删除员工不良记录" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tEmpBadRecordService.removeById(id));
}
/**
* 通过ids删除员工不良记录
* @param ids
* @return R
*/
@Operation(summary = "通过ids删除员工不良记录", description = "通过id删除员工不良记录:hasPermission('demo_tempbadrecord_del_batch')")
@SysLog("通过ids删除员工不良记录" )
@DeleteMapping("/removeByIds" )
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_del_batch')" )
public R<Boolean> removeByIds(@RequestParam String ids) {
List<String> idList = Common.getList(ids);
return R.ok(tEmpBadRecordService.removeByIds(idList));
}
/**
* 批量新增不良记录信息
*
* @param file
* @return
* @Author fxj
* @Date 2019-08-16
**/
@SneakyThrows
@Operation(description = "批量新增不良记录信息 hasPermission('archives_tempbadrecord_importListAdd')")
@SysLog("批量新增不良记录信息")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('archives_tempbadrecord_importListAdd')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tEmpBadRecordService.importEmpBadRecordDiy(file.getInputStream());
}
/**
* 批量导出项目档案信息
* @param searchVo
* @return R<List>
* @Author FXJ
* @Date 2022-06-21
**/
@Operation(description = "导出")
@PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody EmpBadRecordSearchVo searchVo) {
tEmpBadRecordService.listExport(response,searchVo);
}
}
......@@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
/**
......@@ -245,4 +246,17 @@ public class TEmployeeProjectController {
public R getItemByEmpNo(@RequestParam String empIdcard,@RequestParam String empNo) {
return tEmployeeProjectService.getItemByEmpNo(empIdcard,empNo);
}
/**
* 通过身份证获取对应所有项目信息
* @author fxj
* @param empIdCard
* @date 2022-06-29 17:45
* @return R
*/
@Operation(summary = "通过身份证获取对应所有项目信息", description = "通过身份证获取对应所有项目信息")
@GetMapping("/getProjectByIdCard" )
public R<Map<String,String>> getProjectByIdCard(@RequestParam String empIdCard) {
return tEmployeeProjectService.getProjectByIdCard(empIdCard);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import org.apache.ibatis.annotations.Mapper;
/**
* 员工不良记录
*
* @author fxj
* @date 2022-06-29 15:50:45
*/
@Mapper
public interface TEmpBadRecordMapper extends BaseMapper<TEmpBadRecord> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpBadRecordSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 员工不良记录
*
* @author fxj
* @date 2022-06-29 15:50:45
*/
public interface TEmpBadRecordService extends IService<TEmpBadRecord> {
R<List<ErrorMessage>> importEmpBadRecordDiy(InputStream inputStream);
R<Boolean> saveDiy(TEmpBadRecord tEmpBadRecord);
void listExport(HttpServletResponse response, EmpBadRecordSearchVo searchVo);
IPage<TEmpBadRecord> pageDiy(Page page, EmpBadRecordSearchVo tEmpBadRecord);
List<TEmpBadRecord> noPageDiy(EmpBadRecordSearchVo tEmpBadRecord);
}
......@@ -31,6 +31,7 @@ import org.springframework.validation.BindingResult;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 项目档案表
......@@ -118,4 +119,6 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
void saveEmployeeProjectInfo(TEmployeeInfo employeeInfo);
R getItemByEmpNo(String empIdcard, String empNo);
R<Map<String, String>> getProjectByIdCard(String empIdCard);
}
......@@ -92,7 +92,7 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
@Override
public IPage<TCertRecord> pageDiy(Page page, CertRecordSearchVo searchVo) {
LambdaQueryWrapper<TCertRecord> wrapper = buildQueryWrapper(searchVo);
wrapper.orderByDesc(BaseEntity::getCreateTime);
wrapper.orderByDesc(TCertRecord::getOpenTime);
return baseMapper.selectPage(page,wrapper);
}
......
......@@ -96,7 +96,7 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
continue;
}
// 数据合法情况
insertExcelPost(excel,emp);
insertExcel(excel,emp);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),CommonConstants.SAVE_SUCCESS));
}
}
......@@ -166,7 +166,7 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
/**
* 插入excel work record
*/
private void insertExcelPost(EmpWorkRecordExcelVO excel,TEmployeeInfo emp) {
private void insertExcel(EmpWorkRecordExcelVO excel, TEmployeeInfo emp) {
TEmpWorkRecording insert = new TEmpWorkRecording();
BeanUtil.copyProperties(excel, insert);
insert.setDeleteFlag(CommonConstants.ZERO_STRING);
......@@ -194,7 +194,7 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
@Override
public R<List<ErrorMessage>> importEmpWorkRecordDiy(InputStream inputStream) {
List<com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage> errorMessageList = new ArrayList<>();
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<EmpWorkRecordExcelVO> util1 = new ExcelUtil<>(EmpWorkRecordExcelVO.class);;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
......
......@@ -727,4 +727,19 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.ok(map);
}
@Override
public R<Map<String, String>> getProjectByIdCard(String empIdCard) {
List<TEmployeeProject> projects = baseMapper.selectList(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getEmpIdcard,empIdCard));
Map<String,String> projectMap = new HashMap<>();
if (Common.isEmpty(projects)){
for (TEmployeeProject project:projects){
projectMap.put(project.getDeptName(),project.getDeptNo());
}
}
return R.ok(projectMap);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpBadRecordMapper">
<resultMap id="tEmpBadRecordMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empId" column="EMP_ID"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="project" column="PROJECT"/>
<result property="projectCode" column="PROJECT_CODE"/>
<result property="happenTime" column="HAPPEN_TIME"/>
<result property="remark" column="REMARK"/>
<result property="loseFee" column="LOSE_FEE"/>
<result property="loseFeeOther" column="LOSE_FEE_OTHER"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
</mapper>
......@@ -172,7 +172,7 @@ public interface ErrorCodes {
String ARCHIVES_EMP_FAMILY_NAME_EXISTING = "archives.emp.family.name.existing";
/**
* 已存在对应身份证的家庭成员信息
* 无对应身份证的员工信息
*/
String ARCHIVES_EMP_NOT_EXIST = "archives.emp.not.exist";
......@@ -279,4 +279,8 @@ public interface ErrorCodes {
* 申请年份不可为未来年份
*/
String ARCHIVES_EMP_CERTIFICATE_DECLARE_YEAR_ERROR = "archives.emp.certificate.declare.year.error";
/**
* 对应项目编码无项目档案信息,请核实后导入
*/
String ARCHIVES_PROJECT_EMP_NOT_EXIST = "archives.project.emp.not.exist";
}
......@@ -85,6 +85,8 @@ archives.import.emp.leaveReason.must=\u51CF\u6863\u539F\u56E0\u5FC5\u586B
import.file.type.error=\u5BFC\u5165\u7684\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E
archives.project.emp.not.exist=\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u65E0\u9879\u76EE\u6863\u6848\u4FE1\u606F\uFF0C\u8BF7\u6838\u5B9E\u540E\u5BFC\u5165
......
......@@ -77,5 +77,11 @@
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.5</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
package com.yifu.cloud.plus.v1.yifu.common.mybatis.base;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -33,6 +34,7 @@ public class BaseEntity implements Serializable {
*/
@Schema(description = "创建人")
@TableField(fill = FieldFill.INSERT)
@ExcelIgnore
private String createBy;
/**
......@@ -48,6 +50,7 @@ public class BaseEntity implements Serializable {
*/
@Schema(description = "更新人")
@TableField(fill = FieldFill.INSERT_UPDATE)
@ExcelIgnore
private String updateBy;
/**
......
......@@ -66,9 +66,9 @@ public class ${className}Controller {
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@GetMapping("/noPage" )
@PostMapping("/noPage" )
//@PreAuthorize("@pms.hasPermission('${moduleName}_${pathName}_get')" )
public R<List<${className}>> get${className}NoPage(${className} ${classname}) {
public R<List<${className}>> get${className}NoPage(@RequestBody ${className} ${classname}) {
return R.ok(${classname}Service.list(Wrappers.query(${classname})));
}
......@@ -80,7 +80,7 @@ public class ${className}Controller {
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('${moduleName}_${pathName}_get')")
@GetMapping("/{${pk.lowerAttrName}}" )
@PreAuthorize("@pms.hasPermission('${moduleName}_${pathName}_get')" )
public R<${classname}> getById(@PathVariable("${pk.lowerAttrName}" ) ${pk.attrType} ${pk.lowerAttrName}) {
public R<${className}> getById(@PathVariable("${pk.lowerAttrName}" ) ${pk.attrType} ${pk.lowerAttrName}) {
return R.ok(${classname}Service.getById(${pk.lowerAttrName}));
}
......
......@@ -17,6 +17,7 @@
#set($excludeColumns = ["create_time","update_time","create_by","update_by"])
package ${package}.${moduleName}.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -51,6 +52,7 @@ public class ${className} extends BaseEntity {
#end
@ExcelAttribute(name = "$column.comments"#if($column.isNullable =='NO' && $column.attrType !='LocalDate' && $column.attrType !='LocalDateTime'), isNotEmpty = true,errorInfo = "$column.comments不能为空"#end #if($column.maxLength), maxLength = $column.maxLength #end)
@Schema(description ="$column.comments"#if($column.hidden),hidden=$column.hidden#end)
@ExcelProperty("$column.comments")
private $column.attrType $column.lowerAttrName;
#end
......
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