Commit 8aaf0c4c authored by hongguangwu's avatar hongguangwu

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

parents 223d6d66 c518d293
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Date 2022/6/28
* @Description
* @Version 1.0
*/
@Data
public class CertRecordSearchVo extends TCertRecord {
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
}
...@@ -68,7 +68,7 @@ public class EmpDisabilityExcelVO extends RowIndex implements Serializable { ...@@ -68,7 +68,7 @@ public class EmpDisabilityExcelVO extends RowIndex implements Serializable {
@ExcelAttribute(name = "伤残开始日期",isNotEmpty = true, errorInfo = "伤残开始日期不能为空",isDate = true) @ExcelAttribute(name = "伤残开始日期",isNotEmpty = true, errorInfo = "伤残开始日期不能为空",isDate = true)
@NotNull(message = "伤残开始日期不能为空") @NotNull(message = "伤残开始日期不能为空")
@Past @Past
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="伤残开始日期") @ExcelProperty(value ="伤残开始日期")
private Date startTime; private Date startTime;
...@@ -78,7 +78,7 @@ public class EmpDisabilityExcelVO extends RowIndex implements Serializable { ...@@ -78,7 +78,7 @@ public class EmpDisabilityExcelVO extends RowIndex implements Serializable {
@ExcelAttribute(name = "伤残结束日期",isNotEmpty = true, errorInfo = "伤残结束日期不能为空",isDate = true) @ExcelAttribute(name = "伤残结束日期",isNotEmpty = true, errorInfo = "伤残结束日期不能为空",isDate = true)
@NotNull(message = "伤残结束日期不能为空") @NotNull(message = "伤残结束日期不能为空")
@Past @Past
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="伤残结束日期") @ExcelProperty(value ="伤残结束日期")
private Date endTime; private Date endTime;
......
...@@ -64,7 +64,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -64,7 +64,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
/** /**
* 学历名称 * 学历名称
*/ */
@ExcelAttribute(name = "学历",errorInfo = "学历不可为空",isDataId = true,dataType = "system_degree_dict") @ExcelAttribute(name = "学历",errorInfo = "学历不可为空",isDataId = true,dataType = "education")
@NotNull(message = "学历不可为空") @NotNull(message = "学历不可为空")
@ExcelProperty(value ="学历") @ExcelProperty(value ="学历")
private String educationName; private String educationName;
...@@ -96,7 +96,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -96,7 +96,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
*/ */
@ExcelAttribute(name = "入学时间",errorInfo = "入学时间不可为空",isDate = true) @ExcelAttribute(name = "入学时间",errorInfo = "入学时间不可为空",isDate = true)
@NotNull(message = "入学时间不可为空") @NotNull(message = "入学时间不可为空")
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="入学时间") @ExcelProperty(value ="入学时间")
private Date entryDate; private Date entryDate;
...@@ -105,7 +105,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable { ...@@ -105,7 +105,7 @@ public class EmpEducationExcelVO extends RowIndex implements Serializable {
*/ */
@ExcelAttribute(name = "毕业时间",errorInfo = "毕业时间不可为空",isDate = true) @ExcelAttribute(name = "毕业时间",errorInfo = "毕业时间不可为空",isDate = true)
@NotNull(message = "毕业时间不可为空") @NotNull(message = "毕业时间不可为空")
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="毕业时间") @ExcelProperty(value ="毕业时间")
private Date gradutionDate; private Date gradutionDate;
......
...@@ -28,7 +28,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{ ...@@ -28,7 +28,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/** /**
* 学校名称 * 学校名称
*/ */
@ExcelAttribute(name = "学校", isNotEmpty = true,errorInfo = "学校不可为空") @ExcelAttribute(name = "学校", isNotEmpty = true,errorInfo = "学校不可为空",maxLength = 50)
@NotNull(message = "学校不可为空") @NotNull(message = "学校不可为空")
@ExcelProperty(value ="学校") @ExcelProperty(value ="学校")
private String school; private String school;
...@@ -36,7 +36,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{ ...@@ -36,7 +36,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/** /**
* 院系名称 * 院系名称
*/ */
@ExcelAttribute(name = "院系名称") @ExcelAttribute(name = "院系名称",maxLength = 50)
@ExcelProperty(value ="院系名称") @ExcelProperty(value ="院系名称")
private String collageSystem; private String collageSystem;
...@@ -44,7 +44,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{ ...@@ -44,7 +44,7 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/** /**
* 专业 * 专业
*/ */
@ExcelAttribute(name = "专业", isNotEmpty = true,errorInfo = "专业不可为空") @ExcelAttribute(name = "专业", isNotEmpty = true,errorInfo = "专业不可为空",maxLength = 50)
@NotNull(message = "专业不可为空") @NotNull(message = "专业不可为空")
@ExcelProperty(value ="专业") @ExcelProperty(value ="专业")
private String major; private String major;
...@@ -100,13 +100,13 @@ public class EmpEducationUpdateExcelVo extends RowIndex{ ...@@ -100,13 +100,13 @@ public class EmpEducationUpdateExcelVo extends RowIndex{
/** /**
* 证书名称 * 证书名称
*/ */
@ExcelAttribute(name = "证书名称") @ExcelAttribute(name = "证书名称",maxLength = 50)
@ExcelProperty(value ="证书名称") @ExcelProperty(value ="证书名称")
private String certificationName; private String certificationName;
/** /**
* 备注 * 备注
*/ */
@ExcelAttribute(name = "remark") @ExcelAttribute(name = "备注",maxLength = 200)
@ExcelProperty(value ="备注") @ExcelProperty(value ="备注")
private String remark; private String remark;
} }
...@@ -58,7 +58,7 @@ public class EmpFamilyExcelVO extends RowIndex implements Serializable { ...@@ -58,7 +58,7 @@ public class EmpFamilyExcelVO extends RowIndex implements Serializable {
*/ */
@ExcelAttribute(name = "出生日期",isDate = true) @ExcelAttribute(name = "出生日期",isDate = true)
@Past @Past
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="出生日期") @ExcelProperty(value ="出生日期")
private Date birthday; private Date birthday;
......
...@@ -79,7 +79,7 @@ public class EmpWorkRecordExcelVO extends RowIndex implements Serializable { ...@@ -79,7 +79,7 @@ public class EmpWorkRecordExcelVO extends RowIndex implements Serializable {
* 开始工作日期 * 开始工作日期
*/ */
@ExcelAttribute(name = "开始工作日期",errorInfo = "开始工作日期不可为空",isDate = true) @ExcelAttribute(name = "开始工作日期",errorInfo = "开始工作日期不可为空",isDate = true)
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@NotNull(message = "开始工作日期不可为空") @NotNull(message = "开始工作日期不可为空")
@ExcelProperty(value ="开始工作日期") @ExcelProperty(value ="开始工作日期")
private Date startDate; private Date startDate;
...@@ -88,7 +88,7 @@ public class EmpWorkRecordExcelVO extends RowIndex implements Serializable { ...@@ -88,7 +88,7 @@ public class EmpWorkRecordExcelVO extends RowIndex implements Serializable {
* 结束工作日期 * 结束工作日期
*/ */
@ExcelAttribute(name = "结束工作日期",isDate = true) @ExcelAttribute(name = "结束工作日期",isDate = true)
@DateTimeFormat("YYYY-MM-dd") @DateTimeFormat("yyyy-MM-dd")
@ExcelProperty(value ="结束工作日期") @ExcelProperty(value ="结束工作日期")
private Date endDate; private Date endDate;
......
...@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -22,6 +22,7 @@ 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.archives.entity.TCertRecord; import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord;
import com.yifu.cloud.plus.v1.yifu.archives.service.TCertRecordService; import com.yifu.cloud.plus.v1.yifu.archives.service.TCertRecordService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
...@@ -54,25 +55,25 @@ public class TCertRecordController { ...@@ -54,25 +55,25 @@ public class TCertRecordController {
/** /**
* 分页查询 * 分页查询
* @param page 分页对象 * @param page 分页对象
* @param tCertRecord 证明开具记录表 * @param searchVo 证明开具记录表
* @return * @return
*/ */
@Operation(summary = "分页查询", description = "分页查询") @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @GetMapping("/page" )
//@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" ) //@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" )
public R<IPage<TCertRecord>> getTCertRecordPage(Page page, TCertRecord tCertRecord) { public R<IPage<TCertRecord>> getTCertRecordPage(Page page, CertRecordSearchVo searchVo) {
return R.ok(tCertRecordService.page(page, Wrappers.query(tCertRecord))); return R.ok(tCertRecordService.pageDiy(page, searchVo));
} }
/** /**
* 不分页查询 * 不分页查询
* @param tCertRecord 证明开具记录表 * @param searchVo 证明开具记录表
* @return * @return
*/ */
@Operation(summary = "不分页查询", description = "不分页查询") @Operation(summary = "不分页查询", description = "不分页查询")
@GetMapping("/noPage" ) @GetMapping("/noPage" )
//@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" ) //@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" )
public R<List<TCertRecord>> getTCertRecordNoPage(TCertRecord tCertRecord) { public R<List<TCertRecord>> getTCertRecordNoPage(CertRecordSearchVo searchVo) {
return R.ok(tCertRecordService.list(Wrappers.query(tCertRecord))); return R.ok(tCertRecordService.getTCertRecordNoPage(searchVo));
} }
/** /**
......
...@@ -17,11 +17,16 @@ ...@@ -17,11 +17,16 @@
package com.yifu.cloud.plus.v1.yifu.archives.service; 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.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord; import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord;
import com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/** /**
* 证明开具记录表 * 证明开具记录表
* *
...@@ -31,4 +36,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -31,4 +36,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
public interface TCertRecordService extends IService<TCertRecord> { public interface TCertRecordService extends IService<TCertRecord> {
R<TCertRecordVo> getCertRecordInfo(String id); R<TCertRecordVo> getCertRecordInfo(String id);
IPage<TCertRecord> pageDiy(Page page, CertRecordSearchVo searchVo);
List<TCertRecord> getTCertRecordNoPage(CertRecordSearchVo searchVo);
} }
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.TCertRecord; import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
...@@ -24,13 +29,17 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCertRecordMapper; ...@@ -24,13 +29,17 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCertRecordMapper;
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.TCertRecordService; import com.yifu.cloud.plus.v1.yifu.archives.service.TCertRecordService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo;
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.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 证明开具记录表 * 证明开具记录表
* *
...@@ -79,4 +88,39 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert ...@@ -79,4 +88,39 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
vo.setSocialTime(null); vo.setSocialTime(null);
return R.ok(vo); return R.ok(vo);
} }
@Override
public IPage<TCertRecord> pageDiy(Page page, CertRecordSearchVo searchVo) {
LambdaQueryWrapper<TCertRecord> wrapper = buildQueryWrapper(searchVo);
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectPage(page,wrapper);
}
@Override
public List<TCertRecord> getTCertRecordNoPage(CertRecordSearchVo searchVo) {
LambdaQueryWrapper<TCertRecord> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)){
wrapper.in(TCertRecord::getId,idList);
}
return baseMapper.selectList(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(CertRecordSearchVo entity){
LambdaQueryWrapper<TCertRecord> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TCertRecord::getCreateTime, entity.getCreateTimes()[0])
.le(TCertRecord::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getEmpName())){
wrapper.likeRight(TCertRecord::getEmpName,entity.getEmpName());
}
if (Common.isNotNull(entity.getEmpIdcard())){
wrapper.likeRight(TCertRecord::getEmpIdcard,entity.getEmpIdcard());
}
if (Common.isNotNull(entity.getCreateName())){
wrapper.eq(TCertRecord::getCreateName,entity.getCreateName());
}
return wrapper;
}
} }
...@@ -231,7 +231,12 @@ public class ExcelUtil <T> implements Serializable { ...@@ -231,7 +231,12 @@ public class ExcelUtil <T> implements Serializable {
//如果是需要从字典表取值数据的话在这里处理即可 //如果是需要从字典表取值数据的话在这里处理即可
if (Common.isNotNull(attr.readConverterExp())) { if (Common.isNotNull(attr.readConverterExp())) {
c = reverseByExp( c, attr.readConverterExp()); tempStr= reverseByExp( c, attr.readConverterExp());
if (Common.isEmpty(tempStr)){
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "未找到:" + c + "的字典数据"), errorTemp);
}else {
c = tempStr;
}
} else if (attr.isDataId()) { } else if (attr.isDataId()) {
if (Common.isNotNull(attr.dataType())) { if (Common.isNotNull(attr.dataType())) {
//非区域字段处理 TODO //非区域字段处理 TODO
...@@ -351,33 +356,16 @@ public class ExcelUtil <T> implements Serializable { ...@@ -351,33 +356,16 @@ public class ExcelUtil <T> implements Serializable {
public static String reverseByExp(String propertyValue, String converterExp) throws Exception { public static String reverseByExp(String propertyValue, String converterExp) throws Exception {
try { try {
String[] convertSource = converterExp.split(","); String[] convertSource = converterExp.split(",");
if(propertyValue.contains(",")){ for (String item : convertSource) {
String[] valueSource = propertyValue.split(","); String[] itemArray = item.split("=");
propertyValue = ""; if (itemArray[1].equals(propertyValue)) {
for(String value:valueSource){ return itemArray[0];
for (String item : convertSource) {
String[] itemArray = item.split("=");
if (itemArray[1].equals(value)) {
propertyValue += itemArray[0] + ",";
break;
}
}
}
if(propertyValue.endsWith(",")){
propertyValue = propertyValue.substring(CommonConstants.dingleDigitIntArray[0],propertyValue.length()-1);
}
}else{
for (String item : convertSource) {
String[] itemArray = item.split("=");
if (itemArray[1].equals(propertyValue)) {
return itemArray[0];
}
} }
} }
} catch (Exception e) { } catch (Exception e) {
throw e; throw e;
} }
return propertyValue; return null;
} }
/** /**
......
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