值班表,值班日志
parent
341e04faed
commit
f97daaac72
2
ruoyi
2
ruoyi
|
|
@ -1 +1 @@
|
||||||
Subproject commit abeed0c488d4f06787909249dd92f2e7fa5a25cd
|
Subproject commit d456ff189647e16ffaaa170738d785eeee1253c0
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.gunshi.core.annotation.Get;
|
||||||
|
import com.gunshi.core.annotation.Post;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.entity.dto.RotaDto;
|
||||||
|
import com.gunshi.project.xyt.entity.vo.RotaVo;
|
||||||
|
import com.gunshi.project.xyt.listener.RotaImportListener;
|
||||||
|
import com.gunshi.project.xyt.model.RotaB;
|
||||||
|
import com.gunshi.project.xyt.service.RotaService;
|
||||||
|
import com.gunshi.project.xyt.util.ExcelUtil;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/3/25
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/rota")
|
||||||
|
@Tag(name = "值班表")
|
||||||
|
public class RotaController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RotaService rotaService;
|
||||||
|
|
||||||
|
|
||||||
|
@Get(path = "/query", summary = "按年月查询")
|
||||||
|
public R<Map<String,List<RotaB>>> query(@Schema(name = "yearMonth",description = "年月",example = "2024-03") @RequestParam(name = "yearMonth") String yearMonth) {
|
||||||
|
return R.ok(rotaService.query(yearMonth));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Post(path = "/edit/info", summary = "编辑值班信息")
|
||||||
|
public R<String> editInfo(@RequestBody @Validated RotaDto rotaDto) {
|
||||||
|
return R.ok(rotaService.editInfo(rotaDto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get(path = "/date/list", summary = "按年月日查询")
|
||||||
|
public R<List<RotaB>> dateList(@Schema(name = "rotaDate",description = "年月日",example = "2024-08-19") @RequestParam(name = "rotaDate") String rotaDate) {
|
||||||
|
return R.ok(rotaService.dateList(rotaDate));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取导入模板
|
||||||
|
*/
|
||||||
|
@Operation(summary = "获取导入模板")
|
||||||
|
@PostMapping("/importTemplate")
|
||||||
|
public void importTemplate(HttpServletResponse response) {
|
||||||
|
ExcelUtil.exportExcel(new ArrayList<>(), "值班表", RotaVo.class, response, "值班表");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入数据
|
||||||
|
*
|
||||||
|
* @param file 导入文件
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Operation(summary = "导入数据")
|
||||||
|
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
|
public R importData(@RequestPart("file") MultipartFile file) throws Exception {
|
||||||
|
//获取正确数据
|
||||||
|
ArrayList<RotaVo> successArrayList = new ArrayList<>();
|
||||||
|
//获取错误数据
|
||||||
|
ArrayList<RotaVo> errorArrayList = new ArrayList<>();
|
||||||
|
EasyExcel.read(file.getInputStream())
|
||||||
|
.head(RotaVo.class)
|
||||||
|
.registerReadListener(new RotaImportListener(
|
||||||
|
// 监听器中doAfterAllAnalysed执行此方法;所有读取完成之后处理逻辑
|
||||||
|
successArrayList::addAll, errorArrayList::addAll))
|
||||||
|
// 设置sheet,默认读取第一个
|
||||||
|
.sheet()
|
||||||
|
// 设置标题(字段列表)所在行数
|
||||||
|
.headRowNumber(2)
|
||||||
|
.doRead();
|
||||||
|
if(CollectionUtils.isNotEmpty(errorArrayList)){
|
||||||
|
List<String> errMsg = errorArrayList.stream().map(RotaVo::getErrorMsg).collect(Collectors.toList());
|
||||||
|
return R.error(400,String.join(";",errMsg));
|
||||||
|
}
|
||||||
|
if(CollectionUtils.isNotEmpty(successArrayList)){
|
||||||
|
rotaService.saveImportData(successArrayList);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.entity.so.RotaLogPageSo;
|
||||||
|
import com.gunshi.project.xyt.model.RotaLog;
|
||||||
|
import com.gunshi.project.xyt.service.RotaLogService;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/3/25
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/rota/log")
|
||||||
|
@Tag(name = "值班日志")
|
||||||
|
public class RotaLogController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RotaLogService service;
|
||||||
|
|
||||||
|
@Operation(summary = "新增")
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public R<RotaLog> insert(@Validated(Insert.class) @RequestBody RotaLog dto) {
|
||||||
|
checkParam(dto);
|
||||||
|
dto.setId(IdWorker.getId());
|
||||||
|
boolean result = service.save(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R<RotaLog> update(@Validated(Update.class) @RequestBody RotaLog dto) {
|
||||||
|
checkParam(dto);
|
||||||
|
boolean result = service.updateById(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
@GetMapping("/del/{id}")
|
||||||
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||||
|
return R.ok(service.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkParam(RotaLog dto) {
|
||||||
|
Long id = dto.getId();
|
||||||
|
LambdaQueryWrapper<RotaLog> queryWrapper = Wrappers.lambdaQuery();
|
||||||
|
queryWrapper.eq(RotaLog::getRotaDate,dto.getRotaDate());
|
||||||
|
if(id != null){
|
||||||
|
queryWrapper.ne(RotaLog::getId,id);
|
||||||
|
}
|
||||||
|
if(service.count(queryWrapper ) > 0){
|
||||||
|
throw new IllegalArgumentException("该日期已存在值班日志");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
@PostMapping("/page")
|
||||||
|
public R<Page<RotaLog>> page(@RequestBody RotaLogPageSo rotaLogPageSo) {
|
||||||
|
return R.ok(service.queryPage(rotaLogPageSo));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.gunshi.project.xyt.entity.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班表人员参数
|
||||||
|
* Created by wanyan on 2024/3/25
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RotaDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
@Schema(description="日期",example = "2024-03-25")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
@NotNull(message = "日期不能为空")
|
||||||
|
private Date rotaDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否节假日(0否 1是)
|
||||||
|
*/
|
||||||
|
@Schema(description="是否节假日(0否 1是)")
|
||||||
|
private Integer isHoliday;
|
||||||
|
|
||||||
|
@Schema(description = "值班人员")
|
||||||
|
private List<RotaUserDto> userDtoList;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.gunshi.project.xyt.entity.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班表参数
|
||||||
|
* Created by wanyan on 2024/3/25
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RotaUserDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型(1带班领导 2值班人员)
|
||||||
|
*/
|
||||||
|
@Schema(description="类型(1带班领导 2值班人员)")
|
||||||
|
private Integer rotaType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
@Schema(description="用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.gunshi.project.xyt.entity.so;
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.DateRangeSo;
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/3/19
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "值班日志分页查询对象")
|
||||||
|
public class RotaLogPageSo {
|
||||||
|
|
||||||
|
@NotNull(message = "分页参数不能为空")
|
||||||
|
@Schema(description = "分页参数")
|
||||||
|
private PageSo pageSo;
|
||||||
|
|
||||||
|
@Schema(description = "时间范围")
|
||||||
|
private DateRangeSo dateSo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.gunshi.project.xyt.entity.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import com.gunshi.project.xyt.util.excel.LengthValid;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class RotaVo {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班开始时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty({"${title}","值班开始时间"})
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
private Date stm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班结束时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty({"${title}","值班结束时间"})
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
private Date etm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班领导手机号
|
||||||
|
*/
|
||||||
|
@LengthValid(length = 11,msg = "值班领导手机号长度不等于11!")
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ExcelProperty({"${title}","值班领导手机号"})
|
||||||
|
private String leaderPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班人员手机号
|
||||||
|
*/
|
||||||
|
@LengthValid(length = 11,msg = "值班人员手机号长度不等于11!")
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ExcelProperty({"${title}","值班人员手机号"})
|
||||||
|
private String dutyPhone;
|
||||||
|
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
private Long leaderUserId;
|
||||||
|
|
||||||
|
private Long dutyUserId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,173 @@
|
||||||
|
package com.gunshi.project.xyt.listener;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.context.AnalysisContext;
|
||||||
|
import com.alibaba.excel.event.AnalysisEventListener;
|
||||||
|
import com.alibaba.excel.exception.ExcelDataConvertException;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.gunshi.project.xyt.entity.vo.RotaVo;
|
||||||
|
import com.gunshi.project.xyt.service.RotaService;
|
||||||
|
import com.gunshi.project.xyt.util.excel.LengthValid;
|
||||||
|
import com.gunshi.project.xyt.util.spring.SpringUtils;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取excel数据
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class RotaImportListener extends AnalysisEventListener<RotaVo> {
|
||||||
|
|
||||||
|
private final RotaService rotaService;
|
||||||
|
|
||||||
|
|
||||||
|
/**临时存储正常数据集合*/
|
||||||
|
private List<RotaVo> successDataList = Lists.newArrayList();
|
||||||
|
|
||||||
|
/**临时存错误储数据集合*/
|
||||||
|
private List<RotaVo> errorDataList = Lists.newArrayList();
|
||||||
|
|
||||||
|
/**自定义消费者函数接口用于自定义监听器中数据组装*/
|
||||||
|
private final Consumer<List<RotaVo>> successConsumer;
|
||||||
|
|
||||||
|
private final Consumer<List<RotaVo>> errorConsumer;
|
||||||
|
|
||||||
|
public RotaImportListener(Consumer<List<RotaVo>> successConsumer, Consumer<List<RotaVo>> errorConsumer) {
|
||||||
|
this.successConsumer = successConsumer;
|
||||||
|
this.errorConsumer = errorConsumer;
|
||||||
|
this.rotaService = SpringUtils.getBean(RotaService.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**手机号格式异常日志处理*/
|
||||||
|
@Override
|
||||||
|
public void onException(Exception exception, AnalysisContext context) {
|
||||||
|
log.error("异常信息:{}", exception.getMessage());
|
||||||
|
// 如果是某一个单元格的转换异常 能获取到具体行号,如果要获取头的信息 配合invokeHeadMap使用
|
||||||
|
if (exception instanceof ExcelDataConvertException) {
|
||||||
|
ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException) exception;
|
||||||
|
log.error("第{}行,第{}列解析异常,数据为:{}", excelDataConvertException.getRowIndex(), excelDataConvertException.getColumnIndex(), excelDataConvertException.getCellData());
|
||||||
|
}else if (exception instanceof IllegalArgumentException){
|
||||||
|
throw new IllegalArgumentException(exception.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在这里进行模板的判断
|
||||||
|
* @param headMap 存放着导入表格的表头,键是索引,值是名称
|
||||||
|
* @param context
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
|
||||||
|
//只校验第三行表头是否正确
|
||||||
|
Integer rowNum = context.getCurrentRowNum();
|
||||||
|
if (rowNum == 2) {
|
||||||
|
// 获取数据实体的字段列表
|
||||||
|
Field[] fields = RotaVo.class.getDeclaredFields();
|
||||||
|
// 遍历字段进行判断
|
||||||
|
for (Field field : fields) {
|
||||||
|
// 获取当前字段上的ExcelProperty注解信息
|
||||||
|
ExcelProperty fieldAnnotation = field.getAnnotation(ExcelProperty.class);
|
||||||
|
// 判断当前字段上是否存在ExcelProperty注解
|
||||||
|
if (fieldAnnotation != null) {
|
||||||
|
String value = fieldAnnotation.value()[1];
|
||||||
|
// 存在ExcelProperty注解则根据注解的value值到表格中对比是否存在对应的表头
|
||||||
|
if(!headMap.containsValue(value)){
|
||||||
|
// 如果表格不包含模版类字段中的表头,则抛出异常不再往下执行
|
||||||
|
throw new RuntimeException("模板错误,请检查导入模板");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**每行读取监听触发逻辑*/
|
||||||
|
@SneakyThrows
|
||||||
|
@Override
|
||||||
|
public void invoke(RotaVo rotaVo, AnalysisContext analysisContext) {
|
||||||
|
//获取总行数
|
||||||
|
Integer rowNumber = analysisContext.readSheetHolder().getApproximateTotalRowNumber();
|
||||||
|
//行数
|
||||||
|
int row = analysisContext.readRowHolder().getRowIndex() + 1;
|
||||||
|
log.info("第" + row + "行数据进行处理");
|
||||||
|
// 手机号格式校验
|
||||||
|
if(validParam(rotaVo,row)){
|
||||||
|
successDataList.add(rotaVo);
|
||||||
|
}else{
|
||||||
|
errorDataList.add(rotaVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Boolean validParam(RotaVo rotaVo, int row) throws IllegalAccessException {
|
||||||
|
// 参数校验
|
||||||
|
Field[] fields = rotaVo.getClass().getDeclaredFields();
|
||||||
|
Boolean flag = true;
|
||||||
|
String msg = "";
|
||||||
|
for (Field field : fields) {
|
||||||
|
//设置可访问
|
||||||
|
field.setAccessible(true);
|
||||||
|
//判断字段是否添加校验
|
||||||
|
boolean valid = field.isAnnotationPresent(LengthValid.class);
|
||||||
|
if (valid) {
|
||||||
|
String name = field.getName();
|
||||||
|
|
||||||
|
//获取注解信息
|
||||||
|
LengthValid annotation = field.getAnnotation(LengthValid.class);
|
||||||
|
int cell = 4;
|
||||||
|
if("leaderPhone".equals(name)){
|
||||||
|
cell = 3;
|
||||||
|
}
|
||||||
|
//行数列数
|
||||||
|
msg += "第" + row + "行的第" + cell + "列:";
|
||||||
|
//值
|
||||||
|
String value = (String) field.get(rotaVo);
|
||||||
|
System.out.println("value = "+value);
|
||||||
|
if(value.length() != annotation.length()){
|
||||||
|
//错误信息
|
||||||
|
msg += annotation.msg();
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
Long userId = rotaService.checkPhone(value);
|
||||||
|
if(userId == null){
|
||||||
|
//错误信息
|
||||||
|
String err = "手机号"+value+"未找到对应的系统用户,请先核实用户手机号再进行模板导入!";
|
||||||
|
msg += err;
|
||||||
|
flag = false;
|
||||||
|
}else{
|
||||||
|
if(cell == 3){
|
||||||
|
rotaVo.setLeaderUserId(userId);
|
||||||
|
}else {
|
||||||
|
rotaVo.setDutyUserId(userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rotaVo.setErrorMsg(msg);
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||||
|
if (CollectionUtils.isNotEmpty(successDataList)) {
|
||||||
|
successConsumer.accept(successDataList);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(errorDataList)) {
|
||||||
|
errorConsumer.accept(errorDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*监听器的hasNext()方法时没有注意到默认返回的是false,导致一进监听器就判断已经没有下一条记录,直接跳出监听器,然后导入就完成,也不会报错,改成返回true即可解决
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean hasNext(AnalysisContext analysisContext) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.gunshi.project.xyt.model.OriginMessage;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface OriginMessageMapper extends BaseMapper<OriginMessage> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.gunshi.project.xyt.model.RotaB;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface RotaBMapper extends BaseMapper<RotaB> {
|
||||||
|
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select t.*,s.user_name from public.rota_b t left join public.sys_user s on t.user_id = s.user_id
|
||||||
|
where to_char(t.rota_date, 'YYYY-MM') = #{yearMonth}
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
List<RotaB> query(@Param("yearMonth") String yearMonth);
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select t.*,s.user_name from public.rota_b t left join public.sys_user s on t.user_id = s.user_id
|
||||||
|
where to_char(t.rota_date, 'YYYY-MM-DD') = #{rotaDate} order by rota_type
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
List<RotaB> dateList(@Param("rotaDate") String rotaDate);
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select s.user_id from public.sys_user s where s.phonenumber = #{value}
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
Long queryUser(@Param("value") String value);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.project.xyt.entity.so.RotaLogPageSo;
|
||||||
|
import com.gunshi.project.xyt.model.RotaLog;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface RotaLogMapper extends BaseMapper<RotaLog> {
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select t.*,s.user_name as leaderUserName,m.user_name as dutyUserName from public.rota_log t
|
||||||
|
left join public.sys_user s on t.leader_user_id = s.user_id
|
||||||
|
left join public.sys_user m on t.duty_user_id = m.user_id
|
||||||
|
<where>
|
||||||
|
<if test="obj.dateSo != null and obj.dateSo.start != null">
|
||||||
|
t.rota_date <![CDATA[>=]]> #{obj.dateSo.start}
|
||||||
|
</if>
|
||||||
|
<if test="obj.dateSo != null and obj.dateSo.end != null">
|
||||||
|
and t.rota_date <![CDATA[<=]]> #{obj.dateSo.end}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by t.rota_date desc
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
Page<RotaLog> queryPage(Page<RotaLog> page,@Param("obj") RotaLogPageSo rotaLogPageSo);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/8/2
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Schema(description="原始报文表")
|
||||||
|
@Data
|
||||||
|
@TableName("public.origin_message")
|
||||||
|
public class OriginMessage {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@TableField(value="protocol")
|
||||||
|
@Schema(description="协议")
|
||||||
|
private String protocol;
|
||||||
|
|
||||||
|
@TableField(value="address")
|
||||||
|
@Schema(description="设备地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@TableField(value="func_code")
|
||||||
|
@Schema(description="功能码")
|
||||||
|
private String funcCode;
|
||||||
|
|
||||||
|
@TableField(value="data_time")
|
||||||
|
@Schema(description="数据时间")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date dataTime;
|
||||||
|
|
||||||
|
@TableField(value="message")
|
||||||
|
@Schema(description="报文")
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
@TableField(value="tm")
|
||||||
|
@Schema(description="时间戳")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date tm;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班表
|
||||||
|
*/
|
||||||
|
@Schema(description="值班表")
|
||||||
|
@Data
|
||||||
|
@TableName(value = "public.rota_b")
|
||||||
|
public class RotaB implements Serializable {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.INPUT)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
@TableField(value = "rota_date")
|
||||||
|
@Schema(description="日期")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
@NotNull(message = "日期不能为空")
|
||||||
|
private Date rotaDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型(1带班领导 2值班人员)
|
||||||
|
*/
|
||||||
|
@TableField(value = "rota_type")
|
||||||
|
@Schema(description="类型(1带班领导 2值班人员)")
|
||||||
|
private Integer rotaType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
@TableField(value = "user_id")
|
||||||
|
@Schema(description="用户id")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否节假日(0否 1是)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_holiday")
|
||||||
|
@Schema(description="是否节假日(0否 1是)")
|
||||||
|
private Integer isHoliday;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description="用户姓名")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班日志
|
||||||
|
*/
|
||||||
|
@Schema(description="值班日志")
|
||||||
|
@Data
|
||||||
|
@TableName(value = "public.rota_log")
|
||||||
|
public class RotaLog implements Serializable {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.INPUT)
|
||||||
|
@Schema(description="主键")
|
||||||
|
@NotNull(message = "主键不能为空", groups = {Update.class})
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
@TableField(value = "rota_date")
|
||||||
|
@Schema(description="日期")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
@NotNull(message = "日期不能为空", groups = {Insert.class, Update.class})
|
||||||
|
private Date rotaDate;
|
||||||
|
|
||||||
|
@TableField(value = "weather")
|
||||||
|
@Schema(description="天气")
|
||||||
|
private String weather;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带班领导id
|
||||||
|
*/
|
||||||
|
@TableField(value = "leader_user_id")
|
||||||
|
@Schema(description="带班领导id")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long leaderUserId;
|
||||||
|
|
||||||
|
@Schema(description="带班领导姓名")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String leaderUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值班人员id
|
||||||
|
*/
|
||||||
|
@TableField(value = "duty_user_id")
|
||||||
|
@Schema(description="值班人员id")
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long dutyUserId;
|
||||||
|
|
||||||
|
@Schema(description="值班人员姓名")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String dutyUserName;
|
||||||
|
|
||||||
|
@TableField(value = "duty_situation")
|
||||||
|
@Schema(description="值班情况")
|
||||||
|
private String dutySituation;
|
||||||
|
|
||||||
|
@TableField(value = "todo_list")
|
||||||
|
@Schema(description="待处理事项")
|
||||||
|
private String todoList;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.xyt.entity.so.RotaLogPageSo;
|
||||||
|
import com.gunshi.project.xyt.mapper.RotaLogMapper;
|
||||||
|
import com.gunshi.project.xyt.model.RotaLog;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/3/25
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class RotaLogService extends ServiceImpl<RotaLogMapper, RotaLog> {
|
||||||
|
|
||||||
|
public Page<RotaLog> queryPage(RotaLogPageSo rotaLogPageSo) {
|
||||||
|
return this.baseMapper.queryPage(rotaLogPageSo.getPageSo().toPage(),rotaLogPageSo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import com.gunshi.project.xyt.entity.dto.RotaDto;
|
||||||
|
import com.gunshi.project.xyt.entity.dto.RotaUserDto;
|
||||||
|
import com.gunshi.project.xyt.entity.vo.RotaVo;
|
||||||
|
import com.gunshi.project.xyt.mapper.RotaBMapper;
|
||||||
|
import com.gunshi.project.xyt.model.RotaB;
|
||||||
|
import com.gunshi.project.xyt.util.DateUtil;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/3/25
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class RotaService extends ServiceImpl<RotaBMapper, RotaB> {
|
||||||
|
|
||||||
|
|
||||||
|
public Map<String,List<RotaB>> query(String yearMonth) {
|
||||||
|
List<RotaB> list = this.baseMapper.query(yearMonth);
|
||||||
|
return list.stream().collect(Collectors.groupingBy(rota -> new SimpleDateFormat(DateFormatString.YYYY_MM_DD).format(rota.getRotaDate())));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String editInfo(RotaDto RotaDto) {
|
||||||
|
Date rotaDate = RotaDto.getRotaDate();
|
||||||
|
//先删除该日期的所有信息
|
||||||
|
LambdaQueryWrapper<RotaB> queryWrapper = Wrappers.lambdaQuery();
|
||||||
|
queryWrapper.eq(RotaB::getRotaDate,rotaDate);
|
||||||
|
this.remove(queryWrapper);
|
||||||
|
if(RotaDto.getIsHoliday() != null && RotaDto.getIsHoliday() == 1){
|
||||||
|
RotaB rotaB = new RotaB();
|
||||||
|
BeanUtils.copyProperties(RotaDto,rotaB,RotaB.class);
|
||||||
|
rotaB.setId(IdWorker.getId());
|
||||||
|
this.save(rotaB);
|
||||||
|
return "设为放假日成功";
|
||||||
|
}
|
||||||
|
List<RotaUserDto> userDtoList = RotaDto.getUserDtoList();
|
||||||
|
List<RotaB> list = userDtoList.stream().map(o -> {
|
||||||
|
RotaB rotaB = new RotaB();
|
||||||
|
rotaB.setId(IdWorker.getId());
|
||||||
|
rotaB.setRotaDate(rotaDate);
|
||||||
|
rotaB.setIsHoliday(0);
|
||||||
|
rotaB.setRotaType(o.getRotaType());
|
||||||
|
rotaB.setUserId(o.getUserId());
|
||||||
|
return rotaB;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
this.saveBatch(list);
|
||||||
|
return "设置值班信息成功";
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RotaB> dateList(String rotaDate) {
|
||||||
|
return this.baseMapper.dateList(rotaDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long checkPhone(String value){
|
||||||
|
return this.baseMapper.queryUser(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveImportData(ArrayList<RotaVo> successArrayList) {
|
||||||
|
List<RotaB> list = new ArrayList<>();
|
||||||
|
for(RotaVo vo : successArrayList){
|
||||||
|
Date stm = vo.getStm();
|
||||||
|
Date etm = vo.getEtm();
|
||||||
|
List<Date> dates = DateUtil.getDatesBetween(stm, etm);
|
||||||
|
dates.stream().forEach(str->{
|
||||||
|
RotaB rotaB = new RotaB();
|
||||||
|
rotaB.setId(IdWorker.getId());
|
||||||
|
rotaB.setRotaDate(str);
|
||||||
|
rotaB.setIsHoliday(0);
|
||||||
|
rotaB.setRotaType(1);
|
||||||
|
rotaB.setUserId(vo.getLeaderUserId());
|
||||||
|
list.add(rotaB);
|
||||||
|
|
||||||
|
RotaB rota = new RotaB();
|
||||||
|
rota.setId(IdWorker.getId());
|
||||||
|
rota.setRotaDate(str);
|
||||||
|
rota.setIsHoliday(0);
|
||||||
|
rota.setRotaType(2);
|
||||||
|
rota.setUserId(vo.getDutyUserId());
|
||||||
|
list.add(rota);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.saveOrUpdateBatch(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -169,5 +169,18 @@ public class DateUtil {
|
||||||
return dates;
|
return dates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Date> getDatesBetween(Date startDate, Date endDate) {
|
||||||
|
List<Date> dates = new ArrayList<>();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(startDate);
|
||||||
|
|
||||||
|
while (calendar.getTime().before(endDate)) {
|
||||||
|
dates.add(calendar.getTime());
|
||||||
|
calendar.add(Calendar.DATE, 1);
|
||||||
|
}
|
||||||
|
dates.add(endDate);
|
||||||
|
return dates;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.gunshi.project.xyt.util.excel;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/8/19
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Target(ElementType.FIELD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Inherited
|
||||||
|
public @interface LengthValid {
|
||||||
|
|
||||||
|
int length() default 0;
|
||||||
|
|
||||||
|
String msg() default "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue