所有date日期修改为LocalDate或LocalDateTime

This commit is contained in:
qiaoqinzheng 2023-06-20 15:28:32 +08:00
parent 68db2b25de
commit bdf01355eb
30 changed files with 282 additions and 246 deletions

View File

@ -9,6 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
/**
@ -67,9 +68,9 @@ public class SysEmail implements Serializable {
* 创建日期
*/
@TableField(value = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate createTime;
/**
* 创建人员
@ -81,9 +82,9 @@ public class SysEmail implements Serializable {
* 修改日期
*/
@TableField(value = "update_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate updateTime;
/**
* 修改人员

View File

@ -9,7 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDate;
import java.util.List;
@Data
@ -38,9 +38,9 @@ public class AlarmContactGroup implements Serializable {
* 创建时间
*/
@TableField(value = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate createTime;
/**
* 创建人
@ -52,9 +52,9 @@ public class AlarmContactGroup implements Serializable {
* 修改时间
*/
@TableField(value = "update_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate updateTime;
/**
* 修改人

View File

@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.time.LocalDate;
@Data
public class AlarmHistory {
@ -17,9 +17,9 @@ public class AlarmHistory {
/**
* 报警开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date alarmStartDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate alarmStartDate;
/**
* 报警详情

View File

@ -9,7 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDateTime;
@Data
@TableName(value = "alarm_log")
@ -33,7 +33,7 @@ public class AlarmLog implements Serializable {
@TableField(value = "alarm_start_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date alarmStartDate;
private LocalDateTime alarmStartDate;
/**
* 报警详情

View File

@ -9,7 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDate;
@Data
@TableName(value = "alarm_rule")
@ -73,9 +73,9 @@ public class AlarmRule implements Serializable {
* 创建时间
*/
@TableField(value = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate createTime;
/**
* 创建人
@ -87,9 +87,9 @@ public class AlarmRule implements Serializable {
* 修改时间
*/
@TableField(value = "update_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate updateTime;
/**
* 修改人

View File

@ -9,7 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDate;
@Data
@TableName(value = "sys_database")
@ -67,9 +67,9 @@ public class SysDatabase implements Serializable {
* 创建时间
*/
@TableField(value = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate createTime;
/**
* 创建人
@ -81,9 +81,9 @@ public class SysDatabase implements Serializable {
* 修改时间
*/
@TableField(value = "update_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate updateTime;
/**
* 修改人

View File

@ -9,7 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDate;
@Data
@TableName(value = "sys_server")
@ -43,9 +43,9 @@ public class SysServer implements Serializable {
* 创建时间
*/
@TableField(value = "create_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate createTime;
/**
* 创建人
@ -57,9 +57,9 @@ public class SysServer implements Serializable {
* 修改时间
*/
@TableField(value = "update_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate updateTime;
/**
* 修改人

View File

@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@ -99,7 +100,7 @@ public class AlarmContactGroupServiceImpl extends ServiceImpl<AlarmContactGroupM
String username = JwtUtil.getUserNameByToken(request);
Long id = IdWorker.getId();
alarmContactGroup.setId(id.toString());
alarmContactGroup.setCreateTime(new Date());
alarmContactGroup.setCreateTime(LocalDate.now());
alarmContactGroup.setCreateBy(username);
if (CollectionUtils.isNotEmpty(alarmContactGroup.getUserIds())){
List<String> userIds = alarmContactGroup.getUserIds();
@ -120,6 +121,10 @@ public class AlarmContactGroupServiceImpl extends ServiceImpl<AlarmContactGroupM
@Override
public Result update(AlarmContactGroup alarmContactGroup) {
Result result = new Result();
//获取request
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
//获取当前操作人用户名
String username = JwtUtil.getUserNameByToken(request);
LambdaQueryWrapper<AlarmContactGroup> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlarmContactGroup::getId, alarmContactGroup.getId());
AlarmContactGroup contactGroup = this.baseMapper.selectOne(queryWrapper);
@ -141,6 +146,8 @@ public class AlarmContactGroupServiceImpl extends ServiceImpl<AlarmContactGroupM
alarmContactGroupMemberMapper.insert(alarmContactGroupMember);
}
}
alarmContactGroup.setUpdateTime(LocalDate.now());
alarmContactGroup.setUpdateBy(username);
this.baseMapper.updateById(alarmContactGroup);
result.setSuccess(true);
result.success("修改成功");

View File

@ -17,6 +17,7 @@ import org.jeecg.modules.service.IAlarmRuleService;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.time.LocalDate;
import java.util.Date;
import java.util.Objects;
@ -61,7 +62,7 @@ public class AlarmRuleServiceImpl extends ServiceImpl<AlarmRuleMapper, AlarmRule
String username = JwtUtil.getUserNameByToken(request);
Long id = IdWorker.getId();
alarmRule.setId(id.toString());
alarmRule.setCreateTime(new Date());
alarmRule.setCreateTime(LocalDate.now());
alarmRule.setCreateBy(username);
if (StringUtils.isNotBlank(alarmRule.getOperator())){
String jsonString = JSON.toJSONString(alarmRule.getOperator());
@ -87,7 +88,7 @@ public class AlarmRuleServiceImpl extends ServiceImpl<AlarmRuleMapper, AlarmRule
result.error500("对应数据不存在");
return result;
}
alarmRule.setUpdateTime(new Date());
alarmRule.setUpdateTime(LocalDate.now());
alarmRule.setUpdateBy(username);
if (StringUtils.isNotBlank(alarmRule.getOperator())){
String jsonString = JSON.toJSONString(alarmRule.getOperator());

View File

@ -18,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -64,7 +65,7 @@ public class SysDatabaseServiceImpl extends ServiceImpl<SysDatabaseMapper, SysDa
//声明id
Long id = IdWorker.getId();
sysDatabase.setId(id.toString());
sysDatabase.setCreateTime(new Date());
sysDatabase.setCreateTime(LocalDate.now());
sysDatabase.setCreateBy(username);
this.baseMapper.insert(sysDatabase);
result.setSuccess(true);
@ -87,7 +88,7 @@ public class SysDatabaseServiceImpl extends ServiceImpl<SysDatabaseMapper, SysDa
result.error500("对应数据不存在,修改失败");
return result;
}
sysDatabase.setUpdateTime(new Date());
sysDatabase.setUpdateTime(LocalDate.now());
sysDatabase.setUpdateBy(username);
this.baseMapper.updateById(sysDatabase);
result.setSuccess(true);

View File

@ -18,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -66,7 +67,7 @@ public class SysEmailServiceImpl extends ServiceImpl<SysEmailMapper, SysEmail> i
Long id = IdWorker.getId();
sysEmail.setId(id.toString());
//创建时间
sysEmail.setCreateTime(new Date());
sysEmail.setCreateTime(LocalDate.now());
sysEmail.setCreateBy(username);
this.baseMapper.insert(sysEmail);
result.setSuccess(true);
@ -91,7 +92,7 @@ public class SysEmailServiceImpl extends ServiceImpl<SysEmailMapper, SysEmail> i
return result;
}
//创建时间
sysEmail.setUpdateTime(new Date());
sysEmail.setUpdateTime(LocalDate.now());
sysEmail.setUpdateBy(username);
this.baseMapper.updateById(sysEmail);
result.setSuccess(true);

View File

@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -68,7 +69,7 @@ public class SysServerServiceImpl extends ServiceImpl<SysServerMapper, SysServer
Long id = IdWorker.getId();
sysServer.setId(id.toString());
//赋值创建时间
sysServer.setCreateTime(new Date());
sysServer.setCreateTime(LocalDate.now());
sysServer.setCreateBy(username);
this.baseMapper.insert(sysServer);
result.setSuccess(true);
@ -92,7 +93,7 @@ public class SysServerServiceImpl extends ServiceImpl<SysServerMapper, SysServer
result.error500("当前数据不存在");
return result;
}
sysServer.setUpdateTime(new Date());
sysServer.setUpdateTime(LocalDate.now());
sysServer.setUpdateBy(username);
this.baseMapper.updateById(sysServer);
result.setSuccess(true);

View File

@ -4,14 +4,17 @@ 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 lombok.Data;
import org.jeecg.config.valid.InsertGroup;
import org.jeecg.config.valid.UpdateGroup;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ -49,7 +52,9 @@ public class SysUserFocusStation implements Serializable {
* 创建时间
*/
@TableField(value = "create_time")
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* 创建人

View File

@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@ -118,7 +119,7 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStat
sysUserFocusStation.setStationId(String.valueOf(stationId));
String stationType = StationTypeUtil.getStationType(stationId);
sysUserFocusStation.setStationType(stationType);
sysUserFocusStation.setCreateTime(new Date());
sysUserFocusStation.setCreateTime(LocalDateTime.now());
sysUserFocusStation.setCreateBy(username);
this.baseMapper.insert(sysUserFocusStation);
}

View File

@ -11,6 +11,8 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ -73,7 +75,7 @@ public class GardsDetectors implements Serializable {
@TableField(value = "DATE_BEGIN")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dateBegin;
private LocalDateTime dateBegin;
/**
* 结束运行日期
@ -81,7 +83,7 @@ public class GardsDetectors implements Serializable {
@TableField(value = "DATE_END")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dateEnd;
private LocalDateTime dateEnd;
/**
* Y在运行状态良好N停止
@ -101,7 +103,7 @@ public class GardsDetectors implements Serializable {
@TableField(value = "MODDATE")
@NotNull(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date moddate;
private LocalDateTime moddate;
/**
* 台站id

View File

@ -10,9 +10,8 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDateTime;
@Data
@TableName("GARDS_NUCLEARFACILITY")
@ -68,7 +67,7 @@ public class GardsNuclearfacility implements Serializable {
@TableField(value = "BUILDDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date buildDate;
private LocalDateTime buildDate;
/**
* 临界时间
@ -76,7 +75,7 @@ public class GardsNuclearfacility implements Serializable {
@TableField(value = "CRITICALITYDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date criticalityDate;
private LocalDateTime criticalityDate;
/**
* 退休时间
@ -84,7 +83,7 @@ public class GardsNuclearfacility implements Serializable {
@TableField(value = "RETIREDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date retireDate;
private LocalDateTime retireDate;
/**
* 网格工程日期
@ -92,7 +91,7 @@ public class GardsNuclearfacility implements Serializable {
@TableField(value = "GRIDCONEETIONDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gridconeetionDate;
private LocalDateTime gridconeetionDate;
/**
* 销售公司

View File

@ -14,6 +14,8 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ -76,7 +78,7 @@ public class GardsStations implements Serializable {
@TableField(value = "DATE_BEGIN")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date dateBegin;
private LocalDate dateBegin;
/**
* 运行终止日期
@ -84,7 +86,7 @@ public class GardsStations implements Serializable {
@TableField(value = "DATE_END")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date dateEnd;
private LocalDate dateEnd;
/**
* 运行状态
@ -97,6 +99,6 @@ public class GardsStations implements Serializable {
*/
@TableField(value = "MODDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date moddate;
private LocalDateTime moddate;
}

View File

@ -12,7 +12,8 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Data
@ -30,7 +31,7 @@ public class SysTask implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@NotBlank(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
private Date schedulingDate;
private LocalDate schedulingDate;
@TableField(value = "create_by")
private String createBy;
@ -41,12 +42,12 @@ public class SysTask implements Serializable {
@TableField(value = "create_time")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private LocalDateTime createTime;
@TableField(value = "update_time")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private LocalDateTime updateTime;
@TableField(exist = false)
private String userName;

View File

@ -12,6 +12,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ -35,12 +36,12 @@ public class SysTaskStation implements Serializable {
@TableField(value = "create_time")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private LocalDateTime createTime;
@TableField(value = "update_time")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private LocalDateTime updateTime;
@TableField(exist = false)
private String stationName;

View File

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
@ -18,6 +19,6 @@ public class SysTaskChangeVo {
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date day;
private LocalDate day;
}

View File

@ -4,6 +4,7 @@ import lombok.Data;
import org.jeecg.modules.system.entity.SysTaskStation;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
@ -15,7 +16,7 @@ public class SysTaskVo {
private String userId;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date schedulingDate;
private LocalDate schedulingDate;
private String username;

View File

@ -4,7 +4,6 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -12,27 +11,20 @@ import org.jeecg.common.api.QueryRequest;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.system.entity.GardsDetectors;
import org.jeecg.modules.system.entity.GardsStations;
import org.jeecg.modules.system.mapper.GardsDetectorsMapper;
import org.jeecg.modules.system.service.IGardsDetectorsService;
import org.jeecg.modules.system.service.IGardsStationsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
@Service("gardsDetectorsService")
@DS("ora")
public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper, GardsDetectors> implements IGardsDetectorsService {
@Autowired
private IGardsStationsService gardsStationsService;
@Autowired
private RedisUtil redisUtil;
@ -94,6 +86,7 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
return result;
}
}
gardsDetectors.setModdate(LocalDateTime.now());
this.baseMapper.insert(gardsDetectors);
result.success("新增成功");
this.findDetectors();

View File

@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -100,6 +101,7 @@ public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, G
return result;
}
}
gardsStations.setModdate(LocalDateTime.now());
this.baseMapper.insert(gardsStations);
result.setSuccess(true);
result.success("新增成功");

View File

@ -39,6 +39,9 @@ import java.io.IOException;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -115,7 +118,7 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
}
}
for (String day:allDay) {
List<SysTaskVo> taskVos = sysTaskVos.stream().filter(item -> DateUtils.formatDate(item.getSchedulingDate(), "yyyy-MM-dd").equals(day)).collect(Collectors.toList());
List<SysTaskVo> taskVos = sysTaskVos.stream().filter(item -> item.getSchedulingDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")).equals(day)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(taskVos)){
map.put(day, taskVos);
}else {
@ -197,7 +200,7 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
//id
sysTask.setId(String.valueOf(IdWorker.getId()));
//创建时间
sysTask.setCreateTime(new Date());
sysTask.setCreateTime(LocalDateTime.now());
this.baseMapper.insert(sysTask);
//如果排班任务中台站信息不为空
if (CollectionUtils.isNotEmpty(sysTask.getStationList())){
@ -234,7 +237,7 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
//id
sysTask.setId(String.valueOf(IdWorker.getId()));
//创建时间
sysTask.setCreateTime(new Date());
sysTask.setCreateTime(LocalDateTime.now());
this.baseMapper.insert(sysTask);
//如果排班任务中台站信息不为空
if (CollectionUtils.isNotEmpty(sysTask.getStationList())){
@ -251,23 +254,19 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
* 根据排班任务日期删除历史任务信息
* @param schedulingDate
*/
private void deleteByDate(Date schedulingDate){
try {
//根据排班日期查询对应的任务信息
LambdaQueryWrapper<SysTask> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysTask::getSchedulingDate, DateUtils.parseDate(DateUtils.formatDate(schedulingDate, "yyyy-MM-dd"), "yyyy-MM-dd"));
List<SysTask> sysTasks = this.baseMapper.selectList(queryWrapper);
//获取任务信息的id
List<String> taskIds = sysTasks.stream().map(SysTask::getId).collect(Collectors.toList());
//根据任务id删除关联的台站信息
LambdaQueryWrapper<SysTaskStation> taskStationQueryWrapper = new LambdaQueryWrapper<>();
taskStationQueryWrapper.in(SysTaskStation::getTaskId, taskIds);
sysTaskStationMapper.delete(taskStationQueryWrapper);
//根据任务id删除任务信息
this.baseMapper.deleteBatchIds(taskIds);
} catch (ParseException e) {
throw new RuntimeException(e);
}
private void deleteByDate(LocalDate schedulingDate){
//根据排班日期查询对应的任务信息
LambdaQueryWrapper<SysTask> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysTask::getSchedulingDate, schedulingDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
List<SysTask> sysTasks = this.baseMapper.selectList(queryWrapper);
//获取任务信息的id
List<String> taskIds = sysTasks.stream().map(SysTask::getId).collect(Collectors.toList());
//根据任务id删除关联的台站信息
LambdaQueryWrapper<SysTaskStation> taskStationQueryWrapper = new LambdaQueryWrapper<>();
taskStationQueryWrapper.in(SysTaskStation::getTaskId, taskIds);
sysTaskStationMapper.delete(taskStationQueryWrapper);
//根据任务id删除任务信息
this.baseMapper.deleteBatchIds(taskIds);
}
@Override
@ -288,44 +287,40 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
@Transactional
public Result changeScheduling(SysTaskChangeVo sysTaskChangeVo) {
Result result = new Result();
try {
//来源用户相关信息查询
//查询出当前来源用户在排版日期的任务信息
LambdaQueryWrapper<SysTask> fromQueryWrapper = new LambdaQueryWrapper<>();
fromQueryWrapper.eq(SysTask::getUserId, sysTaskChangeVo.getFromUserId());
fromQueryWrapper.eq(SysTask::getSchedulingDate, DateUtils.parseDate(DateUtils.formatDate(sysTaskChangeVo.getDay(), "yyyy-MM-dd"), "yyyy-MM-dd"));
SysTask fromSysTask = this.baseMapper.selectOne(fromQueryWrapper);
//根据来源用户的任务以及台站信息查询出对应的任务及台站信息
LambdaQueryWrapper<SysTaskStation> fromTaskQueryWrapper = new LambdaQueryWrapper<>();
fromTaskQueryWrapper.eq(SysTaskStation::getTaskId, fromSysTask.getId());
fromTaskQueryWrapper.in(SysTaskStation::getStationId, sysTaskChangeVo.getStationIds());
List<SysTaskStation> sysTaskStations = sysTaskStationMapper.selectList(fromTaskQueryWrapper);
//转移到用户相关信息查询
//查询出当前转移到用户在排班日期的任务信息
LambdaQueryWrapper<SysTask> toQueryWrapper = new LambdaQueryWrapper<>();
toQueryWrapper.eq(SysTask::getUserId, sysTaskChangeVo.getToUserId());
toQueryWrapper.eq(SysTask::getSchedulingDate, DateUtils.parseDate(DateUtils.formatDate(sysTaskChangeVo.getDay(), "yyyy-MM-dd"), "yyyy-MM-dd"));
SysTask toSysTask = this.baseMapper.selectOne(toQueryWrapper);
//台站信息不为空
if (CollectionUtils.isNotEmpty(sysTaskStations)){
//遍历当前要进行修改的台站信息
for (SysTaskStation taskStation:sysTaskStations) {
taskStation.setTaskId(toSysTask.getId());
sysTaskStationMapper.updateById(taskStation);
}
//来源用户相关信息查询
//查询出当前来源用户在排版日期的任务信息
LambdaQueryWrapper<SysTask> fromQueryWrapper = new LambdaQueryWrapper<>();
fromQueryWrapper.eq(SysTask::getUserId, sysTaskChangeVo.getFromUserId());
fromQueryWrapper.eq(SysTask::getSchedulingDate, sysTaskChangeVo.getDay().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
SysTask fromSysTask = this.baseMapper.selectOne(fromQueryWrapper);
//根据来源用户的任务以及台站信息查询出对应的任务及台站信息
LambdaQueryWrapper<SysTaskStation> fromTaskQueryWrapper = new LambdaQueryWrapper<>();
fromTaskQueryWrapper.eq(SysTaskStation::getTaskId, fromSysTask.getId());
fromTaskQueryWrapper.in(SysTaskStation::getStationId, sysTaskChangeVo.getStationIds());
List<SysTaskStation> sysTaskStations = sysTaskStationMapper.selectList(fromTaskQueryWrapper);
//转移到用户相关信息查询
//查询出当前转移到用户在排班日期的任务信息
LambdaQueryWrapper<SysTask> toQueryWrapper = new LambdaQueryWrapper<>();
toQueryWrapper.eq(SysTask::getUserId, sysTaskChangeVo.getToUserId());
toQueryWrapper.eq(SysTask::getSchedulingDate, sysTaskChangeVo.getDay().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
SysTask toSysTask = this.baseMapper.selectOne(toQueryWrapper);
//台站信息不为空
if (CollectionUtils.isNotEmpty(sysTaskStations)){
//遍历当前要进行修改的台站信息
for (SysTaskStation taskStation:sysTaskStations) {
taskStation.setTaskId(toSysTask.getId());
sysTaskStationMapper.updateById(taskStation);
}
//判断 如果当前来源用户及日期下的排班任务对应的台站信息为空排班任务信息删除
LambdaQueryWrapper<SysTaskStation> sysTaskStationQueryWrapper = new LambdaQueryWrapper<>();
sysTaskStationQueryWrapper.eq(SysTaskStation::getTaskId, fromSysTask.getId());
List<SysTaskStation> stations = sysTaskStationMapper.selectList(sysTaskStationQueryWrapper);
if (CollectionUtils.isEmpty(stations)){
this.baseMapper.deleteById(fromSysTask);
}
result.setSuccess(true);
result.success("交接完成");
} catch (ParseException e) {
throw new RuntimeException(e);
}
//判断 如果当前来源用户及日期下的排班任务对应的台站信息为空排班任务信息删除
LambdaQueryWrapper<SysTaskStation> sysTaskStationQueryWrapper = new LambdaQueryWrapper<>();
sysTaskStationQueryWrapper.eq(SysTaskStation::getTaskId, fromSysTask.getId());
List<SysTaskStation> stations = sysTaskStationMapper.selectList(sysTaskStationQueryWrapper);
if (CollectionUtils.isEmpty(stations)){
this.baseMapper.deleteById(fromSysTask);
}
result.setSuccess(true);
result.success("交接完成");
return result;
}
@ -341,7 +336,7 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
List<SysTaskVo> sysTaskVos = entry.getValue();
if (CollectionUtils.isNotEmpty(sysTaskVos)){
for (SysTaskVo sysTaskVo:sysTaskVos) {
String schedulingDate = DateUtils.formatDate(sysTaskVo.getSchedulingDate(), "yyyy-MM-dd");
String schedulingDate = sysTaskVo.getSchedulingDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String username = sysTaskVo.getUsername();
String stationNames = "";
for (SysTaskStation sysTaskStation:sysTaskVo.getStationList()) {
@ -415,117 +410,113 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
List<ImportFailureVo> failureList = new ArrayList<>();
int successNum = 0;
int failureNum = 0;
try {
//第一步 读取导入数据中的全部排班任务相关信息进行新增
if (CollectionUtils.isNotEmpty(dataList)){
//遍历导入数据内容
for (SysTaskExportVo sysTaskExportVo:dataList) {
boolean failFlag = false;
//排班任务相关台站信息集合
List<SysTaskStation> sysTaskStationList = new ArrayList<>();
SysTask sysTask = new SysTask();
headRow++;
//排班日期
String schedulingDate = sysTaskExportVo.getSchedulingDate();
//用户名称
String userName = sysTaskExportVo.getUserName();
//台站名称
String stationName = sysTaskExportVo.getStationName();
//存放切割后的台站名称
List<String> stations = new ArrayList<>();
//判断排版日期用户名称台站名称是否为空
if (StringUtils.isAnyEmpty(schedulingDate,userName,stationName)){
failureList.add(new ImportFailureVo(headRow+1, "必填信息不全"));
//第一步 读取导入数据中的全部排班任务相关信息进行新增
if (CollectionUtils.isNotEmpty(dataList)){
//遍历导入数据内容
for (SysTaskExportVo sysTaskExportVo:dataList) {
boolean failFlag = false;
//排班任务相关台站信息集合
List<SysTaskStation> sysTaskStationList = new ArrayList<>();
SysTask sysTask = new SysTask();
headRow++;
//排班日期
String schedulingDate = sysTaskExportVo.getSchedulingDate();
//用户名称
String userName = sysTaskExportVo.getUserName();
//台站名称
String stationName = sysTaskExportVo.getStationName();
//存放切割后的台站名称
List<String> stations = new ArrayList<>();
//判断排版日期用户名称台站名称是否为空
if (StringUtils.isAnyEmpty(schedulingDate,userName,stationName)){
failureList.add(new ImportFailureVo(headRow+1, "必填信息不全"));
failureNum++;
failFlag = true;
if (failFlag){
continue;
}
}
//判断台站名称是否为空
if (StringUtils.isNotBlank(stationName)){
if (stationName.indexOf("")>0){
failureList.add(new ImportFailureVo(headRow+1, "台站信息内容错误,台站编码间用英文逗号隔开"));
failureNum++;
failFlag = true;
if (failFlag){
continue;
}
}
//判断台站名称是否为空
if (StringUtils.isNotBlank(stationName)){
if (stationName.indexOf("")>0){
failureList.add(new ImportFailureVo(headRow+1, "台站信息内容错误,台站编码间用英文逗号隔开"));
failureNum++;
failFlag = true;
if (failFlag){
continue;
}
}else {
stations = Arrays.asList(stationName.split(StringPool.COMMA));
}
}
sysTask.setSchedulingDate(DateUtils.parseDate(schedulingDate, "yyyy-MM-dd"));
//根据用户名称过滤出对应的用户信息
List<SysUser> sysUserList = userList.stream().filter(item -> item.getUsername().equals(userName)).collect(Collectors.toList());
//如果用户存在将用户id传入排班任务
if (CollectionUtils.isNotEmpty(sysUserList)){
SysUser sysUser = sysUserList.get(0);
sysTask.setUserId(sysUser.getId());
}else {
failureList.add(new ImportFailureVo(headRow+1, "用户信息不存在"));
stations = Arrays.asList(stationName.split(StringPool.COMMA));
}
}
sysTask.setSchedulingDate(LocalDate.parse(schedulingDate));
//根据用户名称过滤出对应的用户信息
List<SysUser> sysUserList = userList.stream().filter(item -> item.getUsername().equals(userName)).collect(Collectors.toList());
//如果用户存在将用户id传入排班任务
if (CollectionUtils.isNotEmpty(sysUserList)){
SysUser sysUser = sysUserList.get(0);
sysTask.setUserId(sysUser.getId());
}else {
failureList.add(new ImportFailureVo(headRow+1, "用户信息不存在"));
failureNum++;
failFlag = true;
if (failFlag){
continue;
}
}
//判断内容是否重复
if (CollectionUtils.isNotEmpty(taskList)){
//与本次录入的数据进行比较
for (SysTask task:taskList) {
if (task.getUserId().equals(sysTask.getUserId()) && task.getSchedulingDate().equals(sysTask.getSchedulingDate()) ){
failureList.add(new ImportFailureVo(headRow+1, "排班任务信息已存在,重复录入"));
failureNum++;
failFlag = true;
}
}
if (failFlag){
continue;
}
}
if (CollectionUtils.isNotEmpty(stations)){
for (GardsStations station:stationsList) {
for (String sName:stations) {
if (station.getStationCode().equals(sName)){
SysTaskStation taskStation = new SysTaskStation();
taskStation.setStationId(String.valueOf(station.getStationId()));
taskStation.setStationName(sName);
sysTaskStationList.add(taskStation);
}
}
}
//判断 台站名称集合长度与排班任务对应台站信息长度不一致 丢失台站信息
if (stations.size()!=sysTaskStationList.size()){
String code = "";
List<String> sysTaskStationNames = sysTaskStationList.stream().map(SysTaskStation::getStationName).collect(Collectors.toList());
for (String name:stations) {
if (sysTaskStationNames.indexOf(name)<0){
code+=name+",";
}
}
code = code.substring(0,code.length()-1);
failureList.add(new ImportFailureVo(headRow+1, "台站信息"+code+"不存在!"));
failureNum++;
failFlag = true;
if (failFlag){
continue;
}
}
//判断内容是否重复
if (CollectionUtils.isNotEmpty(taskList)){
//与本次录入的数据进行比较
for (SysTask task:taskList) {
if (task.getUserId().equals(sysTask.getUserId()) && task.getSchedulingDate().equals(sysTask.getSchedulingDate()) ){
failureList.add(new ImportFailureVo(headRow+1, "排班任务信息已存在,重复录入"));
failureNum++;
failFlag = true;
}
}
if (failFlag){
continue;
}
}
if (CollectionUtils.isNotEmpty(stations)){
for (GardsStations station:stationsList) {
for (String sName:stations) {
if (station.getStationCode().equals(sName)){
SysTaskStation taskStation = new SysTaskStation();
taskStation.setStationId(String.valueOf(station.getStationId()));
taskStation.setStationName(sName);
sysTaskStationList.add(taskStation);
}
}
}
//判断 台站名称集合长度与排班任务对应台站信息长度不一致 丢失台站信息
if (stations.size()!=sysTaskStationList.size()){
String code = "";
List<String> sysTaskStationNames = sysTaskStationList.stream().map(SysTaskStation::getStationName).collect(Collectors.toList());
for (String name:stations) {
if (sysTaskStationNames.indexOf(name)<0){
code+=name+",";
}
}
code = code.substring(0,code.length()-1);
failureList.add(new ImportFailureVo(headRow+1, "台站信息"+code+"不存在!"));
failureNum++;
failFlag = true;
if (failFlag){
continue;
}
}
sysTask.setStationList(sysTaskStationList);
}
successNum++;
taskList.add(sysTask);
}
//判断当前数据库中的排班任务信息是否为空
if (CollectionUtils.isNotEmpty(taskList)){
this.addOrUpdate(sysTaskList,taskList);
sysTask.setStationList(sysTaskStationList);
}
successNum++;
taskList.add(sysTask);
}
//判断当前数据库中的排班任务信息是否为空
if (CollectionUtils.isNotEmpty(taskList)){
this.addOrUpdate(sysTaskList,taskList);
}
} catch (ParseException e) {
throw new RuntimeException(e);
}
importViewVo.setDetailList(failureList);
importViewVo.setSuccess(successNum);
@ -558,7 +549,7 @@ public class SysTaskServiceImpl extends ServiceImpl<SysTaskMapper, SysTask> impl
//id
sysTask.setId(String.valueOf(IdWorker.getId()));
//创建时间
sysTask.setCreateTime(new Date());
sysTask.setCreateTime(LocalDateTime.now());
this.baseMapper.insert(sysTask);
//如果排班任务中台站信息不为空
if (CollectionUtils.isNotEmpty(sysTask.getStationList())){

View File

@ -10,6 +10,7 @@ import org.jeecg.modules.system.service.ISysTaskStationService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@ -26,6 +27,7 @@ public class SysTaskStationServiceImpl extends ServiceImpl<SysTaskStationMapper,
sysTaskStation.setOperateIp(ipAddr);
sysTaskStation.setId(String.valueOf(IdWorker.getId()));
sysTaskStation.setTaskId(taskId);
sysTaskStation.setCreateTime(LocalDateTime.now());
this.baseMapper.insert(sysTaskStation);
}
}
@ -43,7 +45,7 @@ public class SysTaskStationServiceImpl extends ServiceImpl<SysTaskStationMapper,
sysTaskStation.setOperateIp(ipAddr);
sysTaskStation.setId(String.valueOf(IdWorker.getId()));
sysTaskStation.setTaskId(taskId);
sysTaskStation.setCreateTime(new Date());
sysTaskStation.setCreateTime(LocalDateTime.now());
this.baseMapper.insert(sysTaskStation);
}
}

View File

@ -2,9 +2,13 @@ package org.jeecg.modules.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ -27,13 +31,17 @@ public class GardsAnalyses implements Serializable {
* 分析开始时间
*/
@TableField(value = "ANALYSISBEGIN")
private Date analysisBegin;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate analysisBegin;
/**
* 分析结束时间
*/
@TableField(value = "ANALYSISEND")
private Date analysisEnd;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate analysisEnd;
/**
* Reviewed:交互
@ -135,7 +143,9 @@ public class GardsAnalyses implements Serializable {
* 操作时间
*/
@TableField(value = "MODDATE")
private Date moddate;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime moddate;
@TableField(value = "USEDGASPHD")
private String usedGasPhd;

View File

@ -2,9 +2,12 @@ package org.jeecg.modules.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
@Data
@ -57,7 +60,9 @@ public class GardsSampleAux implements Serializable {
* #calibration数据块
*/
@TableField(value = "CALIBRATION_DTG")
private Date calibrationDtg;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate calibrationDtg;
/**
* 报文ID号

View File

@ -2,9 +2,12 @@ package org.jeecg.modules.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
@Data
@ -27,7 +30,9 @@ public class GardsSampleCert implements Serializable {
* 鉴定日期
*/
@TableField(value = "ASSAY_DATE")
private Date assayDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate assayDate;
/**
* 单位

View File

@ -11,6 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ -47,12 +48,12 @@ public class GardsDetectors implements Serializable {
@TableField(value = "DATE_BEGIN")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dateBegin;
private LocalDateTime dateBegin;
@TableField(value = "DATE_END")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dateEnd;
private LocalDateTime dateEnd;
@TableField(value = "STATUS")
private String status;
@ -62,7 +63,7 @@ public class GardsDetectors implements Serializable {
@TableField(value = "MODDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date moddate;
private LocalDateTime moddate;
@TableField(value = "STATION_ID")
private Integer stationId;

View File

@ -7,6 +7,8 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@ -40,18 +42,18 @@ public class GardsStations implements Serializable {
@TableField(value = "DATE_BEGIN")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date dateBegin;
private LocalDate dateBegin;
@TableField(value = "DATE_END")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date dateEnd;
private LocalDate dateEnd;
@TableField(value = "STATUS")
private String status;
@TableField(value = "MODDATE")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date moddate;
private LocalDateTime moddate;
}