Commit af064acd authored by hongguangwu's avatar hongguangwu

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

parents 9c61a15d 3ebb9f7f
...@@ -26,6 +26,7 @@ import lombok.Data; ...@@ -26,6 +26,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
/** /**
* 证明开具记录表 * 证明开具记录表
...@@ -94,14 +95,14 @@ public class TCertRecord extends BaseEntity { ...@@ -94,14 +95,14 @@ public class TCertRecord extends BaseEntity {
*/ */
@ExcelAttribute(name = "合同开始时间" ) @ExcelAttribute(name = "合同开始时间" )
@Schema(description ="合同开始时间") @Schema(description ="合同开始时间")
private LocalDateTime contractStart; private Date contractStart;
/** /**
* 合同截止时间 * 合同截止时间
*/ */
@ExcelAttribute(name = "合同截止时间" ) @ExcelAttribute(name = "合同截止时间" )
@Schema(description ="合同截止时间") @Schema(description ="合同截止时间")
private LocalDateTime contractEnd; private Date contractEnd;
/** /**
* 开具当天时间 * 开具当天时间
...@@ -129,7 +130,7 @@ public class TCertRecord extends BaseEntity { ...@@ -129,7 +130,7 @@ public class TCertRecord extends BaseEntity {
*/ */
@ExcelAttribute(name = "离职时间" ) @ExcelAttribute(name = "离职时间" )
@Schema(description ="离职时间") @Schema(description ="离职时间")
private LocalDateTime leaveTime; private Date leaveTime;
/** /**
* 派减原因 * 派减原因
...@@ -150,14 +151,14 @@ public class TCertRecord extends BaseEntity { ...@@ -150,14 +151,14 @@ public class TCertRecord extends BaseEntity {
*/ */
@ExcelAttribute(name = "入职时间(来我单位时间)" ) @ExcelAttribute(name = "入职时间(来我单位时间)" )
@Schema(description ="入职时间(来我单位时间)") @Schema(description ="入职时间(来我单位时间)")
private LocalDateTime entryTime; private Date entryTime;
/** /**
* 签订合同时间-第一次 * 签订合同时间-第一次
*/ */
@ExcelAttribute(name = "签订合同时间-第一次" ) @ExcelAttribute(name = "签订合同时间-第一次" )
@Schema(description ="签订合同时间-第一次") @Schema(description ="签订合同时间-第一次")
private LocalDateTime firstContractTime; private Date firstContractTime;
/** /**
* 开具人 * 开具人
...@@ -171,7 +172,7 @@ public class TCertRecord extends BaseEntity { ...@@ -171,7 +172,7 @@ public class TCertRecord extends BaseEntity {
*/ */
@ExcelAttribute(name = "开具时间" ) @ExcelAttribute(name = "开具时间" )
@Schema(description ="开具时间") @Schema(description ="开具时间")
private LocalDateTime openTime; private Date openTime;
/** /**
* 介绍单位 * 介绍单位
...@@ -185,7 +186,7 @@ public class TCertRecord extends BaseEntity { ...@@ -185,7 +186,7 @@ public class TCertRecord extends BaseEntity {
*/ */
@ExcelAttribute(name = "参保时间" ) @ExcelAttribute(name = "参保时间" )
@Schema(description ="参保时间") @Schema(description ="参保时间")
private LocalDateTime socialTime; private Date socialTime;
} }
...@@ -129,5 +129,6 @@ public class TEmpBadRecord extends BaseEntity { ...@@ -129,5 +129,6 @@ public class TEmpBadRecord extends BaseEntity {
* @Date 14:53 2022/6/21 * @Date 14:53 2022/6/21
**/ **/
@TableField(exist = false) @TableField(exist = false)
@ExcelIgnore
private String attaIds; private String attaIds;
} }
...@@ -17,13 +17,14 @@ ...@@ -17,13 +17,14 @@
package com.yifu.cloud.plus.v1.yifu.archives.entity; package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import java.time.LocalDate; import java.util.Date;
/** /**
* 员工学历信息表 * 员工学历信息表
...@@ -74,8 +75,9 @@ public class TEmpEducation extends BaseEntity { ...@@ -74,8 +75,9 @@ public class TEmpEducation extends BaseEntity {
/** /**
* 入学时间 * 入学时间
*/ */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "入学时间") @Schema(description = "入学时间")
private LocalDate entryDate; private Date entryDate;
/** /**
* 学历名称 * 学历名称
...@@ -87,8 +89,9 @@ public class TEmpEducation extends BaseEntity { ...@@ -87,8 +89,9 @@ public class TEmpEducation extends BaseEntity {
/** /**
* 结业日期 * 结业日期
*/ */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "结业日期") @Schema(description = "结业日期")
private LocalDate gradutionDate; private Date gradutionDate;
/** /**
* 学校名称 * 学校名称
......
...@@ -21,4 +21,14 @@ public class EmpBadRecordSearchVo extends TEmpBadRecord { ...@@ -21,4 +21,14 @@ public class EmpBadRecordSearchVo extends TEmpBadRecord {
*/ */
@Schema(description = "创建时间区间") @Schema(description = "创建时间区间")
private LocalDateTime[] createTimes; private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
} }
...@@ -37,6 +37,9 @@ import org.springframework.web.bind.annotation.*; ...@@ -37,6 +37,9 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
...@@ -87,6 +90,21 @@ public class TEmpBadRecordController { ...@@ -87,6 +90,21 @@ public class TEmpBadRecordController {
@GetMapping("/{id}" ) @GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_get')" ) @PreAuthorize("@pms.hasPermission('demo_tempbadrecord_get')" )
public R<TEmpBadRecord> getById(@PathVariable("id" ) String id) { public R<TEmpBadRecord> getById(@PathVariable("id" ) String id) {
/* TEmpBadRecord record;
List<TEmpBadRecord> list = new ArrayList<>();
for (int i=200000;i<500000;i++){
record = new TEmpBadRecord();
record.setEmpId("1");
record.setEmpName("2");
record.setEmpIdcard("323333333333");
record.setHappenTime(new Date());
record.setLoseFee(BigDecimal.ONE);
record.setId(String.valueOf(i));
record.setProject("test");
record.setProjectCode("test");
list.add(record);
}
tEmpBadRecordService.saveBatch(list);*/
return R.ok(tEmpBadRecordService.getById(id)); return R.ok(tEmpBadRecordService.getById(id));
} }
......
...@@ -66,7 +66,7 @@ public class TEmployeeProjectController { ...@@ -66,7 +66,7 @@ public class TEmployeeProjectController {
@Operation(summary = "根据人员档案id获取项目list", description = "根据人员档案id获取项目list") @Operation(summary = "根据人员档案id获取项目list", description = "根据人员档案id获取项目list")
@GetMapping("/getListByEmpId" ) @GetMapping("/getListByEmpId" )
public R<List<TEmployeeProject>> getListByEmpId(@RequestParam String empId) { public R<List<TEmployeeProject>> getListByEmpId(@RequestParam String empId) {
return R.ok(tEmployeeProjectService.getListByEmpId(empId, CommonConstants.ZERO_INT)); return R.ok(tEmployeeProjectService.getListByEmpId(empId, CommonConstants.ONE_INT));
} }
/** /**
......
...@@ -31,7 +31,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -31,7 +31,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
...@@ -39,7 +38,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpBadRecordMapper; ...@@ -39,7 +38,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpBadRecordMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpBadRecordService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpBadRecordService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpBadRecordSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpBadRecordVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
...@@ -208,27 +208,49 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T ...@@ -208,27 +208,49 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
String fileName = "不良记录批量导出" + LocalDateTime.now() + ".xlsx"; String fileName = "不良记录批量导出" + LocalDateTime.now() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TEmpBadRecord> list = new ArrayList<>(); List<TEmpBadRecord> list = new ArrayList<>();
//获取记录 long count = noPageCountDiy(searchVo);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
ExcelUtil<TEmpBadRecord> util = new ExcelUtil<>(TEmpBadRecord.class);
for (TEmpBadRecord vo:list){
util.convertEntity(vo,null,null,null);
}
}
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
if (list.size()>0) {
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName , "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list); //EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
out.flush(); ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
ExcelUtil<TEmpBadRecord> util = new ExcelUtil<>(TEmpBadRecord.class);
for (TEmpBadRecord vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet("不良记录"+index).build();
excelWriter.write(list,writeSheet);
index++;
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
} }
if (Common.isNotNull(list)){
list.clear();
}
}
excelWriter.finish();
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("不良记录"+index).build();
excelWriter.write(list,writeSheet);
excelWriter.finish();
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush();
}catch (Exception e){ }catch (Exception e){
log.error("执行异常" ,e); log.error("执行异常" ,e);
}finally { }finally {
...@@ -256,8 +278,21 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T ...@@ -256,8 +278,21 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
if (Common.isNotNull(idList)){ if (Common.isNotNull(idList)){
wrapper.in(TEmpBadRecord::getId,idList); wrapper.in(TEmpBadRecord::getId,idList);
} }
if (tEmpBadRecord.getLimitStart() >= 0 && tEmpBadRecord.getLimitEnd() >= 0){
wrapper.last(" limit "+ tEmpBadRecord.getLimitStart() +","+ tEmpBadRecord.getLimitEnd());
}
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
private Long noPageCountDiy(EmpBadRecordSearchVo tEmpBadRecord) {
LambdaQueryWrapper<TEmpBadRecord> wrapper = buildQueryWrapper(tEmpBadRecord);
List<String> idList = Common.getList(tEmpBadRecord.getIds());
if (Common.isNotNull(idList)){
wrapper.in(TEmpBadRecord::getId,idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(EmpBadRecordSearchVo entity){ private LambdaQueryWrapper buildQueryWrapper(EmpBadRecordSearchVo entity){
LambdaQueryWrapper<TEmpBadRecord> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TEmpBadRecord> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) { if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
......
...@@ -75,12 +75,12 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper, ...@@ -75,12 +75,12 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
//划转,更新项目信息 //划转,更新项目信息
TEmployeeProject updateTEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda() TEmployeeProject updateTEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, tEmpChangeInfo.getEmpIdcard()).eq(TEmployeeProject::getDeptName,tEmpChangeInfo.getOldSettle()) .eq(TEmployeeProject::getEmpIdcard, tEmpChangeInfo.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,tEmpChangeInfo.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL)); .eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(updateTEmployeeProject)) { if (Common.isNotNull(updateTEmployeeProject)) {
updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo()); updateTEmployeeProject.setDeptNo(tEmpChangeInfo.getDeptNo());
updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId()); updateTEmployeeProject.setDeptId(tEmpChangeInfo.getDeptId());
updateTEmployeeProject.setDeptName(tEmpChangeInfo.getNewDept()); updateTEmployeeProject.setDeptName(tEmpChangeInfo.getNewSettle());
updateTEmployeeProject.setUnitId(tEmpChangeInfo.getUnitId()); updateTEmployeeProject.setUnitId(tEmpChangeInfo.getUnitId());
updateTEmployeeProject.setUnitNo(tEmpChangeInfo.getUnitNo()); updateTEmployeeProject.setUnitNo(tEmpChangeInfo.getUnitNo());
updateTEmployeeProject.setUnitName(tEmpChangeInfo.getNewDept()); updateTEmployeeProject.setUnitName(tEmpChangeInfo.getNewDept());
......
...@@ -1370,8 +1370,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1370,8 +1370,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
education.setHighIdentification(CommonConstants.ZERO_STRING); education.setHighIdentification(CommonConstants.ZERO_STRING);
education.setSchool(employeeInfo.getSchool()); education.setSchool(employeeInfo.getSchool());
education.setMajor(employeeInfo.getMajor()); education.setMajor(employeeInfo.getMajor());
education.setEntryDate(employeeInfo.getAdmissionDate()); education.setEntryDate(LocalDateTimeUtils.convertLDToDate(employeeInfo.getAdmissionDate()));
education.setGradutionDate(employeeInfo.getGradutionDate()); education.setGradutionDate(LocalDateTimeUtils.convertLDToDate(employeeInfo.getGradutionDate()));
tEmpEducationService.insertEducationOfEmp(education); tEmpEducationService.insertEducationOfEmp(education);
} }
......
...@@ -150,6 +150,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -150,6 +150,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String empNO = getEmpNo(tEmployeeProject.getDeptNo()); String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO); tEmployeeProject.setEmpNo(empNO);
tEmployeeProject.setEmpId(tEmployeeInfo.getId()); tEmployeeProject.setEmpId(tEmployeeInfo.getId());
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
this.save(tEmployeeProject); this.save(tEmployeeProject);
return R.ok(); return R.ok();
} }
...@@ -531,6 +532,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -531,6 +532,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
insTEmployeePro.setCreateBy(user.getId()); insTEmployeePro.setCreateBy(user.getId());
insTEmployeePro.setCreateName(user.getNickname()); insTEmployeePro.setCreateName(user.getNickname());
insTEmployeePro.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
proInsList.add(insTEmployeePro); proInsList.add(insTEmployeePro);
} }
...@@ -683,6 +685,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -683,6 +685,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setEmpName(employeeInfo.getEmpName()); tEmployeeProject.setEmpName(employeeInfo.getEmpName());
tEmployeeProject.setEmpIdcard(employeeInfo.getEmpIdcard()); tEmployeeProject.setEmpIdcard(employeeInfo.getEmpIdcard());
tEmployeeProject.setPost(employeeInfo.getPost()); tEmployeeProject.setPost(employeeInfo.getPost());
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[4]);
String empNO = getEmpNo(employeeInfo.getDeptNo()); String empNO = getEmpNo(employeeInfo.getDeptNo());
tEmployeeProject.setEmpNo(empNO); tEmployeeProject.setEmpNo(empNO);
......
...@@ -256,4 +256,5 @@ public interface CommonConstants { ...@@ -256,4 +256,5 @@ public interface CommonConstants {
String CREATE_TIME = "create_time"; String CREATE_TIME = "create_time";
String ID = "ID"; String ID = "ID";
String PARAM_IS_NOT_ERROR = "传参异常,请检查参数"; String PARAM_IS_NOT_ERROR = "传参异常,请检查参数";
int EXCEL_EXPORT_LIMIT = 60000;
} }
...@@ -230,6 +230,7 @@ public class ExcelUtil <T> implements Serializable { ...@@ -230,6 +230,7 @@ public class ExcelUtil <T> implements Serializable {
if (field == null) { if (field == null) {
continue; continue;
} }
tempStr=null;
// 设置实体类私有属性可访问 // 设置实体类私有属性可访问
field.setAccessible(true); field.setAccessible(true);
attr = field.getAnnotation(ExcelAttribute.class); attr = field.getAnnotation(ExcelAttribute.class);
......
...@@ -47,7 +47,16 @@ public class LocalDateTimeUtils { ...@@ -47,7 +47,16 @@ public class LocalDateTimeUtils {
} }
return null; return null;
} }
public static LocalDateTime convertLocalDateToLDT(LocalDate date) {
return LocalDateTime.ofInstant(date.atStartOfDay(ZoneOffset.ofHours(8)).toInstant(), ZoneId.systemDefault());
}
public static Date convertLDToDate(LocalDate time) {
if (null != time){
return Date.from(time.atStartOfDay(ZoneOffset.ofHours(8)).toInstant());
}
return null;
}
//获取指定日期的毫秒 //获取指定日期的毫秒
public static Long getMilliByTime(LocalDateTime time) { public static Long getMilliByTime(LocalDateTime time) {
......
...@@ -77,10 +77,11 @@ ...@@ -77,10 +77,11 @@
<groupId>com.yifu.cloud.plus.v1</groupId> <groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId> <artifactId>yifu-common-core</artifactId>
</dependency> </dependency>
<!-- easyExcel -->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>3.0.5</version> <version>3.1.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
package com.yifu.cloud.plus.v1.yifu.common.mybatis.base; package com.yifu.cloud.plus.v1.yifu.common.mybatis.base;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -27,6 +28,7 @@ public class BaseEntity implements Serializable { ...@@ -27,6 +28,7 @@ public class BaseEntity implements Serializable {
*/ */
@Schema(description = "创建人-姓名") @Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建人")
private String createName; private String createName;
/** /**
...@@ -43,6 +45,7 @@ public class BaseEntity implements Serializable { ...@@ -43,6 +45,7 @@ public class BaseEntity implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间") @Schema(description = "创建时间")
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
/** /**
...@@ -59,6 +62,7 @@ public class BaseEntity implements Serializable { ...@@ -59,6 +62,7 @@ public class BaseEntity implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间") @Schema(description = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
@ExcelProperty("更新时间")
private LocalDateTime updateTime; private LocalDateTime updateTime;
} }
...@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -35,16 +34,13 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; ...@@ -35,16 +34,13 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
...@@ -96,7 +92,7 @@ public class DictController { ...@@ -96,7 +92,7 @@ public class DictController {
*/ */
@GetMapping("/type/{type}") @GetMapping("/type/{type}")
@Cacheable(value = CacheConstants.DICT_DETAILS, key = "#type") @Cacheable(value = CacheConstants.DICT_DETAILS, key = "#type")
public R<List<SysDictItem>> getDictByType(@PathVariable String type) { public R<List<SysDictItem>> getDictByType(@PathVariable("type") String type) {
return R.ok(sysDictItemService.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getType, type))); return R.ok(sysDictItemService.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getType, type)));
} }
......
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